vendor: 4,469 bytes, line 1
1import{a as $g,b as Hg,c as id,d as Kg,e as bn}from"./chunk-62NMBSC3.js";import{b as qg}from"./chunk-6D2QUQOV.js";import{a as Xg,b as Yg}from"./chunk-2ROWACLR.js";import{$a as Ng,A as jg,B as Zp,C as io,F as li,H as td,N as yl,O as as,Q as Vg,Qa as vn,Ra as qp,Sa as jn,Sb as Zg,V as mr,a as Mg,b as Bn,bb as Ug,c as Lg,d as Cg,f as Eg,jb as Gg,k as kg,l as zg,p as Ag,q as ed,s as Dg,u as Rg,x as Fg,y as Og,z as Bg}from"./chunk-JLKYYNMX.js";import{a as Wg}from"./chunk-NETZAO6G.js";import{a as Oc}from"./chunk-4XVTOVX7.js";import{a as Me,b as wt,d as Ig,e as lx,f as Gp,h as ht}from"./chunk-LNJ3S2LQ.js";var nd=lx((Hp,Xp)=>{"use strict";(function(y,O){typeof Hp=="object"&&typeof Xp<"u"?Xp.exports=O():typeof define=="function"&&define.amd?define(O):(y=typeof globalThis<"u"?globalThis:y||self,y.maplibregl=O())})(Hp,function(){"use strict";var y={},O={};function G(b,l,U){if(O[b]=U,b==="index"){var _e="var sharedModule = {}; ("+O.shared+")(sharedModule); ("+O.worker+")(sharedModule);",Te={};return O.shared(Te),O.index(y,Te),typeof window<"u"&&y.setWorkerUrl(window.URL.createObjectURL(new Blob([_e],{type:"text/javascript"}))),y}}G("shared",["exports"],function(b){"use strict";function l(r,e,i,a){return new(i||(i=Promise))(function(s,h){function u(x){try{g(a.next(x))}catch(w){h(w)}}function f(x){try{g(a.throw(x))}catch(w){h(w)}}function g(x){var w;x.done?s(x.value):(w=x.value,w instanceof i?w:new i(function(S){S(w)})).then(u,f)}g((a=a.apply(r,e||[])).next())})}function U(r,e){this.x=r,this.y=e}function _e(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Te,Ee;typeof SuppressedError=="function"&&SuppressedError,U.prototype={clone(){return new U(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),a=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=a,this},_rotateAround(r,e){let i=Math.cos(r),a=Math.sin(r),s=e.y+a*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-a*(this.y-e.y),this.y=s,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:U},U.convert=function(r){if(r instanceof U)return r;if(Array.isArray(r))return new U(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new U(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var Oe=function(){if(Ee)return Te;function r(e,i,a,s){this.cx=3*e,this.bx=3*(a-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=a,this.p2y=s}return Ee=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 a=e,s=0;s<8;s++){var h=this.sampleCurveX(a)-e;if(Math.abs(h)<i)return a;var u=this.sampleCurveDerivativeX(a);if(Math.abs(u)<1e-6)break;a-=h/u}var f=0,g=1;for(a=e,s=0;s<20&&(h=this.sampleCurveX(a),!(Math.abs(h-e)<i));s++)e>h?f=a:g=a,a=.5*(g-f)+f;return a}
1,solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Te}(),Ve=_e(Oe);let ke,Ge;function ce(){return ke==null&&(ke=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ke}function Dt(){if(Ge==null&&(Ge=!1,ce())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){let s=4*a;e.fillStyle=`rgb(${s},${s+1},${s+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}let i=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&i[a]!==a){Ge=!0;break}}}return Ge||!1}var gt=1e-6,ft=typeof Float32Array<"u"?Float32Array:Array;function Ot(){var r=new ft(9);return ft!=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 di(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 wi(){var r=new ft(3);return ft!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function gi(r){var e=r[0],i=r[1],a=r[2];return Math.sqrt(e*e+i*i+a*a)}function Xr(r,e,i){var a=new ft(3);return a[0]=r,a[1]=e,a[2]=i,a}function Lr(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function Li(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function Yr(r,e,i){var a=e[0],s=e[1],h=e[2],u=i[0],f=i[1],g=i[2];return r[0]=s*g-h*f,r[1]=h*u-a*g,r[2]=a*f-s*u,r}var Or,Br=gi;function Sn(r,e,i){var a=e[0],s=e[1],h=e[2],u=e[3];return r[0]=i[0]*a+i[4]*s+i[8]*h+i[12]*u,r[1]=i[1]*a+i[5]*s+i[9]*h+i[13]*u,r[2]=i[2]*a+i[6]*s+i[10]*h+i[14]*u,r[3]=i[3]*a+i[7]*s+i[11]*h+i[15]*u,r}function oo(){var r=new ft(4);return ft!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function wa(r,e,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",h=Math.PI/360;e*=h,a*=h,i*=h;var u=Math.sin(e),f=Math.cos(e),g=Math.sin(i),x=Math.cos(i),w=Math.sin(a),S=Math.cos(a);switch(s){case"xyz":r[0]=u*x*S+f*g*w,r[1]=f*g*S-u*x*w,r[2]=f*x*w+u*g*S,r[3]=f*x*S-u*g*w;break;case"xzy":r[0]=u*x*S-f*g*w,r[1]=f*g*S-u*x*w,r[2]=f*x*w+u*g*S,r[3]=f*x*S+u*g*w;break;case"yxz":r[0]=u*x*S+f*g*w,r[1]=f*g*S-u*x*w,r[2]=f*x*w-u*g*S,r[3]=f*x*S+u*g*w;break;case"yzx":r[0]=u*x*S+f*g*w,r[1]=f*g*S+u*x*w,r[2]=f*x*w-u*g*S,r[3]=f*x*S-u*g*w;break;case"zxy":r[0]=u*x*S-f*g*w,r[1]=f*g*S+u*x*w,r[2]=f*x*w+u*g*S,r[3]=f*x*S-u*g*w;break;case"zyx":r[0]=u*x*S-f*g*w,r[1]=f*g*S+u*x*w,r[2]=f*x*w-u*g*S,r[3]=f*x*S+u*g*w;break;default:throw new Error("Unknown angle order "+s)}return r}function Kr(){var r=new ft(2);return ft!=Float32Array&&(r[0]=0,r[1]=0),r}function ai(r,e){var i=new ft(2);return i[0]=r,i[1]=e,i}wi(),Or=new ft(4),ft!=Float32Array&&(Or[0]=0,Or[1]=0,Or[2]=0,Or[3]=0),wi(),Xr(1,0,0),Xr(0,1,0),oo(),oo(),Ot(),Kr();let bt=8192;function Un(r,e,i){return e*(bt/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function jr(r,e){return(r%e+e)%e}function so(r,e,i){return r*(1-i)+e*i}function Sa(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 Tn(r,e,i,a){let s=new Ve(r,e,i,a);return h=>s.solve(h)}let Jr=Tn(.25,.1,.25,1);function yr(r,e,i){return Math.min(i,Math.max(e,r))}function Ci(r,e,i){let a=i-e,s=((r-e)%a+a)%a+e;return s===e?i:s}function Wi(r,...e){for(let i of e)for(let a in i)r[a]=i[a];return r}let Ta=1;function Gn(r,e,i){let a={};for(let s in r)a[s]=e.call(this,r[s],s,r);return a}function Zn(r,e,i){let a={};for(let s in r)e.call(this,r[s],s,r)&&(a[s]=r[s]);return a}function Ei(r){return Array.isArray(r)?r.map(Ei):typeof r=="object"&&r?Gn(r,Ei):r}let hs={};function ki(r){hs[r]||(typeof console<"u"&&console.warn(r),hs[r]=!0)}function tr(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function Vr(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let Bt=null;function qn(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}let Pa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function $n(r,e,i,a,s){return l(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let h=new VideoFrame(r,{timestamp:0});try{let u=h==null?void 0:h.format;if(!u||!u.startsWith("BGR")&&!u.startsWith("RGB"))throw new Error(`Unrecognized format ${u}`);let f=u.startsWith("BGR"),g=new Uint8ClampedArray(a*s*4);if(yield h.copyTo(g,function(x,w,S,M,L){let k=4*Math.max(-w,0),A=(Math.max(0,S)-S)*M*4+k,F=4*M,N=Math.max(0,w),H=Math.max(0,S);return{rect:{x:N,y:H,width:Math.min(x.width,w+M)-N,height:Math.min(x.height,S+L)-H},layout:[{offset:A,stride:F}]}}(r,e,i,a,s)),f)for(let x=0;x<g.length;x+=4){let w=g[x];g[x]=g[x+2],g[x+2]=w}return g}finally{h.close()}})}let Pn,Nr;function In(r,e,i,a){return r.addEventListener(e,i,a),{unsubscribe:()=>{r.removeEventListener(e,i,a)}}}function Wn(r){return r*Math.PI/180}function Qr(r){return r/Math.PI*180}let en={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0}
1,Mn={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Ia="AbortError";class lo extends Error{constructor(e=Ia){super(e instanceof Error?e.message:e),this.name=Ia,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function Ma(r){return r.name===Ia}let le={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function z(r){return le.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}let R="global-dispatcher";class j extends Error{constructor(e,i,a,s){super(`AJAXError: ${i} (${e}): ${a}`),this.status=e,this.statusText=i,this.url=a,this.body=s}}let K=()=>Vr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,re=function(r,e){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){let a=z(r.url);if(a)return a(r,e);if(Vr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:R},e)}if(!(/^file:/.test(i=r.url)||/^file:/.test(K())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,s){return l(this,void 0,void 0,function*(){let h=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:K(),signal:s.signal}),u,f;a.type!=="json"||h.headers.has("Accept")||h.headers.set("Accept","application/json");try{u=yield fetch(h)}catch(x){throw Ma(x)?x:new j(0,x.message,a.url,new Blob)}if(!u.ok){let x=yield u.blob();throw new j(u.status,u.statusText,a.url,x)}f=a.type==="arrayBuffer"||a.type==="image"?u.arrayBuffer():a.type==="json"?u.json():u.text();let g=yield f;return s.signal.throwIfAborted(),{data:g,cacheControl:u.headers.get("Cache-Control"),expires:u.headers.get("Expires")}})}(r,e);if(Vr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:R},e)}var i;return function(a,s){return new Promise((h,u)=>{var f;let g=new XMLHttpRequest;g.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(g.responseType="arraybuffer");for(let x in a.headers)g.setRequestHeader(x,a.headers[x]);a.type==="json"&&(g.responseType="text",!((f=a.headers)===null||f===void 0)&&f.Accept||g.setRequestHeader("Accept","application/json")),g.withCredentials=a.credentials==="include",g.onerror=()=>{u(new Error(g.statusText))},g.onload=()=>{if(!s.signal.aborted)if((g.status>=200&&g.status<300||g.status===0)&&g.response!==null){let x=g.response;if(a.type==="json")try{x=JSON.parse(g.response)}catch(w){return void u(w)}h({data:x,cacheControl:g.getResponseHeader("Cache-Control"),expires:g.getResponseHeader("Expires")})}else{let x=new Blob([g.response],{type:g.getResponseHeader("Content-Type")});u(new j(g.status,g.statusText,a.url,x))}},s.signal.addEventListener("abort",()=>{g.abort(),u(new lo(s.signal.reason))}),g.send(a.body)})}(r,e)};function ue(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;let e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function me(r,e,i){i[r]&&i[r].indexOf(e)!==-1||(i[r]=i[r]||[],i[r].push(e))}function oe(r,e,i){if(i&&i[r]){let a=i[r].indexOf(e);a!==-1&&i[r].splice(a,1)}}class he{constructor(e,i={}){Wi(this,i),this.type=e}}class Pe extends he{constructor(e,i={}){super("error",Wi({error:e},i))}}class xe{on(e,i){return this._listeners=this._listeners||{},me(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return oe(e,i,this._listeners),oe(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},me(e,i,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,i){typeof e=="string"&&(e=new he(e,i||{}));let a=e.type;if(this.listens(a)){e.target=this;let s=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(let f of s)f.call(this,e);let h=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(let f of h)oe(a,f,this._oneTimeListeners),f.call(this,e);let u=this._eventedParent;u&&(Wi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof Pe&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var ie={$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"}
vendor: 20,999 bytes, line 1
1,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"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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
vendor: 8,689 bytes, line 1
1"},"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"},
vendor: 4,255 bytes, line 1
1"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"}},"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"}},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 He=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function nt(r,e){let i={};for(let a in r)a!=="ref"&&(i[a]=r[a]);return He.forEach(a=>{a in e&&(i[a]=e[a])}),i}function Qe(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(!Qe(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(!Qe(r[i],e[i]))return!1;return!0}return r===e}function it(r,e){r.push(e)}function rt(r,e,i){it(i,{command:"addSource",args:[r,e[r]]})}function st(r,e,i){it(e,{command:"removeSource",args:[r]}),i[r]=!0}
vendor: 32,323 bytes, line 1
1function Lt(r,e,i,a){st(r,i,a),rt(r,e,i)}function zt(r,e,i){let a;for(a in r[i])if(Object.prototype.hasOwnProperty.call(r[i],a)&&a!=="data"&&!Qe(r[i][a],e[i][a]))return!1;for(a in e[i])if(Object.prototype.hasOwnProperty.call(e[i],a)&&a!=="data"&&!Qe(r[i][a],e[i][a]))return!1;return!0}function Qt(r,e,i,a,s,h){r=r||{},e=e||{};for(let u in r)Object.prototype.hasOwnProperty.call(r,u)&&(Qe(r[u],e[u])||i.push({command:h,args:[a,u,e[u],s]}));for(let u in e)Object.prototype.hasOwnProperty.call(e,u)&&!Object.prototype.hasOwnProperty.call(r,u)&&(Qe(r[u],e[u])||i.push({command:h,args:[a,u,e[u],s]}))}function Si(r){return r.id}function Wt(r,e){return r[e.id]=e,r}class Le{constructor(e,i,a,s){this.message=(e?`${e}: `:"")+a,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function vt(r,...e){for(let i of e)for(let a in i)r[a]=i[a];return r}class jt extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class Hn{constructor(e,i=[]){this.parent=e,this.bindings={};for(let[a,s]of i)this.bindings[a]=s}concat(e){return new Hn(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 tn={kind:"null"},Ae={kind:"number"},at={kind:"string"},ot={kind:"boolean"},_r={kind:"color"},La={kind:"projectionDefinition"},Xn={kind:"object"},ut={kind:"value"},Ca={kind:"collator"},Ea={kind:"formatted"},us={kind:"padding"},co={kind:"colorArray"},ho={kind:"numberArray"},ka={kind:"resolvedImage"},uo={kind:"variableAnchorOffsetCollection"};function Hi(r,e){return{kind:"array",itemType:r,N:e}}function Rt(r){if(r.kind==="array"){let e=Rt(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}let Yn=[tn,Ae,at,ot,_r,La,Ea,Xn,Hi(ut),us,ho,co,ka,uo];function Ln(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Ln(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 Yn)if(!Ln(i,e))return null}}return`Expected ${Rt(r)} but found ${Rt(e)} instead.`}function ds(r,e){return e.some(i=>i.kind===r.kind)}function rn(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 Cn(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}let po=.96422,Sh=.82521,Kn=4/29,En=6/29,pi=3*En*En,_d=En*En*En,Th=Math.PI/180,fo=180/Math.PI;function Ml(r){return(r%=360)<0&&(r+=360),r}function Ph([r,e,i,a]){let s,h,u=ps((.2225045*(r=Ll(r))+.7168786*(e=Ll(e))+.0606169*(i=Ll(i)))/1);r===e&&e===i?s=h=u:(s=ps((.4360747*r+.3850649*e+.1430804*i)/po),h=ps((.0139322*r+.0971045*e+.7141733*i)/Sh));let f=116*u-16;return[f<0?0:f,500*(s-u),200*(u-h),a]}function Ll(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function ps(r){return r>_d?Math.pow(r,1/3):r/pi+Kn}function Ih([r,e,i,a]){let s=(r+16)/116,h=isNaN(e)?s:s+e/500,u=isNaN(i)?s:s-i/200;return s=1*Cl(s),h=po*Cl(h),u=Sh*Cl(u),[fs(3.1338561*h-1.6168667*s-.4906146*u),fs(-.9787684*h+1.9161415*s+.033454*u),fs(.0719453*h-.2289914*s+1.4052427*u),a]}function fs(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Cl(r){return r>En?r*r*r:pi*(r-Kn)}let xd=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function mo(r,e){return xd(r,e)?r[e]:void 0}function ms(r){return parseInt(r.padEnd(2,r),16)/255}function Mh(r,e){return za(e?r/100:r,0,1)}function za(r,e,i){return Math.min(Math.max(e,r),i)}function Lh(r){return!r.some(Number.isNaN)}let Ch={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 xr(r,e,i){return r+i*(e-r)}function Aa(r,e,i){return r.map((a,s)=>xr(a,e[s],i))}class mt{constructor(e,i,a,s=1,h=!0){this.r=e,this.g=i,this.b=a,this.a=s,h||(this.r*=s,this.g*=s,this.b*=s,s||this.overwriteGetter("rgb",[e,i,a,s]))}static parse(e){if(e instanceof mt)return e;if(typeof e!="string")return;let i=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];let s=mo(Ch,a);if(s){let[u,f,g]=s;return[u/255,f/255,g/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){let u=a.length<6?1:2,f=1;return[ms(a.slice(f,f+=u)),ms(a.slice(f,f+=u)),ms(a.slice(f,f+=u)),ms(a.slice(f,f+u)||"ff")]}if(a.startsWith("rgb")){let u=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){let[f,g,x,w,S,M,L,k,A,F,N,H]=u,V=[w||" ",L||" ",F].join("");if(V===" "||V===" /"||V===",,"||V===",,,"){let Z=[x,M,A].join(""),Q=Z==="%%%"?100:Z===""?255:0;if(Q){let ae=[za(+g/Q,0,1),za(+S/Q,0,1),za(+k/Q,0,1),N?Mh(+N,H):1];if(Lh(ae))return ae}}return}}let h=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){let[u,f,g,x,w,S,M,L,k]=h,A=[g||" ",w||" ",M].join("");if(A===" "||A===" /"||A===",,"||A===",,,"){let F=[+f,za(+x,0,100),za(+S,0,100),L?Mh(+L,k):1];if(Lh(F))return function([N,H,V,Z]){function Q(ae){let de=(ae+N/30)%12,we=H*Math.min(V,1-V);return V-we*Math.max(-1,Math.min(de-3,9-de,1))}return N=Ml(N),H/=100,V/=100,[Q(0),Q(8),Q(4),Z]}(F)}}}(e);return i?new mt(...i,!1):void 0}get rgb(){let{r:e,g:i,b:a,a:s}=this,h=s||1/0;return this.overwriteGetter("rgb",[e/h,i/h,a/h,s])}get hcl(){return this.overwriteGetter("hcl",function(e){let[i,a,s,h]=Ph(e),u=Math.sqrt(a*a+s*s);return[Math.round(1e4*u)?Ml(Math.atan2(s,a)*fo):NaN,u,i,h]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ph(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){let[e,i,a,s]=this.rgb;return`rgba(${[e,i,a].map(h=>Math.round(255*h)).join(",")},${s})`}static interpolate(e,i,a,s="rgb"){switch(s){case"rgb":{let[h,u,f,g]=Aa(e.rgb,i.rgb,a);return new mt(h,u,f,g,!1)}case"hcl":{let[h,u,f,g]=e.hcl,[x,w,S,M]=i.hcl,L,k;if(isNaN(h)||isNaN(x))isNaN(h)?isNaN(x)?L=NaN:(L=x,f!==1&&f!==0||(k=w)):(L=h,S!==1&&S!==0||(k=u));else{let V=x-h;x>h&&V>180?V-=360:x<h&&h-x>180&&(V+=360),L=h+a*V}let[A,F,N,H]=function([V,Z,Q,ae]){return V=isNaN(V)?0:V*Th,Ih([Q,Math.cos(V)*Z,Math.sin(V)*Z,ae])}([L,k!=null?k:xr(u,w,a),xr(f,S,a),xr(g,M,a)]);return new mt(A,F,N,H,!1)}case"lab":{let[h,u,f,g]=Ih(Aa(e.lab,i.lab,a));return new mt(h,u,f,g,!1)}}}}mt.black=new mt(0,0,0,1),mt.white=new mt(1,1,1,1),mt.transparent=new mt(0,0,0,0),mt.red=new mt(1,0,0,1);class Jn{constructor(e,i,a){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=a,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 vd=["bottom","center","top"];class El{constructor(e,i,a,s,h,u){this.text=e,this.image=i,this.scale=a,this.fontStack=s,this.textColor=h,this.verticalAlign=u}}class ir{constructor(e){this.sections=e}static fromString(e){return new ir([new El(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 ir?e:ir.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class zi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof zi)return e;if(typeof e=="number")return new zi([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 zi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,a){return new zi(Aa(e.values,i.values,a))}}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]);if(Array.isArray(e)){for(let i of e)if(typeof i!="number")return;return new Ai(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,a){return new Ai(Aa(e.values,i.values,a))}}class Ft{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ft)return e;if(typeof e=="string"){let a=mt.parse(e);return a?new Ft([a]):void 0}if(!Array.isArray(e))return;let i=[];for(let a of e){if(typeof a!="string")return;let s=mt.parse(a);if(!s)return;i.push(s)}return new Ft(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,a,s="rgb"){let h=[];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 u=0;u<e.values.length;u++)h.push(mt.interpolate(e.values[u],i.values[u],a,s));return new Ft(h)}}class Je extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}let Da=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class oi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof oi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){let a=e[i],s=e[i+1];if(typeof a!="string"||!Da.has(a)||!Array.isArray(s)||s.length!==2||typeof s[0]!="number"||typeof s[1]!="number")return}return new oi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,a){let s=e.values,h=i.values;if(s.length!==h.length)throw new Je(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);let u=[];for(let f=0;f<s.length;f+=2){if(s[f]!==h[f])throw new Je(`Cannot interpolate values containing mismatched anchors. from[${f}]: ${s[f]}, to[${f}]: ${h[f]}`);u.push(s[f]);let[g,x]=s[f+1],[w,S]=h[f+1];u.push([xr(g,w,a),xr(x,S,a)])}return new oi(u)}}class rr{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new rr({name:e,available:!1}):null}}class Xi{constructor(e,i,a){this.from=e,this.to=i,this.transition=a}static interpolate(e,i,a){return new Xi(e,i,a)}static parse(e){return e instanceof Xi?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new Xi(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new Xi(e.from,e.to,e.transition):typeof e=="string"?new Xi(e,e,1):void 0}}function gs(r,e,i,a){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,e,i,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,e,i,a]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function nn(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Xi||r instanceof mt||r instanceof Jn||r instanceof ir||r instanceof zi||r instanceof Ai||r instanceof Ft||r instanceof oi||r instanceof rr)return!0;if(Array.isArray(r)){for(let e of r)if(!nn(e))return!1;return!0}if(typeof r=="object"){for(let e in r)if(!nn(r[e]))return!1;return!0}return!1}function Zt(r){if(r===null)return tn;if(typeof r=="string")return at;if(typeof r=="boolean")return ot;if(typeof r=="number")return Ae;if(r instanceof mt)return _r;if(r instanceof Xi)return La;if(r instanceof Jn)return Ca;if(r instanceof ir)return Ea;if(r instanceof zi)return us;if(r instanceof Ai)return ho;if(r instanceof Ft)return co;if(r instanceof oi)return uo;if(r instanceof rr)return ka;if(Array.isArray(r)){let e=r.length,i;for(let a of r){let s=Zt(a);if(i){if(i===s)continue;i=ut;break}i=s}return Hi(i||ut,e)}return Xn}function Ra(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof mt||r instanceof Xi||r instanceof ir||r instanceof zi||r instanceof Ai||r instanceof Ft||r instanceof oi||r instanceof rr?r.toString():JSON.stringify(r)}class an{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(!nn(e[1]))return i.error("invalid value");let a=e[1],s=Zt(a),h=i.expectedType;return s.kind!=="array"||s.N!==0||!h||h.kind!=="array"||typeof h.N=="number"&&h.N!==0||(s=h),new an(s,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Qn={string:at,number:Ae,boolean:ot,object:Xn};class Cr{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 a,s=1,h=e[0];if(h==="array"){let f,g;if(e.length>2){let x=e[1];if(typeof x!="string"||!(x in Qn)||x==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);f=Qn[x],s++}else f=ut;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);g=e[2],s++}a=Hi(f,g)}else{if(!Qn[h])throw new Error(`Types doesn't contain name = ${h}`);a=Qn[h]}let u=[];for(;s<e.length;s++){let f=i.parse(e[s],s,ut);if(!f)return null;u.push(f)}return new Cr(a,u)}evaluate(e){for(let i=0;i<this.args.length;i++){let a=this.args[i].evaluate(e);if(!Ln(this.type,Zt(a)))return a;if(i===this.args.length-1)throw new Je(`Expected value to be of type ${Rt(this.type)}, but found ${Rt(Zt(a))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let go={"to-boolean":ot,"to-color":_r,"to-number":Ae,"to-string":at};class nr{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 a=e[0];if(!go[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return i.error("Expected one argument.");let s=go[a],h=[];for(let u=1;u<e.length;u++){let f=i.parse(e[u],u,ut);if(!f)return null;h.push(f)}return new nr(s,h)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,a;for(let s of this.args){if(i=s.evaluate(e),a=null,i instanceof mt)return i;if(typeof i=="string"){let h=e.parseColor(i);if(h)return h}else if(Array.isArray(i)&&(a=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:gs(i[0],i[1],i[2],i[3]),!a))return new mt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Je(a||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(let a of this.args){i=a.evaluate(e);let s=zi.parse(i);if(s)return s}throw new Je(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(let a of this.args){i=a.evaluate(e);let s=Ai.parse(i);if(s)return s}throw new Je(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(let a of this.args){i=a.evaluate(e);let s=Ft.parse(i);if(s)return s}throw new Je(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(let a of this.args){i=a.evaluate(e);let s=oi.parse(i);if(s)return s}throw new Je(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(let a of this.args){if(i=a.evaluate(e),i===null)return 0;let s=Number(i);if(!isNaN(s))return s}throw new Je(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return ir.fromString(Ra(this.args[0].evaluate(e)));case"resolvedImage":return rr.fromString(Ra(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Ra(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let Eh=["Unknown","Point","LineString","Polygon"];class kl{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"?Eh[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=mt.parse(e),this._parseColorCache.set(e,i)),i}}class yo{constructor(e,i,a=[],s,h=new Hn,u=[]){this.registry=e,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=h,this.errors=u,this.expectedType=s,this._isConstant=i}parse(e,i,a,s,h={}){return i?this.concat(i,a,s)._parse(e,h):this._parse(e,h)}_parse(e,i){function a(s,h,u){return u==="assert"?new Cr(h,[s]):u==="coerce"?new nr(h,[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 h=this.registry[s];if(h){let u=h.parse(e,this);if(!u)return null;if(this.expectedType){let f=this.expectedType,g=u.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value"){if(f.kind==="projectionDefinition"&&["string","array"].includes(g.kind)||["color","formatted","resolvedImage"].includes(f.kind)&&["value","string"].includes(g.kind)||["padding","numberArray"].includes(f.kind)&&["value","number","array"].includes(g.kind)||f.kind==="colorArray"&&["value","string","array"].includes(g.kind)||f.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(g.kind))u=a(u,f,i.typeAnnotation||"coerce");else if(this.checkSubtype(f,g))return null}else u=a(u,f,i.typeAnnotation||"assert")}if(!(u instanceof an)&&u.type.kind!=="resolvedImage"&&this._isConstant(u)){let f=new kl;try{u=new an(u.type,u.evaluate(f))}catch(g){return this.error(g.message),null}}return u}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,a){let s=typeof e=="number"?this.path.concat(e):this.path,h=a?this.scope.concat(a):this.scope;return new yo(this.registry,this._isConstant,s,i||null,h,this.errors)}error(e,...i){let a=`${this.key}${i.map(s=>`[${s}]`).join("")}`;this.errors.push(new jt(a,e))}checkSubtype(e,i){let a=Ln(e,i);return a&&this.error(a),a}}class ea{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 a=[];for(let h=1;h<e.length-1;h+=2){let u=e[h];if(typeof u!="string")return i.error(`Expected string, but found ${typeof u} instead.`,h);if(/[^a-zA-Z0-9_]/.test(u))return i.error("Variable names must contain only alphanumeric characters or '_'.",h);let f=i.parse(e[h+1],h+1);if(!f)return null;a.push([u,f])}let s=i.parse(e[e.length-1],e.length-1,i.expectedType,a);return s?new ea(a,s):null}outputDefined(){return this.result.outputDefined()}}class Ct{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 a=e[1];return i.scope.has(a)?new Ct(a,i.scope.get(a)):i.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class _o{constructor(e,i,a){this.type=e,this.index=i,this.input=a}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let a=i.parse(e[1],1,Ae),s=i.parse(e[2],2,Hi(i.expectedType||ut));return a&&s?new _o(s.type.itemType,a,s):null}evaluate(e){let i=this.index.evaluate(e),a=this.input.evaluate(e);if(i<0)throw new Je(`Array index out of bounds: ${i} < 0.`);if(i>=a.length)throw new Je(`Array index out of bounds: ${i} > ${a.length-1}.`);if(i!==Math.floor(i))throw new Je(`Array index must be an integer, but found ${i} instead.`);return a[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class yt{constructor(e,i){this.type=ot,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 a=i.parse(e[1],1,ut),s=i.parse(e[2],2,ut);return a&&s?ds(a.type,[ot,at,Ae,tn,ut])?new yt(a,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Rt(a.type)} instead`):null}evaluate(e){let i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!rn(i,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${Rt(Zt(i))} instead.`);if(!rn(a,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${Rt(Zt(a))} instead.`);return a.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class ct{constructor(e,i,a){this.type=Ae,this.needle=e,this.haystack=i,this.fromIndex=a}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 a=i.parse(e[1],1,ut),s=i.parse(e[2],2,ut);if(!a||!s)return null;if(!ds(a.type,[ot,at,Ae,tn,ut]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Rt(a.type)} instead`);if(e.length===4){let h=i.parse(e[3],3,Ae);return h?new ct(a,s,h):null}return new ct(a,s)}evaluate(e){let i=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!rn(i,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${Rt(Zt(i))} instead.`);let s;if(this.fromIndex&&(s=this.fromIndex.evaluate(e)),rn(a,["string"])){let h=a.indexOf(i,s);return h===-1?-1:[...a.slice(0,h)].length}if(rn(a,["array"]))return a.indexOf(i,s);throw new Je(`Expected second argument to be of type array or string, but found ${Rt(Zt(a))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class xo{constructor(e,i,a,s,h,u){this.inputType=e,this.type=i,this.input=a,this.cases=s,this.outputs=h,this.otherwise=u}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 a,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);let h={},u=[];for(let x=2;x<e.length-1;x+=2){let w=e[x],S=e[x+1];Array.isArray(w)||(w=[w]);let M=i.concat(x);if(w.length===0)return M.error("Expected at least one branch label.");for(let k of w){if(typeof k!="number"&&typeof k!="string")return M.error("Branch labels must be numbers or strings.");if(typeof k=="number"&&Math.abs(k)>Number.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof k=="number"&&Math.floor(k)!==k)return M.error("Numeric branch labels must be integer values.");if(a){if(M.checkSubtype(a,Zt(k)))return null}else a=Zt(k);if(h[String(k)]!==void 0)return M.error("Branch labels must be unique.");h[String(k)]=u.length}let L=i.parse(S,x,s);if(!L)return null;s=s||L.type,u.push(L)}let f=i.parse(e[1],1,ut);if(!f)return null;let g=i.parse(e[e.length-1],e.length-1,s);return g?f.type.kind!=="value"&&i.concat(1).checkSubtype(a,f.type)?null:new xo(a,s,f,h,u,g):null}evaluate(e){let i=this.input.evaluate(e);return(Zt(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 _t{constructor(e,i,a){this.type=e,this.branches=i,this.otherwise=a}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 a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);let s=[];for(let u=1;u<e.length-1;u+=2){let f=i.parse(e[u],u,ot);if(!f)return null;let g=i.parse(e[u+1],u+1,a);if(!g)return null;s.push([f,g]),a=a||g.type}let h=i.parse(e[e.length-1],e.length-1,a);if(!h)return null;if(!a)throw new Error("Can't infer output type");return new _t(a,s,h)}evaluate(e){for(let[i,a]of this.branches)if(i.evaluate(e))return a.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[i,a]of this.branches)e(i),e(a);e(this.otherwise)}outputDefined(){return this.branches.every(([e,i])=>i.outputDefined())&&this.otherwise.outputDefined()}}class Fa{constructor(e,i,a,s){this.type=e,this.input=i,this.beginIndex=a,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 a=i.parse(e[1],1,ut),s=i.parse(e[2],2,Ae);if(!a||!s)return null;if(!ds(a.type,[Hi(ut),at,ut]))return i.error(`Expected first argument to be of type array or string, but found ${Rt(a.type)} instead`);if(e.length===4){let h=i.parse(e[3],3,Ae);return h?new Fa(a.type,a,s,h):null}return new Fa(a.type,a,s)}evaluate(e){let i=this.input.evaluate(e),a=this.beginIndex.evaluate(e),s;if(this.endIndex&&(s=this.endIndex.evaluate(e)),rn(i,["string"]))return[...i].slice(a,s).join("");if(rn(i,["array"]))return i.slice(a,s);throw new Je(`Expected first argument to be of type array or string, but found ${Rt(Zt(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function vr(r,e){let i=r.length-1,a,s,h=0,u=i,f=0;for(;h<=u;)if(f=Math.floor((h+u)/2),a=r[f],s=r[f+1],a<=e){if(f===i||e<s)return f;h=f+1}else{if(!(a>e))throw new Je("Input is not a number.");u=f-1}return 0}class ta{constructor(e,i,a){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(let[s,h]of a)this.labels.push(s),this.outputs.push(h)}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 a=i.parse(e[1],1,Ae);if(!a)return null;let s=[],h=null;i.expectedType&&i.expectedType.kind!=="value"&&(h=i.expectedType);for(let u=1;u<e.length;u+=2){let f=u===1?-1/0:e[u],g=e[u+1],x=u,w=u+1;if(typeof f!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(s.length&&s[s.length-1][0]>=f)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);let S=i.parse(g,w,h);if(!S)return null;h=h||S.type,s.push([f,S])}return new ta(h,a,s)}evaluate(e){let i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(e);let s=this.input.evaluate(e);if(s<=i[0])return a[0].evaluate(e);let h=i.length;return s>=i[h-1]?a[h-1].evaluate(e):a[vr(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 ys(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var _s,xs,kh=function(){if(xs)return _s;function r(e,i,a,s){this.cx=3*e,this.bx=3*(a-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=a,this.p2y=s}return xs=1,_s=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 a=e,s=0;s<8;s++){var h=this.sampleCurveX(a)-e;if(Math.abs(h)<i)return a;var u=this.sampleCurveDerivativeX(a);if(Math.abs(u)<1e-6)break;a-=h/u}var f=0,g=1;for(a=e,s=0;s<20&&(h=this.sampleCurveX(a),!(Math.abs(h-e)<i));s++)e>h?f=a:g=a,a=.5*(g-f)+f;return a}
1,solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},_s}(),bd=ys(kh);class ji{constructor(e,i,a,s,h){this.type=e,this.operator=i,this.interpolation=a,this.input=s,this.labels=[],this.outputs=[];for(let[u,f]of h)this.labels.push(u),this.outputs.push(f)}static interpolationFactor(e,i,a,s){let h=0;if(e.name==="exponential")h=vs(i,e.base,a,s);else if(e.name==="linear")h=vs(i,1,a,s);else if(e.name==="cubic-bezier"){let u=e.controlPoints;h=new bd(u[0],u[1],u[2],u[3]).solve(vs(i,1,a,s))}return h}static parse(e,i){let[a,s,h,...u]=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 x=s[1];if(typeof x!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:x}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{let x=s.slice(1);if(x.length!==4||x.some(w=>typeof w!="number"||w<0||w>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:x}}}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(h=i.parse(h,2,Ae),!h)return null;let f=[],g=null;a!=="interpolate-hcl"&&a!=="interpolate-lab"||i.expectedType==co?i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType):g=_r;for(let x=0;x<u.length;x+=2){let w=u[x],S=u[x+1],M=x+3,L=x+4;if(typeof w!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',M);if(f.length&&f[f.length-1][0]>=w)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);let k=i.parse(S,L,g);if(!k)return null;g=g||k.type,f.push([w,k])}return Cn(g,Ae)||Cn(g,La)||Cn(g,_r)||Cn(g,us)||Cn(g,ho)||Cn(g,co)||Cn(g,uo)||Cn(g,Hi(Ae))?new ji(g,a,s,h,f):i.error(`Type ${Rt(g)} is not interpolatable.`)}evaluate(e){let i=this.labels,a=this.outputs;if(i.length===1)return a[0].evaluate(e);let s=this.input.evaluate(e);if(s<=i[0])return a[0].evaluate(e);let h=i.length;if(s>=i[h-1])return a[h-1].evaluate(e);let u=vr(i,s),f=ji.interpolationFactor(this.interpolation,s,i[u],i[u+1]),g=a[u].evaluate(e),x=a[u+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return xr(g,x,f);case"color":return mt.interpolate(g,x,f);case"padding":return zi.interpolate(g,x,f);case"colorArray":return Ft.interpolate(g,x,f);case"numberArray":return Ai.interpolate(g,x,f);case"variableAnchorOffsetCollection":return oi.interpolate(g,x,f);case"array":return Aa(g,x,f);case"projectionDefinition":return Xi.interpolate(g,x,f)}case"interpolate-hcl":switch(this.type.kind){case"color":return mt.interpolate(g,x,f,"hcl");case"colorArray":return Ft.interpolate(g,x,f,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return mt.interpolate(g,x,f,"lab");case"colorArray":return Ft.interpolate(g,x,f,"lab")}}}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function vs(r,e,i,a){let s=a-i,h=r-i;return s===0?0:e===1?h/s:(Math.pow(e,h)-1)/(Math.pow(e,s)-1)}let Ti={color:mt.interpolate,number:xr,padding:zi.interpolate,numberArray:Ai.interpolate,colorArray:Ft.interpolate,variableAnchorOffsetCollection:oi.interpolate,array:Aa};class fi{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 a=null,s=i.expectedType;s&&s.kind!=="value"&&(a=s);let h=[];for(let f of e.slice(1)){let g=i.parse(f,1+h.length,a,void 0,{typeAnnotation:"omit"});if(!g)return null;a=a||g.type,h.push(g)}if(!a)throw new Error("No output type");let u=s&&h.some(f=>Ln(s,f.type));return new fi(u?ut:a,h)}evaluate(e){let i,a=null,s=0;for(let h of this.args)if(s++,a=h.evaluate(e),a&&a instanceof rr&&!a.available&&(i||(i=a.name),a=null,s===this.args.length&&(a=i)),a!==null)break;return a}
vendor: 13,399 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function vo(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 zl(r,e,i,a){return a.compare(e,i)===0}function on(r,e,i){let a=r!=="=="&&r!=="!=";return class ty{constructor(h,u,f){this.type=ot,this.lhs=h,this.rhs=u,this.collator=f,this.hasUntypedArgument=h.type.kind==="value"||u.type.kind==="value"}static parse(h,u){if(h.length!==3&&h.length!==4)return u.error("Expected two or three arguments.");let f=h[0],g=u.parse(h[1],1,ut);if(!g)return null;if(!vo(f,g.type))return u.concat(1).error(`"${f}" comparisons are not supported for type '${Rt(g.type)}'.`);let x=u.parse(h[2],2,ut);if(!x)return null;if(!vo(f,x.type))return u.concat(2).error(`"${f}" comparisons are not supported for type '${Rt(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return u.error(`Cannot compare types '${Rt(g.type)}' and '${Rt(x.type)}'.`);a&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Cr(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Cr(g.type,[x])));let w=null;if(h.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(w=u.parse(h[3],3,Ca),!w)return null}return new ty(g,x,w)}evaluate(h){let u=this.lhs.evaluate(h),f=this.rhs.evaluate(h);if(a&&this.hasUntypedArgument){let g=Zt(u),x=Zt(f);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new Je(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){let g=Zt(u),x=Zt(f);if(g.kind!=="string"||x.kind!=="string")return e(h,u,f)}return this.collator?i(h,u,f,this.collator.evaluate(h)):e(h,u,f)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}let yi=on("==",function(r,e,i){return e===i},zl),zh=on("!=",function(r,e,i){return e!==i},function(r,e,i,a){return!zl(0,e,i,a)}),Al=on("<",function(r,e,i){return e<i},function(r,e,i,a){return a.compare(e,i)<0}),Ah=on(">",function(r,e,i){return e>i},function(r,e,i,a){return a.compare(e,i)>0}),wd=on("<=",function(r,e,i){return e<=i},function(r,e,i,a){return a.compare(e,i)<=0}),Oa=on(">=",function(r,e,i){return e>=i},function(r,e,i,a){return a.compare(e,i)>=0});class ia{constructor(e,i,a){this.type=Ca,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");let a=e[1];if(typeof a!="object"||Array.isArray(a))return i.error("Collator options argument must be an object.");let s=i.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,ot);if(!s)return null;let h=i.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,ot);if(!h)return null;let u=null;return a.locale&&(u=i.parse(a.locale,1,at),!u)?null:new ia(s,h,u)}evaluate(e){return new Jn(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 bo{constructor(e,i,a,s,h){this.type=at,this.number=e,this.locale=i,this.currency=a,this.minFractionDigits=s,this.maxFractionDigits=h}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");let a=i.parse(e[1],1,Ae);if(!a)return null;let s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let h=null;if(s.locale&&(h=i.parse(s.locale,1,at),!h))return null;let u=null;if(s.currency&&(u=i.parse(s.currency,1,at),!u))return null;let f=null;if(s["min-fraction-digits"]&&(f=i.parse(s["min-fraction-digits"],1,Ae),!f))return null;let g=null;return s["max-fraction-digits"]&&(g=i.parse(s["max-fraction-digits"],1,Ae),!g)?null:new bo(a,h,u,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class bs{constructor(e){this.type=Ea,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let a=e[1];if(!Array.isArray(a)&&typeof a=="object")return i.error("First argument must be an image or text section.");let s=[],h=!1;for(let u=1;u<=e.length-1;++u){let f=e[u];if(h&&typeof f=="object"&&!Array.isArray(f)){h=!1;let g=null;if(f["font-scale"]&&(g=i.parse(f["font-scale"],1,Ae),!g))return null;let x=null;if(f["text-font"]&&(x=i.parse(f["text-font"],1,Hi(at)),!x))return null;let w=null;if(f["text-color"]&&(w=i.parse(f["text-color"],1,_r),!w))return null;let S=null;if(f["vertical-align"]){if(typeof f["vertical-align"]=="string"&&!vd.includes(f["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${f["vertical-align"]}' instead.`);if(S=i.parse(f["vertical-align"],1,at),!S)return null}let M=s[s.length-1];M.scale=g,M.font=x,M.textColor=w,M.verticalAlign=S}else{let g=i.parse(e[u],1,ut);if(!g)return null;let x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,s.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new bs(s)}evaluate(e){return new ir(this.sections.map(i=>{let a=i.content.evaluate(e);return Zt(a)===ka?new El("",a,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new El(Ra(a),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 ws{constructor(e){this.type=ka,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");let a=i.parse(e[1],1,at);return a?new ws(a):i.error("No image name provided.")}evaluate(e){let i=this.input.evaluate(e),a=rr.fromString(i);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(i)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ba{constructor(e){this.type=Ae,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let a=i.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Rt(a.type)} instead.`):new Ba(a):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 Je(`Expected value to be of type string or array, but found ${Rt(Zt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let ar=8192;function Er(r,e){let i=(180+r[0])/360,a=(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*ar),Math.round(a*s*ar)]}function Ss(r,e){let i=Math.pow(2,e.z);return[(s=(r[0]/ar+e.x)/i,360*s-180),(a=(r[1]/ar+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,s}function kn(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 wo(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function Dl(r,e,i){let a=r[0]-e[0],s=r[1]-e[1],h=r[0]-i[0],u=r[1]-i[1];return a*u-h*s==0&&a*h<=0&&s*u<=0}function Ts(r,e,i,a){return(s=[a[0]-i[0],a[1]-i[1]])[0]*(h=[e[0]-r[0],e[1]-r[1]])[1]-s[1]*h[0]!=0&&!(!Rl(r,e,i,a)||!Rl(i,a,r,e));var s,h}function Sd(r,e,i){for(let a of i)for(let s=0;s<a.length-1;++s)if(Ts(r,e,a[s],a[s+1]))return!0;return!1}function ja(r,e,i=!1){let a=!1;for(let f of e)for(let g=0;g<f.length-1;g++){if(Dl(r,f[g],f[g+1]))return i;(h=f[g])[1]>(s=r)[1]!=(u=f[g+1])[1]>s[1]&&s[0]<(u[0]-h[0])*(s[1]-h[1])/(u[1]-h[1])+h[0]&&(a=!a)}var s,h,u;return a}function Td(r,e){for(let i of e)if(ja(r,i))return!0;return!1}function So(r,e){for(let i of r)if(!ja(i,e))return!1;for(let i=0;i<r.length-1;++i)if(Sd(r[i],r[i+1],e))return!1;return!0}function Pd(r,e){for(let i of e)if(So(r,i))return!0;return!1}function Rl(r,e,i,a){let s=a[0]-i[0],h=a[1]-i[1],u=(r[0]-i[0])*h-s*(r[1]-i[1]),f=(e[0]-i[0])*h-s*(e[1]-i[1]);return u>0&&f<0||u<0&&f>0}function Ps(r,e,i){let a=[];for(let s=0;s<r.length;s++){let h=[];for(let u=0;u<r[s].length;u++){let f=Er(r[s][u],i);kn(e,f),h.push(f)}a.push(h)}return a}function Dh(r,e,i){let a=[];for(let s=0;s<r.length;s++){let h=Ps(r[s],e,i);a.push(h)}return a}function Fl(r,e,i,a){if(r[0]<i[0]||r[0]>i[2]){let s=.5*a,h=r[0]-i[0]>s?-a:i[0]-r[0]>s?a:0;h===0&&(h=r[0]-i[2]>s?-a:i[2]-r[0]>s?a:0),r[0]+=h}kn(e,r)}function Rh(r,e,i,a){let s=Math.pow(2,a.z)*ar,h=[a.x*ar,a.y*ar],u=[];for(let f of r)for(let g of f){let x=[g.x+h[0],g.y+h[1]];Fl(x,e,i,s),u.push(x)}return u}function Fh(r,e,i,a){let s=Math.pow(2,a.z)*ar,h=[a.x*ar,a.y*ar],u=[];for(let g of r){let x=[];for(let w of g){let S=[w.x+h[0],w.y+h[1]];kn(e,S),x.push(S)}u.push(x)}if(e[2]-e[0]<=s/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(let g of u)for(let x of g)Fl(x,e,i,s)}var f;return u}class ra{constructor(e,i){this.type=ot,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(nn(e[1])){let a=e[1];if(a.type==="FeatureCollection"){let s=[];for(let h of a.features){let{type:u,coordinates:f}=h.geometry;u==="Polygon"&&s.push(f),u==="MultiPolygon"&&s.push(...f)}if(s.length)return new ra(a,{type:"MultiPolygon",coordinates:s})}else if(a.type==="Feature"){let s=a.geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new ra(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new ra(a,a)}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,a){let s=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(a.type==="Polygon"){let f=Ps(a.coordinates,h,u),g=Rh(i.geometry(),s,h,u);if(!wo(s,h))return!1;for(let x of g)if(!ja(x,f))return!1}if(a.type==="MultiPolygon"){let f=Dh(a.coordinates,h,u),g=Rh(i.geometry(),s,h,u);if(!wo(s,h))return!1;for(let x of g)if(!Td(x,f))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(i,a){let s=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(a.type==="Polygon"){let f=Ps(a.coordinates,h,u),g=Fh(i.geometry(),s,h,u);if(!wo(s,h))return!1;for(let x of g)if(!So(x,f))return!1}if(a.type==="MultiPolygon"){let f=Dh(a.coordinates,h,u),g=Fh(i.geometry(),s,h,u);if(!wo(s,h))return!1;for(let x of g)if(!Pd(x,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Oh=class{constructor(r=[],e=(i,a)=>i<a?-1:i>a?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,a=e[r];for(;r>0;){let s=r-1>>1,h=e[s];if(i(a,h)>=0)break;e[r]=h,r=s}e[r]=a}_down(r){let{data:e,compare:i}=this,a=this.length>>1,s=e[r];for(;r<a;){let h=1+(r<<1),u=h+1;if(u<this.length&&i(e[u],e[h])<0&&(h=u),i(e[h],s)>=0)break;e[r]=e[h],r=h}e[r]=s}};function Bh(r,e,i=0,a=r.length-1,s=jh){for(;a>i;){if(a-i>600){let g=a-i+1,x=e-i+1,w=Math.log(g),S=.5*Math.exp(2*w/3),M=.5*Math.sqrt(w*S*(g-S)/g)*(x-g/2<0?-1:1);Bh(r,e,Math.max(i,Math.floor(e-x*S/g+M)),Math.min(a,Math.floor(e+(g-x)*S/g+M)),s)}let h=r[e],u=i,f=a;for(Va(r,i,e),s(r[a],h)>0&&Va(r,i,a);u<f;){for(Va(r,u,f),u++,f--;s(r[u],h)<0;)u++;for(;s(r[f],h)>0;)f--}s(r[i],h)===0?Va(r,i,f):(f++,Va(r,f,a)),f<=e&&(i=f+1),e<=f&&(a=f-1)}}function Va(r,e,i){let a=r[e];r[e]=r[i],r[i]=a}function jh(r,e){return r<e?-1:r>e?1:0}function To(r,e){if(r.length<=1)return[r];let i=[],a,s;for(let h of r){let u=Md(h);u!==0&&(h.area=Math.abs(u),s===void 0&&(s=u<0),s===u<0?(a&&i.push(a),a=[h]):a.push(h))}if(a&&i.push(a),e>1)for(let h=0;h<i.length;h++)i[h].length<=e||(Bh(i[h],e,1,i[h].length-1,Id),i[h]=i[h].slice(0,e));return i}function Id(r,e){return e.area-r.area}function Md(r){let e=0;for(let i,a,s=0,h=r.length,u=h-1;s<h;u=s++)i=r[s],a=r[u],e+=(a.x-i.x)*(i.y+a.y);return e}let Vh=1/298.257223563,Nh=Vh*(2-Vh),Po=Math.PI/180;class Ol{constructor(e){let i=6378.137*Po*1e3,a=Math.cos(e*Po),s=1/(1-Nh*(1-a*a)),h=Math.sqrt(s);this.kx=i*h*a,this.ky=i*h*s*(1-Nh)}distance(e,i){let a=this.wrap(e[0]-i[0])*this.kx,s=(e[1]-i[1])*this.ky;return Math.sqrt(a*a+s*s)}
vendor: 6,368 bytes, line 1
1pointOnLine(e,i){let a,s,h,u,f=1/0;for(let g=0;g<e.length-1;g++){let x=e[g][0],w=e[g][1],S=this.wrap(e[g+1][0]-x)*this.kx,M=(e[g+1][1]-w)*this.ky,L=0;S===0&&M===0||(L=(this.wrap(i[0]-x)*this.kx*S+(i[1]-w)*this.ky*M)/(S*S+M*M),L>1?(x=e[g+1][0],w=e[g+1][1]):L>0&&(x+=S/this.kx*L,w+=M/this.ky*L)),S=this.wrap(i[0]-x)*this.kx,M=(i[1]-w)*this.ky;let k=S*S+M*M;k<f&&(f=k,a=x,s=w,h=g,u=L)}return{point:[a,s],index:h,t:Math.max(0,Math.min(1,u))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Uh(r,e){return e[0]-r[0]}function Is(r){return r[1]-r[0]+1}function sn(r,e){return r[1]>=r[0]&&r[1]<e}function Io(r,e){if(r[0]>r[1])return[null,null];let i=Is(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 a=Math.floor(i/2)-1;return[[r[0],r[0]+a],[r[0]+a+1,r[1]]]}function Ms(r,e){if(!sn(e,r.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let a=e[0];a<=e[1];++a)kn(i,r[a]);return i}function Bl(r){let e=[1/0,1/0,-1/0,-1/0];for(let i of r)for(let a of i)kn(e,a);return e}function Gh(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function Ls(r,e,i){if(!Gh(r)||!Gh(e))return NaN;let a=0,s=0;return r[2]<e[0]&&(a=e[0]-r[2]),r[0]>e[2]&&(a=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],[a,s])}function zn(r,e,i){let a=i.pointOnLine(e,r);return i.distance(r,a.point)}function jl(r,e,i,a,s){let h=Math.min(zn(r,[i,a],s),zn(e,[i,a],s)),u=Math.min(zn(i,[r,e],s),zn(a,[r,e],s));return Math.min(h,u)}function Ld(r,e,i,a,s){if(!sn(e,r.length)||!sn(a,i.length))return 1/0;let h=1/0;for(let u=e[0];u<e[1];++u){let f=r[u],g=r[u+1];for(let x=a[0];x<a[1];++x){let w=i[x],S=i[x+1];if(Ts(f,g,w,S))return 0;h=Math.min(h,jl(f,g,w,S,s))}}return h}function Cd(r,e,i,a,s){if(!sn(e,r.length)||!sn(a,i.length))return NaN;let h=1/0;for(let u=e[0];u<=e[1];++u)for(let f=a[0];f<=a[1];++f)if(h=Math.min(h,s.distance(r[u],i[f])),h===0)return h;return h}function Zh(r,e,i){if(ja(r,e,!0))return 0;let a=1/0;for(let s of e){let h=s[0],u=s[s.length-1];if(h!==u&&(a=Math.min(a,zn(r,[u,h],i)),a===0))return a;let f=i.pointOnLine(s,r);if(a=Math.min(a,i.distance(r,f.point)),a===0)return a}return a}function Ed(r,e,i,a){if(!sn(e,r.length))return NaN;for(let h=e[0];h<=e[1];++h)if(ja(r[h],i,!0))return 0;let s=1/0;for(let h=e[0];h<e[1];++h){let u=r[h],f=r[h+1];for(let g of i)for(let x=0,w=g.length,S=w-1;x<w;S=x++){let M=g[S],L=g[x];if(Ts(u,f,M,L))return 0;s=Math.min(s,jl(u,f,M,L,a))}}return s}function qh(r,e){for(let i of r)for(let a of i)if(ja(a,e,!0))return!0;return!1}function kd(r,e,i,a=1/0){let s=Bl(r),h=Bl(e);if(a!==1/0&&Ls(s,h,i)>=a)return a;if(wo(s,h)){if(qh(r,e))return 0}else if(qh(e,r))return 0;let u=1/0;for(let f of r)for(let g=0,x=f.length,w=x-1;g<x;w=g++){let S=f[w],M=f[g];for(let L of e)for(let k=0,A=L.length,F=A-1;k<A;F=k++){let N=L[F],H=L[k];if(Ts(S,M,N,H))return 0;u=Math.min(u,jl(S,M,N,H,i))}}return u}function $h(r,e,i,a,s,h){if(!h)return;let u=Ls(Ms(a,h),s,i);u<e&&r.push([u,h,[0,0]])}function xt(r,e,i,a,s,h,u){if(!h||!u)return;let f=Ls(Ms(a,h),Ms(s,u),i);f<e&&r.push([f,h,u])}function Cs(r,e,i,a,s=1/0){let h=Math.min(a.distance(r[0],i[0][0]),s);if(h===0)return h;let u=new Oh([[0,[0,r.length-1],[0,0]]],Uh),f=Bl(i);for(;u.length>0;){let g=u.pop();if(g[0]>=h)continue;let x=g[1],w=e?50:100;if(Is(x)<=w){if(!sn(x,r.length))return NaN;if(e){let S=Ed(r,x,i,a);if(isNaN(S)||S===0)return S;h=Math.min(h,S)}else for(let S=x[0];S<=x[1];++S){let M=Zh(r[S],i,a);if(h=Math.min(h,M),h===0)return 0}}else{let S=Io(x,e);$h(u,h,a,r,f,S[0]),$h(u,h,a,r,f,S[1])}}return h}function Es(r,e,i,a,s,h=1/0){let u=Math.min(h,s.distance(r[0],i[0]));if(u===0)return u;let f=new Oh([[0,[0,r.length-1],[0,i.length-1]]],Uh);for(;f.length>0;){let g=f.pop();if(g[0]>=u)continue;let x=g[1],w=g[2],S=e?50:100,M=a?50:100;if(Is(x)<=S&&Is(w)<=M){if(!sn(x,r.length)&&sn(w,i.length))return NaN;let L;if(e&&a)L=Ld(r,x,i,w,s),u=Math.min(u,L);else if(e&&!a){let k=r.slice(x[0],x[1]+1);for(let A=w[0];A<=w[1];++A)if(L=zn(i[A],k,s),u=Math.min(u,L),u===0)return u}else if(!e&&a){let k=i.slice(w[0],w[1]+1);for(let A=x[0];A<=x[1];++A)if(L=zn(r[A],k,s),u=Math.min(u,L),u===0)return u}else L=Cd(r,x,i,w,s),u=Math.min(u,L)}else{let L=Io(x,e),k=Io(w,a);xt(f,u,s,r,i,L[0],k[0]),xt(f,u,s,r,i,L[0],k[1]),xt(f,u,s,r,i,L[1],k[0]),xt(f,u,s,r,i,L[1],k[1])}}return u}function Vl(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 na{constructor(e,i){this.type=Ae,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(nn(e[1])){let a=e[1];if(a.type==="FeatureCollection")return new na(a,a.features.map(s=>Vl(s.geometry)).flat());if(a.type==="Feature")return new na(a,Vl(a.geometry));if("type"in a&&"coordinates"in a)return new na(a,Vl(a))}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,a){let s=i.geometry(),h=s.flat().map(g=>Ss([g.x,g.y],i.canonical));if(s.length===0)return NaN;let u=new Ol(h[0][1]),f=1/0;for(let g of a){switch(g.type){case"Point":f=Math.min(f,Es(h,!1,[g.coordinates],!1,u,f));break;case"LineString":f=Math.min(f,Es(h,!1,g.coordinates,!0,u,f));break;case"Polygon":f=Math.min(f,Cs(h,!1,g.coordinates,u,f))}if(f===0)return f}return f}(e,this.geometries);if(e.geometryType()==="LineString")return function(i,a){let s=i.geometry(),h=s.flat().map(g=>Ss([g.x,g.y],i.canonical));if(s.length===0)return NaN;let u=new Ol(h[0][1]),f=1/0;for(let g of a){switch(g.type){case"Point":f=Math.min(f,Es(h,!0,[g.coordinates],!1,u,f));break;case"LineString":f=Math.min(f,Es(h,!0,g.coordinates,!0,u,f));break;case"Polygon":f=Math.min(f,Cs(h,!0,g.coordinates,u,f))}if(f===0)return f}return f}(e,this.geometries);if(e.geometryType()==="Polygon")return function(i,a){let s=i.geometry();if(s.length===0||s[0].length===0)return NaN;let h=To(s,0).map(g=>g.map(x=>x.map(w=>Ss([w.x,w.y],i.canonical)))),u=new Ol(h[0][0][0][1]),f=1/0;for(let g of a)for(let x of h){switch(g.type){case"Point":f=Math.min(f,Cs([g.co
1ordinates],!1,x,u,f));break;case"LineString":f=Math.min(f,Cs(g.coordinates,!0,x,u,f));break;case"Polygon":f=Math.min(f,kd(x,g.coordinates,u,f))}if(f===0)return f}return f}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Mo{constructor(e){this.type=ut,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let a=e[1];return a==null?i.error("Global state property must be defined."):typeof a!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Mo(a)}evaluate(e){var i;let a=(i=e.globals)===null||i===void 0?void 0:i.globalState;return a&&Object.keys(a).length!==0?mo(a,this.key):null}eachChild(){}outputDefined(){return!1}}let Na={"==":yi,"!=":zh,">":Ah,"<":Al,">=":Oa,"<=":wd,array:Cr,at:_o,boolean:Cr,case:_t,coalesce:fi,collator:ia,format:bs,image:ws,in:yt,"index-of":ct,interpolate:ji,"interpolate-hcl":ji,"interpolate-lab":ji,length:Ba,let:ea,literal:an,match:xo,number:Cr,"number-format":bo,object:Cr,slice:Fa,step:ta,string:Cr,"to-boolean":nr,"to-color":nr,"to-number":nr,"to-string":nr,var:Ct,within:ra,distance:na,"global-state":Mo};class br{constructor(e,i,a,s){this.name=e,this.type=i,this._evaluate=a,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 a=e[0],s=br.definitions[a];if(!s)return i.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);let h=Array.isArray(s)?s[0]:s.type,u=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,f=u.filter(([x])=>!Array.isArray(x)||x.length===e.length-1),g=null;for(let[x,w]of f){g=new yo(i.registry,ks,i.path,null,i.scope);let S=[],M=!1;for(let L=1;L<e.length;L++){let k=e[L],A=Array.isArray(x)?x[L-1]:x.type,F=g.parse(k,1+S.length,A);if(!F){M=!0;break}S.push(F)}if(!M)if(Array.isArray(x)&&x.length!==S.length)g.error(`Expected ${x.length} arguments, but found ${S.length} instead.`);else{for(let L=0;L<S.length;L++){let k=Array.isArray(x)?x[L]:x.type,A=S[L];g.concat(L+1).checkSubtype(k,A.type)}if(g.errors.length===0)return new br(a,h,w,S)}}if(f.length===1)i.errors.push(...g.errors);else{let x=(f.length?f:u).map(([S])=>{return M=S,Array.isArray(M)?`(${M.map(Rt).join(", ")})`:`(${Rt(M.type)}...)`;var M}).join(" | "),w=[];for(let S=1;S<e.length;S++){let M=i.parse(e[S],1+w.length);if(!M)return null;w.push(Rt(M.type))}i.error(`Expected arguments of type ${x}, but found (${w.join(", ")}) instead.`)}return null}static register(e,i){br.definitions=i;for(let a in i)e[a]=br}}function Wh(r,[e,i,a,s]){e=e.evaluate(r),i=i.evaluate(r),a=a.evaluate(r);let h=s?s.evaluate(r):1,u=gs(e,i,a,h);if(u)throw new Je(u);return new mt(e/255,i/255,a/255,h,!1)}function Hh(r,e){return r in e}function Nl(r,e){let i=e[r];return i===void 0?null:i}function aa(r){return{type:r}}function ks(r){if(r instanceof Ct)return ks(r.boundExpression);if(r instanceof br&&r.name==="error"||r instanceof ia||r instanceof ra||r instanceof na||r instanceof Mo)return!1;let e=r instanceof nr||r instanceof Cr,i=!0;return r.eachChild(a=>{i=e?i&&ks(a):i&&a instanceof an}),!!i&&zs(r)&&As(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function zs(r){if(r instanceof br&&(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 ra||r instanceof na)return!1;let e=!0;return r.eachChild(i=>{e&&!zs(i)&&(e=!1)}),e}function Lo(r){if(r instanceof br&&r.name==="feature-state")return!1;let e=!0;return r.eachChild(i=>{e&&!Lo(i)&&(e=!1)}),e}function As(r,e){if(r instanceof br&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild(a=>{i&&!As(a,e)&&(i=!1)}),i}function Xh(r){return{result:"success",value:r}}function Ua(r){return{result:"error",value:r}}function Ga(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function Yh(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Ul(r){return!!r.expression&&r.expression.interpolated}function pt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ds(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&Zt(r)===Xn}function zd(r){return r}function Kh(r,e){let i=r.stops&&typeof r.stops[0][0]=="object",a=i||!(i||r.property!==void 0),s=r.type||(Ul(e)?"exponential":"interval"),h=function(w){switch(w.type){case"color":return mt.parse;case"padding":return zi.parse;case"numberArray":return Ai.parse;case"colorArray":return Ft.parse;default:return null}}(e);if(h&&((r=vt({},r)).stops&&(r.stops=r.stops.map(w=>[w[0],h(w[1])])),r.default=h(r.default?r.default:e.default)),r.colorSpace&&(u=r.colorSpace)!=="rgb"&&u!=="hcl"&&u!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var u;let f=function(w){switch(w){case"exponential":return Jh;case"interval":return Dd;case"categorical":return Ad;case"identity":return Rd;default:throw new Error(`Unknown function type "${w}"`)}}(s),g,x;if(s==="categorical"){g=Object.create(null);for(let w of r.stops)g[w[0]]=w[1];x=typeof r.stops[0][0]}if(i){let w={},S=[];for(let k=0;k<r.stops.length;k++){let A=r.stops[k],F=A[0].zoom;w[F]===void 0&&(w[F]={zoom:F,type:r.type,property:r.property,default:r.default,stops:[]},S.push(F)),w[F].stops.push([A[0].value,A[1]])}let M=[];
vendor: 17,683 bytes, line 1
1for(let k of S)M.push([w[k].zoom,Kh(w[k],e)]);let L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:ji.interpolationFactor.bind(void 0,L),zoomStops:M.map(k=>k[0]),evaluate:({zoom:k},A)=>Jh({stops:M,base:r.base},e,k).evaluate(k,A)}}if(a){let w=s==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:ji.interpolationFactor.bind(void 0,w),zoomStops:r.stops.map(S=>S[0]),evaluate:({zoom:S})=>f(r,e,S,g,x)}}return{kind:"source",evaluate(w,S){let M=S&&S.properties?S.properties[r.property]:void 0;return M===void 0?Co(r.default,e.default):f(r,e,M,g,x)}}}function Co(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function Ad(r,e,i,a,s){return Co(typeof i===s?a[i]:void 0,r.default,e.default)}function Dd(r,e,i){if(pt(i)!=="number")return Co(r.default,e.default);let a=r.stops.length;if(a===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[a-1][0])return r.stops[a-1][1];let s=vr(r.stops.map(h=>h[0]),i);return r.stops[s][1]}function Jh(r,e,i){let a=r.base!==void 0?r.base:1;if(pt(i)!=="number")return Co(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 h=vr(r.stops.map(w=>w[0]),i),u=function(w,S,M,L){let k=L-M,A=w-M;return k===0?0:S===1?A/k:(Math.pow(S,A)-1)/(Math.pow(S,k)-1)}(i,a,r.stops[h][0],r.stops[h+1][0]),f=r.stops[h][1],g=r.stops[h+1][1],x=Ti[e.type]||zd;return typeof f.evaluate=="function"?{evaluate(...w){let S=f.evaluate.apply(void 0,w),M=g.evaluate.apply(void 0,w);if(S!==void 0&&M!==void 0)return x(S,M,u,r.colorSpace)}}:x(f,g,u,r.colorSpace)}function Rd(r,e,i){switch(e.type){case"color":i=mt.parse(i);break;case"formatted":i=ir.fromString(i.toString());break;case"resolvedImage":i=rr.fromString(i.toString());break;case"padding":i=zi.parse(i);break;case"colorArray":i=Ft.parse(i);break;case"numberArray":i=Ai.parse(i);break;default:pt(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return Co(i,r.default,e.default)}br.register(Na,{error:[{kind:"error"},[at],(r,[e])=>{throw new Je(e.evaluate(r))}],typeof:[at,[ut],(r,[e])=>Rt(Zt(e.evaluate(r)))],"to-rgba":[Hi(Ae,4),[_r],(r,[e])=>{let[i,a,s,h]=e.evaluate(r).rgb;return[255*i,255*a,255*s,h]}],rgb:[_r,[Ae,Ae,Ae],Wh],rgba:[_r,[Ae,Ae,Ae,Ae],Wh],has:{type:ot,overloads:[[[at],(r,[e])=>Hh(e.evaluate(r),r.properties())],[[at,Xn],(r,[e,i])=>Hh(e.evaluate(r),i.evaluate(r))]]},get:{type:ut,overloads:[[[at],(r,[e])=>Nl(e.evaluate(r),r.properties())],[[at,Xn],(r,[e,i])=>Nl(e.evaluate(r),i.evaluate(r))]]},"feature-state":[ut,[at],(r,[e])=>Nl(e.evaluate(r),r.featureState||{})],properties:[Xn,[],r=>r.properties()],"geometry-type":[at,[],r=>r.geometryType()],id:[ut,[],r=>r.id()],zoom:[Ae,[],r=>r.globals.zoom],"heatmap-density":[Ae,[],r=>r.globals.heatmapDensity||0],elevation:[Ae,[],r=>r.globals.elevation||0],"line-progress":[Ae,[],r=>r.globals.lineProgress||0],accumulated:[ut,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Ae,aa(Ae),(r,e)=>{let i=0;for(let a of e)i+=a.evaluate(r);return i}],"*":[Ae,aa(Ae),(r,e)=>{let i=1;for(let a of e)i*=a.evaluate(r);return i}],"-":{type:Ae,overloads:[[[Ae,Ae],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[Ae],(r,[e])=>-e.evaluate(r)]]},"/":[Ae,[Ae,Ae],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[Ae,[Ae,Ae],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[Ae,[],()=>Math.LN2],pi:[Ae,[],()=>Math.PI],e:[Ae,[],()=>Math.E],"^":[Ae,[Ae,Ae],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[Ae,[Ae],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[Ae,[Ae],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[Ae,[Ae],(r,[e])=>Math.log(e.evaluate(r))],log2:[Ae,[Ae],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[Ae,[Ae],(r,[e])=>Math.sin(e.evaluate(r))],cos:[Ae,[Ae],(r,[e])=>Math.cos(e.evaluate(r))],tan:[Ae,[Ae],(r,[e])=>Math.tan(e.evaluate(r))],asin:[Ae,[Ae],(r,[e])=>Math.asin(e.evaluate(r))],acos:[Ae,[Ae],(r,[e])=>Math.acos(e.evaluate(r))],atan:[Ae,[Ae],(r,[e])=>Math.atan(e.evaluate(r))],min:[Ae,aa(Ae),(r,e)=>Math.min(...e.map(i=>i.evaluate(r)))],max:[Ae,aa(Ae),(r,e)=>Math.max(...e.map(i=>i.evaluate(r)))],abs:[Ae,[Ae],(r,[e])=>Math.abs(e.evaluate(r))],round:[Ae,[Ae],(r,[e])=>{let i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Ae,[Ae],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[Ae,[Ae],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[ot,[at,ut],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[ot,[ut],(r,[e])=>r.id()===e.value],"filter-type-==":[ot,[at],(r,[e])=>r.geometryType()===e.value],"filter-<":[ot,[at,ut],(r,[e,i])=>{let a=r.properties()[e.value],s=i.value;return typeof a==typeof s&&a<s}],"filter-id-<":[ot,[ut],(r,[e])=>{let i=r.id(),a=e.value;return typeof i==typeof a&&i<a}],"filter->":[ot,[at,ut],(r,[e,i])=>{let a=r.properties()[e.value],s=i.value;return typeof a==typeof s&&a>s}],"filter-id->":[ot,[ut],(r,[e])=>{let i=r.id(),a=e.value;return typeof i==typeof a&&i>a}],"filter-<=":[ot,[at,ut],(r,[e,i])=>{let a=r.properties()[e.value],s=i.value;return typeof a==typeof s&&a<=s}],"filter-id-<=":[ot,[ut],(r,[e])=>{let i=r.id(),a=e.value;return typeof i==typeof a&&i<=a}],"filter->=":[ot,[at,ut],(r,[e,i])=>{let a=r.properties()[e.value],s=i.value;return typeof a==typeof s&&a>=s}],"filter-id->=":[ot,[ut],(r,[e])=>{let i=r.id(),a=e.value;return typeof i==typeof a&&i>=a}],"filter-has":[ot,[ut],(r,[e])=>e.value in r.properties()],"filter-has-id":[ot,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[ot,[Hi(at)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[ot,[Hi(ut)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[ot,[at,Hi(ut)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[ot,[at,Hi(ut)],(r,[e,i])=>function(a,s,h,u){for(;h<=u;){let f=h+u>>1;if(s[f]===a)return!0;s[f]>a?u=f-1:h=f+1}return!1}(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:ot,overloads:[[[ot,ot],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[aa(ot),(r,e)=>{for(let i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:ot,overloads:[[[ot,ot],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[aa(ot),(r,e)=>{for(let i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[ot,[ot],(r,[e])=>!e.evaluate(r)],"is-supported-script":[ot,[at],(r,[e])=>{let i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[at,[at],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[at,[at],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[at,aa(ut),(r,e)=>e.map(i=>Ra(i.evaluate(r))).join("")],"resolved-locale":[at,[Ca],(r,[e])=>e.evaluate(r).resolvedLocale()]});class Gl{constructor(e,i,a){this.expression=e,this._warningHistory={},this._evaluator=new kl,this._defaultValue=i?function(s){if(s.type==="color"&&Ds(s.default))return new mt(0,0,0,0);switch(s.type){case"color":return mt.parse(s.default)||null;case"padding":return zi.parse(s.default)||null;case"numberArray":return Ai.parse(s.default)||null;case"colorArray":return Ft.parse(s.default)||null;case"variableAnchorOffsetCollection":return oi.parse(s.default)||null;case"projectionDefinition":return Xi.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=a}evaluateWithoutErrorHandling(e,i,a,s,h,u){return this._globalState&&(e=ln(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=a,this._evaluator.canonical=s,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=u,this.expression.evaluate(this._evaluator)}evaluate(e,i,a,s,h,u){this._globalState&&(e=ln(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=a||null,this._evaluator.canonical=s,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=u||null;try{let f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Je(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function Rs(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Na}function oa(r,e,i){let a=new yo(Na,ks,[],e?function(h){let u={color:_r,string:at,number:Ae,enum:at,boolean:ot,formatted:Ea,padding:us,numberArray:ho,colorArray:co,projectionDefinition:La,resolvedImage:ka,variableAnchorOffsetCollection:uo};return h.type==="array"?Hi(u[h.value]||ut,h.length):u[h.type]}(e):void 0),s=a.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Xh(new Gl(s,e,i)):Ua(a.errors)}class Fs{constructor(e,i,a){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Lo(i.expression),this.globalStateRefs=ko(i.expression),this._globalState=a}evaluateWithoutErrorHandling(e,i,a,s,h,u){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,a,s,h,u)}evaluate(e,i,a,s,h,u){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluate(e,i,a,s,h,u)}}class Zl{constructor(e,i,a,s,h){this.kind=e,this.zoomStops=a,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Lo(i.expression),this.globalStateRefs=ko(i.expression),this.interpolationType=s,this._globalState=h}evaluateWithoutErrorHandling(e,i,a,s,h,u){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,a,s,h,u)}evaluate(e,i,a,s,h,u){return this._globalState&&(e=ln(e,this._globalState)),this._styleExpression.evaluate(e,i,a,s,h,u)}interpolationFactor(e,i,a){return this.interpolationType?ji.interpolationFactor(this.interpolationType,e,i,a):0}}function Qh(r,e,i){let a=oa(r,e,i);if(a.result==="error")return a;let s=a.value.expression,h=zs(s);if(!h&&!Ga(e))return Ua([new jt("","data expressions not supported")]);let u=As(s,["zoom"]);if(!u&&!Yh(e))return Ua([new jt("","zoom expressions not supported")]);let f=Os(s);return f||u?f instanceof jt?Ua([f]):f instanceof ji&&!Ul(e)?Ua([new jt("",'"interpolate" expressions cannot be used with this property')]):Xh(f?new Zl(h?"camera":"composite",a.value,f.labels,f instanceof ji?f.interpolation:void 0,i):new Fs(h?"constant":"source",a.value,i)):Ua([new jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Eo{constructor(e,i){this._parameters=e,this._specification=i,vt(this,Kh(this._parameters,this._specification))}static deserialize(e){return new Eo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Os(r){let e=null;if(r instanceof ea)e=Os(r.result);else if(r instanceof fi){for(let i of r.args)if(e=Os(i),e)break}else(r instanceof ta||r instanceof ji)&&r.input instanceof br&&r.input.name==="zoom"&&(e=r);return e instanceof jt||r.eachChild(i=>{let a=Os(i);a instanceof jt?e=a:!e&&a?e=new jt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new jt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function ko(r,e=new Set){return r instanceof Mo&&e.add(r.key),r.eachChild(i=>{ko(i,e)}),e}function ln(r,e){let{zoom:i,heatmapDensity:a,elevation:s,lineProgress:h,isSupportedScript:u,accumulated:f}=r!=null?r:{};return{zoom:i,heatmapDensity:a,elevation:s,lineProgress:h,isSupportedScript:u,accumulated:f,globalState:e}}function Bs(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(!Bs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let Fd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function zo(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Bs(r)||(r=js(r));let i=oa(r,Fd,e);if(i.result==="error")throw new Error(i.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,s,h)=>i.value.evaluate(a,s,{},h),needGeometry:eu(r),getGlobalStateRefs:()=>ko(i.value.expression)}}function Od(r,e){return r<e?-1:r>e?1:0}function eu(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(eu(r[e]))return!0;return!1}function js(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?Vs(r[1],r[2],"=="):e==="!="?Ns(Vs(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Vs(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map(js))):e==="all"?["all"].concat(r.slice(1).map(js)):e==="none"?["all"].concat(r.slice(1).map(js).map(Ns)):e==="in"?ql(r[1],r.slice(2)):e==="!in"?Ns(ql(r[1],r.slice(2))):e==="has"?tu(r[1]):e!=="!has"||Ns(tu(r[1]));var i}function Vs(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 ql(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(Od)]]:["filter-in-small",r,["literal",e]]}}function tu(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Ns(r){return["!",r]}function Us(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 h of r)s+=`${Us(h)},`;return`${s}]`}let i=Object.keys(r).sort(),a="{";for(let s=0;s<i.length;s++)a+=`${JSON.stringify(i[s])}:${Us(r[i[s]])},`;return`${a}}`}function iu(r){let e="";for(let i of He)e+=`/${Us(r[i])}`;return e}function $l(r){let e=r.value;return e?[new Le(r.key,e,"constants have been deprecated as of v8")]:[]}function ei(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function sa(r){if(Array.isArray(r))return r.map(sa);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let i in r)e[i]=sa(r[i]);return e}return ei(r)}function or(r){let e=r.key,i=r.value,a=r.valueSpec||{},s=r.objectElementValidators||{},h=r.style,u=r.styleSpec,f=r.validateSpec,g=[],x=pt(i);if(x!=="object")return[new Le(e,i,`object expected, ${x} found`)];for(let w in i){let S=w.split(".")[0],M=mo(a,S)||a["*"],L;if(mo(s,S))L=s[S];else if(mo(a,S)){if(i[w]===void 0)continue;L=f}else if(s["*"])L=s["*"];else{if(!a["*"]){g.push(new Le(e,i[w],`unknown property "${w}"`));continue}L=f}g=g.concat(L({key:(e&&`${e}.`)+w,value:i[w],valueSpec:M,style:h,styleSpec:u,object:i,objectKey:w,validateSpec:f},i))}for(let w in a)s[w]||a[w].required&&a[w].default===void 0&&i[w]===void 0&&g.push(new Le(e,i,`missing required property "${w}"`));return g}function Wl(r){let e=r.value,i=r.valueSpec,a=r.style,s=r.styleSpec,h=r.key,u=r.arrayElementValidator||r.validateSpec;if(pt(e)!=="array")return[new Le(h,e,`array expected, ${pt(e)} found`)];if(i.length&&e.length!==i.length)return[new Le(h,e,`array length ${i.length} expected, length ${e.length} found`)];let f={type:i.value,values:i.values};s.$version<7&&(f.function=i.function),pt(i.value)==="object"&&(f=i.value);let g=[];for(let x=0;x<e.length;x++)g=g.concat(u({array:e,arrayIndex:x,value:e[x],valueSpec:f,validateSpec:r.validateSpec,style:a,styleSpec:s,key:`${h}[${x}]`}));return g}function Ao(r){let e=r.key,i=r.value,a=r.valueSpec,s=pt(i);return s==="number"&&i!=i&&(s="NaN"),s!=="number"?[new Le(e,i,`number expected, ${s} found`)]:"minimum"in a&&i<a.minimum?[new Le(e,i,`${i} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&i>a.maximum?[new Le(e,i,`${i} is greater than the maximum value ${a.maximum}`)]:[]}function Hl(r){let e=r.valueSpec,i=ei(r.value.type),a,s,h,u={},f=i!=="categorical"&&r.value.property===void 0,g=!f,x=pt(r.value.stops)==="array"&&pt(r.value.stops[0])==="array"&&pt(r.value.stops[0][0])==="object",w=or({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(i==="identity")return[new Le(L.key,L.value,'identity function may not have a "stops" property')];let k=[],A=L.value;return k=k.concat(Wl({key:L.key,value:A,valueSpec:L.valueSpec,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:S})),pt(A)==="array"&&A.length===0&&k.push(new Le(L.key,A,"array must have at least one stop")),k},default:function(L){return L.validateSpec({key:L.key,value:L.value,valueSpec:e,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec})}}});return i==="identity"&&f&&w.push(new Le(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||w.push(new Le(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!Ul(r.valueSpec)&&w.push(new Le(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(g&&!Ga(r.valueSpec)?w.push(new Le(r.key,r.value,"property functions not supported")):f&&!Yh(r.valueSpec)&&w.push(new Le(r.key,r.value,"zoom functions not supported"))),i!=="c
1ategorical"&&!x||r.value.property!==void 0||w.push(new Le(r.key,r.value,'"property" property is required')),w;function S(L){let k=[],A=L.value,F=L.key;if(pt(A)!=="array")return[new Le(F,A,`array expected, ${pt(A)} found`)];if(A.length!==2)return[new Le(F,A,`array length 2 expected, length ${A.length} found`)];if(x){if(pt(A[0])!=="object")return[new Le(F,A,`object expected, ${pt(A[0])} found`)];if(A[0].zoom===void 0)return[new Le(F,A,"object stop key must have zoom")];if(A[0].value===void 0)return[new Le(F,A,"object stop key must have value")];if(h&&h>ei(A[0].zoom))return[new Le(F,A[0].zoom,"stop zoom values must appear in ascending order")];ei(A[0].zoom)!==h&&(h=ei(A[0].zoom),s=void 0,u={}),k=k.concat(or({key:`${F}[0]`,value:A[0],valueSpec:{zoom:{}},validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Ao,value:M}}))}else k=k.concat(M({key:`${F}[0]`,value:A[0],validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec},A));return Rs(sa(A[1]))?k.concat([new Le(`${F}[1]`,A[1],"expressions are not allowed in function stops.")]):k.concat(L.validateSpec({key:`${F}[1]`,value:A[1],valueSpec:e,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec}))}function M(L,k){let A=pt(L.value),F=ei(L.value),N=L.value!==null?L.value:k;if(a){if(A!==a)return[new Le(L.key,N,`${A} stop domain type must match previous stop domain type ${a}`)]}else a=A;if(A!=="number"&&A!=="string"&&A!=="boolean")return[new Le(L.key,N,"stop domain value must be a number, string, or boolean")];if(A!=="number"&&i!=="categorical"){let H=`number expected, ${A} found`;return Ga(e)&&i===void 0&&(H+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Le(L.key,N,H)]}return i!=="categorical"||A!=="number"||isFinite(F)&&Math.floor(F)===F?i!=="categorical"&&A==="number"&&s!==void 0&&F<s?[new Le(L.key,N,"stop domain values must appear in ascending order")]:(s=F,i==="categorical"&&F in u?[new Le(L.key,N,"stop domain values must be unique")]:(u[F]=!0,[])):[new Le(L.key,N,`integer expected, found ${F}`)]}}function An(r){let e=(r.expressionContext==="property"?Qh:oa)(sa(r.value),r.valueSpec);if(e.result==="error")return e.value.map(a=>new Le(`${r.key}${a.key}`,r.value,a.message));let i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new Le(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"&&!Lo(i))return[new Le(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Lo(i))return[new Le(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!As(i,["zoom","feature-state"]))return[new Le(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!zs(i))return[new Le(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Do(r){let e=r.key,i=r.value,a=pt(i);return a!=="string"?[new Le(e,i,`color expected, ${a} found`)]:mt.parse(String(i))?[]:[new Le(e,i,`color expected, "${i}" found`)]}function la(r){let e=r.key,i=r.value,a=r.valueSpec,s=[];return Array.isArray(a.values)?a.values.indexOf(ei(i))===-1&&s.push(new Le(e,i,`expected one of [${a.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(a.values).indexOf(ei(i))===-1&&s.push(new Le(e,i,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function Ro(r){return Bs(sa(r.value))?An(vt({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Fo(r)}function Fo(r){let e=r.value,i=r.key;if(pt(e)!=="array")return[new Le(i,e,`array expected, ${pt(e)} found`)];let a=r.styleSpec,s,h=[];if(e.length<1)return[new Le(i,e,"filter array must have at least 1 element")];switch(h=h.concat(la({key:`${i}[0]`,value:e[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),ei(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&ei(e[1])==="$type"&&h.push(new Le(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new Le(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=pt(e[1]),s!=="string"&&h.push(new Le(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let u=2;u<e.length;u++)s=pt(e[u]),ei(e[1])==="$type"?h=h.concat(la({key:`${i}[${u}]`,value:e[u],valueSpec:a.geometry_type,style:r.style,styleSpec:r.styleSpec}
vendor: 5,557 bytes, lines 1-2
1)):s!=="string"&&s!=="number"&&s!=="boolean"&&h.push(new Le(`${i}[${u}]`,e[u],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let u=1;u<e.length;u++)h=h.concat(Fo({key:`${i}[${u}]`,value:e[u],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":s=pt(e[1]),e.length!==2?h.push(new Le(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):s!=="string"&&h.push(new Le(`${i}[1]`,e[1],`string expected, ${s} found`))}return h}function ru(r,e){let i=r.key,a=r.validateSpec,s=r.style,h=r.styleSpec,u=r.value,f=r.objectKey,g=h[`${e}_${r.layerType}`];if(!g)return[];let x=f.match(/^(.*)-transition$/);if(e==="paint"&&x&&g[x[1]]&&g[x[1]].transition)return a({key:i,value:u,valueSpec:h.transition,style:s,styleSpec:h});let w=r.valueSpec||g[f];if(!w)return[new Le(i,u,`unknown property "${f}"`)];let S;if(pt(u)==="string"&&Ga(w)&&!w.tokens&&(S=/^{([^}]+)}$/.exec(u)))return[new Le(i,u,`"${f}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(S[1])} }\`.`)];let M=[];return r.layerType==="symbol"&&f==="text-font"&&Ds(sa(u))&&ei(u.type)==="identity"&&M.push(new Le(i,u,'"text-font" does not support identity functions')),M.concat(a({key:r.key,value:u,valueSpec:w,style:s,styleSpec:h,expressionContext:"property",propertyType:e,propertyKey:f}))}function nu(r){return ru(r,"paint")}function au(r){return ru(r,"layout")}function ou(r){let e=[],i=r.value,a=r.key,s=r.style,h=r.styleSpec;if(pt(i)!=="object")return[new Le(a,i,`object expected, ${pt(i)} found`)];i.type||i.ref||e.push(new Le(a,i,'either "type" or "ref" is required'));let u=ei(i.type),f=ei(i.ref);if(i.id){let g=ei(i.id);for(let x=0;x<r.arrayIndex;x++){let w=s.layers[x];ei(w.id)===g&&e.push(new Le(a,i.id,`duplicate layer id "${i.id}", previously used at line ${w.id.__line__}`))}}if("ref"in i){let g;["type","source","source-layer","filter","layout"].forEach(x=>{x in i&&e.push(new Le(a,i[x],`"${x}" is prohibited for ref layers`))}),s.layers.forEach(x=>{ei(x.id)===f&&(g=x)}),g?g.ref?e.push(new Le(a,i.ref,"ref cannot reference another ref layer")):u=ei(g.type):e.push(new Le(a,i.ref,`ref layer "${f}" not found`))}else if(u!=="background")if(i.source){let g=s.sources&&s.sources[i.source],x=g&&ei(g.type);g?x==="vector"&&u==="raster"?e.push(new Le(a,i.source,`layer "${i.id}" requires a raster source`)):x!=="raster-dem"&&u==="hillshade"||x!=="raster-dem"&&u==="color-relief"?e.push(new Le(a,i.source,`layer "${i.id}" requires a raster-dem source`)):x==="raster"&&u!=="raster"?e.push(new Le(a,i.source,`layer "${i.id}" requires a vector source`)):x!=="vector"||i["source-layer"]?x==="raster-dem"&&u!=="hillshade"&&u!=="color-relief"?e.push(new Le(a,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):u!=="line"||!i.paint||!i.paint["line-gradient"]||x==="geojson"&&g.lineMetrics||e.push(new Le(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Le(a,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Le(a,i.source,`source "${i.source}" not found`))}else e.push(new Le(a,i,'missing required property "source"'));return e=e.concat(or({key:a,value:i,valueSpec:h.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${a}.type`,value:i.type,valueSpec:h.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:i,objectKey:"type"}),filter:Ro,layout:g=>or({layer:i,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>au(vt({layerType:u},x))}}),paint:g=>or({layer:i,key:g.key,value:g.value,style:g.style,styleSpec:g.styleSpec,validateSpec:g.validateSpec,objectElementValidators:{"*":x=>nu(vt({layerType:u},x))}})}})),e}function Dn(r){let e=r.value,i=r.key,a=pt(e);return a!=="string"?[new Le(i,e,`string expected, ${a} found`)]:[]}let su={promoteId:function({key:r,value:e}){if(pt(e)==="string")return Dn({key:r,value:e});{let i=[];for(let a in e)i.push(...Dn({key:`${r}.${a}`,value:e[a]}));return i}}};function Xl(r){let e=r.value,i=r.key,a=r.styleSpec,s=r.style,h=r.validateSpec;if(!e.type)return[new Le(i,e,'"type" is required')];let u=ei(e.type),f;switch(u){case"vector":case"raster":return f=or({key:i,value:e,valueSpec:a[`source_${u.replace("-","_")}`],style:r.style,styleSpec:a,objectElementValidators:su,validateSpec:h}),f;case"raster-dem":return f=function(g){var x;let w=(x=g.sourceName)!==null&&x!==void 0?x:"",S=g.value,M=g.styleSpec,L=M.source_raster_dem,k=g.style,A=[],F=pt(S);if(S===void 0)return A;if(F!=="object")return A.push(new Le("source_raster_dem",S,`object expected, ${F} found`)),A;let N=ei(S.encoding)==="custom",H=["redFactor","greenFactor","blueFactor","baseShift"],V=g.value.encoding?`"${g.value.encoding}"`:"Default";for(let Z in S)!N&&H.includes(Z)?A.push(new Le(Z,S[Z],`In "${w}": "${Z}" is only valid when "encoding" is set to "custom". ${V} encoding found`)):L[Z]?A=A.concat(g.validateSpec({key:Z,value:S[Z],valueSpec:L[Z],validateSpec:g.validateSpec,style:k,styleSpec:M})):A.push(new Le(Z,S[Z],`unknown property "${Z}"`));return A}({sourceName:i,value:e,style:r.style,styleSpec:a,validateSpec:h}),f;case"geojson":if(f=or({key:i,value:e,valueSpec:a.source_geojson,style:s,styleSpec:a,validateSpec:h,objectElementValidators:su}),e.cluster)for(let g in e.clusterProperties){let[x,w]=e.clusterProperties[g],S=typeof x=="str
2ing"?[x,["accumulated"],["get",g]]:x;f.push(...An({key:`${i}.${g}.map`,value:w,expressionContext:"cluster-map"})),f.push(...An({key:`${i}.${g}.reduce`,value:S,expressionContext:"cluster-reduce"}))}return f;case"video":return or({key:i,value:e,valueSpec:a.source_video,style:s,validateSpec:h,styleSpec:a});case"image":return or({key:i,value:e,valueSpec:a.source_image,style:s,validateSpec:h,styleSpec:a});case"canvas":return[new Le(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return la({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Yl(r){let e=r.value,i=r.styleSpec,a=i.light,s=r.style,h=[],u=pt(e);if(e===void 0)return h;if(u!=="object")return h=h.concat([new Le("light",e,`object expected, ${u} found`)]),h;for(let f in e){let g=f.match(/^(.*)-transition$/);h=h.concat(g&&a[g[1]]&&a[g[1]].transition?r.validateSpec({key:f,value:e[f],valueSpec:i.transition,validateSpec:r.validateSpec,style:s,styleSpec:i}):a[f]?r.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new Le(f,e[f],`unknown property "${f}"`)])}return h}function Oo(r){let e=r.value,i=r.styleSpec,a=i.sky,s=r.style,h=pt(e);if(e===void 0)return[];if(h!=="object")return[new Le("sky",e,`object expected, ${h} found`)];let u=[];for(let f in e)u=u.concat(a[f]?r.validateSpec({key:f,value:e[f],valueSpec:a[f],style:s,styleSpec:i}):[new Le(f,e[f],`unknown property "${f}"`)]);return u}function lu(r){let e=r.value,i=r.styleSpec,a=i.terrain,s=r.style,h=[],u=pt(e);if(e===void 0)return h;if(u!=="object")return h=h.concat([new Le("terrain",e,`object expected, ${u} found`)]),h;for(let f in e)h=h.concat(a[f]?r.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new Le(f,e[f],`unknown property "${f}"`)]);return h}function Kl(r){let e=[],i=r.value,a=r.key;if(Array.isArray(i)){let s=[],h=[];for(let u in i)i[u].id&&s.includes(i[u].id)&&e.push(new Le(a,i,`all the sprites' ids must be unique, but ${i[u].id} is duplicated`)),s.push(i[u].id),i[u].url&&h.includes(i[u].url)&&e.push(new Le(a,i,`all the sprites' URLs must be unique, but ${i[u].url} is duplicated`)),h.push(i[u].url),e=e.concat(or({key:`${a}[${u}]`,value:i[u],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return e}return Dn({key:a,value:i})}function Jl(r){return!!r&&r.constructor===Object}function cu(r){return Jl(r.value)?[]:[new Le(r.key,r.value,`object expected, ${pt(r.value)} found`)]}let Ql={"*":()=>[],array:Wl,boolean:function(r){let e=r.value,i=r.key,a=pt(e);return a!=="boolean"?[new Le(i,e,`boolean expected, ${a} found`)]:[]},number:Ao,color:Do,constants:$l,enum:la,filter:Ro,function:Hl,layer:ou,object:or,source:Xl,light:Yl,sky:Oo,terrain:lu,projection:function(r){let e=r.value,i=r.styleSpec,a=i.projection,s=r.style,h=pt(e);if(e===void 0)return[];if(h!=="object")return[new Le("projection",e,`object expected, ${h} found`)];let u=[];for(let f in e)u=u.concat(a[f]?r.validateSpec({key:f,value:e[f],valueSpec:a[f],style:s,styleSpec:i}):[new Le(f,e[f],`unknown property "${f}"`)]);return u},projectionDefinition:function(r){let e=r.key,i=r.value;i=i instanceof String?i.valueOf():i;let a=pt(i);return a!=="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(a)?[]:[new Le(e,i,`projection expected, invalid type "${a}" found`)]:[new Le(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:Dn,formatted:function(r){return Dn(r).length===0?[]:An(r)},resolvedImage:function(r){return Dn(r).length===0?[]:An(r)},padding:function(r){let e=r.key,i=r.value;if(pt(i)==="array"){if(i.length<1||i.length>4)return[new Le(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];let a={type:"number"},s=[];for(let h=0;h<i.length;h++)s=s.concat(r.validateSpec({key:`${e}[${h}]`,value:i[h],validateSpec:r.validateSpec,valueSpec:a}));return s}return Ao({key:e,value:i,valueSpec:{}}
vendor: 4,467 bytes, line 2
2)},numberArray:function(r){let e=r.key,i=r.value;if(pt(i)==="array"){let a={type:"number"};if(i.length<1)return[new Le(e,i,"array length at least 1 expected, length 0 found")];let s=[];for(let h=0;h<i.length;h++)s=s.concat(r.validateSpec({key:`${e}[${h}]`,value:i[h],validateSpec:r.validateSpec,valueSpec:a}));return s}return Ao({key:e,value:i,valueSpec:{}})},colorArray:function(r){let e=r.key,i=r.value;if(pt(i)==="array"){if(i.length<1)return[new Le(e,i,"array length at least 1 expected, length 0 found")];let a=[];for(let s=0;s<i.length;s++)a=a.concat(Do({key:`${e}[${s}]`,value:i[s]}));return a}return Do({key:e,value:i})},variableAnchorOffsetCollection:function(r){let e=r.key,i=r.value,a=pt(i),s=r.styleSpec;if(a!=="array"||i.length<1||i.length%2!=0)return[new Le(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let h=[];for(let u=0;u<i.length;u+=2)h=h.concat(la({key:`${e}[${u}]`,value:i[u],valueSpec:s.layout_symbol["text-anchor"]})),h=h.concat(Wl({key:`${e}[${u+1}]`,value:i[u+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:s}));return h},sprite:Kl,state:cu,fontFaces:function(r){let e=r.key,i=r.value,a=r.validateSpec,s=r.styleSpec,h=r.style;if(!Jl(i))return[new Le(e,i,`object expected, ${pt(i)} found`)];let u=[];for(let f in i){let g=i[f],x=pt(g);if(x==="string")u.push(...Dn({key:`${e}.${f}`,value:g}));else if(x==="array"){let w={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[S,M]of g.entries())u.push(...or({key:`${e}.${f}[${S}]`,value:M,valueSpec:w,styleSpec:s,style:h,validateSpec:a}))}else u.push(new Le(`${e}.${f}`,g,`string or array expected, ${x} found`))}return u}};function Bo(r){let e=r.value,i=r.valueSpec,a=r.styleSpec;return r.validateSpec=Bo,i.expression&&Ds(ei(e))?Hl(r):i.expression&&Rs(sa(e))?An(r):i.type&&Ql[i.type]?Ql[i.type](r):or(vt({},r,{valueSpec:i.type?a[i.type]:i}))}function Za(r){let e=r.value,i=r.key,a=Dn(r);return a.length||(e.indexOf("{fontstack}")===-1&&a.push(new Le(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new Le(i,e,'"glyphs" url must include a "{range}" token'))),a}function wr(r,e=ie){let i=[];return i=i.concat(Bo({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:Bo,objectElementValidators:{glyphs:Za,"*":()=>[]}})),r.constants&&(i=i.concat($l({key:"constants",value:r.constants}))),hu(i)}function kr(r){return function(e){return r(Object.assign({},e,{validateSpec:Bo}))}}function hu(r){return[].concat(r).sort((e,i)=>e.line-i.line)}function zr(r){return function(...e){return hu(r.apply(this,e))}}wr.source=zr(kr(Xl)),wr.sprite=zr(kr(Kl)),wr.glyphs=zr(kr(Za)),wr.light=zr(kr(Yl)),wr.sky=zr(kr(Oo)),wr.terrain=zr(kr(lu)),wr.state=zr(kr(cu)),wr.layer=zr(kr(ou)),wr.filter=zr(kr(Ro)),wr.paintProperty=zr(kr(nu)),wr.layoutProperty=zr(kr(au));let Bd={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class jd{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=oa(e,Bd,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map(a=>`${a.key}: ${a.message}`).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=ko(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let jo=ie,Ur=wr,sr=Ur.light,Vo=Ur.sky,uu=Ur.paintProperty,Vd=Ur.layoutProperty;function du(r,e){let i=!1;if(e&&e.length)for(let a of e)r.fire(new Pe(new Error(a.message))),i=!0;return i}class cn{constructor(e,i,a){let s=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let u=new Int32Array(this.arrayBuffer);e=u[0],this.d=(i=u[1])+2*(a=u[2]);for(let g=0;g<this.d*this.d;g++){let x=u[3+g],w=u[3+g+1];s.push(x===w?null:u.subarray(x,w))}let f=u[3+s.length+1];this.keys=u.subarray(u[3+s.length],f),this.bboxes=u.subarray(f),this.insert=this._insertReadonly}else{this.d=i+2*a;for(let u=0;u<this.d*this.d;u++)s.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=a,this.scale=i/e,this.uid=0;let h=a/i*e;this.min=-h,this.max=e+h}
2insert(e,i,a,s,h){this._forEachCell(i,a,s,h,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(s),this.bboxes.push(h)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,a,s,h,u){this.cells[h].push(u)}query(e,i,a,s,h){let u=this.min,f=this.max;if(e<=u&&i<=u&&f<=a&&f<=s&&!h)return Array.prototype.slice.call(this.keys);{let g=[];return this._forEachCell(e,i,a,s,this._queryCell,g,{},h),g}}_queryCell(e,i,a,s,h,u,f,g){let x=this.cells[h];if(x!==null){let w=this.keys,S=this.bboxes;for(let M=0;M<x.length;M++){let L=x[M];if(f[L]===void 0){let k=4*L;(g?g(S[k+0],S[k+1],S[k+2],S[k+3]):e<=S[k+2]&&i<=S[k+3]&&a>=S[k+0]&&s>=S[k+1])?(f[L]=!0,u.push(w[L])):f[L]=!1}}}}_forEachCell(e,i,a,s,h,u,f,g){let x=this._convertToCellCoord(e),w=this._convertToCellCoord(i),S=this._convertToCellCoord(a),M=this._convertToCellCoord(s);for(let L=x;L<=S;L++)for(let k=w;k<=M;k++){let A=this.d*k+L;if((!g||g(this._convertFromCellCoord(L),this._convertFromCellCoord(k),this._convertFromCellCoord(L+1),this._convertFromCellCoord(k+1)))&&h.call(this,e,i,a,s,A,u,f,g))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,a=0;for(let u=0;u<this.cells.length;u++)a+=this.cells[u].length;let s=new Int32Array(i+a+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;let h=i;for(let u=0;u<e.length;u++){let f=e[u];s[3+u]=h,s.set(f,h),h+=f.length}return s[3+e.length]=h,s.set(this.keys,h),h+=this.keys.length,s[3+e.length+1]=h,s.set(this.bboxes,h),h+=this.bboxes.length,s.buffer}static serialize(e,i){let a=e.toArrayBuffer();return i&&i.push(a),{buffer:a}}static deserialize(e){return new cn(e.buffer)}}let Gr={};function Ue(r,e,i={}){if(Gr[r])throw new Error(`${r} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),Gr[r]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}Ue("Object",Object),Ue("Set",Set),Ue("TransferableGridIndex",cn),Ue("Color",mt),Ue("Error",Error),Ue("AJAXError",j),Ue("ResolvedImage",rr),Ue("StylePropertyFunction",Eo),Ue("StyleExpression",Gl,{omit:["_evaluator"]}),Ue("ZoomDependentExpression",Zl),Ue("ZoomConstantExpression",Fs),Ue("CompoundExpression",br,{omit:["_evaluate"]});for(let r in Na)Na[r]._classRegistryKey||Ue(`Expression_${r}`,Na[r]);function pu(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function No(r){return r.$name||r.constructor._classRegistryKey}function fu(r){return!function(e){if(e===null||typeof e!="object")return!1;let i=No(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||pu(r)||qn(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function hn(r,e){if(fu(r))return(pu(r)||qn(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 h=[];for(let u of r)h.push(hn(u,e));return h}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);let i=No(r);if(!i)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!Gr[i])throw new Error(`${i} is not registered.`);let{klass:a}=Gr[i],s=a.serialize?a.serialize(r,e):{};if(a.serialize){if(e&&s===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let h in r){if(!r.hasOwnProperty(h)||Gr[i].omit.indexOf(h)>=0)continue;let u=r[h];s[h]=Gr[i].shallow.indexOf(h)>=0?u:hn(u,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 Uo(r){if(fu(r))return r;if(Array.isArray(r))return r.map(Uo);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);let e=No(r)||"Object";if(!Gr[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:i}=Gr[e];
2if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(r);let a=Object.create(i.prototype);for(let s of Object.keys(r)){if(s==="$name")continue;let h=r[s];a[s]=Gr[e].shallow.indexOf(s)>=0?h:Uo(h)}return a}class ec{constructor(){this.first=!0}update(e,i){let a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=a,!0))}}function Nd(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 ca(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 mu(r){return/\s/u.test(String.fromCodePoint(r))}function tc(r){for(let e of r)if(ca(e.codePointAt(0)))return!0;return!1}function Gs(r){for(let e of r)if(!Zs(e.codePointAt(0)))return!1;return!0}function gu(r){let e=r.map(i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch{return null}}).filter(i=>i);return new RegExp(e.join("|"),"u")}let ic=gu(["Arab","Dupl","Mong","Ougr","Syrc"]);function Zs(r){return!ic.test(String.fromCodePoint(r))}function rc(r){return!(ca(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 yu=gu(["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 nc(r){return yu.test(String.fromCodePoint(r))}function _u(r,e){return!(!e&&nc(r)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(r)))}function ac(r){for(let e of r)if(nc(e.codePointAt(0)))return!0;return!1}let un=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(un.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 l(this,void 0,void 0,function*(){if(this.isParsed())return this.get
vendor: 10,665 bytes, line 2
2State();if(r.pluginStatus!=="loading")return this.setState(r),r;let i=r.pluginURL,a=new Promise(h=>{this.loadScriptResolve=h});e(i);let s=new Promise(h=>setTimeout(()=>h(),this.TIMEOUT));if(yield Promise.race([a,s]),this.isParsed()){let h={pluginStatus:"loaded",pluginURL:i};return this.setState(h),h}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)})}};class Et{constructor(e,i){this.isSupportedScript=xu,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new ec,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ec,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),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*i}}}function xu(r){return function(e,i){for(let a of e)if(!_u(a.codePointAt(0),i))return!1;return!0}(r,un.getRTLTextPluginStatus()==="loaded")}let qs="-transition";class Go{constructor(e,i,a){this.property=e,this.value=i,this.expression=function(s,h,u){if(Ds(s))return new Eo(s,h);if(Rs(s)){let f=Qh(s,h,u);if(f.result==="error")throw new Error(f.value.map(g=>`${g.key}: ${g.message}`).join(", "));return f.value}{let f=s;return h.type==="color"&&typeof s=="string"?f=mt.parse(s):h.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?h.type!=="numberArray"||typeof s!="number"&&!Array.isArray(s)?h.type!=="colorArray"||typeof s!="string"&&!Array.isArray(s)?h.type==="variableAnchorOffsetCollection"&&Array.isArray(s)?f=oi.parse(s):h.type==="projectionDefinition"&&typeof s=="string"&&(f=Xi.parse(s)):f=Ft.parse(s):f=Ai.parse(s):f=zi.parse(s),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>f}}}(i===void 0?e.specification.default:i,e.specification,a)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,a){return this.property.possiblyEvaluate(this,e,i,a)}}class oc{constructor(e,i){this.property=e,this.value=new Go(e,void 0,i)}transitioned(e,i){return new lc(this.property,this.value,i,Wi({},e.transition,this.transition),e.now)}untransitioned(){return new lc(this.property,this.value,null,{},0)}}class sc{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}getValue(e){return Ei(this._values[e].value.value)}setValue(e,i){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new oc(this._values[e].property,this._globalState)),this._values[e].value=new Go(this._values[e].property,i===null?void 0:Ei(i),this._globalState)}getTransition(e){return Ei(this._values[e].transition)}setTransition(e,i){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new oc(this._values[e].property,this._globalState)),this._values[e].transition=Ei(i)||void 0}serialize(){let e={};for(let i of Object.keys(this._values)){let a=this.getValue(i);a!==void 0&&(e[i]=a);let s=this.getTransition(i);s!==void 0&&(e[`${i}${qs}`]=s)}return e}transitioned(e,i){let a=new vu(this._properties);for(let s of Object.keys(this._values))a._values[s]=this._values[s].transitioned(e,i._values[s]);return a}untransitioned(){let e=new vu(this._properties);for(let i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class lc{constructor(e,i,a,s,h){this.property=e,this.value=i,this.begin=h+s.delay||0,this.end=this.begin+s.duration||0,e.specification.transition&&(s.delay||s.duration)&&(this.prior=a)}possiblyEvaluate(e,i,a){let s=e.now||0,h=this.value.possiblyEvaluate(e,i,a),u=this.prior;if(u){if(s>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(s<this.begin)return u.possiblyEvaluate(e,i,a);{let f=(s-this.begin)/(this.end-this.begin);return this.property.interpolate(u.possiblyEvaluate(e,i,a),h,Sa(f))}}return h}}class vu{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,a){let s=new Zo(this._properties);for(let h of Object.keys(this._values))s._values[h]=this._values[h].possiblyEvaluate(e,i,a);return s}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ud{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}getValue(e){return Ei(this._values[e].value)}setValue(e,i){this._values[e]=new Go(this._values[e].property,i===null?void 0:Ei(i),this._globalState)}serialize(){let e={};for(let i of Object.keys(this._values)){let a=this.getValue(i);a!==void 0&&(e[i]=a)}return e}possiblyEvaluate(e,i,a){let s=new Zo(this._properties);for(let h of Object.keys(this._values))s._values[h]=this._values[h].possiblyEvaluate(e,i,a);return s}}class Ar{constructor(e,i,a){this.property=e,this.value=i,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,a,s){return this.property.evaluate(this.value,this.parameters,e,i,a,s)}}class Zo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class We{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,a){let s=Ti[this.specification.type];return s?s(e,i,a):e}}class et{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,a,s){return new Ar(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},a,s)}:e.expression,i)}interpolate(e,i,a){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=Ti[this.specification.type];if(s){let h=s(e.value.value,i.value.value,a);return new Ar(this,{kind:"constant",value:h},e.parameters)}return e}evaluate(e,i,a,s,h,u){return e.kind==="constant"?e.value:e.evaluate(i,a,s,h,u)}}class Rn extends et{possiblyEvaluate(e,i,a,s){if(e.value===void 0)return new Ar(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){let h=e.expression.evaluate(i,null,{},a,s),u=e.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,f=this._calculate(u,u,u,i);return new Ar(this,{kind:"constant",value:f},i)}if(e.expression.kind==="camera"){let h=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:h},i)}return new Ar(this,e.expression,i)}evaluate(e,i,a,s,h,u){if(e.kind==="source"){let f=e.evaluate(i,a,s,h,u);return this._calculate(f,f,f,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},a,s),e.evaluate({zoom:Math.floor(i.zoom)},a,s),e.evaluate({zoom:Math.floor(i.zoom)+1},a,s),i):e.value}_calculate(e,i,a,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:a,to:i}}interpolate(e){return e}}class bu{constructor(e){this.specification=e}possiblyEvaluate(e,i,a,s){if(e.value!==void 0){if(e.expression.kind==="constant"){let h=e.expression.evaluate(i,null,{},a,s);return this._calculate(h,h,h,i)}return this._calculate(e.expression.evaluate(new Et(Math.floor(i.zoom-1),i)),e.expression.evaluate(new Et(Math.floor(i.zoom),i)),e.expression.evaluate(new Et(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,a,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:a,to:i}}interpolate(e){return e}}class qa{constructor(e){this.specification=e}possiblyEvaluate(e,i,a,s){return!!e.expression.evaluate(i,null,{},a,s)}interpolate(){return!1}}class Vi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let i in e){let a=e[i];a.specification.overridable&&this.overridableProperties.push(i);let s=this.defaultPropertyValues[i]=new Go(a,void 0,void 0),h=this.defaultTransitionablePropertyValues[i]=new oc(a,void 0);this.defaultTransitioningPropertyValues[i]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=s.possiblyEvaluate({})}}}Ue("DataDrivenProperty",et),Ue("DataConstantProperty",We),Ue("CrossFadedDataDrivenProperty",Rn),Ue("CrossFadedProperty",bu),Ue("ColorRampProperty",qa);class Dr extends xe{constructor(e,i,a){if(super(),this.id=e.id,this.type=e.type,this._globalState=a,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(s,h){return new jd(s,h)}(this.visibility,a),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=zo(e.filter,a)),i.layout&&(this._unevaluatedLayout=new Ud(i.layout,a)),i.paint)){this._transitionablePaint=new sc(i.paint,a);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 Zo(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=zo(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility: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 a=this._unevaluatedLayout._values[i];for(let s of a.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 a in this._transitionablePaint._values){let s=this._transitionablePaint._values[a].value;for(let h of s.getGlobalStateRefs()){let u=(e=i.get(h))!==null&&e!==void 0?e:[];u.push({name:a,value:s.value}),i.set(h,u)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,a={}
2){if(i==null||!this._validate(Vd,`layers.${this.id}.layout.${e}`,e,i,a))return e==="visibility"?(this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){return e.endsWith(qs)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,i,a={}){if(i!=null&&this._validate(uu,`layers.${this.id}.paint.${e}`,e,i,a))return!1;if(e.endsWith(qs))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{let s=this._transitionablePaint._values[e],h=s.property.specification["property-type"]==="cross-faded-data-driven",u=s.value.isDataDriven(),f=s.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);let g=this._transitionablePaint._values[e].value;return g.isDataDriven()||u||h||this._handleOverridablePaintPropertyUpdate(e,f,g)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,a){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)}
vendor: 15,014 bytes, line 2
2serialize(){let e={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:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Zn(e,(i,a)=>!(i===void 0||a==="layout"&&!Object.keys(i).length||a==="paint"&&!Object.keys(i).length))}_validate(e,i,a,s,h={}){return(!h||h.validate!==!1)&&du(this,e.call(Ur,{key:i,layerType:this.type,objectKey:a,value:s,styleSpec:ie,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&&Ga(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let cc;var wu={get paint(){return cc=cc||new Vi({"raster-opacity":new We(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new We(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new We(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new We(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new We(ie.paint_raster["raster-saturation"]),"raster-contrast":new We(ie.paint_raster["raster-contrast"]),"raster-resampling":new We(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new We(ie.paint_raster["raster-fade-duration"])})}};class Su extends Dr{constructor(e,i){super(e,wu,i)}}let Gd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class qo{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 qt{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")}}function ti(r,e=1){let i=0,a=0;return{members:r.map(s=>{let h=Gd[s.type].BYTES_PER_ELEMENT,u=i=Tu(i,Math.max(e,h)),f=s.components||1;return a=Math.max(a,h),i+=h*f,{name:s.name,type:s.type,components:f,offset:u}}),size:Tu(i,Math.max(a,e)),alignment:e}}function Tu(r,e){return Math.ceil(r/e)*e}class Zr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){let s=2*e;return this.int16[s+0]=i,this.int16[s+1]=a,e}}Zr.prototype.bytesPerElement=4,Ue("StructArrayLayout2i4",Zr);class $s extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,a)}emplace(e,i,a,s){let h=3*e;return this.int16[h+0]=i,this.int16[h+1]=a,this.int16[h+2]=s,e}}$s.prototype.bytesPerElement=6,Ue("StructArrayLayout3i6",$s);class hc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,a,s)}emplace(e,i,a,s,h){let u=4*e;return this.int16[u+0]=i,this.int16[u+1]=a,this.int16[u+2]=s,this.int16[u+3]=h,e}}hc.prototype.bytesPerElement=8,Ue("StructArrayLayout4i8",hc);class uc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u){let f=this.length;return this.resize(f+1),this.emplace(f,e,i,a,s,h,u)}emplace(e,i,a,s,h,u,f){let g=6*e;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=s,this.int16[g+3]=h,this.int16[g+4]=u,this.int16[g+5]=f,e}}uc.prototype.bytesPerElement=12,Ue("StructArrayLayout2i4i12",uc);class Ws extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u){let f=this.length;return this.resize(f+1),this.emplace(f,e,i,a,s,h,u)}emplace(e,i,a,s,h,u,f){let g=4*e,x=8*e;return this.int16[g+0]=i,this.int16[g+1]=a,this.uint8[x+4]=s,this.uint8[x+5]=h,this.uint8[x+6]=u,this.uint8[x+7]=f,e}}Ws.prototype.bytesPerElement=8,Ue("StructArrayLayout2i4ub8",Ws);class $o extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){let s=2*e;return this.float32[s+0]=i,this.float32[s+1]=a,e}}$o.prototype.bytesPerElement=8,Ue("StructArrayLayout2f8",$o);class dc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u,f,g,x,w){let S=this.length;return this.resize(S+1),this.emplace(S,e,i,a,s,h,u,f,g,x,w)}emplace(e,i,a,s,h,u,f,g,x,w,S){let M=10*e;return this.uint16[M+0]=i,this.uint16[M+1]=a,this.uint16[M+2]=s,this.uint16[M+3]=h,this.uint16[M+4]=u,this.uint16[M+5]=f,this.uint16[M+6]=g,this.uint16[M+7]=x,this.uint16[M+8]=w,this.uint16[M+9]=S,e}}dc.prototype.bytesPerElement=20,Ue("StructArrayLayout10ui20",dc);class dn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u,f,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,i,a,s,h,u,f,g)}emplace(e,i,a,s,h,u,f,g,x){let w=8*e;return this.uint16[w+0]=i,this.uint16[w+1]=a,this.uint16[w+2]=s,this.uint16[w+3]=h,this.uint16[w+4]=u,this.uint16[w+5]=f,this.uint16[w+6]=g,this.uint16[w+7]=x,e}}dn.prototype.bytesPerElement=16,Ue("StructArrayLayout8ui16",dn);class Hs extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u,f,g,x,w,S,M){let L=this.length;return this.resize(L+1),this.emplace(L,e,i,a,s,h,u,f,g,x,w,S,M)}emplace(e,i,a,s,h,u,f,g,x,w,S,M,L){let k=12*e;return this.int16[k+0]=i,this.int16[k+1]=a,this.int16[k+2]=s,this.int16[k+3]=h,this.uint16[k+4]=u,this.uint16[k+5]=f,this.uint16[k+6]=g,this.uint16[k+7]=x,this.int16[k+8]=w,this.int16[k+9]=S,this.int16[k+10]=M,this.int16[k+11]=L,e}}Hs.prototype.bytesPerElement=24,Ue("StructArrayLayout4i4ui4i24",Hs);class Wo extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,a)}emplace(e,i,a,s){let h=3*e;return this.float32[h+0]=i,this.float32[h+1]=a,this.float32[h+2]=s,e}}Wo.prototype.bytesPerElement=12,Ue("StructArrayLayout3f12",Wo);class Xs extends qt{_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}}Xs.prototype.bytesPerElement=4,Ue("StructArrayLayout1ul4",Xs);class Ho extends qt{_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,a,s,h,u,f,g,x){let w=this.length;return this.resize(w+1),this.emplace(w,e,i,a,s,h,u,f,g,x)}emplace(e,i,a,s,h,u,f,g,x,w){let S=10*e,M=5*e;return this.int16[S+0]=i,this.int16[S+1]=a,this.int16[S+2]=s,this.int16[S+3]=h,this.int16[S+4]=u,this.int16[S+5]=f,this.uint32[M+3]=g,this.uint16[S+8]=x,this.uint16[S+9]=w,e}}Ho.prototype.bytesPerElement=20,Ue("StructArrayLayout6i1ul2ui20",Ho);class pc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u){let f=this.length;return this.resize(f+1),this.emplace(f,e,i,a,s,h,u)}emplace(e,i,a,s,h,u,f){let g=6*e;return this.int16[g+0]=i,this.int16[g+1]=a,this.int16[g+2]=s,this.int16[g+3]=h,this.int16[g+4]=u,this.int16[g+5]=f,e}}pc.prototype.bytesPerElement=12,Ue("StructArrayLayout2i2i2i12",pc);class $a extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,i,a,s,h)}emplace(e,i,a,s,h,u){let f=4*e,g=8*e;return this.float32[f+0]=i,this.float32[f+1]=a,this.float32[f+2]=s,this.int16[g+6]=h,this.int16[g+7]=u,e}}$a.prototype.bytesPerElement=16,Ue("StructArrayLayout2f1f2i16",$a);class ha extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,a,s,h,u){let f=this.length;return this.resize(f+1),this.emplace(f,e,i,a,s,h,u)}emplace(e,i,a,s,h,u,f){let g=16*e,x=4*e,w=8*e;return this.uint8[g+0]=i,this.uint8[g+1]=a,this.float32[x+1]=s,this.float32[x+2]=h,this.int16[w+6]=u,this.int16[w+7]=f,e}}ha.prototype.bytesPerElement=16,Ue("StructArrayLayout2ub2f2i16",ha);class Ys extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,a)}emplace(e,i,a,s){let h=3*e;return this.uint16[h+0]=i,this.uint16[h+1]=a,this.uint16[h+2]=s,e}}Ys.prototype.bytesPerElement=6,Ue("StructArrayLayout3ui6",Ys);class Ks extends qt{_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,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N){let H=this.length;return this.resize(H+1),this.emplace(H,e,i,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N)}emplace(e,i,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N,H){let V=24*e,Z=12*e,Q=48*e;return this.int16[V+0]=i,this.int16[V+1]=a,this.uint16[V+2]=s,this.uint16[V+3]=h,this.uint32[Z+2]=u,this.uint32[Z+3]=f,this.uint32[Z+4]=g,this.uint16[V+10]=x,this.uint16[V+11]=w,this.uint16[V+12]=S,this.float32[Z+7]=M,this.float32[Z+8]=L,this.uint8[Q+36]=k,this.uint8[Q+37]=A,this.uint8[Q+38]=F,this.uint32[Z+10]=N,this.int16[V+22]=H,e}}Ks.prototype.bytesPerElement=48,Ue("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ks);class ua extends qt{_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,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N,H,V,Z,Q,ae,de,we,Se,Ie,Be,ze){let Ce=this.length;return this.resize(Ce+1),this.emplace(Ce,e,i,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N,H,V,Z,Q,ae,de,we,Se,Ie,Be,ze)}emplace(e,i,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N,H,V,Z,Q,ae,de,we,Se,Ie,Be,ze,Ce){let be=32*e,je=16*e;return this.int16[be+0]=i,this.int16[be+1]=a,this.int16[be+2]=s,this.int16[be+3]=h,this.int16[be+4]=u,this.int16[be+5]=f,this.int16[be+6]=g,this.int16[be+7]=x,this.uint16[be+8]=w,this.uint16[be+9]=S,this.uint16[be+10]=M,this.uint16[be+11]=L,this.uint16[be+12]=k,this.uint16[be+13]=A,this.uint16[be+14]=F,this.uint16[be+15]=N,this.uint16[be+16]=H,this.uint16[be+17]=V,this.uint16[be+18]=Z,this.uint16[be+19]=Q,this.uint16[be+20]=ae,this.uint16[be+21]=de,this.uint16[be+22]=we,this.uint32[je+12]=Se,this.float32[je+13]=Ie,this.float32[je+14]=Be,this.uint16[be+30]=ze,this.uint16[be+31]=Ce,e}}ua.prototype.bytesPerElement=64,Ue("StructArrayLayout8i15ui1ul2f2ui64",ua);class Js extends qt{_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}}Js.prototype.bytesPerElement=4,Ue("StructArrayLayout1f4",Js);class fc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,a)}emplace(e,i,a,s){let h=3*e;return this.uint16[6*e+0]=i,this.float32[h+1]=a,this.float32[h+2]=s,e}}fc.prototype.bytesPerElement=12,Ue("StructArrayLayout1ui2f12",fc);class Qs extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,a)}emplace(e,i,a,s){let h=4*e;return this.uint32[2*e+0]=i,this.uint16[h+2]=a,this.uint16[h+3]=s,e}}Qs.prototype.bytesPerElement=8,Ue("StructArrayLayout1ul2ui8",Qs);class mc extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,i)}emplace(e,i,a){let s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=a,e}}mc.prototype.bytesPerElement=4,Ue("StructArrayLayout2ui4",mc);class d extends qt{_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}}d.prototype.bytesPerElement=2,Ue("StructArrayLayout1ui2",d);class t extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,a,s){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,a,s)}emplace(e,i,a,s,h){let u=4*e;return this.float32[u+0]=i,this.float32[u+1]=a,this.float32[u+2]=s,this.float32[u+3]=h,e}}t.prototype.bytesPerElement=16,Ue("StructArrayLayout4f16",t);class n extends qo{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]}
vendor: 4,960 bytes, line 2
2get anchorPoint(){return new U(this.anchorPointX,this.anchorPointY)}}n.prototype.size=20;class o extends Ho{get(e){return new n(this,e)}}Ue("CollisionBoxArray",o);class c extends qo{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]}}c.prototype.size=48;class p extends Ks{get(e){return new c(this,e)}}Ue("PlacedSymbolArray",p);class m extends qo{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]}}m.prototype.size=64;class _ extends ua{get(e){return new m(this,e)}}Ue("SymbolInstanceArray",_);class v extends Js{getoffsetX(e){return this.float32[1*e+0]}}Ue("GlyphOffsetArray",v);class T extends $s{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ue("SymbolLineVertexArray",T);class P extends qo{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]}}P.prototype.size=12;class E extends fc{get(e){return new P(this,e)}}Ue("TextAnchorOffsetArray",E);class C extends qo{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]}}C.prototype.size=8;class D extends Qs{get(e){return new C(this,e)}}Ue("FeatureIndexArray",D);class B extends Zr{}class q extends Zr{}class W extends Zr{}class $ extends uc{}class Y extends Ws{}class ee extends $o{}class X extends dc{}class te extends dn{}class ne extends Hs{}class J extends Wo{}class se extends Xs{}class ye extends pc{}class fe extends ha{}class pe extends Ys{}
vendor: 15,294 bytes, line 2
2class ge extends mc{}let Re=ti([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fe}=Re;class ve{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,a,s){let h=this.segments[this.segments.length-1];return e>ve.MAX_VERTEX_ARRAY_LENGTH&&ki(`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||!h||h.vertexLength+e>ve.MAX_VERTEX_ARRAY_LENGTH||h.sortKey!==s?this.createNewSegment(i,a,s):h}createNewSegment(e,i,a){let s={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return a!==void 0&&(s.sortKey=a),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(s),s}getOrCreateLatestSegment(e,i,a){return this.prepareSegment(0,e,i,a)}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,a,s){return new ve([{vertexOffset:e,primitiveOffset:i,vertexLength:a,primitiveLength:s,vaos:{},sortKey:0}])}}function qe(r,e){return 256*(r=yr(Math.floor(r),0,255))+yr(Math.floor(e),0,255)}ve.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ue("SegmentVector",ve);let lt=ti([{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"}]),St=ti([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var At,kt,Vt,Tt={exports:{}},ci={exports:{}},Nt={exports:{}},Pi=function(){if(Vt)return Tt.exports;Vt=1;var r=(At||(At=1,ci.exports=function(i,a){var s,h,u,f,g,x,w,S;for(h=i.length-(s=3&i.length),u=a,g=3432918353,x=461845907,S=0;S<h;)w=255&i.charCodeAt(S)|(255&i.charCodeAt(++S))<<8|(255&i.charCodeAt(++S))<<16|(255&i.charCodeAt(++S))<<24,++S,u=27492+(65535&(f=5*(65535&(u=(u^=w=(65535&(w=(w=(65535&w)*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*x+(((w>>>16)*x&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(f>>>16)&65535)<<16);switch(w=0,s){case 3:w^=(255&i.charCodeAt(S+2))<<16;case 2:w^=(255&i.charCodeAt(S+1))<<8;case 1:u^=w=(65535&(w=(w=(65535&(w^=255&i.charCodeAt(S)))*g+(((w>>>16)*g&65535)<<16)&4294967295)<<15|w>>>17))*x+(((w>>>16)*x&65535)<<16)&4294967295}return u^=i.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0}),ci.exports),e=(kt||(kt=1,Nt.exports=function(i,a){for(var s,h=i.length,u=a^h,f=0;h>=4;)s=1540483477*(65535&(s=255&i.charCodeAt(f)|(255&i.charCodeAt(++f))<<8|(255&i.charCodeAt(++f))<<16|(255&i.charCodeAt(++f))<<24))+((1540483477*(s>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),h-=4,++f;switch(h){case 3:u^=(255&i.charCodeAt(f+2))<<16;case 2:u^=(255&i.charCodeAt(f+1))<<8;case 1:u=1540483477*(65535&(u^=255&i.charCodeAt(f)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0}),Nt.exports);return Tt.exports=r,Tt.exports.murmur3=r,Tt.exports.murmur2=e,Tt.exports}(),Ht=_e(Pi);class Xt{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,a,s){this.ids.push(Ni(e)),this.positions.push(i,a,s)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let i=Ni(e),a=0,s=this.ids.length-1;for(;a<s;){let u=a+s>>1;this.ids[u]>=i?s=u:a=u+1}let h=[];for(;this.ids[a]===i;)h.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return h}static serialize(e,i){let a=new Float64Array(e.ids),s=new Uint32Array(e.positions);return pn(a,s,0,a.length-1),i&&i.push(a.buffer,s.buffer),{ids:a,positions:s}}static deserialize(e){let i=new Xt;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function Ni(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Ht(String(r))}function pn(r,e,i,a){for(;i<a;){let s=r[i+a>>1],h=i-1,u=a+1;for(;;){do h++;while(r[h]<s);do u--;while(r[u]>s);if(h>=u)break;qr(r,h,u),qr(e,3*h,3*u),qr(e,3*h+1,3*u+1),qr(e,3*h+2,3*u+2)}u-i<a-u?(pn(r,e,i,u),i=u+1):(pn(r,e,u+1,a),a=u)}}function qr(r,e,i){let a=r[e];r[e]=r[i],r[i]=a}Ue("FeaturePositionMap",Xt);class Ui{constructor(e,i){this.gl=e.gl,this.location=i}}class fn extends Ui{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Xo extends Ui{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 Yo extends Ui{constructor(e,i){super(e,i),this.current=mt.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 Wa=new Float32Array(16);function Yi(r){return[qe(255*r.r,255*r.g),qe(255*r.b,255*r.a)]}class Sr{constructor(e,i,a){this.value=e,this.uniformNames=i.map(s=>`u_${s}`),this.type=a}setUniform(e,i,a){e.set(a.constantOr(this.value))}getBinding(e,i,a){return this.type==="color"?new Yo(e,i):new fn(e,i)}}class lr{constructor(e,i){this.uniformNames=i.map(a=>`u_${a}`),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,a,s){let h=null;s==="u_pattern_to"?h=this.patternTo:s==="u_pattern_from"?h=this.patternFrom:s==="u_dasharray_to"?h=this.dashTo:s==="u_dasharray_from"?h=this.dashFrom:s==="u_pixel_ratio_to"?h=this.pixelRatioTo:s==="u_pixel_ratio_from"&&(h=this.pixelRatioFrom),h!==null&&e.set(h)}getBinding(e,i,a){return a.startsWith("u_pattern")||a.startsWith("u_dasharray_")?new Xo(e,i):new fn(e,i)}}class cr{constructor(e,i,a,s){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=i.map(h=>({name:`a_${h}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new s}populatePaintArray(e,i,a){let s=this.paintVertexArray.length,h=this.expression.evaluate(new Et(0,a),i,{},a.canonical,[],a.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(s,e,h)}updatePaintArray(e,i,a,s,h){let u=this.expression.evaluate(new Et(0,h),a,s);this._setPaintValue(e,i,u)}_setPaintValue(e,i,a){if(this.type==="color"){let s=Yi(a);for(let h=e;h<i;h++)this.paintVertexArray.emplace(h,s[0],s[1])}else{for(let s=e;s<i;s++)this.paintVertexArray.emplace(s,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class It{constructor(e,i,a,s,h,u){this.expression=e,this.uniformNames=i.map(f=>`u_${f}_t`),this.type=a,this.useIntegerZoom=s,this.zoom=h,this.maxValue=0,this.paintVertexAttributes=i.map(f=>({name:`a_${f}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,i,a){let s=this.expression.evaluate(new Et(this.zoom,a),i,{},a.canonical,[],a.formattedSection),h=this.expression.evaluate(new Et(this.zoom+1,a),i,{},a.canonical,[],a.formattedSection),u=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(u,e,s,h)}updatePaintArray(e,i,a,s,h){let u=this.expression.evaluate(new Et(this.zoom,h),a,s),f=this.expression.evaluate(new Et(this.zoom+1,h),a,s);this._setPaintValue(e,i,u,f)}_setPaintValue(e,i,a,s){if(this.type==="color"){let h=Yi(a),u=Yi(s);for(let f=e;f<i;f++)this.paintVertexArray.emplace(f,h[0],h[1],u[0],u[1])}else{for(let h=e;h<i;h++)this.paintVertexArray.emplace(h,a,s);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(s))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.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 a=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=yr(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);e.set(s)}getBinding(e,i,a){return new fn(e,i)}}class Ut{constructor(e,i,a,s,h,u){this.expression=e,this.type=i,this.useIntegerZoom=a,this.zoom=s,this.layerId=u,this.zoomInPaintVertexArray=new h,this.zoomOutPaintVertexArray=new h}populatePaintArray(e,i,a){let s=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(s,e,this.getPositionIds(i),a)}updatePaintArray(e,i,a,s,h){this._setPaintValues(e,i,this.getPositionIds(a),h)}_setPaintValues(e,i,a,s){let h=this.getPositions(s);if(!h||!a)return;let u=h[a.min],f=h[a.mid],g=h[a.max];if(u&&f&&g)for(let x=e;x<i;x++)this.emplace(this.zoomInPaintVertexArray,x,f,u),this.emplace(this.zoomOutPaintVertexArray,x,f,g)}upload(e){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){let i=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,i,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,i,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class hr extends Ut{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns&&e.patterns[this.layerId]}getVertexAttributes(){return lt.members}emplace(e,i,a,s){e.emplace(i,a.tlbr[0],a.tlbr[1],a.tlbr[2],a.tlbr[3],s.tlbr[0],s.tlbr[1],s.tlbr[2],s.tlbr[3],a.pixelRatio,s.pixelRatio)}}class mi extends Ut{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes&&e.dashes[this.layerId]}getVertexAttributes(){return St.members}emplace(e,i,a,s){e.emplace(i,0,a.y,a.height,a.width,0,s.y,s.height,s.width)}}class Pu{constructor(e,i,a){this.binders={},this._buffers=[];let s=[];for(let h in e.paint._values){if(!a(h))continue;let u=e.paint.get(h);if(!(u instanceof Ar&&Ga(u.property.specification)))continue;let f=Zd(h,e.type),g=u.value,x=u.property.specification.type,w=u.property.useIntegerZoom,S=u.property.specification["property-type"],M=S==="cross-faded"||S==="cross-faded-data-driven";if(g.kind==="constant")this.binders[h]=M?new lr(g.value,f):new Sr(g.value,f,x),s.push(`/u_${h}`);else if(g.kind==="source"||M){let L=Iu(h,x,"source");this.binders[h]=M?h==="line-dasharray"?new mi(g,x,w,i,L,e.id):new hr(g,x,w,i,L,e.id):new cr(g,f,x,L),s.push(`/a_${h}`)}else{let L=Iu(h,x,"composite");this.binders[h]=new It(g,f,x,w,i,L),s.push(`/z_${h}`)}}this.cacheKey=s.sort().join("")}getMaxValue(e){let i=this.binders[e];return i instanceof cr||i instanceof It?i.maxValue:0}populatePaintArrays(e,i,a){for(let s in this.binders){let h=this.binders[s];(h instanceof cr||h instanceof It||h instanceof Ut)&&h.populatePaintArray(e,i,a)}}setConstantPatternPositions(e,i){for(let a in this.binders){let s=this.binders[a];s instanceof lr&&s.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(let a in this.binders){let s=this.binders[a];s instanceof lr&&s.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,a,s,h){let u=!1;for(let f in e){let g=i.getPositions(f);for(let x of g){let w=a.feature(x.index);for(let S in this.binders){let M=this.binders[S];if((M instanceof cr||M instanceof It||M instanceof Ut)&&M.expression.isStateDependent===!0){let L=s.paint.get(S);M.expression=L.value,M.updatePaintArray(x.start,x.end,w,e[f],h),u=!0}}}}return u}defines(){let e=[];for(let i in this.binders){let a=this.binders[i];(a instanceof Sr||a instanceof lr)&&e.push(...a.uniformNames.map(s=>`#define HAS_UNIFORM_${s}`))}return e}getBinderAttributes(){let e=[];for(let i in this.binders){let a=this.binders[i];if(a instanceof cr||a instanceof It)for(let s=0;s<a.paintVertexAttributes.length;s++)e.push(a.paintVertexAttributes[s].name);else if(a instanceof Ut){let s=a.getVertexAttributes();for(let h of s)e.push(h.name)}}return e}getBinderUniforms(){let e=[];for(let i in this.binders){let a=this.binders[i];if(a instanceof Sr||a instanceof lr||a instanceof It)for(let s of a.uniformNames)e.push(s)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){let a=[];for(let s in this.binders){let h=this.binders[s];if(h instanceof Sr||h instanceof lr||h instanceof It){for(let u of h.uniformNames)if(i[u]){let f=h.getBinding(e,i[u],u);a.push({name:u,property:s,binding:f})}}}return a}setUniforms(e,i,a,s){for(let{name:h,property:u,binding:f}of i)this.binders[u].setUniform(f,s,a.get(u),h)}updatePaintBuffers(e){this._buffers=[];for(let i in this.binders){let a=this.binders[i];if(e&&a instanceof Ut){let s=e.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;s&&this._buffers.push(s)}else(a instanceof cr||a instanceof It)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(e){for(let i in this.binders){let a=this.binders[i];(a instanceof cr||a instanceof It||a instanceof Ut)&&a.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let i=this.binders[e];(i instanceof cr||i instanceof It||i instanceof Ut)&&i.destroy()}}}class da{constructor(e,i,a=()=>!0){this.programConfigurations={};for(let s of e)this.programConfigurations[s.id]=new Pu(s,i,a);this.needsUpload=!1,this._featureMap=new Xt,this._bufferOffset=0}populatePaintArrays(e,i,a,s){for(let h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,i,s);i.id!==void 0&&this._featureMap.add(i.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,a,s){for(let h of a)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,i,h,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 Zd(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":["ga
2pwidth"],"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 Iu(r,e,i){let a={color:{source:$o,composite:t},number:{source:Js,composite:$o}},s=function(h){return{"line-pattern":{source:X,composite:X},"fill-pattern":{source:X,composite:X},"fill-extrusion-pattern":{source:X,composite:X},"line-dasharray":{source:te,composite:te}}[h]}(r);return s&&s[i]||a[e][i]}Ue("ConstantBinder",Sr),Ue("CrossFadedConstantBinder",lr),Ue("SourceExpressionBinder",cr),Ue("CrossFadedPatternBinder",hr),Ue("CrossFadedDasharrayBinder",mi),Ue("CompositeExpressionBinder",It),Ue("ProgramConfiguration",Pu,{omit:["_buffers"]}),Ue("ProgramConfigurationSet",da);let gc=Math.pow(2,14)-1,Mu=-gc-1;function ur(r){let e=bt/r.extent,i=r.loadGeometry();for(let a=0;a<i.length;a++){let s=i[a];for(let h=0;h<s.length;h++){let u=s[h],f=Math.round(u.x*e),g=Math.round(u.y*e);u.x=yr(f,Mu,gc),u.y=yr(g,Mu,gc),(f<u.x||f>u.x+1||g<u.y||g>u.y+1)&&ki("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function Fn(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?ur(r):[]}}let yc=-32768;function Lu(r,e,i,a,s){r.emplaceBack(yc+8*e+a,yc+8*i+s)}class Ko{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 q,this.indexArray=new pe,this.segments=new ve,this.programConfigurations=new da(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a){let s=this.layers[0],h=[],u=null,f=!1,g=s.type==="heatmap";if(s.type==="circle"){let w=s;u=w.layout.get("circle-sort-key"),f=!u.isConstant(),g=g||w.paint.get("circle-pitch-alignment")==="map"}let x=g?i.subdivisionGranularity.circle:1;for(let{feature:w,id:S,index:M,sourceLayerIndex:L}of e){let k=this.layers[0]._featureFilter.needGeometry,A=Fn(w,k);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),A,a))continue;let F=f?u.evaluate(A,{},a):void 0,N={id:S,properties:w.properties,type:w.type,sourceLayerIndex:L,index:M,geometry:k?A.geometry:ur(w),patterns:{},sortKey:F};h.push(N)}f&&h.sort((w,S)=>w.sortKey-S.sortKey);for(let w of h){let{geometry:S,index:M,sourceLayerIndex:L}=w,k=e[M].feature;this.addFeature(w,S,M,a,x),i.featureIndex.insert(k,S,M,L,this.index)}}update(e,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:a})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fe),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,a,s,h=1){let u;switch(h){case 1:u=[0,7];break;case 3:u=[0,2,5,7];break;case 5:u=[0,1,3,4,6,7];break;case 7:u=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${h}; valid values are 1, 3, 5, 7.`)}let f=u.length;for(let g of i)for(let x of g){let w=x.x,S=x.y;if(w<0||w>=bt||S<0||S>=bt)continue;let M=this.segments.prepareSegment(f*f,this.layoutVertexArray,this.indexArray,e.sortKey),L=M.vertexLength;for(let k=0;k<f;k++)for(let A=0;A<f;A++)Lu(this.layoutVertexArray,w,S,u[A],u[k]);for(let k=0;k<f-1;k++)for(let A=0;A<f-1;A++){let F=L+k*f+A,N=L+(k+1)*f+A;this.indexArray.emplaceBack(F,N+1,F+1),this.indexArray.emplaceBack(F,N,N+1)}M.vertexLength+=f*f,M.primitiveLength+=(f-1)*(f-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:{},canonical:s})}}function _c(r,e){for(let i=0;i<r.length;i++)if(el(e,r[i]))return!0;for(let i=0;i<e.length;i++)if(el(r,e[i]))return!0;return!!qd(r,e)}function Ha(r,e,i){return!!el(r,e)||!!$d(e,r,i)}function pf(r,e){if(r.length===1)return mf(e,r[0]);for(let i=0;i<e.length;i++){let a=e[i];for(let s=0;s<a.length;s++)if(el(r,a[s]))return!0}for(let i=0;i<r.length;i++)if(mf(e,r[i]))return!0;for(let i=0;i<e.length;i++)if(qd(r,e[i]))return!0;return!1}function By(r,e,i){if(r.length>1){if(qd(r,e))return!0;for(let a=0;a<e.length;a++)if($d(e[a],r,i))return!0}for(let a=0;a<r.length;a++)if($d(r[a],e,i))return!0;return!1}function qd(r,e){if(r.length===0||e.length===0)return!1;for(let i=0;i<r.length-1;i++){let a=r[i],s=r[i+1];for(let h=0;h<e.length-1;h++)if(jy(a,s,e[h],e[h+1]))return!0}return!1}function jy(r,e,i,a){return tr(r,i,a)!==tr(e,i,a)&&tr(r,e,i)!==tr(r,e,a)}function $d(r,e,i){let a=i*i;if(e.length===1)return r.distSqr(e[0])<a;for(let s=1;s<e.length;s++)if(ff(r,e[s-1],e[s])<a)return!0;return!1}function ff(r,e,i){let a=e.distSqr(i);if(a===0)return r.distSqr(e);let s=((r.x-e.x)*(i.x-e.x)+(r.y-e.y)*(i.y-e.y))/a;return r.distSqr(s<0?e:s>1?i:i.sub(e)._mult(s)._add(e))}function mf(r,e){let i,a,s,h=!1;for(let u=0;u<r.length;u++){i=r[u];for(let f=0,g=i.length-1;f<i.length;g=f++)a=i[f],s=i[g],a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(h=!h)}return h}function el(r,e){let i=!1;for(let a=0,s=r.length-1;a<r.length;s=a++){let h=r[a],u=r[s];h.y>e.y!=u.y>e.y&&e.x<(u.x-h.x)*(e.y-h.y)/(u.y-h.y)+h.x&&(i=!i)}return i}function Vy(r,e,i){let a=i[0],s=i[2];if(r.x<a.x&&e.x<a.x||r.x>s.x&&e.x>s.x||r.y<a.y&&e.y<a.y||r.y>s.y&&e.y>s.y)return!1;let h=tr(r,e,i[0]);return h!==tr(r,e,i[1])||h!==tr(r,e,i[2])||h!==tr(r,e,i[3])}function tl(r,e,i){let a=e.paint.get(r).value;return a.kind==="constant"?a.value:i.programConfigurations.get(e.id).getMaxValue(r)}function Cu(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}
vendor: 27,405 bytes, line 2
2function Eu(r,e,i,a,s){if(!e[0]&&!e[1])return r;let h=U.convert(e)._mult(s);i==="viewport"&&h._rotate(-a);let u=[];for(let f=0;f<r.length;f++)u.push(r[f].sub(h));return u}function Ny(r){let e=[];for(let i=0;i<r.length;i++){let a=r[i],s=e.at(-1);(i===0||s&&!a.equals(s))&&e.push(a)}return e}function Uy({queryGeometry:r,size:e},i){return Ha(r,i,e)}function Gy({queryGeometry:r,size:e,transform:i,unwrappedTileID:a,getElevation:s},h){return Ha(r,h,e*(i.projectTileCoordinates(h.x,h.y,a,s).signedDistanceFromCamera/i.cameraToCenterDistance))}function Zy({queryGeometry:r,size:e,transform:i,unwrappedTileID:a,getElevation:s},h){let u=i.projectTileCoordinates(h.x,h.y,a,s).signedDistanceFromCamera,f=e*(i.cameraToCenterDistance/u);return Ha(r,Wd(h,i,a,s),f)}function qy({queryGeometry:r,size:e,transform:i,unwrappedTileID:a,getElevation:s},h){return Ha(r,Wd(h,i,a,s),e)}function gf({queryGeometry:r,size:e,transform:i,unwrappedTileID:a,getElevation:s,pitchAlignment:h="map",pitchScale:u="map"},f){let g=h==="map"?u==="map"?Uy:Gy:u==="map"?Zy:qy,x={queryGeometry:r,size:e,transform:i,unwrappedTileID:a,getElevation:s};for(let w of f)for(let S of w)if(g(x,S))return!0;return!1}function Wd(r,e,i,a){let s=e.projectTileCoordinates(r.x,r.y,i,a).point;return new U((.5*s.x+.5)*e.width,(.5*-s.y+.5)*e.height)}let yf,_f;Ue("CircleBucket",Ko,{omit:["layers"]});var $y={get paint(){return _f=_f||new Vi({"circle-radius":new et(ie.paint_circle["circle-radius"]),"circle-color":new et(ie.paint_circle["circle-color"]),"circle-blur":new et(ie.paint_circle["circle-blur"]),"circle-opacity":new et(ie.paint_circle["circle-opacity"]),"circle-translate":new We(ie.paint_circle["circle-translate"]),"circle-translate-anchor":new We(ie.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new We(ie.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new We(ie.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new et(ie.paint_circle["circle-stroke-width"]),"circle-stroke-color":new et(ie.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new et(ie.paint_circle["circle-stroke-opacity"])})},get layout(){return yf=yf||new Vi({"circle-sort-key":new et(ie.layout_circle["circle-sort-key"])})}};class Wy extends Dr{constructor(e,i){super(e,$y,i)}createBucket(e){return new Ko(e)}queryRadius(e){let i=e;return tl("circle-radius",this,i)+tl("circle-stroke-width",this,i)+Cu(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:a,geometry:s,transform:h,pixelsToTileUnits:u,unwrappedTileID:f,getElevation:g}){let x=Eu(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-h.bearingInRadians,u),w=this.paint.get("circle-radius").evaluate(i,a)+this.paint.get("circle-stroke-width").evaluate(i,a),S=this.paint.get("circle-pitch-scale"),M=this.paint.get("circle-pitch-alignment"),L,k;return M==="map"?(L=x,k=w*u):(L=function(A,F,N,H){return A.map(V=>Wd(V,F,N,H))}(x,h,f,g),k=w),gf({queryGeometry:L,size:k,transform:h,unwrappedTileID:f,getElevation:g,pitchAlignment:M,pitchScale:S},s)}}class xf extends Ko{}let vf;Ue("HeatmapBucket",xf,{omit:["layers"]});var Hy={get paint(){return vf=vf||new Vi({"heatmap-radius":new et(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new et(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new We(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new qa(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new We(ie.paint_heatmap["heatmap-opacity"])})}};function Hd(r,{width:e,height:i},a,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*a)throw new RangeError(`mismatched image size. expected: ${s.length} but got: ${e*i*a}`)}else s=new Uint8Array(e*i*a);return r.width=e,r.height=i,r.data=s,r}function bf(r,{width:e,height:i},a){if(e===r.width&&i===r.height)return;let s=Hd({},{width:e,height:i},a);Xd(r,s,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,i)},a),r.width=e,r.height=i,r.data=s.data}function Xd(r,e,i,a,s,h){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||a.x>e.width-s.width||a.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");let u=r.data,f=e.data;if(u===f)throw new Error("srcData equals dstData, so image is already copied");for(let g=0;g<s.height;g++){let x=((i.y+g)*r.width+i.x)*h,w=((a.y+g)*e.width+a.x)*h;for(let S=0;S<s.width*h;S++)f[w+S]=u[x+S]}return e}class xc{constructor(e,i){Hd(this,e,1,i)}resize(e){bf(this,e,1)}clone(){return new xc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,a,s,h){Xd(e,i,a,s,h,1)}}class dr{constructor(e,i){Hd(this,e,4,i)}resize(e){bf(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new dr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,a,s,h){Xd(e,i,a,s,h,4)}setPixel(e,i,a){let s=4*(e*this.width+i);this.data[s+0]=Math.round(255*a.r/a.a),this.data[s+1]=Math.round(255*a.g/a.a),this.data[s+2]=Math.round(255*a.b/a.a),this.data[s+3]=Math.round(255*a.a)}}function wf(r){let e=new Uint8Array(r.length);for(let i=0;i<r.length;i+=4){let a=r[i+3];e[i+0]=Math.round(r[i+0]*a/255),e[i+1]=Math.round(r[i+1]*a/255),e[i+2]=Math.round(r[i+2]*a/255),e[i+3]=a}return e}function Sf(r){let e={},i=r.resolution||256,a=r.clips?r.clips.length:1,s=r.image||new dr({width:i,height:a});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);let h=(u,f,g)=>{e[r.evaluationKey]=g;let x=r.expression.evaluate(e);s.setPixel(u/4/i,f/4,x)};if(r.clips)for(let u=0,f=0;u<a;++u,f+=4*i)for(let g=0,x=0;g<i;g++,x+=4){let w=g/(i-1),{start:S,end:M}=r.clips[u];h(f,x,S*(1-w)+M*w)}else for(let u=0,f=0;u<i;u++,f+=4)h(0,f,u/(i-1));return s}Ue("AlphaImage",xc),Ue("RGBAImage",dr);let Yd="big-fb";class Xy extends Dr{createBucket(e){return new xf(e)}constructor(e,i){super(e,Hy,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Sf({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Yd)&&this.heatmapFbos.delete(Yd)}queryRadius(e){return tl("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:a,geometry:s,transform:h,pixelsToTileUnits:u,unwrappedTileID:f,getElevation:g}){return gf({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,a)*u,transform:h,unwrappedTileID:f,getElevation:g},s)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let Tf;var Yy={get paint(){return Tf=Tf||new Vi({"hillshade-illumination-direction":new We(ie.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new We(ie.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new We(ie.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new We(ie.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new We(ie.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new We(ie.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new We(ie.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new We(ie.paint_hillshade["hillshade-method"])})}};class Ky extends Dr{constructor(e,i){super(e,Yy,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,a=this.paint.get("hillshade-highlight-color").values,s=this.paint.get("hillshade-shadow-color").values,h=Math.max(e.length,i.length,a.length,s.length);e=e.concat(Array(h-e.length).fill(e.at(-1))),i=i.concat(Array(h-i.length).fill(i.at(-1))),a=a.concat(Array(h-a.length).fill(a.at(-1))),s=s.concat(Array(h-s.length).fill(s.at(-1)));let u=i.map(Wn);return{directionRadians:e.map(Wn),altitudeRadians:u,shadowColor:s,highlightColor:a}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let Pf;var Jy={get paint(){return Pf=Pf||new Vi({"color-relief-opacity":new We(ie["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new qa(ie["paint_color-relief"]["color-relief-color"])})}};function If(r){return"data"in r}class Kd{constructor(e,i,a,s){this.context=e,this.format=a,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,s)}update(e,i,a){let{width:s,height:h}=e,u=!(this.size&&this.size[0]===s&&this.size[1]===h||a),{context:f}=this,{gl:g}=f;this.useMipmap=!!(i&&i.useMipmap),g.bindTexture(g.TEXTURE_2D,this.texture),f.pixelStoreUnpackFlipY.set(!1),f.pixelStoreUnpack.set(1);let x=this.format===g.RGBA&&(!i||i.premultiply!==!1);if(u)this.size=[s,h],If(e)?(f.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,x,s,h,g)):(f.pixelStoreUnpackPremultiplyAlpha.set(x),this._uploadDomImage(e,g));else{let{x:w,y:S}=a||{x:0,y:0};If(e)?(f.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,x,w,S,s,h,g)):(f.pixelStoreUnpackPremultiplyAlpha.set(x),this._updateDomImage(e,w,S,g))}this.useMipmap&&this.isSizePowerOfTwo()&&g.generateMipmap(g.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,a,s,h){let{data:u}=e;i&&u&&(u=wf(u)),h.texImage2D(h.TEXTURE_2D,0,this.format,a,s,0,this.format,h.UNSIGNED_BYTE,u)}_updateDomImage(e,i,a,s){s.texSubImage2D(s.TEXTURE_2D,0,i,a,s.RGBA,s.UNSIGNED_BYTE,e)}_updateRawData(e,i,a,s,h,u,f){let{data:g}=e;i&&g&&(g=wf(g)),f.texSubImage2D(f.TEXTURE_2D,0,a,s,h,u,f.RGBA,f.UNSIGNED_BYTE,g)}bind(e,i,a){let{context:s}=this,{gl:h}=s;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),h.bindTexture(h.TEXTURE_2D,this.texture),a!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=h.LINEAR),e!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,e),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,a||e),this.filter=e),i!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,i),h.texParameteri(h.TEXTURE_2D,h.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 Mf{constructor(e,i,a,s=1,h=1,u=1,f=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void ki(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;let g=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=s,this.greenFactor=h,this.blueFactor=u,this.baseShift=f;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<g;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(g,x)]=this.data[this._idx(g-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,g)]=this.data[this._idx(x,g-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(g,-1)]=this.data[this._idx(g-1,0)],this.data[this._idx(-1,g)]=this.data[this._idx(0,g-1)],this.data[this._idx(g,g)]=this.data[this._idx(g-1,g-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<g;x++)for(let w=0;w<g;w++){let S=this.get(x,w);S>this.max&&(this.max=S),S<this.min&&(this.min=S)}}get(e,i){let a=new Uint8Array(this.data.buffer),s=4*this._idx(e,i);return this.unpack(a[s],a[s+1],a[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,a){return e*this.redFactor+i*this.greenFactor+a*this.blueFactor-this.baseShift}pack(e){return Lf(e,this.getUnpackVector())}getPixels(){return new dr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,h=i*this.dim+this.dim,u=a*this.dim,f=a*this.dim+this.dim;switch(i){case-1:s=h-1;break;case 1:h=s+1}switch(a){case-1:u=f-1;break;case 1:f=u+1}let g=-i*this.dim,x=-a*this.dim;for(let w=u;w<f;w++)for(let S=s;S<h;S++)this.data[this._idx(S,w)]=e.data[this._idx(S+g,w+x)]}}function Lf(r,e){let i=e[0],a=e[1],s=e[2],h=e[3],u=Math.min(i,a,s),f=Math.round((r+h)/u);return{r:Math.floor(f*u/i)%256,g:Math.floor(f*u/a)%256,b:Math.floor(f*u/s)%256}}Ue("DEMData",Mf);class Qy extends Dr{constructor(e,i){super(e,Jy,i)}_createColorRamp(e){let i={elevationStops:[],colorStops:[]},a=this._transitionablePaint._values["color-relief-color"].value.expression;if(a instanceof Fs&&a._styleExpression.expression instanceof ji){this.colorRampExpression=a;let u=a._styleExpression.expression;i.elevationStops=u.labels,i.colorStops=[];for(let f of i.elevationStops)i.colorStops.push(u.evaluate({globals:{elevation:f}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[mt.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:[]},h=(i.elevationStops.length-1)/(e-1);for(let u=0;u<i.elevationStops.length-.5;u+=h)s.elevationStops.push(i.elevationStops[Math.round(u)]),s.colorStops.push(i.colorStops[Math.round(u)]);return ki(`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,a){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let s=this._createColorRamp(i),h=new dr({width:s.colorStops.length,height:1}),u=new dr({width:s.colorStops.length,height:1});for(let f=0;f<s.elevationStops.length;f++){let g=Lf(s.elevationStops[f],a);u.setPixel(0,f,new mt(g.r/255,g.g/255,g.b/255,1)),h.setPixel(0,f,s.colorStops[f])}return this.colorRampTextures={elevationTexture:new Kd(e,u,e.gl.RGBA),colorTexture:new Kd(e,h,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let e_=ti([{name:"a_pos",components:2,type:"Int16"}],4),{members:t_}=e_;function ku(r,e,i){let a=i.patternDependencies,s=!1;for(let h of e){let u=h.paint.get(`${r}-pattern`);u.isConstant()||(s=!0);let f=u.constantOr(null);f&&(s=!0,a[f.to]=!0,a[f.from]=!0)}return s}function Jd(r,e,i,a,s){let{zoom:h}=a,u=s.patternDependencies;for(let f of e){let g=f.paint.get(`${r}-pattern`).value;if(g.kind!=="constant"){let x=g.evaluate({zoom:h-1},i,{},s.availableImages),w=g.evaluate({zoom:h},i,{},s.availableImages),S=g.evaluate({zoom:h+1},i,{},s.availableImages);x=x&&x.name?x.name:x,w=w&&w.name?w.name:w,S=S&&S.name?S.name:S,u[x]=!0,u[w]=!0,u[S]=!0,i.patterns[f.id]={min:x,mid:w,max:S}}}return i}function Cf(r,e,i,a,s){let h;if(s===function(u,f,g,x){let w=0;for(let S=f,M=g-x;S<g;S+=x)w+=(u[M]-u[S])*(u[S+1]+u[M+1]),M=S;return w}(r,e,i,a)>0)for(let u=e;u<i;u+=a)h=Af(u/a|0,r[u],r[u+1],h);else for(let u=i-a;u>=e;u-=a)h=Af(u/a|0,r[u],r[u+1],h);return h&&il(h,h.next)&&(Sc(h),h=h.next),h}function Jo(r,e){if(!r)return r;e||(e=r);let i,a=r;do if(i=!1,a.steiner||!il(a,a.next)&&si(a.prev,a,a.next)!==0)a=a.next;else{if(Sc(a),a=e=a.prev,a===a.next)break;i=!0}while(i||a!==e);return e}function vc(r,e,i,a,s,h,u){if(!r)return;!u&&h&&function(g,x,w,S){let M=g;do M.z===0&&(M.z=Qd(M.x,M.y,x,w,S)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==g);M.prevZ.nextZ=null,M.prevZ=null,function(L){let k,A=1;do{let F,N=L;L=null;let H=null;for(k=0;N;){k++;let V=N,Z=0;for(let ae=0;ae<A&&(Z++,V=V.nextZ,V);ae++);let Q=A;for(;Z>0||Q>0&&V;)Z!==0&&(Q===0||!V||N.z<=V.z)?(F=N,N=N.nextZ,Z--):(F=V,V=V.nextZ,Q--),H?H.nextZ=F:L=F,F.prevZ=H,H=F;N=V}H.nextZ=null,A*=2}while(k>1)}(M)}(r,a,s,h);let f=r;for(;r.prev!==r.next;){let g=r.prev,x=r.next;if(h?r_(r,a,s,h):i_(r))e.push(g.i,r.i,x.i),Sc(r),r=x.next,f=x.next;else if((r=x)===f){u?u===1?vc(r=n_(Jo(r),e),e,i,a,s,h,2):u===2&&a_(r,e,i,a,s,h):vc(Jo(r),e,i,a,s,h,1);break}}}function i_(r){let e=r.prev,i=r,a=r.next;if(si(e,i,a)>=0)return!1;let s=e.x,h=i.x,u=a.x,f=e.y,g=i.y,x=a.y,w=Math.min(s,h,u),S=Math.min(f,g,x),M=Math.max(s,h,u),L=Math.max(f,g,x),k=a.next;for(;k!==e;){if(k.x>=w&&k.x<=M&&k.y>=S&&k.y<=L&&bc(s,f,h,g,u,x,k.x,k.y)&&si(k.prev,k,k.next)>=0)return!1;k=k.next}return!0}function r_(r,e,i,a){let s=r.prev,h=r,u=r.next;if(si(s,h,u)>=0)return!1;let f=s.x,g=h.x,x=u.x,w=s.y,S=h.y,M=u.y,L=Math.min(f,g,x),k=Math.min(w,S,M),A=Math.max(f,g,x),F=Math.max(w,S,M),N=Qd(L,k,e,i,a),H=Qd(A,F,e,i,a),V=r.prevZ,Z=r.nextZ;for(;V&&V.z>=N&&Z&&Z.z<=H;){if(V.x>=L&&V.x<=A&&V.y>=k&&V.y<=F&&V!==s&&V!==u&&bc(f,w,g,S,x,M,V.x,V.y)&&si(V.prev,V,V.next)>=0||(V=V.prevZ,Z.x>=L&&Z.x<=A&&Z.y>=k&&Z.y<=F&&Z!==s&&Z!==u&&bc(f,w,g,S,x,M,Z.x,Z.y)&&si(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;V&&V.z>=N;){if(V.x>=L&&V.x<=A&&V.y>=k&&V.y<=F&&V!==s&&V!==u&&bc(f,w,g,S,x,M,V.x,V.y)&&si(V.prev,V,V.next)>=0)return!1;V=V.prevZ}for(;Z&&Z.z<=H;){if(Z.x>=L&&Z.x<=A&&Z.y>=k&&Z.y<=F&&Z!==s&&Z!==u&&bc(f,w,g,S,x,M,Z.x,Z.y)&&si(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function n_(r,e){let i=r;do{let a=i.prev,s=i.next.next;!il(a,s)&&kf(a,i,i.next,s)&&wc(a,s)&&wc(s,a)&&(e.push(a.i,i.i,s.i),Sc(i),Sc(i.next),i=r=s),i=i.next}while(i!==r);return Jo(i)}function a_(r,e,i,a,s,h){let u=r;do{let f=u.next.next;for(;f!==u.prev;){if(u.i!==f.i&&h_(u,f)){let g=zf(u,f);return u=Jo(u,u.next),g=Jo(g,g.next),vc(u,e,i,a,s,h,0),void vc(g,e,i,a,s,h,0)}f=f.next}u=u.next}while(u!==r)}function o_(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 s_(r,e){let i=function(s,h){let u=h,f=s.x,g=s.y,x,w=-1/0;if(il(s,u))return u;do{if(il(s,u.next))return u.next;if(g<=u.y&&g>=u.next.y&&u.next.y!==u.y){let A=u.x+(g-u.y)*(u.next.x-u.x)/(u.next.y-u.y);if(A<=f&&A>w&&(w=A,x=u.x<u.next.x?u:u.next,A===f))return x}u=u.next}while(u!==h);if(!x)return null;let S=x,M=x.x,L=x.y,k=1/0;u=x;do{if(f>=u.x&&u.x>=M&&f!==u.x&&Ef(g<L?f:w,g,M,L,g<L?w:f,g,u.x,u.y)){let A=Math.abs(g-u.y)/(f-u.x);wc(u,s)&&(A<k||A===k&&(u.x>x.x||u.x===x.x&&l_(x,u)))&&(x=u,k=A)}u=u.next}while(u!==S);return x}(r,e);if(!i)return e;let a=zf(i,r);return Jo(a,a.next),Jo(i,i.next)}function l_(r,e){return si(r.prev,r,e.prev)<0&&si(e.next,r,r.next)<0}function Qd(r,e,i,a,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-a)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function c_(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 Ef(r,e,i,a,s,h,u,f){return(s-u)*(e-f)>=(r-u)*(h-f)&&(r-u)*(a-f)>=(i-u)*(e-f)&&(i-u)*(h-f)>=(s-u)*(a-f)}function bc(r,e,i,a,s,h,u,f){return!(r===u&&e===f)&&Ef(r,e,i,a,s,h,u,f)}function h_(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!function(i,a){let s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==a.i&&s.next.i!==a.i&&kf(s,s.next,i,a))return!0;s=s.next}while(s!==i);return!1}(r,e)&&(wc(r,e)&&wc(e,r)&&function(i,a){let s=i,h=!1,u=(i.x+a.x)/2,f=(i.y+a.y)/2;do s.y>f!=s.next.y>f&&s.next.y!==s.y&&u<(s.next.x-s.x)*(f-s.y)/(s.next.y-s.y)+s.x&&(h=!h),s=s.next;while(s!==i);return h}(r,e)&&(si(r.prev,r,e.prev)||si(r,e.prev,e))||il(r,e)&&si(r.prev,r,r.next)>0&&si(e.prev,e,e.next)>0)}function si(r,e,i){return(e.y-r.y)*(i.x-e.x)-(e.x-r.x)*(i.y-e.y)}function il(r,e){return r.x===e.x&&r.y===e.y}function kf(r,e,i,a){let s=Au(si(r,e,i)),h=Au(si(r,e,a)),u=Au(si(i,a,r)),f=Au(si(i,a,e));return s!==h&&u!==f||!(s!==0||!zu(r,i,e))||!(h!==0||!zu(r,a,e))||!(u!==0||!zu(i,r,a))||!(f!==0||!zu(i,e,a))}function zu(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 Au(r){return r>0?1:r<0?-1:0}function wc(r,e){return si(r.prev,r,r.next)<0?si(r,e,r.next)>=0&&si(r,r.prev,e)>=0:si(r,e,r.prev)<0||si(r,r.next,e)<0}function zf(r,e){let i=ep(r.i,r.x,r.y),a=ep(e.i,e.x,e.y),s=r.next,h=e.prev;return r.next=e,e.prev=r,i.next=s,s.prev=i,a.next=i,i.prev=a,h.next=a,a.prev=h,a}function Af(r,e,i,a){let s=ep(r,e,i);return a?(s.next=a.next,s.prev=a,a.next.prev=s,a.next=s):(s.prev=s,s.next=s),s}function Sc(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 ep(r,e,i){return{i:r,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class rl{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 Du{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}Du.noSubdivision=new Du({fill:new rl(0,0),line:new rl(0,0),tile:new rl(0,0),stencil:new rl(0,0),circle:1}),Ue("SubdivisionGranularityExpression",rl),Ue("SubdivisionGranularitySetting",Du);let nl=-32768,Tc=32767;class u_{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=bt/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 a=0|Math.round(e),s=0|Math.round(i),h=this._getKey(a,s);if(this._vertexDictionary.has(h))return this._vertexDictionary.get(h);let u=this._vertexBuffer.length/2;return this._vertexDictionary.set(h,u),this._vertexBuffer.push(a,s),u}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(s,h){let u=[];for(let f=0;f<h.length;f+=3){let g=h[f],x=h[f+1],w=h[f+2],S=s[2*g],M=s[2*g+1];(s[2*x]-S)*(s[2*w+1]-M)-(s[2*x+1]-M)*(s[2*w]-S)>0?(u.push(g),u.push(w),u.push(x)):(u.push(g),u.push(x),u.push(w))}return u}(this._vertexBuffer,e);let i=[],a=e.length;for(let s=0;s<a;s+=3){let h=[e[s+0],e[s+1],e[s+2]],u=[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]],f=1/0,g=1/0,x=-1/0,w=-1/0;for(let A=0;A<3;A++){let F=u[2*A],N=u[2*A+1];f=Math.min(f,F),x=Math.max(x,F),g=Math.min(g,N),w=Math.max(w,N)}if(f===x||g===w)continue;let S=Math.floor(f/this._granularityCellSize),M=Math.ceil(x/this._granularityCellSize),L=Math.floor(g/this._granularityCellSize),k=Math.ceil(w/this._granularityCellSize);if(S!==M||L!==k)for(let A=L;A<k;A++){let F=this._scanlineGenerateVertexRingForCellRow(A,u,h);d_(this._vertexBuffer,F,i)}else i.push(...h)}return i}_scanlineGenerateVertexRingForCellRow(e,i,a){let s=e*this._granularityCellSize,h=s+this._granularityCellSize,u=[];for(let f=0;f<3;f++){let g=i[2*f],x=i[2*f+1],w=i[2*(f+1)%6],S=i[(2*(f+1)+1)%6],M=i[2*(f+2)%6],L=i[(2*(f+2)+1)%6],k=w-g,A=S-x,F=k===0,N=A===0,H=(s-x)/A,V=(h-x)/A,Z=Math.min(H,V),Q=Math.max(H,V);if(!N&&(Z>=1||Q<=0)||N&&(x<s||x>h)){S>=s&&S<=h&&u.push(a[(f+1)%3]);continue}!N&&Z>0&&u.push(this._vertexToIndex(g+k*Z,x+A*Z));let ae=g+k*Math.max(Z,0),de=g+k*Math.min(Q,1);F||this._generateIntraEdgeVertices(u,g,x,w,S,ae,de),!N&&Q<1&&u.push(this._vertexToIndex(g+k*Q,x+A*Q)),(N||S>=s&&S<=h)&&u.push(a[(f+1)%3]),!N&&(S<=s||S>=h)&&this._generateInterEdgeVertices(u,g,x,w,S,M,L,de,s,h)}return u}_generateIntraEdgeVertices(e,i,a,s,h,u,f){let g=s-i,x=h-a,w=x===0,S=w?Math.min(i,s):Math.min(u,f),M=w?Math.max(i,s):Math.max(u,f),L=Math.floor(S/this._granularityCellSize)+1,k=Math.ceil(M/this._granularityCellSize)-1;if(w?i<s:u<f)for(let A=L;A<=k;A++){let F=A*this._granularityCellSize;e.push(this._vertexToIndex(F,a+x*(F-i)/g))}else for(let A=k;A>=L;A--){let F=A*this._granularityCellSize;e.push(this._vertexToIndex(F,a+x*(F-i)/g))}}_generateInterEdgeVertices(e,i,a,s,h,u,f,g,x,w){let S=h-a,M=u-s,L=f-h,k=(x-h)/L,A=(w-h)/L,F=Math.min(k,A),N=Math.max(k,A),H=s+M*F,V=Math.floor(Math.min(H,g)/this._granularityCellSize)+1,Z=Math.ceil(Math.max(H,g)/this._granularityCellSize)-1,Q=g<H,ae=L===0;if(ae&&(f===x||f===w))return;if(ae||F>=1||N<=0){let we=a-f,Se=u+(i-u)*Math.min((x-f)/we,(w-f)/we);V=Math.floor(Math.min(Se,g)/this._granularityCellSize)+1,Z=Math.ceil(Math.max(Se,g)/this._granularityCellSize)-1,Q=g<Se}let de=S>0?w:x;if(Q)for(let we=V;we<=Z;we++)e.push(this._vertexToIndex(we*this._granularityCellSize,de));else for(let we=Z;we>=V;we--)e.push(this._vertexToIndex(we*this._granularityCellSize,de))}_generateOutline(e){let i=[];for(let a of e){let s=Qo(a,this._granularity,!0),h=this._pointArrayToIndices(s),u=[];for(let f=1;f<h.length;f++)u.push(h[f-1]),u.push(h[f]);i.push(u)}return i}_handlePoles(e){let i=!1,a=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(a=!0)),(i||a)&&this._fillPoles(e,i,a)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){let a=e[i+1];a===nl&&(e[i+1]=-32767),a===Tc&&(e[i+1]=32766)}}_generatePoleQuad(e,i,a,s,h,u){s>h!=(u===nl)?(e.push(i),e.push(a),e.push(this._vertexToIndex(s,u)),e.push(a),e.push(this._vertexToIndex(h,u)),e.push(this._vertexToIndex(s,u))):(e.push(a),e.push(i),e.push(this._vertexToIndex(s,u)),e.push(this._vertexToIndex(h,u)),e.push(a),e.push(this._vertexToIndex(s,u)))}_fillPoles(e,i,a){let s=this._vertexBuffer,h=bt,u=e.length;for(let f=2;f<u;f+=3){let g=e[f-2],x=e[f-1],w=e[f],S=s[2*g],M=s[2*g+1],L=s[2*x],k=s[2*x+1],A=s[2*w],F=s[2*w+1];i&&(M===0&&k===0&&this._generatePoleQuad(e,g,x,S,L,nl),k===0&&F===0&&this._generatePoleQuad(e,x,w,L,A,nl),F===0&&M===0&&this._generatePoleQuad(e,w,g,A,S,nl)),a&&(M===h&&k===h&&this._generatePoleQuad(e,g,x,S,L,Tc),k===h&&F===h&&this._generatePoleQuad(e,x,w,L,A,Tc),F===h&&M===h&&this._generatePoleQuad(e,w,g,A,S,Tc))}}_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:a,holeIndices:s}=function(f){let g=[],x=[];for(let w of f)if(w.length!==0){w!==f[0]&&g.push(x.length/2);for(let S=0;S<w.length;S++)x.push(w[S].x),x.push(w[S].y)}return{flattened:x,holeIndices:g}}(e),h;this._initializeVertices(a);try{let f=function(x,w,S=2){let M=w&&w.length,L=M?w[0]*S:x.length,k=Cf(x,0,L,S,!0),A=[];if(!k||k.next===k.prev)return A;let F,N,H;if(M&&(k=function(V,Z,Q,ae){let de=[];for(let we=0,Se=Z.length;we<Se;we++){let Ie=Cf(V,Z[we]*ae,we<Se-1?Z[we+1]*ae:V.length,ae,!1);Ie===Ie.next&&(Ie.steiner=!0),de.push(c_(Ie))}de.sort(o_);for(let we=0;we<de.length;we++)Q=s_(de[we],Q);return Q}(x,w,k,S)),x.length>80*S){F=x[0],N=x[1];
2let V=F,Z=N;for(let Q=S;Q<L;Q+=S){let ae=x[Q],de=x[Q+1];ae<F&&(F=ae),de<N&&(N=de),ae>V&&(V=ae),de>Z&&(Z=de)}H=Math.max(V-F,Z-N),H=H!==0?32767/H:0}return vc(k,A,S,F,N,H,0),A}(a,s),g=this._convertIndices(a,f);h=this._subdivideTrianglesScanline(g)}catch(f){console.error(f)}let u=[];return i&&(u=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(h),{verticesFlattened:this._vertexBuffer,indicesTriangles:h,indicesLineList:u}}_convertIndices(e,i){let a=[];for(let s=0;s<i.length;s++)a.push(this._vertexToIndex(e[2*i[s]],e[2*i[s]+1]));return a}_pointArrayToIndices(e){let i=[];for(let a=0;a<e.length;a++){let s=e[a];i.push(this._vertexToIndex(s.x,s.y))}return i}}function Df(r,e,i,a=!0){return new u_(i,e).subdividePolygonInternal(r,a)}function Qo(r,e,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];let a=r[0],s=r[r.length-1],h=i&&(a.x!==s.x||a.y!==s.y);if(e<2)return h?[...r,r[0]]:[...r];let u=Math.floor(bt/e),f=[];f.push(new U(r[0].x,r[0].y));let g=r.length,x=h?g:g-1;for(let w=0;w<x;w++){let S=r[w],M=w<g-1?r[w+1]:r[0],L=S.x,k=S.y,A=M.x,F=M.y,N=L!==A,H=k!==F;if(!N&&!H)continue;let V=A-L,Z=F-k,Q=Math.abs(V),ae=Math.abs(Z),de=L,we=k;for(;;){let Ie=V>0?(Math.floor(de/u)+1)*u:(Math.ceil(de/u)-1)*u,Be=Z>0?(Math.floor(we/u)+1)*u:(Math.ceil(we/u)-1)*u,ze=Math.abs(de-Ie),Ce=Math.abs(we-Be),be=Math.abs(de-A),je=Math.abs(we-F),Ze=N?ze/Q:Number.POSITIVE_INFINITY,$e=H?Ce/ae:Number.POSITIVE_INFINITY;if((be<=ze||!N)&&(je<=Ce||!H))break;if(Ze<$e&&N||!H){de=Ie,we+=Z*Ze;let Ne=new U(de,Math.round(we));f[f.length-1].x===Ne.x&&f[f.length-1].y===Ne.y||f.push(Ne)}else{de+=V*$e,we=Be;let Ne=new U(Math.round(de),we);f[f.length-1].x===Ne.x&&f[f.length-1].y===Ne.y||f.push(Ne)}}let Se=new U(A,F);
vendor: 16,269 bytes, line 2
2f[f.length-1].x===Se.x&&f[f.length-1].y===Se.y||f.push(Se)}return f}function d_(r,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let a=0,s=r[2*e[0]];for(let g=1;g<e.length;g++){let x=r[2*e[g]];x<s&&(s=x,a=g)}let h=e.length,u=a,f=(u+1)%h;for(;;){let g=u-1>=0?u-1:h-1,x=(f+1)%h,w=r[2*e[g]],S=r[2*e[x]],M=r[2*e[u]],L=r[2*e[u]+1],k=r[2*e[f]+1],A=!1;if(w<S)A=!0;else if(w>S)A=!1;else{let F=k-L,N=-(r[2*e[f]]-M),H=L<k?1:-1;((w-M)*F+(r[2*e[g]+1]-L)*N)*H>((S-M)*F+(r[2*e[x]+1]-L)*N)*H&&(A=!0)}if(A){let F=e[g],N=e[u],H=e[f];F!==N&&F!==H&&N!==H&&i.push(H,N,F),u--,u<0&&(u=h-1)}else{let F=e[x],N=e[u],H=e[f];F!==N&&F!==H&&N!==H&&i.push(H,N,F),f++,f>=h&&(f=0)}if(g===x)break}}function Rf(r,e,i,a,s,h,u,f,g){let x=s.length/2,w=u&&f&&g;if(x<ve.MAX_VERTEX_ARRAY_LENGTH){let S=e.prepareSegment(x,i,a),M=S.vertexLength;for(let A=0;A<h.length;A+=3)a.emplaceBack(M+h[A],M+h[A+1],M+h[A+2]);let L,k;S.vertexLength+=x,S.primitiveLength+=h.length/3,w&&(k=u.prepareSegment(x,i,f),L=k.vertexLength,k.vertexLength+=x);for(let A=0;A<s.length;A+=2)r(s[A],s[A+1]);if(w)for(let A=0;A<g.length;A++){let F=g[A];for(let N=1;N<F.length;N+=2)f.emplaceBack(L+F[N-1],L+F[N]);k.primitiveLength+=F.length/2}}else(function(S,M,L,k,A,F){let N=[];for(let ae=0;ae<k.length/2;ae++)N.push(-1);let H={count:0},V=0,Z=S.getOrCreateLatestSegment(M,L),Q=Z.vertexLength;for(let ae=2;ae<A.length;ae+=3){let de=A[ae-2],we=A[ae-1],Se=A[ae],Ie=N[de]<V,Be=N[we]<V,ze=N[Se]<V;Z.vertexLength+((Ie?1:0)+(Be?1:0)+(ze?1:0))>ve.MAX_VERTEX_ARRAY_LENGTH&&(Z=S.createNewSegment(M,L),V=H.count,Ie=!0,Be=!0,ze=!0,Q=0);let Ce=Pc(N,k,F,H,de,Ie,Z),be=Pc(N,k,F,H,we,Be,Z),je=Pc(N,k,F,H,Se,ze,Z);L.emplaceBack(Q+Ce-V,Q+be-V,Q+je-V),Z.primitiveLength++}})(e,i,a,s,h,r),w&&function(S,M,L,k,A,F){let N=[];for(let ae=0;ae<k.length/2;ae++)N.push(-1);let H={count:0},V=0,Z=S.getOrCreateLatestSegment(M,L),Q=Z.vertexLength;for(let ae=0;ae<A.length;ae++){let de=A[ae];for(let we=1;we<A[ae].length;we+=2){let Se=de[we-1],Ie=de[we],Be=N[Se]<V,ze=N[Ie]<V;Z.vertexLength+((Be?1:0)+(ze?1:0))>ve.MAX_VERTEX_ARRAY_LENGTH&&(Z=S.createNewSegment(M,L),V=H.count,Be=!0,ze=!0,Q=0);let Ce=Pc(N,k,F,H,Se,Be,Z),be=Pc(N,k,F,H,Ie,ze,Z);L.emplaceBack(Q+Ce-V,Q+be-V),Z.primitiveLength++}}}(u,i,f,s,g,r),e.forceNewSegmentOnNextPrepare(),u==null||u.forceNewSegmentOnNextPrepare()}function Pc(r,e,i,a,s,h,u){if(h){let f=a.count;return i(e[2*s],e[2*s+1]),r[s]=a.count,a.count++,u.vertexLength++,f}return r[s]}class tp{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 W,this.indexArray=new pe,this.indexArray2=new ge,this.programConfigurations=new da(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,a){this.hasDependencies=ku("fill",this.layers,i);let s=this.layers[0].layout.get("fill-sort-key"),h=!s.isConstant(),u=[];for(let{feature:f,id:g,index:x,sourceLayerIndex:w}of e){let S=this.layers[0]._featureFilter.needGeometry,M=Fn(f,S);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),M,a))continue;let L=h?s.evaluate(M,{},a,i.availableImages):void 0,k={id:g,properties:f.properties,type:f.type,sourceLayerIndex:w,index:x,geometry:S?M.geometry:ur(f),patterns:{},sortKey:L};u.push(k)}h&&u.sort((f,g)=>f.sortKey-g.sortKey);for(let f of u){let{geometry:g,index:x,sourceLayerIndex:w}=f;if(this.hasDependencies){let S=Jd("fill",this.layers,f,{zoom:this.zoom},i);this.patternFeatures.push(S)}else this.addFeature(f,g,x,a,{},i.subdivisionGranularity);i.featureIndex.insert(e[x].feature,g,x,w,this.index)}}update(e,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:a})}addFeatures(e,i,a){for(let s of this.patternFeatures)this.addFeature(s,s.geometry,s.index,i,a,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,t_),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,a,s,h,u){for(let f of To(i,500)){let g=Df(f,s,u.fill.getGranularityForZoomLevel(s.z)),x=this.layoutVertexArray;Rf((w,S)=>{x.emplaceBack(w,S)},this.segments,this.layoutVertexArray,this.indexArray,g.verticesFlattened,g.indicesTriangles,this.segments2,this.indexArray2,g.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:h,canonical:s})}}let Ff,Of;Ue("FillBucket",tp,{omit:["layers","patternFeatures"]});var p_={get paint(){return Of=Of||new Vi({"fill-antialias":new We(ie.paint_fill["fill-antialias"]),"fill-opacity":new et(ie.paint_fill["fill-opacity"]),"fill-color":new et(ie.paint_fill["fill-color"]),"fill-outline-color":new et(ie.paint_fill["fill-outline-color"]),"fill-translate":new We(ie.paint_fill["fill-translate"]),"fill-translate-anchor":new We(ie.paint_fill["fill-translate-anchor"]),"fill-pattern":new Rn(ie.paint_fill["fill-pattern"])})},get layout(){return Ff=Ff||new Vi({"fill-sort-key":new et(ie.layout_fill["fill-sort-key"])})}};class f_ extends Dr{constructor(e,i){super(e,p_,i)}recalculate(e,i){super.recalculate(e,i);let a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new tp(e)}queryRadius(){return Cu(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:a,pixelsToTileUnits:s}){return pf(Eu(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-a.bearingInRadians,s),i)}isTileClipped(){return!0}}let m_=ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),g_=ti([{name:"a_centroid",components:2,type:"Int16"}],4),{members:y_}=m_;class Ic{constructor(e,i,a,s,h){this.properties={},this.extent=a,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=s,this._values=h,e.readFields(__,this,i)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,a=[],s,h=1,u=0,f=0,g=0;for(;e.pos<i;){if(u<=0){let x=e.readVarint();h=7&x,u=x>>3}if(u--,h===1||h===2)f+=e.readSVarint(),g+=e.readSVarint(),h===1&&(s&&a.push(s),s=[]),s&&s.push(new U(f,g));else{if(h!==7)throw new Error(`unknown command ${h}`);s&&s.push(s[0].clone())}}return s&&a.push(s),a}bbox(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,a=1,s=0,h=0,u=0,f=1/0,g=-1/0,x=1/0,w=-1/0;for(;e.pos<i;){if(s<=0){let S=e.readVarint();a=7&S,s=S>>3}if(s--,a===1||a===2)h+=e.readSVarint(),u+=e.readSVarint(),h<f&&(f=h),h>g&&(g=h),u<x&&(x=u),u>w&&(w=u);else if(a!==7)throw new Error(`unknown command ${a}`)}return[f,x,g,w]}toGeoJSON(e,i,a){let s=this.extent*Math.pow(2,a),h=this.extent*e,u=this.extent*i,f=this.loadGeometry();function g(M){return[360*(M.x+h)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(M.y+u)/s)*Math.PI))-90]}function x(M){return M.map(g)}let w;if(this.type===1){let M=[];for(let k of f)M.push(k[0]);let L=x(M);w=M.length===1?{type:"Point",coordinates:L[0]}:{type:"MultiPoint",coordinates:L}}else if(this.type===2){let M=f.map(x);w=M.length===1?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}}else{if(this.type!==3)throw new Error("unknown feature type");{let M=Bf(f),L=[];for(let k of M)L.push(k.map(x));w=L.length===1?{type:"Polygon",coordinates:L[0]}:{type:"MultiPolygon",coordinates:L}}}let S={type:"Feature",geometry:w,properties:this.properties};return this.id!=null&&(S.id=this.id),S}}function __(r,e,i){r===1?e.id=i.readVarint():r===2?function(a,s){let h=a.readVarint()+a.pos;for(;a.pos<h;){let u=s._keys[a.readVarint()],f=s._values[a.readVarint()];s.properties[u]=f}}(i,e):r===3?e.type=i.readVarint():r===4&&(e._geometry=i.pos)}function Bf(r){let e=r.length;if(e<=1)return[r];let i=[],a,s;for(let h=0;h<e;h++){let u=x_(r[h]);u!==0&&(s===void 0&&(s=u<0),s===u<0?(a&&i.push(a),a=[r[h]]):a&&a.push(r[h]))}return a&&i.push(a),i}function x_(r){let e=0;for(let i,a,s=0,h=r.length,u=h-1;s<h;u=s++)i=r[s],a=r[u],e+=(a.x-i.x)*(i.y+a.y);return e}Ic.types=["Unknown","Point","LineString","Polygon"];class v_{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(b_,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 Ic(this._pbf,i,this.extent,this._keys,this._values)}}function b_(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(a){let s=null,h=a.readVarint()+a.pos;for(;a.pos<h;){let u=a.readVarint()>>3;s=u===1?a.readString():u===2?a.readFloat():u===3?a.readDouble():u===4?a.readVarint64():u===5?a.readVarint():u===6?a.readSVarint():u===7?a.readBoolean():null}if(s==null)throw new Error("unknown feature value");return s}(i))}class jf{constructor(e,i){this.layers=e.readFields(w_,{},i)}}function w_(r,e,i){if(r===3){let a=new v_(i,i.readVarint()+i.pos);a.length&&(e[a.name]=a)}}let ip=Math.pow(2,13);function Mc(r,e,i,a,s,h,u,f){r.emplaceBack(e,i,2*Math.floor(a*ip)+u,s*ip*2,h*ip*2,Math.round(f))}class rp{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 $,this.centroidVertexArray=new B,this.indexArray=new pe,this.programConfigurations=new da(e.layers,e.zoom),this.segments=new ve,this.stateDependentLayerIds=this.layers.filter(i=>i.isStateDependent()).map(i=>i.id)}populate(e,i,a){this.features=[],this.hasDependencies=ku("fill-extrusion",this.layers,i);for(let{feature:s,id:h,index:u,sourceLayerIndex:f}of e){let g=this.layers[0]._featureFilter.needGeometry,x=Fn(s,g);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),x,a))continue;let w={id:h,sourceLayerIndex:f,index:u,geometry:g?x.geometry:ur(s),properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(Jd("fill-extrusion",this.layers,w,{zoom:this.zoom},i)):this.addFeature(w,w.geometry,u,a,{},i.subdivisionGranularity),i.featureIndex.insert(s,w.geometry,u,f,this.index,!0)}}addFeatures(e,i,a){for(let s of this.features){let{geometry:h}=s;this.addFeature(s,h,s.index,i,a,e.subdivisionGranularity)}}update(e,i,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:a})}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,y_),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,g_.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,a,s,h,u){for(let f of To(i,500)){let g={x:0,y:0,sampleCount:0},x=this.layoutVertexArray.length;this.processPolygon(g,s,e,f,u);let w=this.layoutVertexArray.length-x,S=Math.floor(g.x/g.sampleCount),M=Math.floor(g.y/g.sampleCount);for(let L=0;L<w;L++)this.centroidVertexArray.emplaceBack(S,M)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:h,canonical:s})}processPolygon(e,i,a,s,h){if(s.length<1||Vf(s[0]))return;for(let S of s)S.length!==0&&S_(e,S);let u={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},f=h.fill.getGranularityForZoomLevel(i.z),g=Ic.types[a.type]==="Polygon";for(let S of s){if(S.length===0||Vf(S))continue;let M=Qo(S,f,g);this._generateSideFaces(M,u)}if(!g)return;let x=Df(s,i,f,!1),w=this.layoutVertexArray;Rf((S,M)=>{Mc(w,S,M,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,x.verticesFlattened,x.indicesTriangles)}_generateSideFaces(e,i){let a=0;for(let s=1;s<e.length;s++){let h=e[s],u=e[s-1];if(T_(h,u))continue;i.segment.vertexLength+4>ve.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let f=h.sub(u)._perp()._unit(),g=u.dist(h);a+g>32768&&(a=0),Mc(this.layoutVertexArray,h.x,h.y,f.x,f.y,0,0,a),Mc(this.layoutVertexArray,h.x,h.y,f.x,f.y,0,1,a),a+=g,Mc(this.layoutVertexArray,u.x,u.y,f.x,f.y,0,0,a),Mc(this.layoutVertexArray,u.x,u.y,f.x,f.y,0,1,a);let x=i.segment.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function S_(r,e){for(let i=0;i<e.length;i++){let a=e[i];i===e.length-1&&e[0].x===a.x&&e[0].y===a.y||(r.x+=a.x,r.y+=a.y,r.sampleCount++)}}function T_(r,e){return r.x===e.x&&(r.x<0||r.x>bt)||r.y===e.y&&(r.y<0||r.y>bt)}function Vf(r){return r.every(e=>e.x<0)||r.every(e=>e.x>bt)||r.every(e=>e.y<0)||r.every(e=>e.y>bt)}let Nf;Ue("FillExtrusionBucket",rp,{omit:["layers","features"]});var P_={get paint(){return Nf=Nf||new Vi({"fill-extrusion-opacity":new We(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new et(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new We(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new We(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Rn(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new et(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new et(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new We(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class I_ extends Dr{constructor(e,i){super(e,P_,i)}createBucket(e){return new rp(e)}queryRadius(){return Cu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:a,geometry:s,transform:h,pixelsToTileUnits:u,pixelPosMatrix:f}){let g=Eu(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-h.bearingInRadians,u),x=this.paint.get("fill-extrusion-height").evaluate(i,a),w=this.paint.get("fill-extrusion-base").evaluate(i,a),S=function(L,k){let A=[];for(let F of L){let N=[F.x,F.y,0,1];Sn(N,N,k),A.push(new U(N[0]/N[3],N[1]/N[3]))}return A}(g,f),M=function(L,k,A,F){let N=[],H=[],V=F[8]*k,Z=F[9]*k,Q=F[10]*k,ae=F[11]*k,de=F[8]*A,we=F[9]*A,Se=F[10]*A,Ie=F[11]*A;for(let Be of L){let ze=[],Ce=[];for(let be of Be){let je=be.x,Ze=be.y,$e=F[0]*je+F[4]*Ze+F[12],Ne=F[1]*je+F[5]*Ze+F[13],dt=F[2]*je+F[6]*Ze+F[14],Mt=F[3]*je+F[7]*Ze+F[15],Gt=dt+Q,Fi=Mt+ae,$r=$e+de,Qi=Ne+we,Ii=dt+Se,Oi=Mt+Ie,ri=new U(($e+V)/Fi,(Ne+Z)/Fi);ri.z=Gt/Fi,ze.push(ri);let Mi=new U($r/Oi,Qi/Oi);Mi.z=Ii/Oi,Ce.push(Mi)}N.push(ze),H.push(Ce)}return[N,H]}(s,w,x,f);return function(L,k,A){let F=1/0;pf(A,k)&&(F=Uf(A,k[0]));for(let N=0;N<k.length;N++){let H=k[N],V=L[N];for(let Z=0;Z<H.length-1;Z++){let Q=H[Z],ae=[Q,H[Z+1],V[Z+1],V[Z],Q];_c(A,ae)&&(F=Math.min(F,Uf(A,ae)))}}return F!==1/0&&F}(M[0],M[1],S)}}function Lc(r,e){return r.x*e.x+r.y*e.y}function Uf(r,e){if(r.length===1){let i=0,a=e[i++],s;for(;!s||a.equals(s);)if(s=e[i++],!s)return 1/0;for(;i<e.length;i++){let h=e[i],u=r[0],f=s.sub(a),g=h.sub(a),x=u.sub(a),w=Lc(f,f),S=Lc(f,g),M=Lc(g,g),L=Lc(x,f),k=Lc(x,g),A=w*M-S*S,F=(M*L-S*k)/A,N=(w*k-S*L)/A,H=a.z*(1-F-N)+s.z*F+h.z*N;
2if(isFinite(H))return H}return 1/0}{let i=1/0;for(let a of e)i=Math.min(i,a.z);return i}}let M_=ti([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:L_}=M_,C_=ti([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:E_}=C_,k_=Math.cos(Math.PI/180*37.5),Gf=Math.pow(2,14)/.5;class np{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={},this.layers.forEach(i=>{this.gradients[i.id]={}}),this.layoutVertexArray=new Y,this.layoutVertexArray2=new ee,this.indexArray=new pe,this.programConfigurations=new da(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,a){this.hasDependencies=ku("line",this.layers,i)||this.hasLineDasharray(this.layers);let s=this.layers[0].layout.get("line-sort-key"),h=!s.isConstant(),u=[];for(let{feature:f,id:g,index:x,sourceLayerIndex:w}of e){let S=this.layers[0]._featureFilter.needGeometry,M=Fn(f,S);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),M,a))continue;let L=h?s.evaluate(M,{},a):void 0,k={id:g,properties:f.properties,type:f.type,sourceLayerIndex:w,index:x,geometry:S?M.geometry:ur(f),patterns:{},dashes:{},sortKey:L};u.push(k)}h&&u.sort((f,g)=>f.sortKey-g.sortKey);for(let f of u){let{geometry:g,index:x,sourceLayerIndex:w}=f;this.hasDependencies?(ku("line",this.layers,i)?Jd("line",this.layers,f,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,f,this.zoom,i),this.patternFeatures.push(f)):this.addFeature(f,g,x,a,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[x].feature,g,x,w,this.index)}}update(e,i,a,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:a,dashPositions:s})}addFeatures(e,i,a,s){for(let h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,i,a,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,E_)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,L_),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.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,i,a,s,h,u,f){let g=this.layers[0].layout,x=g.get("line-join").evaluate(e,{}),w=g.get("line-cap"),S=g.get("line-miter-limit"),M=g.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let L of i)this.addLine(L,e,x,w,S,M,s,f);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{imagePositions:h,dashPositions:u,canonical:s})}addLine(e,i,a,s,h,u,f,g){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=Qo(e,f?g.line.getGranularityForZoomLevel(f.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let V=0;V<e.length-1;V++)this.totalDistance+=e[V].dist(e[V+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let x=Ic.types[i.type]==="Polygon",w=e.length;for(;w>=2&&e[w-1].equals(e[w-2]);)w--;let S=0;for(;S<w-1&&e[S].equals(e[S+1]);)S++;if(w<(x?3:2))return;a==="bevel"&&(h=1.05);let M=this.overscaling<=16?122880/(512*this.overscaling):0,L=this.segments.prepareSegment(10*w,this.layoutVertexArray,this.indexArray),k,A,F,N,H;this.e1=this.e2=-1,x&&(k=e[w-2],H=e[S].sub(k)._unit()._perp());for(let V=S;V<w;V++){if(F=V===w-1?x?e[S+1]:void 0:e[V+1],F&&e[V].equals(F))continue;H&&(N=H),k&&(A=k),k=e[V],H=F?F.sub(k)._unit()._perp():N,N=N||H;let Z=N.add(H);Z.x===0&&Z.y===0||Z._unit();let Q=N.x*H.x+N.y*H.y,ae=Z.x*H.x+Z.y*H.y,de=ae!==0?1/ae:1/0,we=2*Math.sqrt(2-2*ae),Se=ae<k_&&A&&F,Ie=N.x*H.y-N.y*H.x>0;if(Se&&V>S){let Ce=k.dist(A);if(Ce>2*M){let be=k.sub(k.sub(A)._mult(M/Ce)._round());this.updateDistance(A,be),this.addCurrentVertex(be,N,0,0,L),A=be}}let Be=A&&F,ze=Be?a:x?"butt":s;if(Be&&ze==="round"&&(de<u?ze="miter":de<=2&&(ze="fakeround")),ze==="miter"&&de>h&&(ze="bevel"),ze==="bevel"&&(de>2&&(ze="flipbevel"),de<h&&(ze="miter")),A&&this.updateDistance(A,k),ze==="miter")Z._mult(de),this.addCurrentVertex(k,Z,0,0,L);else if(ze==="flipbevel"){if(de>100)Z=H.mult(-1);else{let Ce=de*N.add(H).mag()/N.sub(H).mag();Z._perp()._mult(Ce*(Ie?-1:1))}this.addCurrentVertex(k,Z,0,0,L),this.addCurrentVertex(k,Z.mult(-1),0,0,L)}else if(ze==="bevel"||ze==="fakeround"){let Ce=-Math.sqrt(de*de-1),be=Ie?Ce:0,je=Ie?0:Ce;if(A&&this.addCurrentVertex(k,N,be,je,L),ze==="fakeround"){let Ze=M
vendor: 27,441 bytes, line 2
2ath.round(180*we/Math.PI/20);for(let $e=1;$e<Ze;$e++){let Ne=$e/Ze;if(Ne!==.5){let Mt=Ne-.5;Ne+=Ne*Mt*(Ne-1)*((1.0904+Q*(Q*(3.55645-1.43519*Q)-3.2452))*Mt*Mt+(.848013+Q*(.215638*Q-1.06021)))}let dt=H.sub(N)._mult(Ne)._add(N)._unit()._mult(Ie?-1:1);this.addHalfVertex(k,dt.x,dt.y,!1,Ie,0,L)}}F&&this.addCurrentVertex(k,H,-be,-je,L)}else if(ze==="butt")this.addCurrentVertex(k,Z,0,0,L);else if(ze==="square"){let Ce=A?1:-1;this.addCurrentVertex(k,Z,Ce,Ce,L)}else ze==="round"&&(A&&(this.addCurrentVertex(k,N,0,0,L),this.addCurrentVertex(k,N,1,1,L,!0)),F&&(this.addCurrentVertex(k,H,-1,-1,L,!0),this.addCurrentVertex(k,H,0,0,L)));if(Se&&V<w-1){let Ce=k.dist(F);if(Ce>2*M){let be=k.add(F.sub(k)._mult(M/Ce)._round());this.updateDistance(k,be),this.addCurrentVertex(be,H,0,0,L),k=be}}}}addCurrentVertex(e,i,a,s,h,u=!1){let f=i.y*s-i.x,g=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*a,i.y-i.x*a,u,!1,a,h),this.addHalfVertex(e,f,g,u,!0,-s,h),this.distance>Gf/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,a,s,h,u))}addHalfVertex({x:e,y:i},a,s,h,u,f,g){let x=.5*(this.lineClips?this.scaledDistance*(Gf-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(i<<1)+(u?1:0),Math.round(63*a)+128,Math.round(63*s)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let w=g.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,w,this.e2),g.primitiveLength++),u?this.e2=w:this.e1=w}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 a=i.paint.get("line-dasharray");if(a&&!a.isConstant())return!0}return!1}addLineDashDependencies(e,i,a,s){for(let h of e){let u=h.paint.get("line-dasharray");if(!u||u.value.kind==="constant")continue;let f=h.layout.get("line-cap")==="round",g={dasharray:u.value.evaluate({zoom:a-1},i,{}),round:f},x={dasharray:u.value.evaluate({zoom:a},i,{}),round:f},w={dasharray:u.value.evaluate({zoom:a+1},i,{}),round:f},S=`${g.dasharray.join(",")},${g.round}`,M=`${x.dasharray.join(",")},${x.round}`,L=`${w.dasharray.join(",")},${w.round}`;s.dashDependencies[S]=g,s.dashDependencies[M]=x,s.dashDependencies[L]=w,i.dashes[h.id]={min:S,mid:M,max:L}}}}let Zf,qf;Ue("LineBucket",np,{omit:["layers","patternFeatures"]});var $f={get paint(){return qf=qf||new Vi({"line-opacity":new et(ie.paint_line["line-opacity"]),"line-color":new et(ie.paint_line["line-color"]),"line-translate":new We(ie.paint_line["line-translate"]),"line-translate-anchor":new We(ie.paint_line["line-translate-anchor"]),"line-width":new et(ie.paint_line["line-width"]),"line-gap-width":new et(ie.paint_line["line-gap-width"]),"line-offset":new et(ie.paint_line["line-offset"]),"line-blur":new et(ie.paint_line["line-blur"]),"line-dasharray":new Rn(ie.paint_line["line-dasharray"]),"line-pattern":new Rn(ie.paint_line["line-pattern"]),"line-gradient":new qa(ie.paint_line["line-gradient"])})},get layout(){return Zf=Zf||new Vi({"line-cap":new We(ie.layout_line["line-cap"]),"line-join":new et(ie.layout_line["line-join"]),"line-miter-limit":new We(ie.layout_line["line-miter-limit"]),"line-round-limit":new We(ie.layout_line["line-round-limit"]),"line-sort-key":new et(ie.layout_line["line-sort-key"])})}};class z_ extends et{possiblyEvaluate(e,i){return i=new Et(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,a,s){return i=Wi({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,a,s)}}let Ru;class A_ extends Dr{constructor(e,i){super(e,$f,i),this.gradientVersion=0,Ru||(Ru=new z_($f.paint.properties["line-width"].specification),Ru.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let i=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(i)&&i._styleExpression.expression instanceof ta,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"]=Ru.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new np(e)}queryRadius(e){let i=e,a=Wf(tl("line-width",this,i),tl("line-gap-width",this,i)),s=tl("line-offset",this,i);return a/2+Math.abs(s)+Cu(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:a,geometry:s,transform:h,pixelsToTileUnits:u}){let f=Eu(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-h.bearingInRadians,u),g=u/2*Wf(this.paint.get("line-width").evaluate(i,a),this.paint.get("line-gap-width").evaluate(i,a)),x=this.paint.get("line-offset").evaluate(i,a);return x&&(s=function(w,S){let M=[];for(let L=0;L<w.length;L++){let k=Ny(w[L]),A=[];for(let F=0;F<k.length;F++){let N=k[F],H=k[F-1],V=k[F+1],Z=F===0?new U(0,0):N.sub(H)._unit()._perp(),Q=F===k.length-1?new U(0,0):V.sub(N)._unit()._perp(),ae=Z._add(Q)._unit(),de=ae.x*Q.x+ae.y*Q.y;de!==0&&ae._mult(1/de),A.push(ae._mult(S)._add(N))}M.push(A)}return M}(s,x*u)),function(w,S,M){for(let L=0;L<S.length;L++){let k=S[L];if(w.length>=3){for(let A=0;A<k.length;A++)if(el(w,k[A]))return!0}if(By(w,k,M))return!0}return!1}(f,s,g)}isTileClipped(){return!0}}function Wf(r,e){return e>0?e+2*r:r}let D_=ti([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),R_=ti([{name:"a_projected_pos",components:3,type:"Float32"}],4);ti([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let F_=ti([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ti([{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 Hf=ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),O_=ti([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function B_(r,e,i){return r.sections.forEach(a=>{a.text=function(s,h,u){let f=h.layout.get("text-transform").evaluate(u,{});return f==="uppercase"?s=s.toLocaleUpperCase():f==="lowercase"&&(s=s.toLocaleLowerCase()),un.applyArabicShaping&&(s=un.applyArabicShaping(s)),s}(a.text,e,i)}),r}ti([{name:"triangle",components:3,type:"Uint16"}]),ti([{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"}]),ti([{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"}]),ti([{type:"Float32",name:"offsetX"}]),ti([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ti([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var _i=24;let Cc={"!":"\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"},j_={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},V_={40:!0};function Xf(r,e,i,a,s,h){if("fontStack"in e){let u=i[e.fontStack],f=u&&u[r];return f?f.metrics.advance*e.scale+s:0}{let u=a[e.imageName];return u?u.displaySize[0]*e.scale*_i/h+s:0}}function Yf(r,e,i,a){let s=Math.pow(r-e,2);return a?r<e?s/2:2*s:s+Math.abs(i)*i}function N_(r,e,i){let a=0;return r===10&&(a-=1e4),i&&(a+=150),r!==40&&r!==65288||(a+=50),e!==41&&e!==65289||(a+=50),a}function Kf(r,e,i,a,s,h){let u=null,f=Yf(e,i,s,h);for(let g of a){let x=Yf(e-g.x,i,s,h)+g.badness;x<=f&&(u=g,f=x)}return{index:r,x:e,priorBreak:u,badness:f}}function Jf(r){return r?Jf(r.priorBreak).concat(r.index):[]}class al{constructor(e="",i=[],a=[]){this.text=e,this.sections=i,this.sectionIndex=a,this.imageSectionID=null}static fromFeature(e,i){let a=new al;for(let s=0;s<e.sections.length;s++){let h=e.sections[s];h.image?a.addImageSection(h):a.addTextSection(h,i)}return a}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="",a={premature:!0,value:void 0},s=e[Symbol.iterator](),h=s.next(),u=e[Symbol.iterator]();u.next();let f=u.next();for(;!h.done;)i+=!f.done&&rc(f.value.codePointAt(0))&&!Cc[f.value]||!a.premature&&rc(a.value.codePointAt(0))&&!Cc[a.value]||!Cc[h.value]?h.value:Cc[h.value],a={value:h.value,premature:!1},h=s.next(),f=u.next();return i}(this.text)}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.text.match(/^\s*/),i=e?e[0].length:0,a=this.text.match(/\S\s*$/),s=a?a[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 a=[...this.text].slice(e,i).join(""),s=this.sectionIndex.slice(e,i);return new al(a,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,a=0;for(let s=0;s<this.length();s++){let h=this.getSection(s);if("imageName"in h){let u=e[h.imageName];if(!u)continue;let f=u.displaySize;i=Math.max(i,f[0]),a=Math.max(a,f[1])}}return{maxImageWidth:i,maxImageHeight:a}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});let a=this.sections.length-1;this.sectionIndex.push(...[...e.text].map(()=>a))}addImageSection(e){let i=e.image?e.image.name:"";if(i.length===0)return void ki("Can't add FormattedSection with an empty image.");let a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):ki("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,a,s,h){let u=[],f=this.determineAverageLineWidth(e,i,a,s,h),g=this.hasZeroWidthSpaces(),x=0,w=0,S=this.text[Symbol.iterator](),M=S.next(),L=this.text[Symbol.iterator]();L.next();let k=L.next(),A=this.text[Symbol.iterator]();A.next(),A.next();let F=A.next();for(;!M.done;){let N=this.getSection(w),H=M.value.codePointAt(0);if(mu(H)||(x+=Xf(H,N,a,s,e,h)),!k.done){let V=Nd(H),Z=k.value.codePointAt(0);(j_[H]||V||"imageName"in N||!F.done&&V_[Z])&&u.push(Kf(w+1,x,f,u,N_(H,Z,V&&g),!1))}w++,M=S.next(),k=L.next(),F=A.next()}return Jf(Kf(this.length(),x,f,u,0,!0))}determineAverageLineWidth(e,i,a,s,h){let u=0,f=0;for(let g of this.text){let x=this.getSection(f);u+=Xf(g.codePointAt(0),x,a,s,e,h),f++}return u/Math.max(1,Math.ceil(u/i))}}let ap=4294967296,Qf=1/ap,em=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class Fu{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,a=this.length){for(;this.pos<a;){let s=this.readVarint(),h=s>>3,u=this.pos;this.type=7&s,e(h,i,this),this.pos===u&&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)*ap;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*ap;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,a,s;return s=i[this.pos++],a=127&s,s<128?a:(s=i[this.pos++],a|=(127&s)<<7,s<128?a:(s=i[this.pos++],a|=(127&s)<<14,s<128?a:(s=i[this.pos++],a|=(127&s)<<21,s<128?a:(s=i[this.pos],a|=(15&s)<<28,function(h,u,f){let g=f.buf,x,w;if(w=g[f.pos++],x=(112&w)>>4,w<128||(w=g[f.pos++],x|=(127&w)<<3,w<128)||(w=g[f.pos++],x|=(127&w)<<10,w<128)||(w=g[f.pos++],x|=(127&w)<<17,w<128)||(w=g[f.pos++],x|=(127&w)<<24,w<128)||(w=g[f.pos++],x|=(1&w)<<31,w<128))return ol(h,x,u);throw new Error("Expected varint not more than 10 bytes")}(a,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&&em?em.decode(this.buf.subarray(i,e)):function(a,s,h){let u="",f=s;for(;f<h;){let g=a[f],x,w,S,M=null,L=g>239?4:g>223?3:g>191?2:1;if(f+L>h)break;L===1?g<128&&(M=g):L===2?(x=a[f+1],(192&x)==128&&(M=(31&g)<<6|63&x,M<=127&&(M=null))):L===3?(x=a[f+1],w=a[f+2],(192&x)==128&&(192&w)==128&&(M=(15&g)<<12|(63&x)<<6|63&w,(M<=2047||M>=55296&&M<=57343)&&(M=null))):L===4&&(x=a[f+1],w=a[f+2],S=a[f+3],(192&x)==128&&(192&w)==128&&(192&S)==128&&(M=(15&g)<<18|(63&x)<<12|(63&w)<<6|63&S,(M<=65535||M>=1114112)&&(M=null))),M===null?(M=65533,L=1):M>65535&&(M-=65536,u+=String.fromCharCode(M>>>10&1023|55296),M=56320|1023&M),u+=String.fromCharCode(M),f+=L}return u}(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 a=this.readPackedEnd();for(;this.pos<a;)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 a=new Uint8Array(i);a.set(this.buf),this.buf=a,this.dataView=new DataView(a.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*Qf),!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*Qf),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(i,a){let s,h;if(i>=0?(s=i%4294967296|0,h=i/4294967296|0):(s=~(-i%4294967296),h=~(-i/4294967296),4294967295^s?s=s+1|0:(s=0,h=h+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");a.realloc(10),function(u,f,g){g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,u>>>=7,g.buf[g.pos++]=127&u|128,g.buf[g.pos]=127&(u>>>=7)}(s,0,a),function(u,f){let g=(7&u)<<4;f.buf[f.pos++]|=g|((u>>>=3)?128:0),u&&(f.buf[f.pos++]=127&u|((u>>>=7)?128:0),u&&(f.buf[f.pos++]=127&u|((u>>>=7)?128:0),u&&(f.buf[f.pos++]=127&u|((u>>>=7)?128:0),u&&(f.buf[f.pos++]=127&u|((u>>>=7)?128:0),u&&(f.buf[f.pos++]=127&u)))))}(h,a)}(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,h,u){for(let f,g,x=0;x<h.length;x++){if(f=h.charCodeAt(x),f>55295&&f<57344){if(!g){f>56319||x+1===h.length?(s[u++]=239,s[u++]=191,s[u++]=189):g=f;continue}if(f<56320){s[u++]=239,s[u++]=191,s[u++]=189,g=f;continue}f=g-55296<<10|f-56320|65536,g=null}else g&&(s[u++]=239,s[u++]=191,s[u++]=189,g=null);f<128?s[u++]=f:(f<2048?s[u++]=f>>6|192:(f<65536?s[u++]=f>>12|224:(s[u++]=f>>18|240,s[u++]=f>>12&63|128),s[u++]=f>>6&63|128),s[u++]=63&f|128)}return u}(this.buf,e,this.pos);let a=this.pos-i;a>=128&&tm(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a}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 a=0;a<i;a++)this.buf[this.pos++]=e[a]}writeRawMessage(e,i){this.pos++;let a=this.pos;e(i,this);let s=this.pos-a;s>=128&&tm(a,s,this),this.pos=a-1,this.writeVarint(s),this.pos+=s}writeMessage(e,i,a){this.writeTag(e,2),this.writeRawMessage(i,a)}writePackedVarint(e,i){i.length&&this.writeMessage(e,U_,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,G_,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,$_,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,Z_,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,q_,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,W_,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,H_,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,X_,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,Y_,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 ol(r,e,i){return i?4294967296*e+(r>>>0):4294967296*(e>>>0)+(r>>>0)}function tm(r,e,i){let a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(a);for(let s=i.pos-1;s>=r;s--)i.buf[s+a]=i.buf[s]}function U_(r,e){for(let i=0;i<r.length;i++)e.writeVarint(r[i])}function G_(r,e){for(let i=0;i<r.length;i++)e.writeSVarint(r[i])}function Z_(r,e){for(let i=0;i<r.length;i++)e.writeFloat(r[i])}function q_(r,e){for(let i=0;i<r.length;i++)e.writeDouble(r[i])}function $_(r,e){for(let i=0;i<r.length;i++)e.writeBoolean(r[i])}function W_(r,e){for(let i=0;i<r.length;i++)e.writeFixed32(r[i])}function H_(r,e){for(let i=0;i<r.length;i++)e.writeSFixed32(r[i])}function X_(r,e){for(let i=0;i<r.length;i++)e.writeFixed64(r[i])}function Y_(r,e){for(let i=0;i<r.length;i++)e.writeSFixed64(r[i])}function K_(r,e,i){r===1&&i.readMessage(J_,e)}function J_(r,e,i){if(r===3){let{id:a,bitmap:s,width:h,height:u,left:f,top:g,advance:x}=i.readMessage(Q_,{});e.push({id:a,bitmap:new xc({width:h+6,height:u+6},s),metrics:{width:h,height:u,left:f,top:g,advance:x}})}}function Q_(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 im(r){let e=0,i=0;for(let u of r)e+=u.w*u.h,i=Math.max(i,u.w);r.sort((u,f)=>f.h-u.h);let a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],s=0,h=0;for(let u of r)for(let f=a.length-1;f>=0;f--){let g=a[f];if(!(u.w>g.w||u.h>g.h)){if(u.x=g.x,u.y=g.y,h=Math.max(h,u.y+u.h),s=Math.max(s,u.x+u.w),u.w===g.w&&u.h===g.h){let x=a.pop();x&&f<a.length&&(a[f]=x)}else u.h===g.h?(g.x+=u.w,g.w-=u.w):u.w===g.w?(g.y+=u.h,g.h-=u.h):(a.push({x:g.x+u.w,y:g.y,w:g.w-u.w,h:u.h}),g.y+=u.h,g.h-=u.h);break}}return{w:s,h,fill:e/(s*h)||0}}class op{constructor(e,{pixelRatio:i,version:a,stretchX:s,stretchY:h,content:u,textFitWidth:f,textFitHeight:g}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=s,this.stretchY=h,this.content=u,this.version=a,this.textFitWidth=f,this.textFitHeight=g}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 rm{constructor(e,i){let a={},s={};this.haveRenderCallbacks=[];let h=[];this.addImages(e,a,h),this.addImages(i,s,h);let{w:u,h:f}=im(h),g=new dr({width:u||1,height:f||1});for(let x in e){let w=e[x],S=a[x].paddedRect;dr.copy(w.data,g,{x:0,y:0},{x:S.x+1,y:S.y+1},w.data)}for(let x in i){let w=i[x],S=s[x].paddedRect,M=S.x+1,L=S.y+1,k=w.data.width,A=w.data.height;dr.copy(w.data,g,{x:0,y:0},{x:M,y:L},w.data),dr.copy(w.data,g,{x:0,y:A-1},{x:M,y:L-1},{width:k,height:1}),dr.copy(w.data,g,{x:0,y:0},{x:M,y:L+A},{width:k,height:1}),dr.copy(w.data,g,{x:k-1,y:0},{x:M-1,y:L},{width:1,height:A}),dr.copy(w.data,g,{x:0,y:0},{x:M+k,y:L},{width:1,height:A})}this.image=g,this.iconPositions=a,this.patternPositions=s}addImages(e,i,a){for(let s in e){let h=e[s],u={x:0,y:0,w:h.data.width+2,h:h.data.height+2};a.push(u),i[s]=new op(u,h),h.hasRenderCallback&&this.haveRenderCallbacks.push(s)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),i),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),i)}patchUpdatedImage(e,i,a){if(!e||!i||e.version===i.version)return;e.version=i.version;let[s,h]=e.tl;a.update(i.data,void 0,{x:s,y:h})}}var Xa;function Ou(r,e,i,a,s,h,u,f,g,x,w,S,M,L,k){let A=al.fromFeature(r,s),F;S===b.az.vertical&&A.verticalizePunctuation();let N=A.determineLineBreaks(x,h,e,a,L),{processBidirectionalText:H,processStyledBidirectionalText:V}=un;if(H&&A.sections.length===1){F=[],N=N.map(de=>A.toCodeUnitIndex(de));let ae=H(A.toString(),N);for(let de of ae){let we=[...de].map(()=>0);F.push(new al(de,A.sections,we))}}else if(V){F=[],N=N.map(Se=>A.toCodeUnitIndex(Se));let ae=0,de=[];for(let Se of A.text)de.push(...Array(Se.length).fill(A.sectionIndex[ae])),ae++;let we=V(A.text,de,N);for(let Se of we){let Ie=[],Be="";for(let ze of Se[0])Ie.push(Se[1][Be.length]),Be+=ze;F.push(new al(Se[0],A.sections,Ie))}}else F=function(ae,de){let we=[],Se=0;for(let Ie of de)we.push(ae.substring(Se,Ie)),Se=Ie;return Se<ae.length()&&we.push(ae.substring(Se,ae.length())),we}(A,N);let Z=[],Q={positionedLines:Z,text:A.toString(),top:w[1],bottom:w[1],left:w[0],right:w[0],writingMode:S,iconsInText:!1,verticalizable:!1};return function(ae,de,we,Se,Ie,Be,ze,Ce,be,je,Ze,$e){let Ne=0,dt=0,Mt=0,Gt=0,Fi=Ce==="right"?1:Ce==="left"?0:.5,$r=_i/$e,Qi=0;for(let ri of Ie){ri.trim();let Mi=ri.getMaxScale(),Zi={positionedGlyphs:[],lineOffset:0};ae.positionedLines[Qi]=Zi;let qi=Zi.positionedGlyphs,pr=0;if(!ri.length()){dt+=Be,++Qi;continue}let Bi=e0(Se,ri,$r),fr=0;for(let vi of ri.text){let $t=ri.getSection(fr),hi=vi.codePointAt(0),Kt=t0(be,Ze,hi),bi={glyph:hi,imageName:null,x:Ne,y:dt+-17,vertical:Kt,scale:1,fontStack:"",sectionIndex:ri.getSectionIndex(fr),metrics:null,rect:null},fa;
2if("fontStack"in $t){if(fa=i0($t,hi,Kt,Bi,de,we),!fa)continue;bi.fontStack=$t.fontStack}else{if(ae.iconsInText=!0,$t.scale*=$r,fa=r0($t,Kt,Mi,Bi,Se),!fa)continue;pr=Math.max(pr,fa.imageOffset),bi.imageName=$t.imageName}let{rect:yn,metrics:Fc,baselineOffset:to}=fa;bi.y+=to,bi.scale=$t.scale,bi.metrics=Fc,bi.rect=yn,qi.push(bi),Kt?(ae.verticalizable=!0,Ne+=("imageName"in $t?Fc.advance:_i)*$t.scale+je):Ne+=Fc.advance*$t.scale+je,fr++}qi.length!==0&&(Mt=Math.max(Ne-je,Mt),n0(qi,0,qi.length-1,Fi)),Ne=0,Zi.lineOffset=Math.max(pr,(Mi-1)*_i);let Wr=Be*Mi+pr;dt+=Wr,Gt=Math.max(Wr,Gt),++Qi}let{horizontalAlign:Ii,verticalAlign:Oi}=sp(ze);(function(ri,Mi,Zi,qi,pr,Bi,fr,Wr,vi){let $t=(Mi-Zi)*pr,hi=0;hi=Bi!==fr?-Wr*qi- -17:-qi*vi*fr+.5*fr;for(let Kt of ri)for(let bi of Kt.positionedGlyphs)bi.x+=$t,bi.y+=hi})(ae.positionedLines,Fi,Ii,Oi,Mt,Gt,Be,dt,Ie.length),ae.top+=-Oi*dt,ae.bottom=ae.top+dt,ae.left+=-Ii*Mt,ae.right=ae.left+Mt}(Q,e,i,a,F,u,f,g,S,x,M,k),!function(ae){for(let de of ae)if(de.positionedGlyphs.length!==0)return!1;return!0}(Z)&&Q}function sp(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 e0(r,e,i){let a=e.getMaxScale()*_i,{maxImageWidth:s,maxImageHeight:h}=e.getMaxImageSize(r),u=Math.max(a,h*i);return{verticalLineContentWidth:Math.max(a,s*i),horizontalLineContentHeight:u}}function nm(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function t0(r,e,i){return!(r===b.az.horizontal||!e&&!ca(i)||e&&(mu(i)||(a=i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(a)))));var a}function i0(r,e,i,a,s,h){let u=h[r.fontStack],f=function(x,w,S,M){if(x&&x.rect)return x;let L=w[S.fontStack],k=L&&L[M];return k?{rect:null,metrics:k.metrics}:null}(u&&u[e],s,r,e);if(f===null)return null;let g;if(i)g=a.verticalLineContentWidth-r.scale*_i;else{let x=nm(r.verticalAlign);g=(a.horizontalLineContentHeight-r.scale*_i)*x}return{rect:f.rect,metrics:f.metrics,baselineOffset:g}}function r0(r,e,i,a,s){let h=s[r.imageName];if(!h)return null;let u=h.paddedRect,f=h.displaySize,g={width:f[0],height:f[1],left:1,top:-3,advance:e?f[1]:f[0]},x;if(e)x=a.verticalLineContentWidth-f[1]*r.scale;else{let w=nm(r.verticalAlign);x=(a.horizontalLineContentHeight-f[1]*r.scale)*w}return{rect:u,metrics:g,baselineOffset:x,imageOffset:(e?f[0]:f[1])*r.scale-_i*i}}function n0(r,e,i,a){if(a===0)return;let s=r[i],h=(r[i].x+s.metrics.advance*s.scale)*a;for(let u=e;u<=i;u++)r[u].x-=h}function a0(r,e,i){let{horizontalAlign:a,verticalAlign:s}=sp(i),h=e[0]-r.displaySize[0]*a,u=e[1]-r.displaySize[1]*s;return{image:r,top:u,bottom:u+r.displaySize[1],left:h,right:h+r.displaySize[0]}}function am(r){var e,i;let a=r.left,s=r.top,h=r.right-a,u=r.bottom-s,f=(e=r.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",g=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",x=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(g==="proportional"){if(f==="stretchOnly"&&h/u<x||f==="proportional"){let w=Math.ceil(u*x);a*=w/h,h=w}}else if(f==="proportional"&&g==="stretchOnly"&&x!==0&&h/u>x){let w=Math.ceil(h/x);s*=w/u,u=w}return{x1:a,y1:s,x2:a+h,y2:s+u}}function om(r,e,i,a,s,h){let u=r.image,f;if(u.content){let F=u.content,N=u.pixelRatio||1;f=[F[0]/N,F[1]/N,u.displaySize[0]-F[2]/N,u.displaySize[1]-F[3]/N]}let g=e.left*h,x=e.right*h,w,S,M,L;i==="width"||i==="both"?(L=s[0]+g-a[3],S=s[0]+x+a[1]):(L=s[0]+(g+x-u.displaySize[0])/2,S=L+u.displaySize[0]);let k=e.top*h,A=e.bottom*h;return i==="height"||i==="both"?(w=s[1]+k-a[0],M=s[1]+A+a[2]):(w=s[1]+(k+A-u.displaySize[1])/2,M=w+u.displaySize[1]),{image:u,top:w,right:S,bottom:M,left:L,collisionPadding:f}}Ue("ImagePosition",op),Ue("ImageAtlas",rm),b.az=void 0,(Xa=b.az||(b.az={}))[Xa.none=0]="none",Xa[Xa.horizontal=1]="horizontal",Xa[Xa.vertical=2]="vertical",Xa[Xa.horizontalOnly=3]="horizontalOnly";let pa=128,Ya=32640;function sm(r,e){let{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Et(r+1))};if(i.kind==="source")return{kind:"source"};{let{zoomStops:a,interpolationType:s}=i,h=0;for(;h<a.length&&a[h]<=r;)h++;h=Math.max(0,h-1);let u=h;for(;u<a.length&&a[u]<r+1;)u++;u=Math.min(a.length-1,u);
vendor: 12,579 bytes, line 2
2let f=a[h],g=a[u];return i.kind==="composite"?{kind:"composite",minZoom:f,maxZoom:g,interpolationType:s}:{kind:"camera",minZoom:f,maxZoom:g,minSize:i.evaluate(new Et(f)),maxSize:i.evaluate(new Et(g)),interpolationType:s}}}function lp(r,e,i){let a="never",s=r.get(e);return s?a=s:r.get(i)&&(a="always"),a}let o0=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Bu(r,e,i,a,s,h,u,f,g,x,w,S,M){let L=f?Math.min(Ya,Math.round(f[0])):0,k=f?Math.min(Ya,Math.round(f[1])):0;r.emplaceBack(e,i,Math.round(32*a),Math.round(32*s),h,u,(L<<1)+(g?1:0),k,16*x,16*w,256*S,256*M)}function cp(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 s0(r){for(let e of r.sections)if(ac(e.text))return!0;return!1}class hp{constructor(e){this.layoutVertexArray=new ne,this.indexArray=new pe,this.programConfigurations=e,this.segments=new ve,this.dynamicLayoutVertexArray=new J,this.opacityVertexArray=new se,this.hasVisibleVertices=!1,this.placedSymbolArray=new p}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,a,s){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,D_.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,R_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,o0,!0),this.opacityVertexBuffer.itemSize=1),(a||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())}}Ue("SymbolBuffers",hp);class up{constructor(e,i,a){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new a,this.segments=new ve,this.collisionVertexArray=new fe}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,F_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ue("CollisionBuffers",up);class sl{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.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=sm(this.zoom,i["text-size"]),this.iconSizeData=sm(this.zoom,i["icon-size"]);let a=this.layers[0].layout,s=a.get("symbol-sort-key"),h=a.get("symbol-z-order");this.canOverlap=lp(a,"text-overlap","text-allow-overlap")!=="never"||lp(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=h!=="viewport-y"&&!s.isConstant(),this.sortFeaturesByY=(h==="viewport-y"||h==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(u=>b.az[u])),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID}createArrays(){this.text=new hp(new da(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new hp(new da(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new v,this.lineVertexArray=new T,this.symbolInstances=new _,this.textAnchorOffsets=new E}calculateGlyphDependencies(e,i,a,s,h){for(let u of e)if(i[u.codePointAt(0)]=!0,(a||s)&&h){let f=Cc[u];f&&(i[f.codePointAt(0)]=!0)}}populate(e,i,a){let s=this.layers[0],h=s.layout,u=h.get("text-font"),f=h.get("text-field"),g=h.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof ir&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(u.value.kind!=="constant"||u.value.value.length>0),w=g.value.kind!=="constant"||!!g.value.value||Object.keys(g.parameters).length>0,S=h.get("symbol-sort-key");if(this.features=[],!x&&!w)return;let M=i.iconDependencies,L=i.glyphDependencies,k=i.availableImages,A=new Et(this.zoom);for(let{feature:F,id:N,index:H,sourceLayerIndex:V}of e){let Z=s._featureFilter.needGeometry,Q=Fn(F,Z);if(!s._featureFilter.filter(A,Q,a))continue;let ae,de;if(Z||(Q.geometry=ur(F)),x){let Se=s.getValueAndResolveTokens("text-field",Q,a,k),Ie=ir.factory(Se),Be=this.hasRTLText=this.hasRTLText||s0(Ie);(!Be||un.getRTLTextPluginStatus()==="unavailable"||Be&&un.isParsed())&&(ae=B_(Ie,s,Q))}if(w){let Se=s.getValueAndResolveTokens("icon-image",Q,a,k);de=Se instanceof rr?Se:rr.fromString(Se)}if(!ae&&!de)continue;let we=this.sortFeaturesByKey?S.evaluate(Q,{},a):void 0;if(this.features.push({id:N,text:ae,icon:de,index:H,sourceLayerIndex:V,geometry:Q.geometry,properties:F.properties,type:Ic.types[F.type],sortKey:we}),de&&(M[de.name]=!0),ae){let Se=u.evaluate(Q,{},a).join(","),Ie=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(b.az.vertical)>=0;for(let Be of ae.sections)if(Be.image)M[Be.image.name]=!0;else{let ze=tc(ae.toString()),Ce=Be.fontStack||Se,be=L[Ce]=L[Ce]||{};this.calculateGlyphDependencies(Be.text,be,Ie,this.allowVerticalPlacement,ze)}}}h.get("symbol-placement")==="line"&&(this.features=function(F){let N={},H={},V=[],Z=0;function Q(Se){V.push(F[Se]),Z++}function ae(Se,Ie,Be){let ze=H[Se];return delete H[Se],H[Ie]=ze,V[ze].geometry[0].pop(),V[ze].geometry[0]=V[ze].geometry[0].concat(Be[0]),ze}function de(Se,Ie,Be){let ze=N[Ie];return delete N[Ie],N[Se]=ze,V[ze].geometry[0].shift(),V[ze].geometry[0]=Be[0].concat(V[ze].geometry[0]),ze}function we(Se,Ie,Be){let ze=Be?Ie[0][Ie[0].length-1]:Ie[0][0];return`${Se}:${ze.x}:${ze.y}`}for(let Se=0;Se<F.length;Se++){let Ie=F[Se],Be=Ie.geometry,ze=Ie.text?Ie.text.toString():null;if(!ze){Q(Se);continue}let Ce=we(ze,Be),be=we(ze,Be,!0);if(Ce in H&&be in N&&H[Ce]!==N[be]){let je=de(Ce,be,Be),Ze=ae(Ce,be,V[je].geometry);delete N[Ce],delete H[be],H[we(ze,V[Ze].geometry,!0)]=Ze,V[je].geometry=null}else Ce in H?ae(Ce,be,Be):be in N?de(Ce,be,Be):(Q(Se),N[Ce]=Z-1,H[be]=Z-1)}return V.filter(Se=>Se.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((F,N)=>F.sortKey-N.sortKey)}update(e,i,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:a}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:a}))}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 a=this.lineVertexArray.length;if(e.segment!==void 0){let s=e.dist(i[e.segment+1]),h=e.dist(i[e.segment]),u={};for(let f=e.segment+1;f<i.length;f++)u[f]={x:i[f].x,y:i[f].y,tileUnitDistanceFromAnchor:s},f<i.length-1&&(s+=i[f+1].dist(i[f]));for(let f=e.segment||0;f>=0;f--)u[f]={x:i[f].x,y:i[f].y,tileUnitDistanceFromAnchor:h},f>0&&(h+=i[f-1].dist(i[f]));for(let f=0;f<i.length;f++){let g=u[f];this.lineVertexArray.emplaceBack(g.x,g.y,g.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,i,a,s,h,u,f,g,x,w,S,M){let L=e.indexArray,k=e.layoutVertexArray,A=e.segments.prepareSegment(4*i.length,k,L,this.canOverlap?u.sortKey:void 0),F=this.glyphOffsetArray.length,N=A.vertexLength,H=this.allowVerticalPlacement&&f===b.az.vertical?Math.PI/2:0,V=u.text&&u.text.sections;for(let Z=0;Z<i.length;Z++){let{tl:Q,tr:ae,bl:de,br:we,tex:Se,pixelOffsetTL:Ie,pixelOffsetBR:Be,minFontScaleX:ze,minFontScaleY:Ce,glyphOffset:be,isSDF:je,sectionIndex:Ze}=i[Z],$e=A.vertexLength,Ne=be[1];Bu(k,g.x,g.y,Q.x,Ne+Q.y,Se.x,Se.y,a,je,Ie.x,Ie.y,ze,Ce),Bu(k,g.x,g.y,ae.x,Ne+ae.y,Se.x+Se.w,Se.y,a,je,Be.x,Ie.y,ze,Ce),Bu(k,g.x,g.y,de.x,Ne+de.y,Se.x,Se.y+Se.h,a,je,Ie.x,Be.y,ze,Ce),Bu(k,g.x,g.y,we.x,Ne+we.y,Se.x+Se.w,Se.y+Se.h,a,je,Be.x,Be.y,ze,Ce),cp(e.dynamicLayoutVertexArray,g,H),L.emplaceBack($e,$e+2,$e+1),L.emplaceBack($e+1,$e+2,$e+3),A.vertexLength+=4,A.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(be[0]),Z!==i.length-1&&Ze===i[Z+1].sectionIndex||e.programConfigurations.populatePaintArrays(k.length,u,u.index,{imagePositions:{},canonical:M,formattedSection:V&&V[Ze]})}e.placedSymbolArray.emplaceBack(g.x,g.y,F,this.glyphOffsetArray.length-F,N,x,w,g.segment,a?a[0]:0,a?a[1]:0,s[0],s[1],f,0,!1,0,S)}_addCollisionDebugVertex(e,i,a,s,h,u){return i.emplaceBack(0,0),e.emplaceBack(a.x,a.y,s,h,Math.round(u.x),Math.round(u.y))}addCollisionDebugVertices(e,i,a,s,h,u,f){let g=h.segments.prepareSegment(4,h.layoutVertexArray,h.indexArray),x=g.vertexLength,w=h.layoutVertexArray,S=h.collisionVertexArray,M=f.anchorX,L=f.anchorY;this._addCollisionDebugVertex(w,S,u,M,L,new U(e,i)),this._addCollisionDebugVertex(w,S,u,M,L,new U(a,i)),this._addCollisionDebugVertex(w,S,u,M,L,new U(a,s)),this._addCollisionDebugVertex(w,S,u,M,L,new U(e,s)),g.vertexLength+=4;let k=h.indexArray;k.emplaceBack(x,x+1),k.emplaceBack(x+1,x+2),k.emplaceBack(x+2,x+3),k.emplaceBack(x+3,x),g.primitiveLength+=4}addDebugCollisionBoxes(e,i,a,s){for(let h=e;h<i;h++){let u=this.collisionBoxArray.get(h);this.addCollisionDebugVertices(u.x1,u.y1,u.x2,u.y2,s?this.textCollisionBox:this.iconCollisionBox,u.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new up(ye,Hf.members,ge),this.iconCollisionBox=new up(ye,Hf.members,ge);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,a,s,h,u,f,g,x){let w={};for(let S=i;S<a;S++){let M=e.get(S);w.textBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},w.textFeatureIndex=M.featureIndex;break}for(let S=s;S<h;S++){let M=e.get(S);w.verticalTextBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},w.verticalTextFeatureIndex=M.featureIndex;break}for(let S=u;S<f;S++){let M=e.get(S);w.iconBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},w.iconFeatureIndex=M.featureIndex;break}for(let S=g;S<x;S++){let M=e.get(S);w.verticalIconBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},w.verticalIconFeatureIndex=M.featureIndex;break}return w}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){let a=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.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 a=e.placedSymbolArray.get(i),s=a.vertexStartIndex+4*a.numGlyphs;for(let h=a.vertexStartIndex;h<s;h+=4)e.indexArray.emplaceBack(h,h+2,h+1),e.indexArray.emplaceBack(h+1,h+2,h+3)}
vendor: 6,256 bytes, line 2
2getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let i=Math.sin(e),a=Math.cos(e),s=[],h=[],u=[];for(let f=0;f<this.symbolInstances.length;++f){u.push(f);let g=this.symbolInstances.get(f);s.push(0|Math.round(i*g.anchorX+a*g.anchorY)),h.push(g.featureIndex)}return u.sort((f,g)=>s[f]-s[g]||h[g]-h[f]),u}addToSortKeyRanges(e,i){let a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===i?a.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 a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((s,h,u)=>{s>=0&&u.indexOf(s)===h&&this.addIndicesForPlacedSymbol(this.text,s)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let lm,cm;Ue("SymbolBucket",sl,{omit:["layers","collisionBoxArray","features","compareText"]}),sl.MAX_GLYPHS=65535,sl.addDynamicAttributes=cp;var dp={get paint(){return cm=cm||new Vi({"icon-opacity":new et(ie.paint_symbol["icon-opacity"]),"icon-color":new et(ie.paint_symbol["icon-color"]),"icon-halo-color":new et(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new et(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new et(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new We(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new We(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new et(ie.paint_symbol["text-opacity"]),"text-color":new et(ie.paint_symbol["text-color"],{runtimeType:_r,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new et(ie.paint_symbol["text-halo-color"]),"text-halo-width":new et(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new et(ie.paint_symbol["text-halo-blur"]),"text-translate":new We(ie.paint_symbol["text-translate"]),"text-translate-anchor":new We(ie.paint_symbol["text-translate-anchor"])})},get layout(){return lm=lm||new Vi({"symbol-placement":new We(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new We(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new We(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new et(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new We(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new We(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new We(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new We(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new We(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new We(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new et(ie.layout_symbol["icon-size"]),"icon-text-fit":new We(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new We(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new et(ie.layout_symbol["icon-image"]),"icon-rotate":new et(ie.layout_symbol["icon-rotate"]),"icon-padding":new et(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new We(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new et(ie.layout_symbol["icon-offset"]),"icon-anchor":new et(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new We(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new We(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new We(ie.layout_symbol["text-rotation-alignment"]),"text-field":new et(ie.layout_symbol["text-field"]),"text-font":new et(ie.layout_symbol["text-font"]),"text-size":new et(ie.layout_symbol["text-size"]),"text-max-width":new et(ie.layout_symbol["text-max-width"]),"text-line-height":new We(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new et(ie.layout_symbol["text-letter-spacing"]),"text-justify":new et(ie.layout_symbol["text-justify"]),"text-radial-offset":new et(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new We(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new et(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new et(ie.layout_symbol["text-anchor"]),"text-max-angle":new We(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new We(ie.layout_symbol["text-writing-mode"]),"text-rotate":new et(ie.layout_symbol["text-rotate"]),"text-padding":new We(ie.layout_symbol["text-padding"]),"text-keep-upright":new We(ie.layout_symbol["text-keep-upright"]),"text-transform":new et(ie.layout_symbol["text-transform"]),"text-offset":new et(ie.layout_symbol["text-offset"]),"text-allow-overlap":new We(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new We(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new We(ie.layout_symbol["text-ignore-placement"]),"text-optional":new We(ie.layout_symbol["text-optional"])})}};class hm{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:tn,this.defaultValue=e}evaluate(e){if(e.formattedSection){let i=this.defaultValue.property.overrides;if(i&&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}}Ue("FormatSectionOverride",hm,{omit:["defaultValue"]});
2class ju extends Dr{constructor(e,i){super(e,dp,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 a=this.layout.get("text-writing-mode");if(a){let s=[];for(let h of a)s.indexOf(h)<0&&s.push(h);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,a,s){let h=this.layout.get(e).evaluate(i,{},a,s),u=this._unevaluatedLayout._values[e];return u.isDataDriven()||Rs(u.value)||!h?h:function(f,g){return g.replace(/{([^{}]+)}/g,(x,w)=>f&&w in f?String(f[w]):"")}(i.properties,h)}createBucket(e){return new sl(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of dp.paint.overridableProperties){if(!ju.hasPaintOverride(this.layout,e))continue;let i=this.paint.get(e),a=new hm(i),s=new Gl(a,i.property.specification),h=null;h=i.value.kind==="constant"||i.value.kind==="source"?new Fs("source",s):new Zl("composite",s,i.value.zoomStops),this.paint._values[e]=new Ar(i.property,h,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,a){return!(!this.layout||i.isDataDriven()||a.isDataDriven())&&ju.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){let a=e.get("text-field"),s=dp.paint.properties[i],h=!1,u=f=>{for(let g of f)if(s.overrides&&s.overrides.hasOverride(g))return void(h=!0)};if(a.value.kind==="constant"&&a.value.value instanceof ir)u(a.value.value.sections);else if(a.value.kind==="source"||a.value.kind==="composite"){let f=x=>{h||(x instanceof an&&Zt(x.value)===Ea?u(x.value.sections):x instanceof bs?u(x.sections):x.eachChild(f))},g=a.value;g._styleExpression&&f(g._styleExpression.expression)}return h}}let um;var l0={get paint(){return um=um||new Vi({"background-color":new We(ie.paint_background["background-color"]),"background-pattern":new bu(ie.paint_background["background-pattern"]),"background-opacity":new We(ie.paint_background["background-opacity"])})}};class c0 extends Dr{constructor(e,i){super(e,l0,i)}}class h0 extends Dr{constructor(e,i){super(e,{},i),this.onAdd=a=>{this.implementation.onAdd&&this.implementation.onAdd(a,a.painter.context.gl)},this.onRemove=a=>{this.implementation.onRemove&&this.implementation.onRemove(a,a.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 u0{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let d0={once:!0},pp=63710088e-1;class Ka{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 Ka(Ci(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,a=this.lat*i,s=e.lat*i,h=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return pp*Math.acos(Math.min(h,1))}static convert(e){if(e instanceof Ka)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ka(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Ka(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 dm=2*Math.PI*pp;function pm(r){return dm*Math.cos(r*Math.PI/180)}function fm(r){return(180+r)/360}function mm(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function gm(r,e){return r/pm(e)}function ym(r){return 360*r-180}function Vu(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180)
2)-90}function _m(r,e){return r*pm(Vu(e))}class Ec{constructor(e,i,a=0){this.x=+e,this.y=+i,this.z=+a}static fromLngLat(e,i=0){let a=Ka.convert(e);return new Ec(fm(a.lng),mm(a.lat),gm(i,a.lat))}toLngLat(){return new Ka(ym(this.x),Vu(this.y))}toAltitude(){return _m(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/dm*(e=Vu(this.y),1/Math.cos(e*Math.PI/180));var e}}function xm(r,e,i){var a=2*Math.PI*6378137/256/Math.pow(2,i);return[r*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class fp{constructor(e,i,a){if(!function(s,h,u){return!(s<0||s>25||u<0||u>=Math.pow(2,s)||h<0||h>=Math.pow(2,s))}(e,i,a))throw new Error(`x=${i}, y=${a}, 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=a,this.key=ll(0,e,e,i,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,a){let s=(u=this.y,f=this.z,g=xm(256*(h=this.x),256*(u=Math.pow(2,f)-u-1),f),x=xm(256*(h+1),256*(u+1),f),g[0]+","+g[1]+","+x[0]+","+x[1]);var h,u,f,g,x;let w=function(S,M,L){let k,A="";for(let F=S;F>0;F--)k=1<<F-1,A+=(M&k?1:0)+(L&k?2:0);return A}(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(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,w).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 U((e.x*i-this.x)*bt,(e.y*i-this.y)*bt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class vm{constructor(e,i){this.wrap=e,this.canonical=i,this.key=ll(e,i.z,i.z,i.x,i.y)}}class Tr{constructor(e,i,a,s,h){if(this.terrainRttPosMatrix32f=null,e<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=i,this.canonical=new fp(a,+s,+h),this.key=ll(i,e,a,s,h)}clone(){return new Tr(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 Tr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Tr(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 a=this.canonical.z-e;return e>this.canonical.z?ll(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):ll(this.wrap*+i,e,e,this.canonical.x>>a,this.canonical.y>>a)}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 Tr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,a=2*this.canonical.x,s=2*this.canonical.y;return[new Tr(i,this.wrap,i,a,s),new Tr(i,this.wrap,i,a+1,s),new Tr(i,this.wrap,i,a,s+1),new Tr(i,this.wrap,i,a+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 Tr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Tr(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 vm(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Ec(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,a=8192){if(e>=0&&e<a&&i>=0&&i<a)return{tileID:this,x:e,y:i};let s=Math.floor(e/a),h=Math.floor(i/a),u=e-s*a,f=i-h*a,g=this.canonical.z,x=1<<g,w=this.canonical.y+h;if(w<0||w>=x)return null;let S=this.canonical.x+s,M=this.wrap;return S<0?(M-=Math.ceil(-S/x),S=(S%x+x)%x):S>=x&&(M+=Math.floor(S/x),S%=x),{tileID:new Tr(this.overscaledZ,M,g,S,w),x:u,y:f}}}function ll(r,e,i,a,s){(r*=2)<0&&(r=-1*r-1);let h=1<<i;
2return(h*h*r+h*s+a).toString(36)+i.toString(36)+e.toString(36)}function mp(r,e){return e?r.properties[e]:r.id}function p0(r,e){let i={id:r.id};if(e.removeAllProperties&&(delete r.removeProperties,delete r.addOrUpdateProperties,delete e.removeProperties),e.removeProperties)for(let a of e.removeProperties){let s=r.addOrUpdateProperties.findIndex(h=>h.key===a);s>-1&&r.addOrUpdateProperties.splice(s,1)}return(r.removeAllProperties||e.removeAllProperties)&&(i.removeAllProperties=!0),(r.removeProperties||e.removeProperties)&&(i.removeProperties=[...r.removeProperties||[],...e.removeProperties||[]]),(r.addOrUpdateProperties||e.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...r.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(r.newGeometry||e.newGeometry)&&(i.newGeometry=e.newGeometry||r.newGeometry),i}function bm(r){var e,i;if(!r)return{};let a={};return a.removeAll=r.removeAll,a.remove=new Set(r.remove||[]),a.add=new Map((e=r.add)===null||e===void 0?void 0:e.map(s=>[s.id,s])),a.update=new Map((i=r.update)===null||i===void 0?void 0:i.map(s=>[s.id,s])),a}Ue("CanonicalTileID",fp),Ue("OverscaledTileID",Tr,{omit:["terrainRttPosMatrix32f"]});class es{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 es;return i.extend(e(new U(this.minX,this.minY))),i.extend(e(new U(this.maxX,this.minY))),i.extend(e(new U(this.minX,this.maxY))),i.extend(e(new U(this.maxX,this.maxY))),i}static fromPoints(e){let i=new es;for(let a of e)i.extend(a);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 wm{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){let a=e[i];this._stringToNumber[a]=i,this._numberToString[i]=a}}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 Sm{constructor(e,i,a,s,h){this.type="Feature",this._vectorTileFeature=e,this._x=a,this._y=s,this._z=i,this.properties=e.properties,this.id=h}projectPoint(e,i,a,s){return[360*(e.x+i)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+a)/s)*Math.PI))-90]}projectLine(e,i,a,s){return e.map(h=>this.projectPoint(h,i,a,s))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),a=e.extent*this._x,s=e.extent*this._y,h=e.loadGeometry();switch(e.type){case 1:{let u=[];for(let g of h)u.push(g[0]);let f=this.projectLine(u,a,s,i);this._geometry=u.length===1?{type:"Point",coordinates:f[0]}:{type:"MultiPoint",coordinates:f};break}case 2:{let u=h.map(f=>this.projectLine(f,a,s,i));this._geometry=u.length===1?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u};break}case 3:{let u=Bf(h),f=[];for(let g of u)f.push(g.map(x=>this.projectLine(x,a,s,i)));this._geometry=f.length===1?{type:"Polygon",coordinates:f[0]}:{type:"MultiPolygon",coordinates:f};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 cl{_name;dataBuffer;nullabilityBuffer;_size;constructor(e,i,a){this._name=e,this.dataBuffer=i,typeof a=="number"?this._size=a:(this.nullabilityBuffer=a,this._size=a.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer&&this.nullabilityBuffer.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Nu extends cl{}class gp extends Nu{getValueFromBuffer(e){return this.dataBuffer[e]}}class yp extends Nu{getValueFromBuffer(e){return this.dataBuffer[e]}}class Tm extends cl{delta;constructor(e,i,a,s){super(e,i,s),this.delta=a}}class _p extends Tm{constructor(e,i,a,s){super(e,Int32Array.of(i),a,s)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class xp extends cl{constructor(e,i,a){super(e,Int32Array.of(i),a)}getValueFromBuffer(e){return this.dataBuffer[0]}}class f0{_name;_geometryVector;_idVector;_propertyVectors;_extent;propertyVectorsMap;constructor(e,i,a,s,h=4096){this._name=e,this._geometryVector=i,this._idVector=a,this._propertyVectors=s,this._extent=h}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)}*[Symbol.iterator](){let e=this.geometryVector[Symbol.iterator](),i=0;for(;i<this.numFeatures;){let a;this.idVector&&(a=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(i)):this.idVector.getValue(i));let s=e==null?void 0:e.next().value,h={};
2for(let u of this.propertyVectors){if(!u)continue;let f=u.name,g=u.getValue(i);g!==null&&(h[f]=g)}i++,yield{id:a,geometry:s,properties:h}}}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],i=this.geometryVector.getGeometries();for(let a=0;a<this.numFeatures;a++){let s;this.idVector&&(s=this.containsMaxSaveIntegerValues(this.idVector)?Number(this.idVector.getValue(a)):this.idVector.getValue(a));let h={coordinates:i[a],type:this.geometryVector.geometryType(a)},u={};for(let f of this.propertyVectors){if(!f)continue;let g=f.name,x=f.getValue(a);x!==null&&(u[g]=x)}e.push({id:s,geometry:h,properties:u})}return e}containsMaxSaveIntegerValues(e){return e instanceof gp||e instanceof xp&&e instanceof _p||e instanceof yp}}class m0{value;constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Pt,Ja,Di,mn,ts,Pr,ii,xi,Pm,Rr;function Gi(r,e,i){let a=new Int32Array(i),s=0,h=e.get();for(let u=0;u<a.length;u++){let f=r[h++],g=127&f;f<128||(f=r[h++],g|=(127&f)<<7,f<128||(f=r[h++],g|=(127&f)<<14,f<128||(f=r[h++],g|=(127&f)<<21,f<128||(f=r[h++],g|=(15&f)<<28)))),a[s++]=g}return e.set(h),a}function vp(r,e,i){let a=new BigInt64Array(i);for(let s=0;s<a.length;s++)a[s]=g0(r,e);return a}function g0(r,e){let i=0n,a=0,s=e.get();for(;s<r.length;){let h=r[s++];if(i|=BigInt(127&h)<<BigInt(a),!(128&h))break;if(a+=7,a>=64)throw new Error("Varint too long")}return e.set(s),i}function y0(r,e){let i,a;return a=r[e.get()],e.increment(),i=127&a,a<128?i:(a=r[e.get()],e.increment(),i|=(127&a)<<7,a<128?i:(a=r[e.get()],e.increment(),i|=(127&a)<<14,a<128?i:(a=r[e.get()],e.increment(),i|=(127&a)<<21,a<128?i:(a=r[e.get()],i|=(15&a)<<28,function(s,h,u){let f,g;if(g=h[u.get()],u.increment(),f=(112&g)>>4,g<128||(g=h[u.get()],u.increment(),f|=(127&g)<<3,g<128)||(g=h[u.get()],u.increment(),f|=(127&g)<<10,g<128)||(g=h[u.get()],u.increment(),f|=(127&g)<<17,g<128)||(g=h[u.get()],u.increment(),f|=(127&g)<<24,g<128)||(g=h[u.get()],u.increment(),f|=(1&g)<<31,g<128))return 4294967296*f+(s>>>0);throw new Error("Expected varint not more than 10 bytes")}(i,r,e)))))}function Yt(r){return r>>>1^-(1&r)}function Ir(r){return r>>1n^-(1n&r)}function hl(r){return r%2==1?(r+1)/-2:r/2}function Im(r,e,i){if(i===void 0){i=0;for(let h=0;h<e;h++)i+=r[h]}let a=new Int32Array(i),s=0;for(let h=0;h<e;h++){let u=r[h];a.fill(r[h+e],s,s+u),s+=u}return a}function Mm(r,e,i){if(i===void 0){i=0;for(let h=0;h<e;h++)i+=Number(r[h])}let a=new BigInt64Array(i),s=0;for(let h=0;h<e;h++){let u=Number(r[h]);a.fill(r[h+e],s,s+u),s+=u}return a}function Lm(r,e,i){let a=new Float64Array(i),s=0;for(let h=0;h<e;h++){let u=r[h];a.fill(r[h+e],s,s+u),s+=u}return a}function Cm(r){let e=r.length/4*4,i=1;if(e>=4)for(let a=r[0];i<e-4;i+=4)a=r[i]+=a,a=r[i+1]+=a,a=r[i+2]+=a,a=r[i+3]+=a;for(;i!=r.length;)r[i]+=r[i-1],++i}(function(r){r.NONE="NONE",r.DELTA="DELTA",r.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",r.RLE="RLE",r.MORTON="MORTON",r.PDE="PDE"})(Pt||(Pt={})),function(r){r.NONE="NONE",r.FAST_PFOR="FAST_PFOR",r.VARINT="VARINT",r.ALP="ALP"}(Ja||(Ja={})),function(r){r.PRESENT="PRESENT",r.DATA="DATA",r.OFFSET="OFFSET",r.LENGTH="LENGTH"}(Di||(Di={}));class bp{_dictionaryType;_offsetType;_lengthType;constructor(e,i,a){this._dictionaryType=e,this._offsetType=i,this._lengthType=a}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function Ki(r,e){let i=function(a,s){let h=a[s.get()],u=Object.values(Di)[h>>4],f=null;switch(u){case Di.DATA:f=new bp(Object.values(mn)[15&h]);break;case Di.OFFSET:f=new bp(null,Object.values(ts)[15&h]);break;case Di.LENGTH:f=new bp(null,null,Object.values(Pr)[15&h])}s.increment();let g=a[s.get()],x=Object.values(Pt)[g>>5],w=Object.values(Pt)[g>>2&7],S=Object.values(Ja)[3&g];s.increment();let M=Gi(a,s,2),L=M[0];return{physicalStreamType:u,logicalStreamType:f,logicalLevelTechnique1:x,logicalLevelTechnique2:w,physicalLevelTechnique:S,numValues:L,byteLength:M[1],decompressedCount:L}}(r,e);return i.logicalLevelTechnique1===Pt.MORTON?function(a,s,h){let u=Gi(s,h,2);return{physicalStreamType:a.physicalStreamType,logicalStreamType:a.logicalStreamType,logicalLevelTechnique1:a.logicalLevelTechnique1,logicalLevelTechnique2:a.logicalLevelTechnique2,physicalLevelTechnique:a.physicalLevelTechnique,numValues:a.numValues,byteLength:a.byteLength,decompressedCount:a.decompressedCount,numBits:u[0],coordinateShift:u[1]}}(i,r,e):Pt.RLE!==i.logicalLevelTechnique1&&Pt.RLE!==i.logicalLevelTechnique2||Ja.NONE===i.physicalLevelTechnique?i:function(a,s,h){let u=Gi(s,h,2);return{physicalStreamType:a.physicalStreamType,logicalStreamType:a.logicalStreamType,logicalLevelTechnique1:a.logicalLevelTechnique1,logicalLevelTechnique2:a.logicalLevelTechnique2,physicalLevelTechnique:a.physicalLevelTechnique,numValues:a.numValues,byteLength:a.byteLength,decompressedCount:u[1],runs:u[0],numRleValues:u[1]}}(i,r,e)}(function(r){r.NONE="NONE",r.SINGLE="SINGLE",r.SHARED="SHARED",r.VERTEX="VERTEX",r.MORTON="MORTON",r.FSST="FSST"})(mn||(mn={})),function(r){r.VERTEX="VERTEX",r.INDEX="INDEX",r.STRING="STRING",r.KEY="KEY"}(ts||(ts={})),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"}(Pr||(Pr={})),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"}(ii||(ii={}));class gn{values;_size;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 a=Math.floor(e/8);this.values[a]=this.values[a]|(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 Uu(r,e,i){if(!e)return r;let a=e.size(),s=new r.constructor(a),h=0;for(let u=0;u<a;u++)s[u]=e.get(u)?r[h++]:i;return s}function Ji(r,e,i,a,s,h){return function(u,f,g,x,w){switch(f.logicalLevelTechnique1){case Pt.DELTA:if(f.logicalLevelTechnique2===Pt.RLE){let S=f;if(!w)return function(M,L,k){let A=new Int32Array(k),F=0,N=0;for(let H=0;H<L;H++){let V=M[H],Z=Yt(M[H+L]);for(let Q=0;Q<V;Q++)N+=Z,A[F++]=N}return A}(u,S.runs,S.numRleValues);u=Im(u,S.runs,S.numRleValues)}(function(S){S[0]=Yt(S[0]);let M=S.length/4*4,L=1;if(M>=4)for(;L<M-4;L+=4){let k=S[L+1],A=S[L+2],F=S[L+3];S[L]=Yt(S[L])+S[L-1],S[L+1]=Yt(k)+S[L],S[L+2]=Yt(A)+S[L+1],S[L+3]=Yt(F)+S[L+2]}for(;L!=S.length;++L)S[L]=Yt(S[L])+S[L-1]})(u);break;case Pt.RLE:u=function(S,M,L){return L?function(k,A,F){if(F===void 0){F=0;for(let V=0;V<A;V++)F+=k[V]}let N=new Int32Array(F),H=0;for(let V=0;V<A;V++){let Z=k[V],Q=k[V+A];Q=Yt(Q),N.fill(Q,H,H+Z),H+=Z}return N}(S,M.runs,M.numRleValues):Im(S,M.runs,M.numRleValues)}(u,f,g);break;case Pt.MORTON:Cm(u);break;case Pt.COMPONENTWISE_DELTA:(function(S){if(S.length<2)return;S[0]=Yt(S[0]),S[1]=Yt(S[1]);let M=S.length/4*4,L=2;if(M>=4)for(;L<M-4;L+=4){let k=S[L+1],A=S[L+2],F=S[L+3];S[L]=Yt(S[L])+S[L-2],S[L+1]=Yt(k)+S[L-1],S[L+2]=Yt(A)+S[L],S[L+3]=Yt(F)+S[L+1]}for(;L!=S.length;L+=2)S[L]=Yt(S[L])+S[L-2],S[L+1]=Yt(S[L+1])+S[L-1]})(u);break;case Pt.NONE:g&&function(S){for(let M=0;M<S.length;M++)S[M]=Yt(S[M])}(u);break;default:throw new Error(`The specified Logical level technique is not supported: ${f.logicalLevelTechnique1}`)}return w?Uu(u,w,0):u}(Gu(r,e,i),i,a,0,h)}function Qa(r,e,i){return function(a,s){if(s.logicalLevelTechnique1===Pt.DELTA&&s.logicalLevelTechnique2===Pt.NONE)return function(h){let u=new Int32Array(h.length+1);u[0]=0,u[1]=Yt(h[0]);let f=u[1];for(let g=2;g!=u.length;++g)f+=Yt(h[g-1]),u[g]=u[g-1]+f;return new Uint32Array(u)}(a);if(s.logicalLevelTechnique1===Pt.RLE&&s.logicalLevelTechnique2===Pt.NONE)return function(h,u,f){let g=new Int32Array(f+1);g[0]=0;let x=1,w=g[0];for(let S=0;S<u;S++){let M=h[S],L=h[S+u];for(let k=x;k<x+M;k++)g[k]=L+w,w=g[k];x+=M}return new Uint32Array(g)}(a,s.runs,s.numRleValues);if(s.logicalLevelTechnique1===Pt.NONE&&s.logicalLevelTechnique2===Pt.NONE){(function(u){let f=0;for(let g=0;g<u.length;
2g++)u[g]+=f,f=u[g]})(a);let h=new Uint32Array(s.numValues+1);return h[0]=0,h.set(a,1),h}if(s.logicalLevelTechnique1===Pt.DELTA&&s.logicalLevelTechnique2===Pt.RLE){let h=function(u,f,g){let x=new Int32Array(g+1);x[0]=0;let w=1,S=x[0];for(let M=0;M<f;M++){let L=u[M],k=u[M+f];k=Yt(k);for(let A=w;A<w+L;A++)x[A]=k+S,S=x[A];w+=L}return new Uint32Array(x)}(a,s.runs,s.numRleValues);return Cm(h),h}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")}(Gu(r,e,i),i)}function Gu(r,e,i){let a=i.physicalLevelTechnique;if(a===Ja.FAST_PFOR)return function(){throw new Error("FastPFor is not implemented yet.")}();if(a===Ja.VARINT)return Gi(r,e,i.numValues);if(a===Ja.NONE){let s=e.get();e.add(i.byteLength);let h=r.subarray(s,e.get());return new Int32Array(h)}throw new Error("Specified physicalLevelTechnique is not supported (yet).")}function wp(r,e,i,a){let s=Gu(r,e,i);if(s.length===1){let h=s[0];return a?Yt(h):h}return a?function(h){return Yt(h[1])}(s):function(h){return h[1]}(s)}function Em(r,e,i){return function(a){if(a.length==2){let s=Yt(a[1]);return[s,s]}return[Yt(a[2]),Yt(a[3])]}(Gu(r,e,i))}function km(r,e,i){return function(a){if(a.length==2){let s=Ir(a[1]);return[s,s]}return[Ir(a[2]),Ir(a[3])]}(vp(r,e,i.numValues))}function zm(r,e,i,a,s){return function(h,u,f,g){switch(u.logicalLevelTechnique1){case Pt.DELTA:if(u.logicalLevelTechnique2===Pt.RLE){let x=u;if(!g)return function(w,S,M){let L=new BigInt64Array(M),k=0,A=0n;for(let F=0;F<S;F++){let N=Number(w[F]),H=Ir(w[F+S]);for(let V=0;V<N;V++)A+=H,L[k++]=A}return L}(h,x.runs,x.numRleValues);h=Mm(h,x.runs,x.numRleValues)}(function(x){x[0]=Ir(x[0]);let w=x.length/4*4,S=1;if(w>=4)for(;S<w-4;S+=4){let M=x[S+1],L=x[S+2],k=x[S+3];x[S]=Ir(x[S])+x[S-1],x[S+1]=Ir(M)+x[S],x[S+2]=Ir(L)+x[S+1],x[S+3]=Ir(k)+x[S+2]}for(;S!=x.length;++S)x[S]=Ir(x[S])+x[S-1]})(h);break;case Pt.RLE:h=function(x,w,S){return S?function(M,L,k){if(k===void 0){k=0;for(let N=0;N<L;N++)k+=Number(M[N])}let A=new BigInt64Array(k),F=0;for(let N=0;N<L;N++){let H=Number(M[N]),V=M[N+L];V=Ir(V),A.fill(V,F,F+H),F+=H}return A}(x,w.runs,w.numRleValues):Mm(x,w.runs,w.numRleValues)}(h,u,f);break;case Pt.NONE:f&&function(x){for(let w=0;w<x.length;w++)x[w]=Ir(x[w])}(h);break;default:throw new Error(`The specified Logical level technique is not supported: ${u.logicalLevelTechnique1}`)}return g?Uu(h,g,0n):h}(vp(r,e,i.numValues),i,a,s)}function Am(r,e,i,a){let s=vp(r,e,i.numValues);if(s.length===1){let h=s[0];return a?Ir(h):h}return a?function(h){return Ir(h[1])}(s):function(h){return h[1]}(s)}function Zu(r,e,i,a){let s=r.logicalLevelTechnique1;if(s===Pt.RLE)return r.runs===1?ii.CONST:ii.FLAT;if(s!==Pt.DELTA||r.logicalLevelTechnique2!==Pt.RLE)return r.numValues===1?ii.CONST:ii.FLAT;let h=e instanceof gn?e.size():e;
2if(r.numRleValues!==h)return ii.FLAT;if(r.runs===1)return ii.SEQUENCE;if(r.runs!==2)return r.numValues===1?ii.CONST:ii.FLAT;let u=a.get(),f;if(r.physicalLevelTechnique===Ja.VARINT)f=Gi(i,a,4);else{let g=a.get();f=new Int32Array(i.buffer,i.byteOffset+g,4)}return a.set(u),f[2]===2&&f[3]===2?ii.SEQUENCE:r.numValues===1?ii.CONST:ii.FLAT}class Dm extends Nu{getValueFromBuffer(e){return this.dataBuffer[e]}}class Rm extends Tm{constructor(e,i,a,s){super(e,BigInt64Array.of(i),a,s)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}class ul{_geometryOffsets;_partOffsets;_ringOffsets;constructor(e,i,a){this._geometryOffsets=e,this._partOffsets=i,this._ringOffsets=a}get geometryOffsets(){return this._geometryOffsets}get partOffsets(){return this._partOffsets}get ringOffsets(){return this._ringOffsets}}function Sp(r,e,i){return{x:Fm(r,e)-i,y:Fm(r>>1,e)-i}}function Fm(r,e){let i=0;for(let a=0;a<e;a++)i|=(r&1<<2*a)>>a;return i}(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"})(xi||(xi={})),function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON"}(Pm||(Pm={})),function(r){r[r.MORTON=0]="MORTON",r[r.VEC_2=1]="VEC_2",r[r.VEC_3=2]="VEC_3"}(Rr||(Rr={}));class _0{createPoint(e){return[[e]]}createMultiPoint(e){return e.map(i=>[i])}createLineString(e){return[e]}createMultiLineString(e){return e}createPolygon(e,i){return[e].concat(i)}createMultiPolygon(e){return e.flat()}}function Om(r){let e=new Array(r.numGeometries),i=1,a=1,s=1,h=0,u=new _0,f=0,g=0,x=r.mortonSettings,w=r.topologyVector,S=w.geometryOffsets,M=w.partOffsets,L=w.ringOffsets,k=r.vertexOffsets,A=r.containsPolygonGeometry(),F=r.vertexBuffer;for(let N=0;N<r.numGeometries;N++){let H=r.geometryType(N);if(H===xi.POINT){if(k&&k.length!==0)if(r.vertexBufferType===Rr.VEC_2){let V=2*k[g++],Z=new U(F[V],F[V+1]);e[h++]=u.createPoint(Z)}else{let V=Sp(F[k[g++]],x.numBits,x.coordinateShift),Z=new U(V.x,V.y);e[h++]=u.createPoint(Z)}else{let V=new U(F[f++],F[f++]);e[h++]=u.createPoint(V)}S&&s++,M&&i++,L&&a++}else if(H===xi.MULTIPOINT){let V=S[s]-S[s-1];s++;let Z=new Array(V);if(k&&k.length!==0){for(let Q=0;Q<V;Q++){let ae=2*k[g++];Z[Q]=new U(F[ae],F[ae+1])}e[h++]=u.createMultiPoint(Z)}else{for(let Q=0;Q<V;Q++){let ae=F[f++],de=F[f++];Z[Q]=new U(ae,de)}e[h++]=u.createMultiPoint(Z)}}else if(H===xi.LINESTRING){let V,Z=0;A?(Z=L[a]-L[a-1],a++):Z=M[i]-M[i-1],i++,k&&k.length!==0?(V=r.vertexBufferType===Rr.VEC_2?Pp(F,k,g,Z,!1):Ip(F,k,g,Z,!1,x),g+=Z):(V=Tp(F,f,Z,!1),f+=2*Z),e[h++]=u.createLineString(V),S&&s++}else if(H===xi.POLYGON){let V=M[i]-M[i-1];i++;let Z=new Array(V-1),Q=L[a]-L[a-1];if(a++,k&&k.length!==0){let ae=r.vertexBufferType===Rr.VEC_2?$u(F,k,g,Q):Wu(F,k,g,Q,0,x);g+=Q;for(let de=0;de<Z.length;de++)Q=L[a]-L[a-1],a++,Z[de]=r.vertexBufferType===Rr.VEC_2?$u(F,k,g,Q):Wu(F,k,g,Q,0,x),g+=Q;e[h++]=u.createPolygon(ae,Z)}else{let ae=qu(F,f,Q);f+=2*Q;for(let de=0;de<Z.length;de++)Q=L[a]-L[a-1],a++,Z[de]=qu(F,f,Q),f+=2*Q;e[h++]=u.createPolygon(ae,Z)}S&&s++}else if(H===xi.MULTILINESTRING){let V=S[s]-S[s-1];s++;let Z=new Array(V);if(k&&k.length!==0){for(let Q=0;Q<V;Q++){let ae=0;A?(ae=L[a]-L[a-1],a++):ae=M[i]-M[i-1],i++;let de=r.vertexBufferType===Rr.VEC_2?Pp(F,k,g,ae,!1):Ip(F,k,g,ae,!1,x);Z[Q]=de,g+=ae}e[h++]=u.createMultiLineString(Z)}else{for(let Q=0;Q<V;Q++){let ae=0;A?(ae=L[a]-L[a-1],a++):ae=M[i]-M[i-1],i++,Z[Q]=Tp(F,f,ae,!1),f+=2*ae}e[h++]=u.createMultiLineString(Z)}}else{if(H!==xi.MULTIPOLYGON)throw new Error("The specified geometry type is currently not supported.");{let V=S[s]-S[s-1];s++;let Z=new Array(V),Q=0;if(k&&k.length!==0){for(let ae=0;ae<V;ae++){let de=M[i]-M[i-1];i++;let we=new Array(de-1);Q=L[a]-L[a-1],a++;let Se=r.vertexBufferType===Rr.VEC_2?$u(F,k,g,Q):Wu(F,k,g,Q,0,x);g+=Q;for(let Ie=0;Ie<we.length;Ie++)Q=L[a]-L[a-1],a++,we[Ie]=r.vertexBufferType===Rr.VEC_2?$u(F,k,g,Q):Wu(F,k,g,Q,0,x),g+=Q;Z[ae]=u.createPolygon(Se,we)}e[h++]=u.createMultiPolygon(Z)}else{for(let ae=0;ae<V;ae++){let de=M[i]-M[i-1];i++;let we=new Array(de-1);Q=L[a]-L[a-1],a++;let Se=qu(F,f,Q);f+=2*Q;for(let Ie=0;Ie<we.length;Ie++){let Be=L[a]-L[a-1];a++,we[Ie]=qu(F,f,Be),f+=2*Be}Z[ae]=u.createPolygon(Se,we)}e[h++]=u.createMultiPolygon(Z)}}}}return e}function qu(r,e,i){return Tp(r,e,i,!0)}function $u(r,e,i,a){return Pp(r,e,i,a,!0)}function Wu(r,e,i,a,s,h){return Ip(r,e,i,a,!0,h)}function Tp(r,e,i,a){let s=new Array(a?i+1:i);for(let h=0;h<2*i;h+=2)s[h/2]=new U(r[e+h],r[e+h+1]);return a&&(s[s.length-1]=s[0]),s}function Pp(r,e,i,a,s){let h=new Array(s?a+1:a);for(let u=0;u<2*a;u+=2){let f=2*e[i+u/2];h[u/2]=new U(r[f],r[f+1])}return s&&(h[h.length-1]=h[0]),h}function Ip(r,e,i,a,s,h){let u=new Array(s?a+1:a);for(let f=0;f<a;f++){let g=Sp(r[e[i+f]],h.numBits,h.coordinateShift);u[f]=new U(g.x,g.y)}return s&&(u[u.length-1]=u[0]),u}class Bm{_vertexBufferType;_topologyVector;_vertexOffsets;_vertexBuffer;_mortonSettings;constructor(e,i,a,s,h){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=a,this._vertexBuffer=s,this._mortonSettings=h}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}*[Symbol.iterator](){let e=Om(this),i=0;for(;i<this.numGeometries;)yield{coordinates:e[i],type:this.geometryType(i)},i++}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 a=Sp(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return Om(this)}get mortonSettings(){return this._mortonSettings}}class jm extends Bm{_numGeometries;_geometryType;constructor(e,i,a,s,h,u,f){super(a,s,h,u,f),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===xi.POLYGON||this._geometryType===xi.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class Vm extends Bm{_geometryTypes;constructor(e,i,a,s,h,u){super(e,a,s,h,u),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)===xi.POLYGON||this.geometryType(e)===xi.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class Nm{_triangleOffsets;_indexBuffer;_vertexBuffer;_topologyVector;constructor(e,i,a,s){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=a,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,a=i.partOffsets,s=i.ringOffsets,h=i.geometryOffsets,u=0,f=1,g=1,x=1;for(let w=0;w<this.numGeometries;w++)switch(this.geometryType(w)){case xi.POLYGON:{let S=a[f]-a[f-1];f++;let M=[];for(let L=0;L<S;L++){let k=s[g]-s[g-1];g++;let A=[];for(let F=0;F<k;F++){let N=this._vertexBuffer[u++],H=this._vertexBuffer[u++];A.push(new U(N,H))}A.length>0&&A.push(A[0]),M.push(A)}e[w]=M,h&&x++}break;case xi.MULTIPOLYGON:{let S=h[x]-h[x-1];x++;let M=[];for(let L=0;L<S;L++){let k=a[f]-a[f-1];f++;for(let A=0;A<k;A++){let F=s[g]-s[g-1];g++;let N=[];for(let H=0;H<F;H++){let V=this._vertexBuffer[u++],Z=this._vertexBuffer[u++];N.push(new U(V,Z))}N.length>0&&N.push(N[0]),M.push(N)}}e[w]=M}}return e}[Symbol.iterator](){return null}}function Um(r,e,i,a,s,h){return new x0(r,e,i,a,s,h)}class x0 extends Nm{_numGeometries;_geometryType;constructor(e,i,a,s,h,u){super(a,s,h,u),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function Gm(r,e,i,a,s){return new v0(r,e,i,a,s)}class v0 extends Nm{_geometryTypes;constructor(e,i,a,s,h){super(i,a,s,h),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function b0(r,e,i,a,s){let h=Ki(r,i),u=null,f=null,g=null,x=null;if(Zu(h,a,r,i)===ii.CONST){let H=wp(r,i,h,!1),V=null,Z=null,Q=null,ae=null;for(let de=0;de<e-1;de++){let we=Ki(r,i);switch(we.physicalStreamType){case Di.LENGTH:switch(we.logicalStreamType.lengthType){case Pr.GEOMETRIES:V=Qa(r,i,we);break;case Pr.PARTS:Z=Qa(r,i,we);break;case Pr.RINGS:Q=Qa(r,i,we);break;case Pr.TRIANGLES:ae=Qa(r,i,we)}break;case Di.OFFSET:switch(we.logicalStreamType.offsetType){case ts.VERTEX:u=Ji(r,i,we,!1);break;case ts.INDEX:x=Ji(r,i,we,!1)}break;case Di.DATA:mn.VERTEX===we.logicalStreamType.dictionaryType?f=Ji(r,i,we,!0):(g={numBits:we.numBits,coordinateShift:we.coordinateShift},f=Ji(r,i,we,!1))}}return x!==null?V!=null||Z!=null?Um(a,H,ae,x,f,new ul(V,Z,Q)):Um(a,H,ae,x,f):g===null?function(de,we,Se,Ie,Be){return new jm(de,we,Rr.VEC_2,Se,Ie,Be)}(a,H,new ul(V,Z,Q),u,f):function(de,we,Se,Ie,Be,ze){return new jm(de,we,Rr.MORTON,Se,Ie,Be,ze)}(a,H,new ul(V,Z,Q),u,f,g)}let w=Ji(r,i,h,!1),S=null,M=null,L=null,k=null;for(let H=0;H<e-1;H++){let V=Ki(r,i);switch(V.physicalStreamType){case Di.LENGTH:switch(V.logicalStreamType.lengthType){case Pr.GEOMETRIES:S=Ji(r,i,V,!1);break;case Pr.PARTS:M=Ji(r,i,V,!1);break;case Pr.RINGS:L=Ji(r,i,V,!1);break;case Pr.TRIANGLES:k=Qa(r,i,V)}break;case Di.OFFSET:switch(V.logicalStreamType.offsetType){case ts.VERTEX:u=Ji(r,i,V,!1);break;case ts.INDEX:x=Ji(r,i,V,!1)}break;case Di.DATA:mn.VERTEX===V.logicalStreamType.dictionaryType?f=Ji(r,i,V,!0):(g={numBits:V.numBits,coordinateShift:V.coordinateShift},f=Ji(r,i,V,!1))}}let A=null,F=null,N=null;return S!==null?(A=Mp(w,S,2),M!==null&&L!==null?(F=Zm(w,A,M,!1),N=function(H,V,Z,Q){let ae=new Uint32Array(Z[Z.length-1]+1),de=0;ae[0]=de;let we=1,Se=1,Ie=0;for(let Be=0;Be<H.length;Be++){let ze=H[Be],Ce=V[Be+1]-V[Be];if(ze!==0&&ze!==3)for(let be=0;be<Ce;be++){let je=Z[we]-Z[we-1];we++;for(let Ze=0;Ze<je;Ze++)de=ae[Se++]=de+Q[Ie++]}else for(let be=0;be<Ce;be++)ae[Se++]=++de,we++}return ae}(w,A,F,L)):M!==null&&(F=function(H,V,Z){let Q=new Uint32Array(V[V.length-1]+1),ae=0;Q[0]=ae;let de=1,we=0;for(let Se=0;Se<H.length;Se++){let Ie=H[Se],Be=V[Se+1]-V[Se];if(Ie===4||Ie===1)for(let ze=0;ze<Be;ze++)ae=Q[de++]=ae+Z[we++];else for(let ze=0;ze<Be;ze++)Q[de++]=++ae}return Q}(w,A,M))):M!==null&&L!==null?(F=Mp(w,M,1),N=Zm(w,F,L,!0)):M!==null&&(F=Mp(w,M,0)),x!==null&&F===null?Gm(w,k,x,f):x!==null?Gm(w,k,x,f,new ul(A,F,N)):g===null?function(H,V,Z,Q){return new Vm(Rr.VEC_2,H,V,Z,Q)}(w,new ul(A,F,N),u,f):function(H,V,Z,Q,ae){return new Vm(Rr.MORTON,H,V,Z,Q,ae)}(w,new ul(A,F,N),u,f,g)}function Mp(r,e,i){let a=new Uint32Array(r.length+1),s=0;a[0]=s;let h=0;for(let u=0;u<r.length;u++)s=a[u+1]=s+(r[u]>i?e[h++]:1);return a}function Zm(r,e,i,a){let s=new Uint32Array(e[e.length-1]+1),h=0;s[0]=h;let u=1,f=0;for(let g=0;g<r.length;
2g++){let x=r[g],w=e[g+1]-e[g];if(x===5||x===2||a&&(x===4||x===1))for(let S=0;S<w;S++)h=s[u++]=h+i[f++];else for(let S=0;S<w;S++)s[u++]=++h}return s}class w0 extends cl{dataVector;constructor(e,i,a){super(e,i.getBuffer(),a),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class S0 extends Nu{getValueFromBuffer(e){return this.dataBuffer[e]}}class qm extends cl{constructor(e,i,a){super(e,BigInt64Array.of(i),a)}getValueFromBuffer(e){return this.dataBuffer[0]}}function kc(r,e,i,a,s){let h=function(u,f,g,x){let w=new Uint8Array(f),S=0,M=x.get()+g;for(;S<f&&!(x.get()>=M);){let L=u[x.increment()];if(L<=127){let k=L+3,A=u[x.increment()],F=Math.min(S+k,f);w.fill(A,S,F),S=F}else{let k=256-L;for(let A=0;A<k&&S<f;A++)w[S++]=u[x.increment()]}}return x.set(M),w}(r,Math.ceil(e/8),i,a);return s?function(u,f,g){if(!g)return u;let x=g.size(),w=new gn(u,f),S=new gn(new Uint8Array(Math.ceil(x/8)),x),M=0;for(let L=0;L<x;L++){let k=!!g.get(L)&&w.get(M++);S.set(L,k)}return S.getBuffer()}(h,e,s):h}let T0=new TextDecoder;function Lp(r,e,i){return i-e>=12?T0.decode(r.subarray(e,i)):function(a,s,h){let u="",f=s;for(;f<h;){let g=a[f],x,w,S,M=null,L=g>239?4:g>223?3:g>191?2:1;if(f+L>h)break;L===1?g<128&&(M=g):L===2?(x=a[f+1],(192&x)==128&&(M=(31&g)<<6|63&x,M<=127&&(M=null))):L===3?(x=a[f+1],w=a[f+2],(192&x)==128&&(192&w)==128&&(M=(15&g)<<12|(63&x)<<6|63&w,(M<=2047||M>=55296&&M<=57343)&&(M=null))):L===4&&(x=a[f+1],w=a[f+2],S=a[f+3],(192&x)==128&&(192&w)==128&&(192&S)==128&&(M=(15&g)<<18|(63&x)<<12|(63&w)<<6|63&S,(M<=65535||M>=1114112)&&(M=null))),M===null?(M=65533,L=1):M>65535&&(M-=65536,u+=String.fromCharCode(M>>>10&1023|55296),M=56320|1023&M),u+=String.fromCharCode(M),f+=L}return u}(r,e,i)}class Cp extends cl{offsetBuffer;constructor(e,i,a,s){super(e,a,s),this.offsetBuffer=i}}class $m extends Cp{textEncoder;constructor(e,i,a,s){super(e,i,a,s!=null?s:i.length-1),this.textEncoder=new TextEncoder}getValueFromBuffer(e){return Lp(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class dl extends Cp{indexBuffer;textEncoder;constructor(e,i,a,s,h){super(e,a,s,h!=null?h:i.length),this.indexBuffer=i,this.indexBuffer=i,this.textEncoder=new TextEncoder}getValueFromBuffer(e){let i=this.indexBuffer[e];return Lp(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class Wm extends Cp{indexBuffer;symbolOffsetBuffer;symbolTableBuffer;textEncoder;symbolLengthBuffer;lengthBuffer;decodedDictionary;constructor(e,i,a,s,h,u,f){super(e,a,s,f),this.indexBuffer=i,this.symbolOffsetBuffer=h,this.symbolTableBuffer=u,this.textEncoder=new TextEncoder}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer),this.lengthBuffer=this.offsetToLengthBuffer(this.offsetBuffer)),this.decodedDictionary=function(a,s,h){let u=[],f=new Array(s.length).fill(0);for(let g=1;g<s.length;g++)f[g]=f[g-1]+s[g-1];for(let g=0;g<h.length;g++)if(h[g]===255)u.push(h[++g]);else{let x=s[h[g]],w=f[h[g]];for(let S=0;S<x;S++)u.push(a[w+S])}return new Uint8Array(u)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let i=this.indexBuffer[e];return Lp(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){let i=new Uint32Array(e.length-1),a=e[0];for(let s=1;s<e.length;s++){let h=e[s];i[s-1]=h-a,a=h}return i}}function P0(r,e,i,a,s,h){return i.type==="scalarType"?function(u,f,g,x,w,S){let M=null,L=0;if(u===0)return null;if(S.nullable){let A=Ki(f,g);L=A.numValues;let F=g.get(),N=kc(f,L,A.byteLength,g);g.set(F+A.byteLength),M=new gn(N,A.numValues)}let k=M!=null?M:x;switch(w.physicalType){case 4:case 3:return function(A,F,N,H,V){let Z=Ki(A,F),Q=Zu(Z,V,A,F),ae=H.physicalType===3;if(Q===ii.FLAT){let de=Ji(A,F,Z,ae,0,zc(V)?V:void 0);return new gp(N.name,de,V)}if(Q===ii.SEQUENCE){let de=Em(A,F,Z);return new _p(N.name,de[0],de[1],Z.numRleValues)}{let de=wp(A,F,Z,ae);return new xp(N.name,de,V)}}(f,g,S,w,k);case 9:return function(A,F,N,H,V){var ze,Ce;let Z=null,Q=null,ae=null,de=null,we=null,Se=null,Ie=null,Be=null;for(let be=0;be<H;be++){let je=Ki(F,N);if(je.byteLength!==0)switch(je.physicalStreamType){case Di.PRESENT:{let Ze=kc(F,je.numValues,je.byteLength,N);Se=new gn(Ze,je.numValues);break}case Di.OFFSET:Q=Ji(F,N,je,!1,0,V!=null||Se!=null?V!=null?V:Se:void 0);break;case Di.LENGTH:{let Ze=Qa(F,N,je);Pr.DICTIONARY===je.logicalStreamType.lengthType?Z=Ze:Pr.SYMBOL===je.logicalStreamType.lengthType?de=Ze:Ie=Ze;break}case Di.DATA:{let Ze=F.subarray(N.get(),N.get()+je.byteLength);N.add(je.byteLength);let $e=je.logicalStreamType.dictionaryType;mn.FSST===$e?we=Ze:mn.SINGLE===$e||mn.SHARED===$e?ae=Ze:mn.NONE===$e&&(Be=Ze);break}}}return(Ce=(ze=function(be,je,Ze,$e,Ne,dt,Mt){return je?new Wm(be,Ze,$e,Ne,dt,je,Mt):null}(A,we,Q,Z,ae,de,V!=null?V:Se))!=null?ze:function(be,je,Ze,$e,Ne){return je?Ne?new dl(be,Ze,$e,je,Ne):new dl(be,Ze,$e,je):null}(A,ae,Q,Z,V!=null?V:Se))!=null?Ce:function(be,je,Ze,$e,Ne){if(!je||!Ze)return null;if($e)return Ne?new dl(be,$e,je,Ze,Ne):new dl(be,$e,je,Ze);if(Ne&&Ne.size()!==je.length-1){let dt=new Int32Array(Ne.size()),Mt=0;for(let Gt=0;Gt<Ne.size();Gt++)dt[Gt]=Ne.get(Gt)?Mt++:0;return new dl(be,dt,je,Ze,Ne)}return Ne?new $m(be,je,Ze,Ne):new $m(be,je,Ze)}(A,Ie,Be,Q,V!=null?V:Se)}(S.name,f,g,S.nullable?u-1:u,M);case 0:return function(A,F,N,H,V){let Z=Ki(A,F),Q=Z.numValues,ae=F.get(),de=zc(V)?V:void 0,we=kc(A,Q,Z.byteLength,F,de);F.set(ae+Z.byteLength);let Se=new gn(we,Q);return new w0(N.name,Se,V)}(f,g,S,0,k);case 6:case 5:return function(A,F,N,H,V){let Z=Ki(A,F),Q=Zu(Z,H,A,F),ae=V.physicalType===5;if(Q===ii.FLAT){let de=zm(A,F,Z,ae,zc(H)?H:void 0);return new Dm(N.name,de,H)}if(Q===ii.SEQUENCE){let de=km(A,F,Z);return new Rm(N.name,de[0],de[1],Z.numRleValues)}{let de=Am(A,F,Z,ae);return new qm(N.name,de,H)}}(f,g,S,k,w);case 7:return function(A,F,N,H){let V=Ki(A,F),Z=zc(H)?H:void 0,Q=function(ae,de,we,Se){let Ie=de.get(),Be=Ie+we*Float32Array.BYTES_PER_ELEMENT,ze=new Uint8Array(ae.subarray(Ie,Be)).buffer,Ce=new Float32Array(ze);return de.set(Be),Se?Uu(Ce,Se,0):Ce}(A,F,V.numValues,Z);return new S0(N.name,Q,H)}(f,g,S,k);case 8:return function(A,F,N,H){let V=Ki(A,F),Z=zc(H)?H:void 0,Q=function(ae,de,we,Se){let Ie=de.get(),Be=Ie+we*Float64Array.BYTES_PER_ELEMENT,ze=new Uint8Array(ae.subarray(Ie,Be)).buffer,Ce=new Float64Array(ze);return de.set(Be),Se?Uu(Ce,Se,0):Ce}(A,F,V.numValues,Z);return new yp(N.name,Q,H)}(f,g,S,k);default:throw new Error(`The specified data type for the field is currently not supported: ${w}`)}}
2(a,r,e,s,i.scalarType,i):a===0?null:function(u,f,g,x){let w=null,S=null,M=null,L=null,k=!1;for(;!k;){let H=Ki(u,f);switch(H.physicalStreamType){case Di.LENGTH:Pr.DICTIONARY===H.logicalStreamType.lengthType?w=Qa(u,f,H):M=Qa(u,f,H);break;case Di.DATA:mn.SINGLE===H.logicalStreamType.dictionaryType||mn.SHARED===H.logicalStreamType.dictionaryType?(S=u.subarray(f.get(),f.get()+H.byteLength),k=!0):L=u.subarray(f.get(),f.get()+H.byteLength),f.add(H.byteLength)}}let A=g.complexType.children,F=[],N=0;for(let H of A){let V=Gi(u,f,1)[0];if(V==0)continue;let Z=H.name?`${g.name}${H.name}`:g.name;if(V!==2||H.type!=="scalarField"||H.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");let Q=Ki(u,f),ae=kc(u,Q.numValues,Q.byteLength,f),de=Ki(u,f),we=Ji(u,f,de,!1,0,de.decompressedCount!==x?new gn(ae,Q.numValues):void 0);F[N++]=L?new Wm(Z,we,w,S,M,L,new gn(ae,Q.numValues)):new dl(Z,we,w,S,new gn(ae,Q.numValues))}return F}(r,e,i,s)}function zc(r){return r instanceof gn}function Hm(r){switch(r){case 0:case 1:case 2:case 3:{let e={};e.nullable=!!(1&r),e.columnScope=0;let i={};return i.physicalType=r>1?6:4,i.type="physicalType",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=null;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 a={};a.nullable=!!(1&e),a.columnScope=0;let s={type:"physicalType"};return s.physicalType=i,a.type="scalarType",a.scalarType=s,a}(r)}}function Xm(r){return r>=10}function Ym(r){return r===30}function I0(r){if(r.name==="id")return!1;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}else 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}let M0=new TextDecoder;function Ep(r,e){let i=Gi(r,e,1)[0];if(i===0)return"";let a=e.get(),s=r.subarray(a,a+i);return e.add(i),M0.decode(s)}function Km(r,e){let i=Gi(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 a=Hm(i);if(Xm(i)&&(a.name=Ep(r,e)),Ym(i)){let s=Gi(r,e,1)[0]>>>0;a.complexType.children=new Array(s);for(let h=0;h<s;h++)a.complexType.children[h]=Km(r,e)}return function(s){return{name:s.name,nullable:s.nullable,scalarField:s.scalarType,complexField:s.complexType,type:s.type==="scalarType"?"scalarField":"complexField"}}(a)}function L0(r,e){let i=Gi(r,e,1)[0]>>>0,a=Hm(i);if(!a)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(Xm(i)?a.name=Ep(r,e):i>=0&&i<=3?a.name="id":i===4&&(a.name="geometry"),Ym(i)){let s=Gi(r,e,1)[0]>>>0,h=a.complexType;h.children=new Array(s);for(let u=0;u<s;u++)h.children[u]=Km(r,e)}return a}function C0(r,e){let i={featureTables:[]},a={};a.name=Ep(r,e);let s=Gi(r,e,1)[0]>>>0,h=Gi(r,e,1)[0]>>>0;a.columns=new Array(h);for(let u=0;u<h;u++)a.columns[u]=L0(r,e);return i.featureTables.push(a),[i,s]}function E0(r,e,i,a,s,h,u=!1){let f=e.scalarType.physicalType,g=Zu(s,h,r,i);if(f===4)switch(g){case ii.FLAT:{let x=Ji(r,i,s,!1);return new gp(a,x,h)}case ii.SEQUENCE:{let x=Em(r,i,s);return new _p(a,x[0],x[1],s.numRleValues)}case ii.CONST:{let x=wp(r,i,s,!1);return new xp(a,x,h)}}else switch(g){case ii.FLAT:{if(u){let w=function(S,M,L){let k=function(A,F,N){let H=new Float64Array(N);for(let V=0;V<N;V++)H[V]=y0(A,F);return H}(S,M,L.numValues);return function(A,F){switch(F.logicalLevelTechnique1){case Pt.DELTA:return F.logicalLevelTechnique2===Pt.RLE&&(A=Lm(A,F.runs,F.numRleValues)),function(N){N[0]=hl(N[0]);let H=N.length/4*4,V=1;if(H>=4)for(;V<H-4;V+=4){let Z=N[V+1],Q=N[V+2],ae=N[V+3];N[V]=hl(N[V])+N[V-1],N[V+1]=hl(Z)+N[V],N[V+2]=hl(Q)+N[V+1],N[V+3]=hl(ae)+N[V+2]}for(;V!=N.length;++V)N[V]=hl(N[V])+N[V-1]}(A),A;case Pt.RLE:return function(N,H){return Lm(N,H.runs,H.numRleValues)}(A,F);case Pt.NONE:return A;default:throw new Error(`The specified Logical level technique is not supported: ${F.logicalLevelTechnique1}`)}}(k,L)}(r,i,s);return new yp(a,w,h)}let x=zm(r,i,s,!1);return new Dm(a,x,h)}case ii.SEQUENCE:{let x=km(r,i,s);return new Rm(a,x[0],x[1],s.numRleValues)}case ii.CONST:{let x=Am(r,i,s,!1);return new qm(a,x,h)}}throw new Error("Vector type not supported for id column.")}class k0{constructor(e,i){var a;switch(this._featureData=e,this.properties=this._featureData.properties||{},(a=this._featureData.geometry)===null||a===void 0?void 0:a.type){case xi.POINT:case xi.MULTIPOINT:this.t
2ype=1;break;case xi.LINESTRING:case xi.MULTILINESTRING:this.type=2;break;case xi.POLYGON:case xi.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 a=[];for(let s of i)a.push(new U(s.x,s.y));e.push(a)}return e}}class z0{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 k0(this.features[e],this.extent)}}class Jm{constructor(e){this.layers={};let i=function(a,s,h=!0){let u=new m0(0),f=[];for(;u.get()<a.length;){let g=Gi(a,u,1)[0]>>>0,x=u.get()+g;if(x>a.length)throw new Error(`Block overruns tile: ${x} > ${a.length}`);if(Gi(a,u,1)[0]>>>0!=1){u.set(x);continue}let w=C0(a,u),S=w[1],M=w[0].featureTables[0],L=null,k=null,A=[],F=0;for(let H of M.columns){let V=H.name;if(V==="id"){let Z=null;if(H.nullable){let ae=Ki(a,u),de=u.get(),we=kc(a,ae.numValues,ae.byteLength,u);u.set(de+ae.byteLength),Z=new gn(we,ae.numValues)}let Q=Ki(a,u);F=Q.decompressedCount,L=E0(a,H,u,V,Q,Z!=null?Z:F,h)}else if(V==="geometry"){let Z=Gi(a,u,1)[0];if(F===0){let Q=u.get();F=Ki(a,u).decompressedCount,u.set(Q)}k=b0(a,Z,u,F)}else{let Z=I0(H)?Gi(a,u,1)[0]:1;if(Z===0)continue;let Q=P0(a,u,H,Z,F);if(Q)if(Array.isArray(Q))for(let ae of Q)A.push(ae);else A.push(Q)}}let N=new f0(M.name,k,L,A,S);f.push(N),u.set(x)}return f}(new Uint8Array(e));this.layers=i.reduce((a,s)=>Object.assign(Object.assign({},a),{[s.name]:new z0(s)}),{})}}class A0{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{}
2,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 a of i){let s=[];for(let h of a)s.push(new U(h[0],h[1]));e.push(s)}return e}}let Ac="_geojsonTileLayer";function D0(r,e){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);let i={keys:[],values:[],keycache:{},valuecache:{}};for(let h=0;h<r.length;h++)i.feature=r.feature(h),e.writeMessage(2,R0,i);let a=i.keys;for(let h of a)e.writeStringField(3,h);let s=i.values;for(let h of s)e.writeMessage(4,B0,h)}function R0(r,e){if(!r.feature)return;let i=r.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,F0,r),e.writeVarintField(3,i.type),e.writeMessage(4,O0,i)}function F0(r,e){var i;for(let a in(i=r.feature)==null?void 0:i.properties){let s=r.feature.properties[a],h=r.keycache[a];if(s==null)continue;h===void 0&&(r.keys.push(a),h=r.keys.length-1,r.keycache[a]=h),e.writeVarint(h),typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"&&(s=JSON.stringify(s));let u=typeof s+":"+s,f=r.valuecache[u];f===void 0&&(r.values.push(s),f=r.values.length-1,r.valuecache[u]=f),e.writeVarint(f)}}function kp(r,e){return(e<<3)+(7&r)}function Qm(r){return r<<1^r>>31}function O0(r,e){let i=r.loadGeometry(),a=r.type,s=0,h=0;for(let u of i){let f=1;a===1&&(f=u.length),e.writeVarint(kp(1,f));let g=a===3?u.length-1:u.length;for(let x=0;x<g;x++){x===1&&a!==1&&e.writeVarint(kp(2,g-1));let w=u[x].x-s,S=u[x].y-h;e.writeVarint(Qm(w)),e.writeVarint(Qm(S)),s+=w,h+=S}r.type===3&&e.writeVarint(kp(7,1))}}function B0(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 eg{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new cn(bt,16,0),this.grid3D=new cn(bt,16,0),this.featureIndexArray=new D,this.promoteId=i}insert(e,i,a,s,h,u){let f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,s,h);let g=u?this.grid3D:this.grid;for(let x=0;x<i.length;x++){let w=i[x],S=[1/0,1/0,-1/0,-1/0];for(let M=0;M<w.length;M++){let L=w[M];S[0]=Math.min(S[0],L.x),S[1]=Math.min(S[1],L.y),S[2]=Math.max(S[2],L.x),S[3]=Math.max(S[3],L.y)}S[0]<bt&&S[1]<bt&&S[2]>=0&&S[3]>=0&&g.insert(f,S[0],S[1],S[2],S[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new jf(new Fu(this.rawTileData)).layers:new Jm(this.rawTileData).layers,this.sourceLayerCoder=new wm(this.vtLayers?Object.keys(this.vtLayers).sort():[Ac])),this.vtLayers}query(e,i,a,s){this.loadVTLayers();let h=e.params,u=bt/e.tileSize/e.scale,f=zo(h.filter,h.globalState),g=e.queryGeometry,x=e.queryPadding*u,w=es.fromPoints(g),S=this.grid.query(w.minX-x,w.minY-x,w.maxX+x,w.maxY+x),M=es.fromPoints(e.cameraQueryGeometry).expandBy(x),L=this.grid3D.query(M.minX,M.minY,M.maxX,M.maxY,(F,N,H,V)=>function(Z,Q,ae,de,we){for(let Ie of Z)if(Q<=Ie.x&&ae<=Ie.y&&de>=Ie.x&&we>=Ie.y)return!0;let Se=[new U(Q,ae),new U(Q,we),new U(de,we),new U(de,ae)];if(Z.length>2){for(let Ie of Se)if(el(Z,Ie))return!0}for(let Ie=0;Ie<Z.length-1;Ie++)if(Vy(Z[Ie],Z[Ie+1],Se))return!0;return!1}(e.cameraQueryGeometry,F-x,N-x,H+x,V+x));for(let F of L)S.push(F);S.sort(j0);let k={},A;for(let F=0;F<S.length;F++){let N=S[F];if(N===A)continue;A=N;let H=this.featureIndexArray.get(N),V=null;this.loadMatchingFeature(k,H.bucketIndex,H.sourceLayerIndex,H.featureIndex,f,h.layers,h.availableImages,i,a,s,(Z,Q,ae)=>(V||(V=ur(Z)),Q.queryIntersectsFeature({queryGeometry:g,feature:Z,featureState:ae,geometry:V,zoom:this.z,transform:e.transform,pixelsToTileUnits:u,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return k}loadMatchingFeature(e,i,a,s,h,u,f,g,x,w,S){let M=this.bucketLayerIDs[i];if(u&&!M.some(F=>u.has(F)))return;let L=this.sourceLayerCoder.decode(a),k=this.vtLayers[L].feature(s);if(h.needGeometry){let F=Fn(k,!0);
vendor: 16,995 bytes, line 2
2if(!h.filter(new Et(this.tileID.overscaledZ),F,this.tileID.canonical))return}else if(!h.filter(new Et(this.tileID.overscaledZ),k))return;let A=this.getId(k,L);for(let F=0;F<M.length;F++){let N=M[F];if(u&&!u.has(N))continue;let H=g[N];if(!H)continue;let V={};A&&w&&(V=w.getState(H.sourceLayer||Ac,A));let Z=Wi({},x[N]);Z.paint=tg(Z.paint,H.paint,k,V,f),Z.layout=tg(Z.layout,H.layout,k,V,f);let Q=!S||S(k,H,V);if(!Q)continue;let ae=new Sm(k,this.z,this.x,this.y,A);ae.layer=Z;let de=e[N];de===void 0&&(de=e[N]=[]),de.push({featureIndex:s,feature:ae,intersectionZ:Q})}}lookupSymbolFeatures(e,i,a,s,h,u,f,g){let x={};this.loadVTLayers();let w=zo(h.filterSpec,h.globalState);for(let S of e)this.loadMatchingFeature(x,a,s,S,w,u,f,g,i);return x}hasLayer(e){for(let i of this.bucketLayerIDs)for(let a of i)if(e===a)return!0;return!1}getId(e,i){var a;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&&(!((a=e.properties)===null||a===void 0)&&a.cluster)&&this.promoteId&&(s=Number(e.properties.cluster_id))),s}}function tg(r,e,i,a,s){return Gn(r,(h,u)=>{let f=e instanceof Zo?e.get(u):null;return f&&f.evaluate?f.evaluate(i,a,s):f})}function j0(r,e){return e-r}function ig(r,e,i,a,s){let h=[];for(let u=0;u<r.length;u++){let f=r[u],g;for(let x=0;x<f.length-1;x++){let w=f[x],S=f[x+1];w.x<e&&S.x<e||(w.x<e?w=new U(e,w.y+(e-w.x)/(S.x-w.x)*(S.y-w.y))._round():S.x<e&&(S=new U(e,w.y+(e-w.x)/(S.x-w.x)*(S.y-w.y))._round()),w.y<i&&S.y<i||(w.y<i?w=new U(w.x+(i-w.y)/(S.y-w.y)*(S.x-w.x),i)._round():S.y<i&&(S=new U(w.x+(i-w.y)/(S.y-w.y)*(S.x-w.x),i)._round()),w.x>=a&&S.x>=a||(w.x>=a?w=new U(a,w.y+(a-w.x)/(S.x-w.x)*(S.y-w.y))._round():S.x>=a&&(S=new U(a,w.y+(a-w.x)/(S.x-w.x)*(S.y-w.y))._round()),w.y>=s&&S.y>=s||(w.y>=s?w=new U(w.x+(s-w.y)/(S.y-w.y)*(S.x-w.x),s)._round():S.y>=s&&(S=new U(w.x+(s-w.y)/(S.y-w.y)*(S.x-w.x),s)._round()),g&&w.equals(g[g.length-1])||(g=[w],h.push(g)),g.push(S)))))}}return h}function rg(r,e,i,a,s){switch(e){case 1:return function(h,u,f,g){let x=[];for(let w of h)for(let S of w){let M=g===0?S.x:S.y;M>=u&&M<=f&&x.push([S])}return x}(r,i,a,s);case 2:return ng(r,i,a,s,!1);case 3:return ng(r,i,a,s,!0)}return[]}function V0(r,e,i,a,s){let h=a===0?N0:U0,u=[],f=[];for(let w=0;w<r.length-1;w++){let S=r[w],M=r[w+1],L=a===0?S.x:S.y,k=a===0?M.x:M.y,A=!1;L<e?k>e&&u.push(h(S,M,e)):L>i?k<i&&u.push(h(S,M,i)):u.push(S),k<e&&L>=e&&(u.push(h(S,M,e)),A=!0),k>i&&L<=i&&(u.push(h(S,M,i)),A=!0),!s&&A&&(f.push(u),u=[])}let g=r.length-1,x=a===0?r[g].x:r[g].y;return x>=e&&x<=i&&u.push(r[g]),s&&u.length>0&&!u[0].equals(u[u.length-1])&&u.push(new U(u[0].x,u[0].y)),u.length>0&&f.push(u),f}function ng(r,e,i,a,s){let h=[];for(let u of r){let f=V0(u,e,i,a,s);f.length>0&&h.push(...f)}return h}function N0(r,e,i){return new U(i,r.y+(i-r.x)/(e.x-r.x)*(e.y-r.y))}function U0(r,e,i){return new U(r.x+(i-r.y)/(e.y-r.y)*(e.x-r.x),i)}Ue("FeatureIndex",eg,{omit:["rawTileData","sourceLayerCoder"]});class eo extends U{constructor(e,i,a,s){super(e,i),this.angle=a,s!==void 0&&(this.segment=s)}clone(){return new eo(this.x,this.y,this.angle,this.segment)}}function ag(r,e,i,a,s){if(e.segment===void 0||i===0)return!0;let h=e,u=e.segment+1,f=0;for(;f>-i/2;){if(u--,u<0)return!1;f-=r[u].dist(h),h=r[u]}f+=r[u].dist(r[u+1]),u++;let g=[],x=0;for(;f<i/2;){let w=r[u],S=r[u+1];if(!S)return!1;let M=r[u-1].angleTo(w)-w.angleTo(S);for(M=Math.abs((M+3*Math.PI)%(2*Math.PI)-Math.PI),g.push({distance:f,angleDelta:M}),x+=M;f-g[0].distance>a;)x-=g.shift().angleDelta;if(x>s)return!1;u++,f+=w.dist(S)}return!0}function og(r){let e=0;for(let i=0;i<r.length-1;i++)e+=r[i].dist(r[i+1]);return e}function sg(r,e,i){return r?.6*e*i:0}function lg(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}function G0(r,e,i,a,s,h){let u=sg(i,s,h),f=lg(i,a)*h,g=0,x=og(r)/2;for(let w=0;w<r.length-1;w++){let S=r[w],M=r[w+1],L=S.dist(M);if(g+L>x){let k=(x-g)/L,A=Ti.number(S.x,M.x,k),F=Ti.number(S.y,M.y,k),N=new eo(A,F,M.angleTo(S),w);return N._round(),!u||ag(r,N,f,u,e)?N:void 0}g+=L}}function Z0(r,e,i,a,s,h,u,f,g){let x=sg(a,h,u),w=lg(a,s),S=w*u,M=r[0].x===0||r[0].x===g||r[0].y===0||r[0].y===g;return e-S<e/4&&(e=S+e/4),cg(r,M?e/2*f%e:(w/2+2*h)*u*f%e,e,x,i,S,M,!1,g)}function cg(r,e,i,a,s,h,u,f,g){let x=h/2,w=og(r),S=0,M=e-i,L=[];for(let k=0;k<r.length-1;k++){let A=r[k],F=r[k+1],N=A.dist(F),H=F.angleTo(A);for(;M+i<S+N;){M+=i;let V=(M-S)/N,Z=Ti.number(A.x,F.x,V),Q=Ti.number(A.y,F.y,V);if(Z>=0&&Z<g&&Q>=0&&Q<g&&M-x>=0&&M+x<=w){let ae=new eo(Z,Q,H,k);ae._round(),a&&!ag(r,ae,h,a,s)||L.push(ae)}}S+=N}return f||L.length||u||(L=cg(r,S/2,i,a,s,h,u,!0,g)),L}function hg(r,e,i,a){let s=[],h=r.image,u=h.pixelRatio,f=h.paddedRect.w-2,g=h.paddedRect.h-2,x={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom},w=h.stretchX||[[0,f]],S=h.stretchY||[[0,g]],M=(be,je)=>be+je[1]-je[0],L=w.reduce(M,0),k=S.reduce(M,0),A=f-L,F=g-k,N=0,H=L,V=0,Z=k,Q=0,ae=A,de=0,we=F;if(h.content&&a){let be=h.content,je=be[2]-be[0],Ze=be[3]-be[1];(h.textFitWidth||h.textFitHeight)&&(x=am(r)),N=Hu(w,0,be[0]),V=Hu(S,0,be[1]),H=Hu(w,be[0],be[2]),Z=Hu(S,be[1],be[3]),Q=be[0]-N,de=be[1]-V,ae=je-H,we=Ze-Z}let Se=x.x1,Ie=x.y1,Be=x.x2-Se,ze=x.y2-Ie,Ce=(be,je,Ze,$e)=>{let Ne=Xu(be.stretch-N,H,Be,Se),dt=Yu(be.fixed-Q,ae,be.stretch,L),Mt=Xu(je.stretch-V,Z,ze,Ie),Gt=Yu(je.fixed-de,we,je.stretch,k),Fi=Xu(Ze.stretch-N,H,Be,Se),$r=Yu(Ze.fixed-Q,ae,Ze.stretch,L),Qi=Xu($e.stretch-V,Z,ze,Ie),Ii=Yu($e.fixed-de,we,$e.stretch,k),Oi=new U(Ne,Mt),ri=new U(Fi,Mt),Mi=new U(Fi,Qi),Zi=new U(Ne,Qi),qi=new U(dt/u,Gt/u),pr=new U($r/u,Ii/u),Bi=e*Math.PI/180;if(Bi){let vi=Math.sin(Bi),$t=Math.cos(Bi),hi=[$t,-vi,vi,$t];Oi._matMult(hi),ri._matMult(hi),Zi._matMult(hi),Mi._matMult(hi)}let fr=be.stretch+be.fixed,Wr=je.stretch+je.fixed;return{tl:Oi,tr:ri,bl:Zi,br:Mi,tex:{x:h.paddedRect.x+1+fr,y:h.paddedRect.y+1+Wr,w:Ze.stretch+Ze.fixed-fr,h:$e.stretch+$e.fixed-Wr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:qi,pixelOffsetBR:pr,minFontScaleX:ae/u/Be,minFontScaleY:we/u/ze,isSDF:i}};if(a&&(h.stretchX||h.stretchY)){let be=ug(w,A,L),je=ug(S,F,k);for(let Ze=0;Ze<be.length-1;Ze++){let $e=be[Ze],Ne=be[Ze+1];for(let dt=0;dt<je.length-1;dt++)s.push(Ce($e,je[dt],Ne,je[dt+1]))}}else s.push(Ce({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:f+1},{fixed:0,stretch:g+1}));return s}function Hu(r,e,i){let a=0;for(let s of r)a+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]));return a}function ug(r,e,i){let a=[{fixed:-1,stretch:0}];for(let[s,h]of r){let u=a[a.length-1];a.push({fixed:s-u.stretch,stretch:u.stretch}),a.push({fixed:s-u.stretch,stretch:u.stretch+(h-s)})}return a.push({fixed:e+1,stretch:i}),a}function Xu(r,e,i,a){return r/e*i+a}function Yu(r,e,i,a){return r-e*i/a}Ue("Anchor",eo);class Ku{constructor(e,i,a,s,h,u,f,g,x,w){var S;if(this.boxStartIndex=e.length,x){let M=u.top,L=u.bottom,k=u.collisionPadding;k&&(M-=k[1],L+=k[3]);let A=L-M;A>0&&(A=Math.max(10,A),this.circleDiameter=A)}else{let M=!((S=u.image)===null||S===void 0)&&S.content&&(u.image.textFitWidth||u.image.textFitHeight)?am(u):{x1:u.left,y1:u.top,x2:u.right,y2:u.bottom};M.y1=M.y1*f-g[0],M.y2=M.y2*f+g[2],M.x1=M.x1*f-g[3],M.x2=M.x2*f+g[1];let L=u.collisionPadding;if(L&&(M.x1-=L[0]*f,M.y1-=L[1]*f,M.x2+=L[2]*f,M.y2+=L[3]*f),w){let k=new U(M.x1,M.y1),A=new U(M.x2,M.y1),F=new U(M.x1,M.y2),N=new U(M.x2,M.y2),H=w*Math.PI/180;k._rotate(H),A._rotate(H),F._rotate(H),N._rotate(H),M.x1=Math.min(k.x,A.x,F.x,N.x),M.x2=Math.max(k.x,A.x,F.x,N.x),M.y1=Math.min(k.y,A.y,F.y,N.y),M.y2=Math.max(k.y,A.y,F.y,N.y)}e.emplaceBack(i.x,i.y,M.x1,M.y1,M.x2,M.y2,a,s,h)}this.boxEndIndex=e.length}}class q0{constructor(e=[],i=(a,s)=>a<s?-1:a>s?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}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:a}=this,s=i[e];for(;e>0;){let h=e-1>>1,u=i[h];if(a(s,u)>=0)break;i[e]=u,e=h}i[e]=s}_down(e){let{data:i,compare:a}=this,s=this.length>>1,h=i[e];for(;e<s;){let u=1+(e<<1),f=u+1;if(f<this.length&&a(i[f],i[u])<0&&(u=f),a(i[u],h)>=0)break;i[e]=i[u],e=u}i[e]=h}}function $0(r,e=1,i=!1){let a=es.fromPoints(r[0]),s=Math.min(a.width(),a.height()),h=s/2,u=new q0([],W0),{minX:f,minY:g,maxX:x,maxY:w}=a;if(s===0)return new U(f,g);for(let L=f;L<x;L+=s)for(let k=g;k<w;k+=s)u.push(new pl(L+h,k+h,h,r));let S=function(L){let k=0,A=0,F=0,N=L[0];for(let H=0,V=N.length,Z=V-1;H<V;Z=H++){let Q=N[H],ae=N[Z],de=Q.x*ae.y-ae.x*Q.y;A+=(Q.x+ae.x)*de,F+=(Q.y+ae.y)*de,k+=3*de}return new pl(A/k,F/k,0,L)}(r),M=u.length;for(;u.length;){let L=u.pop();(L.d>S.d||!S.d)&&(S=L,i&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,M)),L.max-S.d<=e||(h=L.h/2,u.push(new pl(L.p.x-h,L.p.y-h,h,r)),u.push(new pl(L.p.x+h,L.p.y-h,h,r)),u.push(new pl(L.p.x-h,L.p.y+h,h,r)),u.push(new pl(L.p.x+h,L.p.y+h,h,r)),M+=4)}return i&&(console.log(`num probes: ${M}`),console.log(`best distance: ${S.d}`)),S.p}function W0(r,e){return e.max-r.max}function pl(r,e,i,a){this.p=new U(r,e),this.h=i,this.d=function(s,h){let u=!1,f=1/0;for(let g=0;g<h.length;g++){let x=h[g];for(let w=0,S=x.length,M=S-1;w<S;M=w++){let L=x[w],k=x[M];L.y>s.y!=k.y>s.y&&s.x<(k.x-L.x)*(s.y-L.y)/(k.y-L.y)+L.x&&(u=!u),f=Math.min(f,ff(s,L,k))}}return(u?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var Ri;b.aP=void 0,(Ri=b.aP||(b.aP={}))[Ri.center=1]="center",Ri[Ri.left=2]="left",Ri[Ri.right=3]="right",Ri[Ri.top=4]="top",Ri[Ri.bottom=5]="bottom",Ri[Ri["top-left"]=6]="top-left",Ri[Ri["top-right"]=7]="top-right",Ri[Ri["bottom-left"]=8]="bottom-left",Ri[Ri["bottom-right"]=9]="bottom-right";let zp=Number.POSITIVE_INFINITY;function dg(r,e){return e[1]!==zp?function(i,a,s){let h=0,u=0;switch(a=Math.abs(a),s=Math.abs(s),i){case"top-right":case"top-left":case"top":u=s-7;break;case"bottom-right":case"bottom-left":case"bottom":u=7-s}switch(i){case"top-right":case"bottom-right":case"right":h=-a;break;case"top-left":case"bottom-left":case"left":h=a}return[h,u]}(r,e[0],e[1]):function(i,a){let s=0,h=0;a<0&&(a=0);let u=a/Math.SQRT2;switch(i){case"top-right":case"top-left":h=u-7;break;case"bottom-right":case"bottom-left":h=7-u;break;case"bottom":h=7-a;break;case"top":h=a-7}switch(i){case"top-right":case"bottom-right":s=-u;break;case"top-left":case"bottom-left":s=u;break;case"left":s=a;break;case"right":s=-a}return[s,h]}(r,e[0])}function pg(r,e,i){var a;let s=r.layout,h=(a=s.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},i);if(h){let f=h.values,g=[];for(let x=0;x<f.length;x+=2){let w=g[x]=f[x],S=f[x+1].map(M=>M*_i);w.startsWith("top")?S[1]-=7:w.startsWith("bottom")&&(S[1]+=7),g[x+1]=S}return new oi(g)}let u=s.get("text-variable-anchor");if(u){let f;f=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[s.get("text-radial-offset").evaluate(e,{},i)*_i,zp]:s.get("text-offset").evaluate(e,{},i).map(x=>x*_i);let g=[];for(let x of u)g.push(x,dg(x,f));return new oi(g)}return null}function Ap(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 H0(r,e,i,a,s,h,u,f,g,x,w,S){let M=h.textMaxSize.evaluate(e,{});M===void 0&&(M=u);let L=r.layers[0].layout,k=L.get("icon-offset").evaluate(e,{},w),A=mg(i.horizontal),F=u/24,N=r.tilePixelRatio*F,H=r.tilePixelRatio*M/24,V=r.tilePixelRatio*f,Z=r.tilePixelRatio*L.get("symbol-spacing"),Q=L.get("text-padding")*r.tilePixelRatio,ae=function(Ze,$e,Ne,dt=1){let Mt=Ze.get("icon-padding").evaluate($e,{},Ne),Gt=Mt&&Mt.values;return[Gt[0]*dt,Gt[1]*dt,Gt[2]*dt,Gt[3]*dt]}(L,e,w,r.tilePixelRatio),de=L.get("text-max-angle")/180*Math.PI,we=L.get("text-rotation-alignment")!=="viewport"&&L.get("symbol-placement")!=="point",Se=L.get("icon-rotation-alignment")==="map"&&L.get("symbol-placement")!=="point",Ie=L.get("symbol-placement"),Be=Z/2,ze=L.get("icon-text-fit"),Ce;a&&ze!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(Ce=om(a,i.vertical,ze,L.get("icon-text-fit-padding"),k,F)),A&&(a=om(a,A,ze,L.get("icon-text-fit-padding"),k,F)));let be=w?S.line.getGranularityForZoomLevel(w.z):1,je=(Ze,$e)=>{$e.x<0||$e.x>=bt||$e.y<0||$e.y>=bt||function(Ne,dt,Mt,Gt,Fi,$r,Qi,Ii,Oi,ri,Mi,Zi,qi,pr,Bi,fr,Wr,vi,$t,hi,Kt,bi,fa,yn,Fc){let to=Ne.addToLineVertexArray(dt,Mt),is,fl,ml,gl,xg=0,vg=0,bg=0,wg=0,Np=-1,Up=-1,ma={},Sg=Ht("");if(Ne.allowVerticalPlacement&&Gt.vertical){let $i=Ii.layout.get("text-rotate").evaluate(Kt,{},yn)+90;ml=new Ku(Oi,dt,ri,Mi,Zi,Gt.vertical,qi,pr,Bi,$i),Qi&&(gl=new Ku(Oi,dt,ri,Mi,Zi,Qi,Wr,vi,Bi,$i))}if(Fi){let $i=Ii.layout.get("icon-rotate").evaluate(Kt,{}),Fr=Ii.layout.get("icon-text-fit")!=="none",rs=hg(Fi,$i,fa,Fr),xn=Qi?hg(Qi,$i,fa,Fr):void 0;fl=new Ku(Oi,dt,ri,Mi,Zi,Fi,Wr,vi,!1,$i),xg=4*rs.length;let ns=Ne.iconSizeData,On=null;ns.kind==="source"?(On=[pa*Ii.layout.get("icon-size").evaluate(Kt,{})],On[0]>Ya&&ki(`${Ne.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):ns.kind==="composite"&&(On=[pa*bi.compositeIconSizes[0].evaluate(Kt,{},yn),pa*bi.compositeIconSizes[1].evaluate(Kt,{},yn)],(On[0]>Ya||On[1]>Ya)&&ki(`${Ne.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ne.addSymbols(Ne.icon,rs,On,hi,$t,Kt,b.az.none,dt,to.lineStartIndex,to.lineLength,-1,yn),Np=Ne.icon.placedSymbolArray.length-1,xn&&(vg=4*xn.length,Ne.addSymbols(Ne.icon,xn,On,hi,$t,Kt,b.az.vertical,dt,to.lineStartIndex,to.lineLength,-1,yn),Up=Ne.icon.placedSymbolArray.length-1)}let Tg=Object.keys(Gt.horizontal);for(let $i of Tg){let Fr=Gt.horizontal[$i];if(!is){Sg=Ht(Fr.text);let xn=Ii.layout.get("text-rotate").evaluate(Kt,{},yn);is=new Ku(Oi,dt,ri,Mi,Zi,Fr,qi,pr,Bi,xn)}let rs=Fr.positionedLines.length===1;if(bg+=fg(Ne,dt,Fr,$r,Ii,Bi,Kt,fr,to,Gt.vertical?b.az.horizontal:b.az.horizontalOnly,rs?Tg:[$i],ma,Np,bi,yn),rs)break}Gt.vertical&&(wg+=fg(Ne,dt,Gt.vertical,$r,Ii,Bi,Kt,fr,to,b.az.vertical,["vertical"],ma,Up,bi,yn));let K0=is?is.boxStartIndex:Ne.collisionBoxArray.length,J0=is?is.boxEndIndex:Ne.collisionBoxArray.length,Q0=ml?ml.boxStartIndex:Ne.collisionBoxArray.length,ex=ml?ml.boxEndIndex:Ne.collisionBoxArray.length,tx=fl?fl.boxStartIndex:Ne.collisionBoxArray.length,ix=fl?fl.boxEndIndex:Ne.collisionBoxArray.length,rx=gl?gl.boxStartIndex:Ne.collisionBoxArray.length,nx=gl?gl.boxEndIndex:Ne.collisionBoxArray.length,_n=-1,Qu=($i,Fr)=>$i&&$i.circleDiameter?Math.max($i.circleDiameter,Fr):Fr;_n=Qu(is,_n),_n=Qu(ml,_n),_n=Qu(fl,_n),_n=Qu(gl,_n);let Pg=_n>-1?1:0;Pg&&(_n*=Fc/_i),Ne.glyphOffsetArray.length>=sl.MAX_GLYPHS&&ki("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Kt.sortKey!==void 0&&Ne.addToSortKeyRanges(Ne.symbolInstances.length,Kt.sortKey);let ax=pg(Ii,Kt,yn),[ox,sx]=function($i,Fr){let rs=$i.length,xn=Fr==null?void 0:Fr.values;if((xn==null?void 0:xn.length)>0)for(let ns=0;ns<xn.length;ns+=2){let On=xn[ns+1];$i.emplaceBack(b.aP[xn[ns]],On[0],On[1])}return[rs,$i.length]}(Ne.textAnchorOffsets,ax);Ne.symbolInstances.emplaceBack(dt.x,dt.y,ma.right>=0?ma.right:-1,ma.center>=0?ma.center:-1,ma.left>=0?ma.left:-1,ma.vertical||-1,Np,Up,Sg,K0,J0,Q0,ex,tx,ix,rx,nx,ri,bg,wg,xg,vg,Pg,0,qi,_n,ox,sx)}(r,$e,Ze,i,a,s,Ce,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,N,[Q,Q,Q,Q],we,g,V,ae,Se,k,e,h,x,w,u)};if(Ie==="line")for(let Ze of ig(e.geometry,0,0,bt,bt)){let $e=Qo(Ze,be),Ne=Z0($e,Z,de,i.vertical||A,a,24,H,r.overscaling,bt);for(let dt of Ne)A&&X0(r,A.text,Be,dt)||je($e,dt)}else if(Ie==="line-center"){for(let Ze of e.geometry)if(Ze.length>1){let $e=Qo(Ze,be),Ne=G0($e,de,i.vertical||A,a,24,H);Ne&&je($e,Ne)}}else if(e.type==="Polygon")for(let Ze of To(e.geometry,0)){let $e=$0(Ze,16);je(Qo(Ze[0],be,!0),new eo($e.x,$e.y,0))}else if(e.type==="LineString")for(let Ze of e.geometry){let $e=Qo(Ze,be);je($e,new eo($e[0].x,$e[0].y,0))}else if(e.type==="Point")for(let Ze of e.geometry)for(let $e of Ze)je([$e],new eo($e.x,$e.y,0))}function fg(r,e,i,a,s,h,u,f,g,x,w,S,M,L,k){let A=function(H,V,Z,Q,ae,de,we,Se){let Ie=Q.layout.get("text-rotate").evaluate(de,{})*Math.PI/180,Be=[];for(let ze of V.positionedLines)for(let Ce of ze.positionedGlyphs){if(!Ce.rect)continue;let be=Ce.rect||{},je=4,Ze=!0,$e=1,Ne=0,dt=(ae||Se)&&Ce.vertical,Mt=Ce.metrics.advance*Ce.scale/2;if(Se&&V.verticalizable&&(Ne=ze.lineOffset/2-(Ce.imageName?-(_i-Ce.metrics.width*Ce.scale)/2:(Ce.scale-1)*_i)),Ce.imageName){let vi=we[Ce.imageName];Ze=vi.sdf,$e=vi.pixelRatio,je=1/$e}let Gt=ae?[Ce.x+Mt,Ce.y]:[0,0],Fi=ae?[0,0]:[Ce.x+Mt+Z[0],Ce.y+Z[1]-Ne],$r=[0,0];dt&&($r=Fi,Fi=[0,0]);let Qi=Ce.metrics.isDoubleResolution?2:1,Ii=(Ce.metrics.left-je)*Ce.scale-Mt+Fi[0],Oi=(-Ce.metrics.top-je)*Ce.scale+Fi[1],ri=Ii+be.w/Qi*Ce.scale/$e,Mi=Oi+be.h/Qi*Ce.scale/$e,Zi=new U(Ii,Oi),qi=new U(ri,Oi),pr=new U(Ii,Mi),Bi=new U(ri,Mi);if(dt){let vi=new U(-Mt,Mt- -17),$t=-Math.PI/2,hi=12-Mt,Kt=new U(22-hi,-(Ce.imageName?hi:0)),bi=new U(...$r);
2Zi._rotateAround($t,vi)._add(Kt)._add(bi),qi._rotateAround($t,vi)._add(Kt)._add(bi),pr._rotateAround($t,vi)._add(Kt)._add(bi),Bi._rotateAround($t,vi)._add(Kt)._add(bi)}if(Ie){let vi=Math.sin(Ie),$t=Math.cos(Ie),hi=[$t,-vi,vi,$t];Zi._matMult(hi),qi._matMult(hi),pr._matMult(hi),Bi._matMult(hi)}let fr=new U(0,0),Wr=new U(0,0);Be.push({tl:Zi,tr:qi,bl:pr,br:Bi,tex:be,writingMode:V.writingMode,glyphOffset:Gt,sectionIndex:Ce.sectionIndex,isSDF:Ze,pixelOffsetTL:fr,pixelOffsetBR:Wr,minFontScaleX:0,minFontScaleY:0})}return Be}(0,i,f,s,h,u,a,r.allowVerticalPlacement),F=r.textSizeData,N=null;F.kind==="source"?(N=[pa*s.layout.get("text-size").evaluate(u,{})],N[0]>Ya&&ki(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):F.kind==="composite"&&(N=[pa*L.compositeTextSizes[0].evaluate(u,{},k),pa*L.compositeTextSizes[1].evaluate(u,{},k)],(N[0]>Ya||N[1]>Ya)&&ki(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),r.addSymbols(r.text,A,N,f,h,u,x,e,g.lineStartIndex,g.lineLength,M,k);for(let H of w)S[H]=r.text.placedSymbolArray.length-1;return 4*A.length}function mg(r){for(let e in r)return r[e];return null}function X0(r,e,i,a){let s=r.compareText;if(e in s){let h=s[e];for(let u=h.length-1;u>=0;u--)if(a.dist(h[u])<i)return!0}else s[e]=[];return s[e].push(a),!1}let gg=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Dp{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[i,a]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=a>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);let h=gg[15&a];if(!h)throw new Error("Unrecognized array type.");let[u]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new Dp(f,u,h,e)}constructor(e,i=64,a=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=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let h=gg.indexOf(this.ArrayType),u=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,g=(8-f%8)%8;if(h<0)throw new Error(`Unexpected typed array class: ${a}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+u+f+g),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+g,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+h]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){let a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=i,a}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Rp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,a,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:h,coords:u,nodeSize:f}=this,g=[0,h.length-1,0],x=[];for(;g.length;){let w=g.pop()||0,S=g.pop()||0,M=g.pop()||0;if(S-M<=f){for(let F=M;F<=S;F++){let N=u[2*F],H=u[2*F+1];N>=e&&N<=a&&H>=i&&H<=s&&x.push(h[F])}continue}let L=M+S>>1,k=u[2*L],A=u[2*L+1];k>=e&&k<=a&&A>=i&&A<=s&&x.push(h[L]),(w===0?e<=k:i<=A)&&(g.push(M),g.push(L-1),g.push(1-w)),(w===0?a>=k:s>=A)&&(g.push(L+1),g.push(S),g.push(1-w))}return x}within(e,i,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:s,coords:h,nodeSize:u}=this,f=[0,s.length-1,0],g=[],x=a*a;for(;f.length;){let w=f.pop()||0,S=f.pop()||0,M=f.pop()||0;if(S-M<=u){for(let F=M;F<=S;F++)_g(h[2*F],h[2*F+1],e,i)<=x&&g.push(s[F]);continue}let L=M+S>>1,k=h[2*L],A=h[2*L+1];_g(k,A,e,i)<=x&&g.push(s[L]),(w===0?e-a<=k:i-a<=A)&&(f.push(M),f.push(L-1),f.push(1-w)),(w===0?e+a>=k:i+a>=A)&&(f.push(L+1),f.push(S),f.push(1-w))}return g}}
2function Rp(r,e,i,a,s,h){if(s-a<=i)return;let u=a+s>>1;yg(r,e,u,a,s,h),Rp(r,e,i,a,u-1,1-h),Rp(r,e,i,u+1,s,1-h)}function yg(r,e,i,a,s,h){for(;s>a;){if(s-a>600){let x=s-a+1,w=i-a+1,S=Math.log(x),M=.5*Math.exp(2*S/3),L=.5*Math.sqrt(S*M*(x-M)/x)*(w-x/2<0?-1:1);yg(r,e,i,Math.max(a,Math.floor(i-w*M/x+L)),Math.min(s,Math.floor(i+(x-w)*M/x+L)),h)}let u=e[2*i+h],f=a,g=s;for(Dc(r,e,a,i),e[2*s+h]>u&&Dc(r,e,a,s);f<g;){for(Dc(r,e,f,g),f++,g--;e[2*f+h]<u;)f++;for(;e[2*g+h]>u;)g--}e[2*a+h]===u?Dc(r,e,a,g):(g++,Dc(r,e,g,s)),g<=i&&(a=g+1),i<=g&&(s=g-1)}}function Dc(r,e,i,a){Fp(r,i,a),Fp(e,2*i,2*a),Fp(e,2*i+1,2*a+1)}function Fp(r,e,i){let a=r[e];r[e]=r[i],r[i]=a}function _g(r,e,i,a){let s=r-i,h=e-a;return s*s+h*h}var Op;b.cI=void 0,(Op=b.cI||(b.cI={})).create="create",Op.load="load",Op.fullLoad="fullLoad";let Ju=null,Rc=[],Bp=1e3/60,jp="loadTime",Vp="fullLoadTime",Y0={mark(r){performance.mark(r)},recordStartOfFrameAt(r){Ju!=null&&Rc.push(r-Ju),Ju=r},resetRuntimeMetrics(){Ju=null,Rc=[]},clearInitializationMetrics(){performance.clearMeasures(jp),performance.clearMeasures(Vp);for(let r in b.cI)performance.clearMarks(b.cI[r])},remove(){this.resetRuntimeMetrics(),this.clearInitializationMetrics()},getPerformanceMetrics(){performance.measure(jp,b.cI.create,b.cI.load),performance.measure(Vp,b.cI.create,b.cI.fullLoad);let r=performance.getEntriesByName(jp)[0].duration,e=performance.getEntriesByName(Vp)[0].duration,i=Rc.length;return{loadTimeMs:r,fullLoadTimeMs:e,averageFramesPerSecond:1/(Rc.reduce((a,s)=>a+s,0)/i/1e3),virtualDroppedFramesCount:Rc.filter(a=>a>Bp).reduce((a,s)=>a+(s-Bp)/Bp,0),totalFramesCount:i}}};b.$=ce,b.A=ft,b.B=du,b.C=Ur,b.D=We,b.E=xe,b.F=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)}},b.G=Ti,b.H=Et,b.I=op,b.J=Vo,b.K=function(r){if(Bt==null){let e=r.navigator?r.navigator.userAgent:null;Bt=!!r.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Bt},b.L=class{constructor(r,e){this.target=r,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new u0(()=>this.process()),this.subscription=In(this.target,"message",i=>this.receive(i),!1),this.globalScope=Vr(self)?r:window}registerMessageHandler(r,e){this.messageHandlers[r]=e}unregisterMessageHandler(r){delete this.messageHandlers[r]}sendAsync(r,e){return new Promise((i,a)=>{let s=Math.round(1e18*Math.random()).toString(36).substring(0,10),h=e?In(e.signal,"abort",()=>{h==null||h.unsubscribe(),delete this.resolveRejects[s];let g={id:s,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(g)},d0):null;this.resolveRejects[s]={resolve:g=>{h==null||h.unsubscribe(),i(g)},reject:g=>{h==null||h.unsubscribe(),a(g)}};let u=[],f=Object.assign(Object.assign({},r),{id:s,sourceMapId:this.mapId,origin:location.origin,data:hn(r.data,u)});this.target.postMessage(f,{transfer:u})})}receive(r){let e=r.data,i=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!=="resource://android"&&location.origin!=="resource://android"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];let a=this.abortControllers[i];return delete this.abortControllers[i],void(a&&a.abort())}if(Vr(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 l(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(Uo(e.error)):s.resolve(Uo(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=Uo(e.data),a=new AbortController;this.abortControllers[r]=a;try{let s=yield this.messageHandlers[e.type](e.sourceMapId,i,a);this.completeTask(r,null,s)}catch(s){this.completeTask(r,s)}})}completeTask(r,e,i){let a=[];delete this.abortControllers[r];let s={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?hn(e):null,data:hn(i,a)};this.target.postMessage(s,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},b.M=R,b.N=function(){var r=new ft(16);return ft!=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},b.O=function(r,e,i){var a,s,h,u,f,g,x,w,S,M,L,k,A=i[0],F=i[1],N=i[2];return e===r?(r[12]=e[0]*A+e[4]*F+e[8]*N+e[12],r[13]=e[1]*A+e[5]*F+e[9]*N+e[13],r[14]=e[2]*A+e[6]*F+e[10]*N+e[14],r[15]=e[3]*A+e[7]*F+e[11]*N+e[15]):(s=e[1],h=e[2],u=e[3],f=e[4],g=e[5],x=e[6],w=e[7],S=e[8],M=e[9],L=e[10],k=e[11],r[0]=a=e[0],r[1]=s,r[2]=h,r[3]=u,r[4]=f,r[5]=g,r[6]=x,r[7]=w,r[8]=S,r[9]=M,r[10]=L,r[11]=k,r[12]=a*A+f*F+S*N+e[12],r[13]=s*A+g*F+M*N+e[13],r[14]=h*A+x*F+L*N+e[14],r[15]=u*A+w*F+k*N+e[15]),r},b.P=U,b.Q=function(r,e,i){var a=i[0],s=i[1],h=i[2];return r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r[3]=e[3]*a,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*h,r[9]=e[9]*h,r[10]=e[10]*h,r[11]=e[11]*h,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},b.R=dr,b.S=function(r,e,i){var a=e[0],s=e[1],h=e[2],u=e[3],f=e[4],g=e[5],x=e[6],w=e[7],S=e[8],M=e[9],L=e[10],k=e[11],A=e[12],F=e[13],N=e[14],H=e[15],V=i[0],Z=i[1],Q=i[2],ae=i[3];return r[0]=V*a+Z*f+Q*S+ae*A,r[1]=V*s+Z*g+Q*M+ae*F,r[2]=V*h+Z*x+Q*L+ae*N,r[3]=V*u+Z*w+Q*k+ae*H,r[4]=(V=i[4])*a+(Z=i[5])*f+(Q=i[6])*S+(ae=i[7])*A,r[5]=V*s+Z*g+Q*M+ae*F,r[6]=V*h+Z*x+Q*L+ae*N,r[7]=V*u+Z*w+Q*k+ae*H,r[8]=(V=i[8])*a+(Z=i[9])*f+(Q=i[10])*S+(ae=i[11])*A,r[9]=V*s+Z*g+Q*M+ae*F,r[10]=V*h+Z*x+Q*L+ae*N,r[11]=V*u+Z*w+Q*k+ae*H,r[12]=(V=i[12])*a+(Z=i[13])*f+(Q=i[14])*S+(ae=i[15])*A,r[13]=V*s+Z*g+Q*M+ae*F,r[14]=V*h+Z*x+Q*L+ae*N,r[15]=V*u+Z*w+Q*k+ae*H,r},b.T=Kd,b.U=function(r,e){let i={};for(let a=0;a<e.length;a++){let s=e[a];s in r&&(i[s]=r[s])}return i},b.V=Ka,b.W=Ci,b.X=mm,b.Y=fm,b.Z=Ma,b._=l,b.a=lo,b.a$=Li,b.a0=Dt,b.a1=$n,b.a2=Tr,b.a3=ym,b.a4=Vu,b.a5=bt,b.a6=function(r,e,i){if(!r)return e||{};if(!e)return r||{};let a=bm(r),s=bm(e);(function(u,f){f.removeAll&&(u.add.clear(),u.update.clear(),u.remove.clear(),f.remove.clear());for(let g of f.remove)u.add.delete(g),u.update.delete(g);for(let[g,x]of f.update){let w=u.update.get(g);w&&(f.update.set(g,p0(w,x)),u.update.delete(g))}})(a,s);let h={};
vendor: 10,601 bytes, line 2
2if((a.removeAll||s.removeAll)&&(h.removeAll=!0),h.remove=new Set([...a.remove,...s.remove]),h.add=new Map([...a.add,...s.add]),h.update=new Map([...a.update,...s.update]),h.remove.size&&h.add.size)for(let u of h.add.keys())h.remove.delete(u);return function(u){let f={};return u.removeAll&&(f.removeAll=u.removeAll),u.remove&&(f.remove=Array.from(u.remove)),u.add&&(f.add=Array.from(u.add.values())),u.update&&(f.update=Array.from(u.update.values())),f}(h)},b.a7=function(r,e){let i=new Map;if(r==null||r.type==null)return i;if(r.type==="Feature"){let a=mp(r,e);return a==null?void 0:(i.set(a,r),i)}if(r.type==="FeatureCollection"){let a=new Set;for(let s of r.features){let h=mp(s,e);if(h==null||a.has(h))return;a.add(h),i.set(h,s)}return i}},b.a8=function(r,e,i){var a,s;let h=[];if(e.removeAll)r.clear();else if(e.remove)for(let u of e.remove){let f=r.get(u);f&&(h.push(f.geometry),r.delete(u))}if(e.add)for(let u of e.add){let f=mp(u,i);if(f==null)continue;let g=r.get(f);g&&h.push(g.geometry),h.push(u.geometry),r.set(f,u)}if(e.update)for(let u of e.update){let f=r.get(u.id);if(!f)continue;let g=!!u.newGeometry,x=u.removeAllProperties||((a=u.removeProperties)===null||a===void 0?void 0:a.length)>0||((s=u.addOrUpdateProperties)===null||s===void 0?void 0:s.length)>0;if(!g&&!x)continue;h.push(f.geometry);let w=Object.assign({},f);if(r.set(u.id,w),g&&(h.push(u.newGeometry),w.geometry=u.newGeometry),x){if(w.properties=u.removeAllProperties?{}:Object.assign({},w.properties||{}),u.removeProperties)for(let S of u.removeProperties)delete w.properties[S];if(u.addOrUpdateProperties)for(let{key:S,value:M}of u.addOrUpdateProperties)w.properties[S]=M}}return h},b.a9=Ec,b.aA=function(r,{uSize:e,uSizeT:i},{lowerSize:a,upperSize:s}){return r.kind==="source"?a/pa:r.kind==="composite"?Ti.number(a/pa,s/pa,i):e},b.aB=function(r,e){var i=e[0],a=e[1],s=e[2],h=e[3],u=e[4],f=e[5],g=e[6],x=e[7],w=e[8],S=e[9],M=e[10],L=e[11],k=e[12],A=e[13],F=e[14],N=e[15],H=i*f-a*u,V=i*g-s*u,Z=i*x-h*u,Q=a*g-s*f,ae=a*x-h*f,de=s*x-h*g,we=w*A-S*k,Se=w*F-M*k,Ie=w*N-L*k,Be=S*F-M*A,ze=S*N-L*A,Ce=M*N-L*F,be=H*Ce-V*ze+Z*Be+Q*Ie-ae*Se+de*we;return be?(r[0]=(f*Ce-g*ze+x*Be)*(be=1/be),r[1]=(s*ze-a*Ce-h*Be)*be,r[2]=(A*de-F*ae+N*Q)*be,r[3]=(M*ae-S*de-L*Q)*be,r[4]=(g*Ie-u*Ce-x*Se)*be,r[5]=(i*Ce-s*Ie+h*Se)*be,r[6]=(F*Z-k*de-N*V)*be,r[7]=(w*de-M*Z+L*V)*be,r[8]=(u*ze-f*Ie+x*we)*be,r[9]=(a*Ie-i*ze-h*we)*be,r[10]=(k*ae-A*Z+N*H)*be,r[11]=(S*Z-w*ae-L*H)*be,r[12]=(f*Se-u*Be-g*we)*be,r[13]=(i*Be-a*Se+s*we)*be,r[14]=(A*V-k*Q-F*H)*be,r[15]=(w*Q-S*V+M*H)*be,r):null},b.aC=Kr,b.aD=function(r){var e=r[0],i=r[1];return Math.sqrt(e*e+i*i)},b.aE=function(r){return r[0]=0,r[1]=0,r},b.aF=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r},b.aG=cp,b.aH=Sn,b.aI=function(r,e,i,a){let s=e.y-r.y,h=e.x-r.x,u=a.y-i.y,f=a.x-i.x,g=u*h-f*s;if(g===0)return null;let x=(f*(r.y-i.y)-u*(r.x-i.x))/g;return new U(r.x+x*h,r.y+x*s)},b.aJ=ig,b.aK=_c,b.aL=function(r){let e=1/0,i=1/0,a=-1/0,s=-1/0;for(let h of r)e=Math.min(e,h.x),i=Math.min(i,h.y),a=Math.max(a,h.x),s=Math.max(s,h.y);return[e,i,a,s]},b.aM=_i,b.aN=Un,b.aO=function(r,e,i,a,s=!1){if(!i[0]&&!i[1])return[0,0];let h=s?a==="map"?-r.bearingInRadians:0:a==="viewport"?r.bearingInRadians:0;if(h){let u=Math.sin(h),f=Math.cos(h);i=[i[0]*f-i[1]*u,i[0]*u+i[1]*f]}return[s?i[0]:Un(e,i[0],r.zoom),s?i[1]:Un(e,i[1],r.zoom)]},b.aQ=lp,b.aR=Ap,b.aS=sp,b.aT=Dp,b.aU=ti,b.aV=Du,b.aW=B,b.aX=ve,b.aY=pe,b.aZ=Qr,b.a_=_m,b.aa=es,b.ab=25,b.ac=fp,b.ad=r=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(i=>{e.onloadstart=()=>{i(e)};for(let a of r){let s=window.document.createElement("source");ue(a)||(e.crossOrigin="Anonymous"),s.src=a,e.appendChild(s)}})},b.ae=Le,b.af=function(){return Ta++},b.ag=o,b.ah=sl,b.ai=Ac,b.aj=zo,b.ak=Fn,b.al=Sm,b.am=function(r){let e={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,a,s,h)=>{let u=s||h;return e[a]=!u||u.toLowerCase(),""}),e["max-age"]){let i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},b.an=yr,b.ao=85.051129,b.ap=Wn,b.aq=function(r){return Math.pow(2,r)},b.ar=di,b.as=gm,b.at=function(r){return Math.log(r)/Math.LN2},b.au=function(r){var e=r[0],i=r[1];return e*e+i*i},b.av=function(r){if(!r.length)return new Set;let e=Math.max(...r.map(g=>g.canonical.z)),i=1/0,a=-1/0,s=1/0,h=-1/0,u=[];for(let g of r){let{x,y:w,z:S}=g.canonical,M=Math.pow(2,e-S),L=x*M,k=w*M;u.push({id:g,x:L,y:k}),L<i&&(i=L),L>a&&(a=L),k<s&&(s=k),k>h&&(h=k)}let f=new Set;for(let g of u)g.x!==i&&g.x!==a&&g.y!==s&&g.y!==h||f.add(g.id);return f},b.aw=function(r,e){let i=Math.abs(2*r.wrap)-+(r.wrap<0),a=Math.abs(2*e.wrap)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||a-i||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x},b.ax=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 a=r.wrapped().key;this.data[a]===void 0&&(this.data[a]=[]);let s={value:e,timeout:void 0};if(i!==void 0&&(s.timeout=setTimeout(()=>{this.remove(r,s)},i)),this.data[a].push(s),this.order.push(a),this.order.length>this.max){let h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}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,a=e===void 0?0:this.data[i].indexOf(e),s=this.data[i][a];return this.data[i].splice(a,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 a of this.data[i])r(a.value)||e.push(a);for(let i of e)this.remove(i.value.tileID,i)}},b.ay=function(r,e){let i=0,a=0;if(r.kind==="constant")a=r.layoutSize;else if(r.kind!=="source"){let{interpolationType:s,minZoom:h,maxZoom:u}=r,f=s?yr(ji.interpolationFactor(s,e,h,u),0,1):0;r.kind==="camera"?a=Ti.number(r.minSize,r.maxSize,f):i=f}return{uSizeT:i,uSize:a}},b.b=qn,b.b$=Yo,b.b0=Lr,b.b1=function(r){var e=new ft(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},b.b2=function(r,e,i){return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],r},b.b3=function(r,e){var i=e[0],a=e[1],s=e[2],h=i*i+a*a+s*s;return h>0&&(h=1/Math.sqrt(h)),r[0]=e[0]*h,r[1]=e[1]*h,r[2]=e[2]*h,r},b.b4=Yr,b.b5=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]},b.b6=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},b.b7=gi,b.b8=function(r,e,i){let a=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return a===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/a},b.b9=Br,b.bA=function(){return new Float64Array(3)},b.bB=wa,b.bC=function(r,e,i){var a=i[0],s=i[1],h=i[2],u=i[3],f=e[0],g=e[1],x=e[2],w=s*x-h*g,S=h*f-a*x,M=a*g-s*f;return r[0]=f+u*(w+=w)+s*(M+=M)-h*(S+=S),r[1]=g+u*S+h*w-a*M,r[2]=x+u*M+a*S-s*w,r},b.bD=function(r,e,i){let a=(s=[r[0],r[1],r[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((w=s[8])*(u=s[4])-(f=s[5])*(x=s[7]))+s[1]*(-w*(h=s[3])+f*(g=s[6]))+s[2]*(x*h-u*g);var s,h,u,f,g,x,w;if(a===0)return null;let S=Yr([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),M=Yr([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),L=Yr([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),k=Li([],S,-r[3]);return Lr(k,k,Li([],M,-e[3])),Lr(k,k,Li([],L,-i[3])),Li(k,k,1/a),k},b.bE=pp,b.bF=function(){return new Float64Array(4)},b.bG=function(r,e,i,a){var s=[],h=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],h[0]=s[0]*Math.cos(a)-s[1]*Math.sin(a),h[1]=s[0]*Math.sin(a)+s[1]*Math.cos(a),h[2]=s[2],r[0]=h[0]+i[0],r[1]=h[1]+i[1],r[2]=h[2]+i[2],r},b.bH=function(r,e,i,a){var s=[],h=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],h[0]=s[0],h[1]=s[1]*Math.cos(a)-s[2]*Math.sin(a),h[2]=s[1]*Math.sin(a)+s[2]*Math.cos(a),r[0]=h[0]+i[0],r[1]=h[1]+i[1],r[2]=h[2]+i[2],r},b.bI=function(r,e,i,a){var s=[],h=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],h[0]=s[2]*Math.sin(a)+s[0]*Math.cos(a),h[1]=s[1],h[2]=s[2]*Math.cos(a)-s[0]*Math.sin(a),r[0]=h[0]+i[0],r[1]=h[1]+i[1],r[2]=h[2]+i[2],r},b.bJ=function(r,e,i){var a=Math.sin(i),s=Math.cos(i),h=e[0],u=e[1],f=e[2],g=e[3],x=e[8],w=e[9],S=e[10],M=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]=h*s-x*a,r[1]=u*s-w*a,r[2]=f*s-S*a,r[3]=g*s-M*a,r[8]=h*a+x*s,r[9]=u*a+w*s,r[10]=f*a+S*s,r[11]=g*a+M*s,r},b.bK=function(r,e){let i=jr(r,360),a=jr(e,360),s=a-i,h=a>i?s-360:s+360;return Math.abs(s)<Math.abs(h)?s:h},b.bL=function(r){return r[0]=0,r[1]=0,r[2]=0,r},b.bM=function(r,e,i,a){let s=Math.sqrt(r*r+e*e),h=Math.sqrt(i*i+a*a);r/=s,e/=s,i/=h,a/=h;let u=Math.acos(r*i+e*a);return-e*i+r*a>0?u:-u},b.bN=function(r,e){let i=jr(r,2*Math.PI),a=jr(e,2*Math.PI);return Math.min(Math.abs(i-a),Math.abs(i-a+2*Math.PI),Math.abs(i-a-2*Math.PI))},b.bO=function(){let r={},e=ie.$version;for(let i in ie.$root){let a=ie.$root[i];if(a.required){let s=null;s=i==="version"?e:a.type==="array"?[]:{},s!=null&&(r[i]=s)}}return r},b.bP=K,b.bQ=ec,b.bR=function r(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let a=0;a<e.length;a++)if(!r(e[a],i[a]))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 a in e)if(!r(e[a],i[a]))return!1;return!0}return e===i},b.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]=nt(r[i],e[r[i].ref]));return r},b.bT=function(r,e){if(r.type==="custom")return new h0(r,e);switch(r.type){case"background":return new c0(r,e);case"circle":return new Wy(r,e);case"color-relief":return new Qy(r,e);case"fill":return new f_(r,e);case"fill-extrusion":return new I_(r,e);case"heatmap":return new Xy(r,e);case"hillshade":return new Ky(r,e);case"line":return new A_(r,e);case"raster":return new Su(r,e);case"symbol":return new ju(r,e)}},b.bU=r=>r.type==="raster",b.bV=Ei,b.bW=function(r,e){if(!r)return[{command:"setStyle",args:[e]}];let i=[];
2try{if(!Qe(r.version,e.version))return[{command:"setStyle",args:[e]}];Qe(r.center,e.center)||i.push({command:"setCenter",args:[e.center]}),Qe(r.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),Qe(r.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),Qe(r.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),Qe(r.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),Qe(r.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),Qe(r.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),Qe(r.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),Qe(r.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),Qe(r.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),Qe(r.light,e.light)||i.push({command:"setLight",args:[e.light]}),Qe(r.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),Qe(r.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),Qe(r.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});let a={},s=[];(function(u,f,g,x){let w;for(w in f=f||{},u=u||{}
vendor: 12,413 bytes, line 2
2)Object.prototype.hasOwnProperty.call(u,w)&&(Object.prototype.hasOwnProperty.call(f,w)||st(w,g,x));for(w in f)Object.prototype.hasOwnProperty.call(f,w)&&(Object.prototype.hasOwnProperty.call(u,w)?Qe(u[w],f[w])||(u[w].type==="geojson"&&f[w].type==="geojson"&&zt(u,f,w)?it(g,{command:"setGeoJSONSourceData",args:[w,f[w].data]}):Lt(w,f,g,x)):rt(w,f,g))})(r.sources,e.sources,s,a);let h=[];r.layers&&r.layers.forEach(u=>{"source"in u&&a[u.source]?i.push({command:"removeLayer",args:[u.id]}):h.push(u)}),i=i.concat(s),function(u,f,g){f=f||[];let x=(u=u||[]).map(Si),w=f.map(Si),S=u.reduce(Wt,{}),M=f.reduce(Wt,{}),L=x.slice(),k=Object.create(null),A,F,N,H,V;for(let Z=0,Q=0;Z<x.length;Z++)A=x[Z],Object.prototype.hasOwnProperty.call(M,A)?Q++:(it(g,{command:"removeLayer",args:[A]}),L.splice(L.indexOf(A,Q),1));for(let Z=0,Q=0;Z<w.length;Z++)A=w[w.length-1-Z],L[L.length-1-Z]!==A&&(Object.prototype.hasOwnProperty.call(S,A)?(it(g,{command:"removeLayer",args:[A]}),L.splice(L.lastIndexOf(A,L.length-Q),1)):Q++,H=L[L.length-Z],it(g,{command:"addLayer",args:[M[A],H]}),L.splice(L.length-Z,0,A),k[A]=!0);for(let Z=0;Z<w.length;Z++)if(A=w[Z],F=S[A],N=M[A],!k[A]&&!Qe(F,N))if(Qe(F.source,N.source)&&Qe(F["source-layer"],N["source-layer"])&&Qe(F.type,N.type)){for(V in Qt(F.layout,N.layout,g,A,null,"setLayoutProperty"),Qt(F.paint,N.paint,g,A,null,"setPaintProperty"),Qe(F.filter,N.filter)||it(g,{command:"setFilter",args:[A,N.filter]}),Qe(F.minzoom,N.minzoom)&&Qe(F.maxzoom,N.maxzoom)||it(g,{command:"setLayerZoomRange",args:[A,N.minzoom,N.maxzoom]}),F)Object.prototype.hasOwnProperty.call(F,V)&&V!=="layout"&&V!=="paint"&&V!=="filter"&&V!=="metadata"&&V!=="minzoom"&&V!=="maxzoom"&&(V.indexOf("paint.")===0?Qt(F[V],N[V],g,A,V.slice(6),"setPaintProperty"):Qe(F[V],N[V])||it(g,{command:"setLayerProperty",args:[A,V,N[V]]}));for(V in N)Object.prototype.hasOwnProperty.call(N,V)&&!Object.prototype.hasOwnProperty.call(F,V)&&V!=="layout"&&V!=="paint"&&V!=="filter"&&V!=="metadata"&&V!=="minzoom"&&V!=="maxzoom"&&(V.indexOf("paint.")===0?Qt(F[V],N[V],g,A,V.slice(6),"setPaintProperty"):Qe(F[V],N[V])||it(g,{command:"setLayerProperty",args:[A,V,N[V]]}))}else it(g,{command:"removeLayer",args:[A]}),H=L[L.lastIndexOf(A)+1],it(g,{command:"addLayer",args:[N,H]})}(h,e.layers,i)}catch(a){console.warn("Unable to compute style diff:",a),i=[{command:"setStyle",args:[e]}]}return i},b.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},b.bY=Gn,b.bZ=Zn,b.b_=class extends Ui{constructor(r,e){super(r,e),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},b.ba=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},b.bb=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]},b.bc=vm,b.bd=ll,b.be=function(r,e,i,a,s){var h=1/Math.tan(e/2);if(r[0]=h/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=h,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 u=1/(a-s);r[10]=(s+a)*u,r[14]=2*s*a*u}else r[10]=-1,r[14]=-2*a;return r},b.bf=function(r){var e=new ft(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},b.bg=function(r,e,i){var a=Math.sin(i),s=Math.cos(i),h=e[0],u=e[1],f=e[2],g=e[3],x=e[4],w=e[5],S=e[6],M=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]=h*s+x*a,r[1]=u*s+w*a,r[2]=f*s+S*a,r[3]=g*s+M*a,r[4]=x*s-h*a,r[5]=w*s-u*a,r[6]=S*s-f*a,r[7]=M*s-g*a,r},b.bh=function(r,e,i){var a=Math.sin(i),s=Math.cos(i),h=e[4],u=e[5],f=e[6],g=e[7],x=e[8],w=e[9],S=e[10],M=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]=h*s+x*a,r[5]=u*s+w*a,r[6]=f*s+S*a,r[7]=g*s+M*a,r[8]=x*s-h*a,r[9]=w*s-u*a,r[10]=S*s-f*a,r[11]=M*s-g*a,r},b.bi=function(){let r=new Float32Array(16);return di(r),r},b.bj=function(){let r=new Float64Array(16);return di(r),r},b.bk=function(){return new Float64Array(16)},b.bl=function(r,e,i){let a=new Float64Array(4);return wa(a,r,e-90,i),a},b.bm=function(r,e,i,a){var s,h,u,f,g,x=e[0],w=e[1],S=e[2],M=e[3],L=i[0],k=i[1],A=i[2],F=i[3];return(h=x*L+w*k+S*A+M*F)<0&&(h=-h,L=-L,k=-k,A=-A,F=-F),1-h>gt?(s=Math.acos(h),u=Math.sin(s),f=Math.sin((1-a)*s)/u,g=Math.sin(a*s)/u):(f=1-a,g=a),r[0]=f*x+g*L,r[1]=f*w+g*k,r[2]=f*S+g*A,r[3]=f*M+g*F,r},b.bn=function(r){let e=new Float64Array(9);var i,a,s,h,u,f,g,x,w,S,M,L,k,A,F,N,H,V;S=(s=(a=r)[0])*(g=s+s),M=(h=a[1])*g,k=(u=a[2])*g,A=u*(x=h+h),N=(f=a[3])*g,H=f*x,V=f*(w=u+u),(i=e)[0]=1-(L=h*x)-(F=u*w),i[3]=M-V,i[6]=k+H,i[1]=M+V,i[4]=1-S-F,i[7]=A-N,i[2]=k-H,i[5]=A+N,i[8]=1-S-L;let Z=Qr(-Math.asin(yr(e[2],-1,1))),Q,ae;return Math.hypot(e[5],e[8])<.001?(Q=0,ae=-Qr(Math.atan2(e[3],e[4]))):(Q=Qr(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),ae=Qr(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:Q,pitch:Z+90,bearing:ae}},b.bo=function(r,e){return r.roll==e.roll&&r.pitch==e.pitch&&r.bearing==e.bearing},b.bp=mt,b.bq=fn,b.br=nl,b.bs=Tc,b.bt=rl,b.bu=so,b.bv=Sa,b.bw=Xi,b.bx=function(r,e,i,a,s){return so(a,s,yr((r-e)/(i-e),0,1))},b.by=function(r,e,i,a){return r[0]=e[0]+i[0]*a,r[1]=e[1]+i[1]*a,r[2]=e[2]+i[2]*a,r},b.bz=jr,b.c=le,b.c$=class{constructor(r){this.start=`${r}#start`,this.end=`${r}#end`,this.measure=r,performance.mark(this.start)}finish(){performance.mark(this.end);let r=performance.getEntriesByName(this.measure);return r.length===0&&(performance.measure(this.measure,this.start,this.end),r=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),r}},b.c0=class extends Ui{constructor(r,e){super(r,e),this.current=Wa}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}}},b.c1=Xo,b.c2=class extends Ui{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]))}},b.c3=class extends Ui{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]))}},b.c4=Ot,b.c5=function(r,e){var i=Math.sin(e),a=Math.cos(e);return r[0]=a,r[1]=i,r[2]=0,r[3]=-i,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},b.c6=function(r,e,i){var a=e[0],s=e[1],h=e[2];return r[0]=a*i[0]+s*i[3]+h*i[6],r[1]=a*i[1]+s*i[4]+h*i[7],r[2]=a*i[2]+s*i[5]+h*i[8],r},b.c7=function(r,e,i,a,s,h,u){var f=1/(e-i),g=1/(a-s),x=1/(h-u);return r[0]=-2*f,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*x,r[11]=0,r[12]=(e+i)*f,r[13]=(s+a)*g,r[14]=(u+h)*x,r[15]=1,r},b.c8=class extends Ui{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)}}},b.c9=class extends Ui{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)}}},b.cA=function(r,e){var i;if(!Mn[e])return!1;let a=r==null?void 0:r.target,s=((i=a==null?void 0:a.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return r instanceof s.MouseEvent||r instanceof s.WheelEvent},b.cB=function(r,e){return en[e]&&"touches"in r},b.cC=function(r){return en[r]||Mn[r]},b.cD=function(r,e,i){var a=e[0],s=e[1];return r[0]=i[0]*a+i[4]*s+i[12],r[1]=i[1]*a+i[5]*s+i[13],r},b.cE=function(r,e){let{x:i,y:a}=Ec.fromLngLat(e);return!(r<0||r>25||a<0||a>=1||i<0||i>=1)},b.cF=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},b.cG=class extends $s{},b.cH=Y0,b.cJ=j,b.cK=function(r,e){le.REGISTERED_PROTOCOLS[r]=e},b.cL=function(r){delete le.REGISTERED_PROTOCOLS[r]},b.cM=function(r,e){let i={};for(let s=0;s<r.length;s++){let h=e&&e[r[s].id]||iu(r[s]);e&&(e[r[s].id]=h);let u=i[h];u||(u=i[h]=[]),u.push(r[s])}let a=[];for(let s in i)a.push(i[s]);return a},b.cN=Ue,b.cO=wm,b.cP=eg,b.cQ=rm,b.cR=function(r){var e;r.bucket.createArrays(),r.bucket.tilePixelRatio=bt/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;let i=r.bucket.layers[0],a=i.layout,s=i._unevaluatedLayout._values,h={layoutIconSize:s["icon-size"].possiblyEvaluate(new Et(r.bucket.zoom+1),r.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new Et(r.bucket.zoom+1),r.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new Et(18))};if(r.bucket.textSizeData.kind==="composite"){let{minZoom:w,maxZoom:S}=r.bucket.textSizeData;h.compositeTextSizes=[s["text-size"].possiblyEvaluate(new Et(w),r.canonical),s["text-size"].possiblyEvaluate(new Et(S),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){let{minZoom:w,maxZoom:S}=r.bucket.iconSizeData;h.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new Et(w),r.canonical),s["icon-size"].possiblyEvaluate(new Et(S),r.canonical)]}let u=a.get("text-line-height")*_i,f=a.get("text-rotation-alignment")!=="viewport"&&a.get("symbol-placement")!=="point",g=a.get("text-keep-upright"),x=a.get("text-size");for(let w of r.bucket.features){let S=a.get("text-font").evaluate(w,{},r.canonical).join(","),M=x.evaluate(w,{},r.canonical),L=h.layoutTextSize.evaluate(w,{},r.canonical),k=h.layoutIconSize.evaluate(w,{},r.canonical),A={horizontal:{},vertical:void 0},F=w.text,N,H=[0,0];if(F){let Q=F.toString(),ae=a.get("text-letter-spacing").evaluate(w,{},r.canonical)*_i,de=Gs(Q)?ae:0,we=a.get("text-anchor").evaluate(w,{},r.canonical),Se=pg(i,w,r.canonical);if(!Se){let Ce=a.get("text-radial-offset").evaluate(w,{},r.canonical);H=Ce?dg(we,[Ce*_i,zp]):a.get("text-offset").evaluate(w,{},r.canonical).map(be=>be*_i)}let Ie=f?"center":a.get("text-justify").evaluate(w,{},r.canonical),Be=a.get("symbol-placement")==="point"?a.get("text-max-width").evaluate(w,{},r.canonical)*_i:1/0,ze=()=>{r.bucket.allowVerticalPlacement&&tc(Q)&&(A.vertical=Ou(F,r.glyphMap,r.glyphPositions,r.imagePositions,S,Be,u,we,"left",de,H,b.az.vertical,!0,L,M))};if(!f&&Se){let Ce=new Set;if(Ie==="auto")for(let je=0;je<Se.values.length;je+=2)Ce.add(Ap(Se.values[je]));else Ce.add(Ie);let be=!1;for(let je of Ce)if(!A.horizontal[je])if(be)A.horizontal[je]=A.horizontal[0];else{let Ze=Ou(F,r.glyphMap,r.glyphPositions,r.imagePositions,S,Be,u,"center",je,de,H,b.az.horizontal,!1,L,M);Ze&&(A.horizontal[je]=Ze,be=Ze.positionedLines.length===1)}ze()}else{Ie==="auto"&&(Ie=Ap(we));let Ce=Ou(F,r.glyphMap,r.glyphPositions,r.imagePositions,S,Be,u,we,Ie,de,H,b.az.horizontal,!1,L,M);Ce&&(A.horizontal[Ie]=Ce),ze(),tc(Q)&&f&&g&&(A.vertical=Ou(F,r.glyphMap,r.glyphPositions,r.imagePositions,S,Be,u,we,Ie,de,H,b.az.vertical,!1,L,M))}}let V=!1;if(w.icon&&w.icon.name){let Q=r.imageMap[w.icon.name];Q&&(N=a0(r.imagePositions[w.icon.name],a.get("icon-offset").evaluate(w,{},r.canonical),a.get("icon-anchor").evaluate(w,{},r.canonical)),V=!!Q.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=V:r.bucket.sdfIcons!==V&&ki("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Q.pixelRatio!==r.bucket.pixelRatio||a.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}let Z=mg(A.horizontal)||A.vertical;(e=r.bucket).iconsInText||(e.iconsInText=!!Z&&Z.iconsInText),(Z||N)&&H0(r.bucket,w,A,N,r.imageMap,h,L,k,H,V,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},b.cS=tp,b.cT=rp,b.cU=np,b.cV=function(r){let e=new Fu;return function(i,a){for(let s in i.layers)a.writeMessage(3,D0,i.layers[s])}(r,e),e.finish()},b.cW=function(r,e,i,a,s,h){let u=rg(r,e,i,s,0);return u=rg(u,e,a,h,1),u},b.cX=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>
2=this.maxEntries){let i=this.map.keys().next().value;this.map.delete(i)}this.map.set(r,e)}clear(){this.map.clear()}},b.cY=jf,b.cZ=Fu,b.c_=Jm,b.ca=class extends $a{},b.cb=O_,b.cc=class extends Ys{},b.cd=Yd,b.ce=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},b.cf=Sf,b.cg=function(r,e,i){var a=e[0],s=e[1],h=e[2],u=i[3]*a+i[7]*s+i[11]*h+i[15];return r[0]=(i[0]*a+i[4]*s+i[8]*h+i[12])/(u=u||1),r[1]=(i[1]*a+i[5]*s+i[9]*h+i[13])/u,r[2]=(i[2]*a+i[6]*s+i[10]*h+i[14])/u,r},b.ch=class extends hc{},b.ci=class extends d{},b.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]},b.ck=function(r,e){var i=r[0],a=r[1],s=r[2],h=r[3],u=r[4],f=r[5],g=r[6],x=r[7],w=r[8],S=r[9],M=r[10],L=r[11],k=r[12],A=r[13],F=r[14],N=r[15],H=e[0],V=e[1],Z=e[2],Q=e[3],ae=e[4],de=e[5],we=e[6],Se=e[7],Ie=e[8],Be=e[9],ze=e[10],Ce=e[11],be=e[12],je=e[13],Ze=e[14],$e=e[15];return Math.abs(i-H)<=gt*Math.max(1,Math.abs(i),Math.abs(H))&&Math.abs(a-V)<=gt*Math.max(1,Math.abs(a),Math.abs(V))&&Math.abs(s-Z)<=gt*Math.max(1,Math.abs(s),Math.abs(Z))&&Math.abs(h-Q)<=gt*Math.max(1,Math.abs(h),Math.abs(Q))&&Math.abs(u-ae)<=gt*Math.max(1,Math.abs(u),Math.abs(ae))&&Math.abs(f-de)<=gt*Math.max(1,Math.abs(f),Math.abs(de))&&Math.abs(g-we)<=gt*Math.max(1,Math.abs(g),Math.abs(we))&&Math.abs(x-Se)<=gt*Math.max(1,Math.abs(x),Math.abs(Se))&&Math.abs(w-Ie)<=gt*Math.max(1,Math.abs(w),Math.abs(Ie))&&Math.abs(S-Be)<=gt*Math.max(1,Math.abs(S),Math.abs(Be))&&Math.abs(M-ze)<=gt*Math.max(1,Math.abs(M),Math.abs(ze))&&Math.abs(L-Ce)<=gt*Math.max(1,Math.abs(L),Math.abs(Ce))&&Math.abs(k-be)<=gt*Math.max(1,Math.abs(k),Math.abs(be))&&Math.abs(A-je)<=gt*Math.max(1,Math.abs(A),Math.abs(je))&&Math.abs(F-Ze)<=gt*Math.max(1,Math.abs(F),Math.abs(Ze))&&Math.abs(N-$e)<=gt*Math.max(1,Math.abs(N),Math.abs($e))},b.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},b.cm=r=>r.type==="symbol",b.cn=r=>r.type==="circle",b.co=r=>r.type==="heatmap",b.cp=r=>r.type==="line",b.cq=r=>r.type==="fill",b.cr=r=>r.type==="fill-extrusion",b.cs=r=>r.type==="hillshade",b.ct=r=>r.type==="color-relief",b.cu=r=>r.type==="background",b.cv=r=>r.type==="custom",b.cw=Tn,b.cx=function(r,e,i){if(e<=0)return r;let a=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(r*a)/a:(i>0?Math.ceil(r*a-1e-9):Math.floor(r*a+1e-10))/a},b.cy=function(r,e,i){let a=ai(e.x-i.x,e.y-i.y),s=ai(r.x-i.x,r.y-i.y);var h,u;return Qr(Math.atan2(a[0]*s[1]-a[1]*s[0],(h=a)[0]*(u=s)[0]+h[1]*u[1]))},b.cz=Jr,b.d=ue,b.d0=function(r,e,i,a,s){return l(this,void 0,void 0,function*(){if(Dt())try{return yield $n(r,e,i,a,s)}catch{}return function(h,u,f,g,x){let w=h.width,S=h.height;Pn&&Nr||(Pn=new OffscreenCanvas(w,S),Nr=Pn.getContext("2d",{willReadFrequently:!0})),Pn.width=w,Pn.height=S,Nr.drawImage(h,0,0,w,S);let M=Nr.getImageData(u,f,g,x);return Nr.clearRect(0,0,w,S),M.data}(r,e,i,a,s)})},b.d1=Mf,b.d2=_e,b.d3=class{constructor(r,e){this.layers={[Ac]:this},this.name=Ac,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=r.length,this.features=r}feature(r){return new A0(this.features[r],this.extent)}},b.d4=oa,b.d5=un,b.e=Wi,b.f=r=>l(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 ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),b.g=z,b.h=r=>new Promise((e,i)=>{let a=new Image;a.onload=()=>{e(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame(()=>{a.src=Pa})},a.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"});a.src=r.byteLength?URL.createObjectURL(s):Pa}),b.i=Vr,b.j=(r,e)=>re(Wi(r,{type:"json"}),e),b.k=Pe,b.l=he,b.m=re,b.n=(r,e)=>re(Wi(r,{type:"arrayBuffer"}),e),b.o=function(r){return new Fu(r).readFields(K_,[])},b.p=im,b.q=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))},b.r=xc,b.s=In,b.t=Vi,b.u=ie,b.v=jo,b.w=ki,b.x=sc,b.y=sr,b.z=qs}),G("worker",["./shared"],function(b){"use strict";class l{constructor(z,R){this.keyCache={},z&&this.replace(z,R)}replace(z,R){this._layerConfigs={},this._layers={},this.update(z,[],R)}update(z,R,j){for(let re of z){this._layerConfigs[re.id]=re;let ue=this._layers[re.id]=b.bT(re,j);ue._featureFilter=b.aj(ue.filter,j),this.keyCache[re.id]&&delete this.keyCache[re.id]}for(let re of R)delete this.keyCache[re],delete this._layerConfigs[re],delete this._layers[re];this.familiesBySource={};let K=b.cM(Object.values(this._layerConfigs),this.keyCache);for(let re of K){let ue=re.map(ie=>this._layers[ie.id]),me=ue[0];if(me.isHidden())continue;let oe=me.source||"",he=this.familiesBySource[oe];he||(he=this.familiesBySource[oe]={});let Pe=me.sourceLayer||b.ai,xe=he[Pe];xe||(xe=he[Pe]=[]),xe.push(ue)}}}class U{constructor(z){let R={},j=[];for(let me in z){let oe=z[me],he=R[me]={};for(let Pe in oe){let xe=oe[+Pe];if(!xe||xe.bitmap.width===0||xe.bitmap.height===0)continue;let ie={x:0,y:0,w:xe.bitmap.width+2,h:xe.bitmap.height+2};j.push(ie),he[Pe]={rect:ie,metrics:xe.metrics}}}let{w:K,h:re}=b.p(j),ue=new b.r({width:K||1,height:re||1});for(let me in z){let oe=z[me];for(let he in oe){let Pe=oe[+he];
vendor: 4,378 bytes, line 2
2if(!Pe||Pe.bitmap.width===0||Pe.bitmap.height===0)continue;let xe=R[me][he].rect;b.r.copy(Pe.bitmap,ue,{x:0,y:0},{x:xe.x+1,y:xe.y+1},Pe.bitmap)}}this.image=ue,this.positions=R}}b.cN("GlyphAtlas",U);class _e{constructor(z){this.tileID=new b.a2(z.tileID.overscaledZ,z.tileID.wrap,z.tileID.canonical.z,z.tileID.canonical.x,z.tileID.canonical.y),this.uid=z.uid,this.zoom=z.zoom,this.pixelRatio=z.pixelRatio,this.tileSize=z.tileSize,this.source=z.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=z.showCollisionBoxes,this.collectResourceTiming=!!z.collectResourceTiming,this.returnDependencies=!!z.returnDependencies,this.promoteId=z.promoteId,this.inFlightDependencies=[]}parse(z,R,j,K,re){return b._(this,void 0,void 0,function*(){this.status="parsing",this.data=z,this.collisionBoxArray=new b.ag;let ue=new b.cO(Object.keys(z.layers).sort()),me=new b.cP(this.tileID,this.promoteId);me.bucketLayerIDs=[];let oe={},he={featureIndex:me,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:j,subdivisionGranularity:re},Pe=R.familiesBySource[this.source];for(let vt in Pe){let jt=z.layers[vt];if(!jt)continue;jt.version===1&&b.w(`Vector tile source "${this.source}" layer "${vt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Hn=ue.encode(vt),tn=[];for(let Ae=0;Ae<jt.length;Ae++){let at=jt.feature(Ae),ot=me.getId(at,vt);tn.push({feature:at,id:ot,index:Ae,sourceLayerIndex:Hn})}for(let Ae of Pe[vt]){let at=Ae[0];at.source!==this.source&&b.w(`layer.source = ${at.source} does not equal this.source = ${this.source}`),at.isHidden(this.zoom,!0)||(Te(Ae,this.zoom,j),(oe[at.id]=at.createBucket({index:me.bucketLayerIDs.length,layers:Ae,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Hn,sourceID:this.source})).populate(tn,he,this.tileID.canonical),me.bucketLayerIDs.push(Ae.map(ot=>ot.id)))}}let xe=b.bY(he.glyphDependencies,vt=>Object.keys(vt).map(Number));this.inFlightDependencies.forEach(vt=>vt==null?void 0:vt.abort()),this.inFlightDependencies=[];let ie=Promise.resolve({});if(Object.keys(xe).length){let vt=new AbortController;this.inFlightDependencies.push(vt),ie=K.sendAsync({type:"GG",data:{stacks:xe,source:this.source,tileID:this.tileID,type:"glyphs"}},vt)}let He=Object.keys(he.iconDependencies),nt=Promise.resolve({});if(He.length){let vt=new AbortController;this.inFlightDependencies.push(vt),nt=K.sendAsync({type:"GI",data:{icons:He,source:this.source,tileID:this.tileID,type:"icons"}},vt)}let Qe=Object.keys(he.patternDependencies),it=Promise.resolve({});if(Qe.length){let vt=new AbortController;this.inFlightDependencies.push(vt),it=K.sendAsync({type:"GI",data:{icons:Qe,source:this.source,tileID:this.tileID,type:"patterns"}},vt)}let rt=he.dashDependencies,st=Promise.resolve({});if(Object.keys(rt).length){let vt=new AbortController;this.inFlightDependencies.push(vt),st=K.sendAsync({type:"GDA",data:{dashes:rt}},vt)}let[Lt,zt,Qt,Si]=yield Promise.all([ie,nt,it,st]),Wt=new U(Lt),Le=new b.cQ(zt,Qt);for(let vt in oe){let jt=oe[vt];jt instanceof b.ah?(Te(jt.layers,this.zoom,j),b.cR({bucket:jt,glyphMap:Lt,glyphPositions:Wt.positions,imageMap:zt,imagePositions:Le.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:he.subdivisionGranularity})):jt.hasDependencies&&(jt instanceof b.cS||jt instanceof b.cT||jt instanceof b.cU)&&(Te(jt.layers,this.zoom,j),jt.addFeatures(he,this.tileID.canonical,Le.patternPositions,Si))}return this.status="done",{buckets:Object.values(oe).filter(vt=>!vt.isEmpty()),featureIndex:me,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Wt.image,imageAtlas:Le,dashPositions:Si,glyphMap:this.returnDependencies?Lt:null,iconMap:this.returnDependencies?zt:null,glyphPositions:this.returnDependencies?Wt.positions:null}})}}function Te(le,z,R){let j=new b.H(z);for(let K of le)K.recalculate(j,R)}class Ee{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(z,R){this.loading[z]=R}finishLoading(z){delete this.loading[z]}abort(z){let R=this.loading[z];R!=null&&R.abort&&(R.abort.abort(),delete this.loading[z])}setParsing(z,R){this.parsing[z]=R}consumeParsing(z){let R=this.parsing[z];if(R)return delete this.parsing[z],R}clearParsing(z){delete this.parsing[z]}
2markLoaded(z,R){this.loaded[z]=R}getLoaded(z){let R=this.loaded[z];if(R)return R}removeLoaded(z){delete this.loaded[z]}clearLoaded(){this.loaded={}}}class Oe{constructor(z,R,j,K,re){this.type=z,this.properties=j||{},this.extent=re,this.pointsArray=R,this.id=K}loadGeometry(){return this.pointsArray.map(z=>z.map(R=>new b.P(R.x,R.y)))}}class Ve{constructor(z,R,j){this.version=2,this._myFeatures=z,this.name=R,this.length=z.length,this.extent=j}feature(z){return this._myFeatures[z]}}class ke{constructor(){this.layers={}}addLayer(z){this.layers[z.name]=z}}function Ge(le){let z=b.cV(le);return z.byteOffset===0&&z.byteLength===z.buffer.byteLength||(z=new Uint8Array(z)),{vectorTile:le,rawData:z.buffer}}function ce(le,z,R){let{extent:j}=le,K=Math.pow(2,R.z-z.z),re=(R.x-z.x*K)*j,ue=(R.y-z.y*K)*j,me=[];for(let oe=0;oe<le.length;oe++){let he=le.feature(oe),Pe=he.loadGeometry();for(let ie of Pe)for(let He of ie)He.x=He.x*K-re,He.y=He.y*K-ue;let xe=128;Pe=b.cW(Pe,he.type,-xe,-xe,j+xe,j+xe),Pe.length!==0&&me.push(new Oe(he.type,Pe,he.properties,he.id,j))}return new Ve(me,le.name,j)}class Dt{constructor(z,R,j){this.actor=z,this.layerIndex=R,this.availableImages=j,this.tileState=new Ee,this.overzoomedTileResultCache=new b.cX(1e3)}loadVectorTile(z,R){return b._(this,void 0,void 0,function*(){let j=yield b.n(z.request,R);try{return{vectorTile:z.encoding!=="mlt"?new b.cY(new b.cZ(j.data)):new b.c_(j.data),rawData:j.data,cacheControl:j.cacheControl,expires:j.expires}}catch(K){let re=new Uint8Array(j.data),ue=`Unable to parse the tile at ${z.request.url}, `;throw ue+=re[0]===31&&re[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${K.message}`,new Error(ue)}})}loadTile(z){return b._(this,void 0,void 0,function*(){let{uid:R,overzoomParameters:j}=z;j&&(z.request=j.overzoomRequest);let K=this._startRequestTiming(z),re=new _e(z);this.tileState.startLoading(R,re);let ue=new AbortController;re.abort=ue;try{let me=yield this.loadVectorTile(z,ue);if(this.tileState.finishLoading(R),!me)return null;let{vectorTile:oe,rawData:he}=me;j&&({vectorTile:oe,rawData:he}=this._getOverzoomTile(z,me.vectorTile));let Pe=this._getExpiryData(me),xe=this._finishRequestTiming(K);re.vectorTile=oe,this.tileState.markLoaded(R,re);let ie={rawData:he,cacheControl:Pe,resourceTiming:xe};this.tileState.setParsing(R,ie);try{return yield this._parseWorkerTile(re,z,ie)}finally{this.tileState.clearParsing(R)}}catch(me){throw this.tileState.finishLoading(R),re.status="done",this.tileState.markLoaded(R,re),me}})}_parseWorkerTile(z,R,j){return b._(this,void 0,void 0,function*(){let K=yield z.parse(z.vectorTile,this.layerIndex,this.availableImages,this.actor,R.subdivisionGranularity);if(j){let{rawData:re,cacheControl:ue,resourceTiming:me}=j;K=b.e({rawTileData:re.slice(0),encoding:R.encoding},K,ue,me)}return K})}_getExpiryData(z){let{expires:R,cacheControl:j}=z,K={};return R&&(K.expires=R),j&&(K.cacheControl=j),K}_startRequestTiming(z){var R;if(!((R=z.request)===null||R===void 0)&&R.collectResourceTiming)return new b.c$(z.request.url)}_finishRequestTiming(z){let R=z==null?void 0:z.finish();return R?{resourceTiming:JSON.parse(JSON.stringify(R))}:{}}_getOverzoomTile(z,R){let{tileID:j,source:K,overzoomParameters:re}=z,{maxZoomTileID:ue}=re,me=`${ue.key}_${j.key}`,oe=this.overzoomedTileResultCache.get(me);if(oe)return oe;let he=new ke,Pe=this.layerIndex.familiesBySource[K];for(let ie in Pe){let He=R.layers[ie];if(!He)continue;let nt=ce(He,ue,j.canonical);nt.length>0&&he.addLayer(nt)}let xe=Ge(he);return this.overzoomedTileResultCache.set(me,xe),xe}reloadTile(z){return b._(this,void 0,void 0,function*(){let R=z.uid,j=this.tileState.getLoaded(R);if(!j)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(j.showCollisionBoxes=z.showCollisionBoxes,j.status==="parsing"){let K=this.tileState.consumeParsing(R);return yield this._parseWorkerTile(j,z,K)}if(j.status==="done"&&j.vectorTile)return yield this._parseWorkerTile(j,z)})}abortTile(z){return b._(this,void 0,void 0,function*(){this.tileState.abort(z.uid)})}removeTile(z){return b._(this,void 0,void 0,function*(){this.tileState.removeLoaded(z.uid)})}}class gt{constructor(){this.loaded={}}loadTile(z){return b._(this,void 0,void 0,function*(){let{uid:R,encoding:j,rawImageData:K,redFactor:re,greenFactor:ue,blueFactor:me,baseShift:oe}=z,he=K.width+2,Pe=K.height+2,xe=b.b(K)?new b.R({width:he,height:Pe},yield b.d0(K,-1,-1,he,Pe)):K,ie=new b.d1(R,xe,j,re,ue,me,oe);return this.loaded=this.loaded||{},this.loaded[R]=ie,ie})}removeTile(z){let R=this.loaded,j=z.uid;R&&R[j]&&delete R[j]}}var ft,Ot,di=function(){if(Ot)return ft;function le(R,j){if(R.length!==0){z(R[0],j);for(var K=1;K<R.length;K++)z(R[K],!j)}}function z(R,j){for(var K=0,re=0,ue=0,me=R.length,oe=me-1;ue<me;oe=ue++){var he=(R[ue][0]-R[oe][0])*(R[oe][1]+R[ue][1]),Pe=K+he;re+=Math.abs(K)>=Math.abs(he)?K-Pe+he:he-Pe+K,K=Pe}K+re>=0!=!!j&&R.reverse()}return Ot=1,ft=function R(j,K){var re,ue=j&&j.type;if(ue==="FeatureCollection")for(re=0;re<j.features.length;re++)R(j.features[re],K);else if(ue==="GeometryCollection")for(re=0;re<j.geometries.length;re++)R(j.geometries[re],K);else if(ue==="Feature")R(j.geometry,K);else if(ue==="Polygon")le(j.coordinates,K);else if(ue==="MultiPolygon")for(re=0;re<j.coordinates.length;re++)le(j.coordinates[re],K);return j}}(),wi=b.d2(di);let gi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:le=>le},Xr=Math.fround||(Lr=new Float32Array(1),le=>(Lr[0]=+le,Lr[0]));var Lr;class Li{constructor(z){this.options=Object.assign(Object.create(gi),z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}
2load(z){let{log:R,minZoom:j,maxZoom:K}=this.options;R&&console.time("total time");let re=`prepare ${z.length} points`;R&&console.time(re),this.points=z;let ue=[];for(let oe=0;oe<z.length;oe++){let he=z[oe];if(!he.geometry)continue;let[Pe,xe]=he.geometry.coordinates,ie=Xr(Br(Pe)),He=Xr(Sn(xe));ue.push(ie,He,1/0,oe,-1,1),this.options.reduce&&ue.push(0)}let me=this.trees[K+1]=this._createTree(ue);R&&console.timeEnd(re);for(let oe=K;oe>=j;oe--){let he=+Date.now();me=this.trees[oe]=this._createTree(this._cluster(me,oe)),R&&console.log("z%d: %d clusters in %dms",oe,me.numItems,+Date.now()-he)}return R&&console.timeEnd("total time"),this}getClusters(z,R){let j=((z[0]+180)%360+360)%360-180,K=Math.max(-90,Math.min(90,z[1])),re=z[2]===180?180:((z[2]+180)%360+360)%360-180,ue=Math.max(-90,Math.min(90,z[3]));if(z[2]-z[0]>=360)j=-180,re=180;else if(j>re){let xe=this.getClusters([j,K,180,ue],R),ie=this.getClusters([-180,K,re,ue],R);return xe.concat(ie)}let me=this.trees[this._limitZoom(R)],oe=me.range(Br(j),Sn(ue),Br(re),Sn(K)),he=me.data,Pe=[];for(let xe of oe){let ie=this.stride*xe;Pe.push(he[ie+5]>1?Yr(he,ie,this.clusterProps):this.points[he[ie+3]])}return Pe}getChildren(z){let R=this._getOriginId(z),j=this._getOriginZoom(z),K="No cluster with the specified id.",re=this.trees[j];if(!re)throw new Error(K);let ue=re.data;if(R*this.stride>=ue.length)throw new Error(K);let me=this.options.radius/(this.options.extent*Math.pow(2,j-1)),oe=re.within(ue[R*this.stride],ue[R*this.stride+1],me),he=[];for(let Pe of oe){let xe=Pe*this.stride;ue[xe+4]===z&&he.push(ue[xe+5]>1?Yr(ue,xe,this.clusterProps):this.points[ue[xe+3]])}if(he.length===0)throw new Error(K);return he}getLeaves(z,R,j){let K=[];return this._appendLeaves(K,z,R=R||10,j=j||0,0),K}getTile(z,R,j){let K=this.trees[this._limitZoom(z)],re=Math.pow(2,z),{extent:ue,radius:me}=this.options,oe=me/ue,he=(j-oe)/re,Pe=(j+1+oe)/re,xe={features:[]};return this._addTileFeatures(K.range((R-oe)/re,he,(R+1+oe)/re,Pe),K.data,R,j,re,xe),R===0&&this._addTileFeatures(K.range(1-oe/re,he,1,Pe),K.data,re,j,re,xe),R===re-1&&this._addTileFeatures(K.range(0,he,oe/re,Pe),K.data,-1,j,re,xe),xe.features.length?xe:null}getClusterExpansionZoom(z){let R=this._getOriginZoom(z)-1;for(;R<=this.options.maxZoom;){let j=this.getChildren(z);if(R++,j.length!==1)break;z=j[0].properties.cluster_id}return R}_appendLeaves(z,R,j,K,re){let ue=this.getChildren(R);for(let me of ue){let oe=me.properties;if(oe&&oe.cluster?re+oe.point_count<=K?re+=oe.point_count:re=this._appendLeaves(z,oe.cluster_id,j,K,re):re<K?re++:z.push(me),z.length===j)break}return re}_createTree(z){let R=new b.aT(z.length/this.stride|0,this.options.nodeSize,Float32Array);for(let j=0;j<z.length;j+=this.stride)R.add(z[j],z[j+1]);return R.finish(),R.data=z,R}_addTileFeatures(z,R,j,K,re,ue){for(let me of z){let oe=me*this.stride,he=R[oe+5]>1,Pe,xe,ie;if(he)Pe=Or(R,oe,this.clusterProps),xe=R[oe],ie=R[oe+1];else{let Qe=this.points[R[oe+3]];Pe=Qe.properties;let[it,rt]=Qe.geometry.coordinates;xe=Br(it),ie=Sn(rt)}let He={type:1,geometry:[[Math.round(this.options.extent*(xe*re-j)),Math.round(this.options.extent*(ie*re-K))]],tags:Pe},nt;nt=he||this.options.generateId?R[oe+3]:this.points[R[oe+3]].id,nt!==void 0&&(He.id=nt),ue.features.push(He)}}_limitZoom(z){return Math.max(this.options.minZoom,Math.min(Math.floor(+z),this.options.maxZoom+1))}_cluster(z,R){let{radius:j,extent:K,reduce:re,minPoints:ue}=this.options,me=j/(K*Math.pow(2,R)),oe=z.data,he=[],Pe=this.stride;for(let xe=0;xe<oe.length;xe+=Pe){if(oe[xe+2]<=R)continue;oe[xe+2]=R;let ie=oe[xe],He=oe[xe+1],nt=z.within(oe[xe],oe[xe+1],me),Qe=oe[xe+5],it=Qe;for(let rt of nt){let st=rt*Pe;oe[st+2]>R&&(it+=oe[st+5])}if(it>Qe&&it>=ue){let rt,st=ie*Qe,Lt=He*Qe,zt=-1,Qt=(xe/Pe<<5)+(R+1)+this.points.length;for(let Si of nt){let Wt=Si*Pe;if(oe[Wt+2]<=R)continue;oe[Wt+2]=R;let Le=oe[Wt+5];st+=oe[Wt]*Le,Lt+=oe[Wt+1]*Le,oe[Wt+4]=Qt,re&&(rt||(rt=this._map(oe,xe,!0),zt=this.clusterProps.length,this.clusterProps.push(rt)),re(rt,this._map(oe,Wt)))}oe[xe+4]=Qt,he.push(st/it,Lt/it,1/0,Qt,-1,it),re&&he.push(zt)}else{for(let rt=0;rt<Pe;rt++)he.push(oe[xe+rt]);if(it>1)for(let rt of nt){let st=rt*Pe;if(!(oe[st+2]<=R)){oe[st+2]=R;for(let Lt=0;Lt<Pe;Lt++)he.push(oe[st+Lt])}}}}return he}_getOriginId(z){return z-this.points.length>>5}_getOriginZoom(z){return(z-this.points.length)%32}_map(z,R,j){if(z[R+5]>1){let ue=this.clusterProps[z[R+6]];return j?Object.assign({},ue):ue}let K=this.points[z[R+3]].properties,re=this.options.map(K);return j&&re===K?Object.assign({},re):re}}function Yr(le,z,R){return{type:"Feature",id:le[z+3],properties:Or(le,z,R),geometry:{type:"Point",coordinates:[(j=le[z],360*(j-.5)),oo(le[z+1])]}};var j}function Or(le,z,R){let j=le[z+5],K=j>=1e4?`${Math.round(j/1e3)}
2k`:j>=1e3?Math.round(j/100)/10+"k":j,re=le[z+6],ue=re===-1?{}:Object.assign({},R[re]);return Object.assign(ue,{cluster:!0,cluster_id:le[z+3],point_count:j,point_count_abbreviated:K})}function Br(le){return le/360+.5}function Sn(le){let z=Math.sin(le*Math.PI/180),R=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return R<0?0:R>1?1:R}function oo(le){let z=(180-360*le)*Math.PI/180;return 360*Math.atan(Math.exp(z))/Math.PI-90}function wa(le,z,R,j){let K=j,re=z+(R-z>>1),ue,me=R-z,oe=le[z],he=le[z+1],Pe=le[R],xe=le[R+1];for(let ie=z+3;ie<R;ie+=3){let He=Kr(le[ie],le[ie+1],oe,he,Pe,xe);if(He>K)ue=ie,K=He;else if(He===K){let nt=Math.abs(ie-re);nt<me&&(ue=ie,me=nt)}}K>j&&(ue-z>3&&wa(le,z,ue,j),le[ue+2]=K,R-ue>3&&wa(le,ue,R,j))}function Kr(le,z,R,j,K,re){let ue=K-R,me=re-j;if(ue!==0||me!==0){let oe=((le-R)*ue+(z-j)*me)/(ue*ue+me*me);oe>1?(R=K,j=re):oe>0&&(R+=ue*oe,j+=me*oe)}return ue=le-R,me=z-j,ue*ue+me*me}function ai(le,z,R,j){let K={type:z,geom:R},re={id:le==null?null:le,type:K.type,geometry:K.geom,tags:j,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(K.type){case"Point":case"MultiPoint":case"LineString":bt(re,K.geom);break;case"Polygon":bt(re,K.geom[0]);break;case"MultiLineString":for(let ue of K.geom)bt(re,ue);break;case"MultiPolygon":for(let ue of K.geom)bt(re,ue[0])}return re}function bt(le,z){for(let R=0;R<z.length;R+=3)le.minX=Math.min(le.minX,z[R]),le.minY=Math.min(le.minY,z[R+1]),le.maxX=Math.max(le.maxX,z[R]),le.maxY=Math.max(le.maxY,z[R+1])}function Un(le,z){let R=[];switch(le.type){case"FeatureCollection":for(let j=0;j<le.features.length;j++)jr(R,le.features[j],z,j);break;case"Feature":jr(R,le,z);break;default:jr(R,{geometry:le,properties:void 0},z)}return R}function jr(le,z,R,j){var me;if(!z.geometry)return;if(z.geometry.type==="GeometryCollection"){for(let oe of z.geometry.geometries)jr(le,{id:z.id,geometry:oe,properties:z.properties},R,j);return}let K=z.geometry.coordinates;if(!(K!=null&&K.length))return;let re=Math.pow(R.tolerance/((1<<R.maxZoom)*R.extent),2),ue=z.id;switch(R.promoteId?ue=(me=z.properties)==null?void 0:me[R.promoteId]:R.generateId&&(ue=j||0),z.geometry.type){case"Point":{let oe=[];return so(z.geometry.coordinates,oe),void le.push(ai(ue,z.geometry.type,oe,z.properties))}case"MultiPoint":{let oe=[];for(let he of z.geometry.coordinates)so(he,oe);return void le.push(ai(ue,z.geometry.type,oe,z.properties))}case"LineString":{let oe=[];return Sa(z.geometry.coordinates,oe,re,!1),void le.push(ai(ue,z.geometry.type,oe,z.properties))}case"MultiLineString":{if(R.lineMetrics){for(let he of z.geometry.coordinates){let Pe=[];Sa(he,Pe,re,!1),le.push(ai(ue,"LineString",Pe,z.properties))}return}let oe=[];return Tn(z.geometry.coordinates,oe,re,!1),void le.push(ai(ue,z.geometry.type,oe,z.properties))}case"Polygon":{let oe=[];return Tn(z.geometry.coordinates,oe,re,!0),void le.push(ai(ue,z.geometry.type,oe,z.properties))}case"MultiPolygon":{let oe=[];for(let he of z.geometry.coordinates){let Pe=[];Tn(he,Pe,re,!0),oe.push(Pe)}return void le.push(ai(ue,z.geometry.type,oe,z.properties))}default:throw new Error("Input data is not a valid GeoJSON object.")}}function so(le,z){z.push(Jr(le[0]),yr(le[1]),0)}function Sa(le,z,R,j){let K,re,ue=0;for(let oe=0;oe<le.length;oe++){let he=Jr(le[oe][0]),Pe=yr(le[oe][1]);z.push(he,Pe,0),oe>0&&(ue+=j?(K*Pe-he*re)/2:Math.sqrt(Math.pow(he-K,2)+Math.pow(Pe-re,2))),K=he,re=Pe}let me=z.length-3;z[2]=1,R>0&&wa(z,0,me,R),z[me+2]=1,z.size=Math.abs(ue),z.start=0,z.end=z.size}function Tn(le,z,R,j){for(let K=0;K<le.length;K++){let re=[];Sa(le[K],re,R,j),z.push(re)}}function Jr(le){return le/360+.5}function yr(le){let z=Math.sin(le*Math.PI/180),R=.5-.25*Math.log((1+z)/(1-z))/Math.PI;return R<0?0:R>1?1:R}function Ci(le,z,R,j,K,re,ue,me){if(j/=z,re>=(R/=z)&&ue<j)return le;if(ue<R||re>=j)return null;let oe=[];for(let he of le){let Pe=K===0?he.minX:he.minY,xe=K===0?he.maxX:he.maxY;if(Pe>=R&&xe<j)oe.push(he);else if(!(xe<R||Pe>=j))switch(he.type){case"Point":case"MultiPoint":{let ie=[];if(Wi(he.geometry,ie,R,j,K),!ie.length)continue;oe.push(ai(he.id,ie.length===3?"Point":"MultiPoint",ie,he.tags));continue}case"LineString":{let ie=[];if(Ta(he.geometry,ie,R,j,K,!1,me.lineMetrics),!ie.length)continue;if(me.lineMetrics){for(let He of ie)oe.push(ai(he.id,he.type,He,he.tags));continue}if(ie.length>1){oe.push(ai(he.id,"MultiLineString",ie,he.tags));continue}oe.push(ai(he.id,he.type,ie[0],he.tags));continue}case"MultiLineString":{let ie=[];if(Zn(he.geometry,ie,R,j,K,!1),!ie.length)continue;if(ie.length===1){oe.push(ai(he.id,"LineString",ie[0],he.tags));continue}oe.push(ai(he.id,he.type,ie,he.tags));continue}case"Polygon":{let ie=[];if(Zn(he.geometry,ie,R,j,K,!0),!ie.length)continue;oe.push(ai(he.id,he.type,ie,he.tags));continue}case"MultiPolygon":{let ie=[];for(let He of he.geometry){let nt=[];
2Zn(He,nt,R,j,K,!0),nt.length&&ie.push(nt)}if(!ie.length)continue;oe.push(ai(he.id,he.type,ie,he.tags));continue}}}return oe.length?oe:null}function Wi(le,z,R,j,K){for(let re=0;re<le.length;re+=3){let ue=le[re+K];ue>=R&&ue<=j&&Ei(z,le[re],le[re+1],le[re+2])}}function Ta(le,z,R,j,K,re,ue){let me=Gn(le),oe=K===0?hs:ki,he,Pe,xe=le.start;for(let it=0;it<le.length-3;it+=3){let rt=le[it],st=le[it+1],Lt=le[it+2],zt=le[it+3],Qt=le[it+4],Si=K===0?rt:st,Wt=K===0?zt:Qt,Le=!1;ue&&(he=Math.sqrt(Math.pow(rt-zt,2)+Math.pow(st-Qt,2))),Si<R?Wt>R&&(Pe=oe(me,rt,st,zt,Qt,R),ue&&(me.start=xe+he*Pe)):Si>j?Wt<j&&(Pe=oe(me,rt,st,zt,Qt,j),ue&&(me.start=xe+he*Pe)):Ei(me,rt,st,Lt),Wt<R&&Si>=R&&(Pe=oe(me,rt,st,zt,Qt,R),Le=!0),Wt>j&&Si<=j&&(Pe=oe(me,rt,st,zt,Qt,j),Le=!0),!re&&Le&&(ue&&(me.end=xe+he*Pe),z.push(me),me=Gn(le)),ue&&(xe+=he)}let ie=le.length-3,He=le[ie],nt=le[ie+1],Qe=K===0?He:nt;Qe>=R&&Qe<=j&&Ei(me,He,nt,le[ie+2]),ie=me.length-3,re&&ie>=3&&(me[ie]!==me[0]||me[ie+1]!==me[1])&&Ei(me,me[0],me[1],me[2]),me.length&&z.push(me)}function Gn(le){let z=[];return z.size=le.size,z.start=le.start,z.end=le.end,z}function Zn(le,z,R,j,K,re){for(let ue of le)Ta(ue,z,R,j,K,re,!1)}function Ei(le,z,R,j){le.push(z,R,j)}function hs(le,z,R,j,K,re){let ue=(re-z)/(j-z);return Ei(le,re,R+(K-R)*ue,1),ue}function ki(le,z,R,j,K,re){let ue=(re-R)/(K-R);return Ei(le,z+(j-z)*ue,re,1),ue}function tr(le,z){let R=z.buffer/z.extent,j=le,K=Ci(le,1,-1-R,R,0,-1,2,z),re=Ci(le,1,1-R,2+R,0,-1,2,z);return(K||re)&&(j=Ci(le,1,-R,1+R,0,-1,2,z)||[],K&&(j=Vr(K,1).concat(j)),re&&(j=j.concat(Vr(re,-1)))),j}function Vr(le,z){let R=[];for(let j of le)switch(j.type){case"Point":case"MultiPoint":case"LineString":{let K=Bt(j.geometry,z);R.push(ai(j.id,j.type,K,j.tags));continue}case"MultiLineString":case"Polygon":{let K=[];for(let re of j.geometry)K.push(Bt(re,z));R.push(ai(j.id,j.type,K,j.tags));continue}case"MultiPolygon":{let K=[];for(let re of j.geometry){let ue=[];for(let me of re)ue.push(Bt(me,z));K.push(ue)}R.push(ai(j.id,j.type,K,j.tags));continue}}return R}function Bt(le,z){let R=[];R.size=le.size,le.start!==void 0&&(R.start=le.start,R.end=le.end);for(let j=0;j<le.length;j+=3)R.push(le[j]+z,le[j+1],le[j+2]);return R}function qn(le,z){if(le.transformed)return le;let R=1<<le.z,j=le.x,K=le.y;for(let re of le.features){if(re.type===1){let me=[];for(let oe=0;oe<re.geometry.length;oe+=2)me.push(Pa(re.geometry[oe],re.geometry[oe+1],z,R,j,K));re.geometry=me;continue}let ue=[];for(let me of re.geometry){let oe=[];for(let he=0;he<me.length;he+=2)oe.push(Pa(me[he],me[he+1],z,R,j,K));ue.push(oe)}re.geometry=ue}return le.transformed=!0,le}function Pa(le,z,R,j,K,re){return[Math.round(R*(le*j-K)),Math.round(R*(z*j-re))]}function $n(le,z,R,j,K){let re=z===K.maxZoom?0:K.tolerance/((1<<z)*K.extent),ue={features:[],numPoints:0,numSimplified:0,numFeatures:le.length,source:null,x:R,y:j,z,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let me of le)Pn(ue,me,re,K);return ue}function Pn(le,z,R,j){le.minX=Math.min(le.minX,z.minX),le.minY=Math.min(le.minY,z.minY),le.maxX=Math.max(le.maxX,z.maxX),le.maxY=Math.max(le.maxY,z.maxY);let K,re=z.tags||null;switch(z.type){case"Point":case"MultiPoint":{let ue=[];for(let me=0;me<z.geometry.length;me+=3)ue.push(z.geometry[me],z.geometry[me+1]),le.numPoints++,le.numSimplified++;if(!ue.length)return;K={type:1,tags:re,geometry:ue};break}case"LineString":{let ue=[];if(Nr(ue,z.geometry,le,R,!1,!1),!ue.length)return;if(j.lineMetrics){re={};for(let me in z.tags)re[me]=z.tags[me];re.mapbox_clip_start=z.geometry.start/z.geometry.size,re.mapbox_clip_end=z.geometry.end/z.geometry.size}K={type:2,tags:re,geometry:ue};break}case"MultiLineString":case"Polygon":{let ue=[];for(let me=0;me<z.geometry.length;me++)Nr(ue,z.geometry[me],le,R,z.type==="Polygon",me===0);if(!ue.length)return;K={type:z.type==="Polygon"?3:2,tags:re,geometry:ue};break}case"MultiPolygon":{let ue=[];for(let me=0;me<z.geometry.length;me++){let oe=z.geometry[me];for(let he=0;he<oe.length;he++)Nr(ue,oe[he],le,R,!0,he===0)}if(!ue.length)return;K={type:3,tags:re,geometry:ue};break}}z.id!==null&&(K.id=z.id),le.features.push(K)}function Nr(le,z,R,j,K,re){let ue=j*j;if(j>0&&z.size<(K?ue:j))return void(R.numPoints+=z.length/3);let me=[];for(let oe=0;oe<z.length;oe+=3)(j===0||z[oe+2]>ue)&&(R.numSimplified++,me.push(z[oe],z[oe+1])),R.numPoints++;K&&function(oe,he){let Pe=0;for(let xe=0,ie=oe.length,He=ie-2;xe<ie;
2He=xe,xe+=2)Pe+=(oe[xe]-oe[He])*(oe[xe+1]+oe[He+1]);if(Pe>0===he)for(let xe=0,ie=oe.length;xe<ie/2;xe+=2){let He=oe[xe],nt=oe[xe+1];oe[xe]=oe[ie-2-xe],oe[xe+1]=oe[ie-1-xe],oe[ie-2-xe]=He,oe[ie-1-xe]=nt}}(me,re),le.push(me)}function In(le,z,R){var re,ue;let j=!!z.newGeometry,K=z.removeAllProperties||((re=z.removeProperties)==null?void 0:re.length)>0||((ue=z.addOrUpdateProperties)==null?void 0:ue.length)>0;if(j){let me=Un({type:"FeatureCollection",features:[{type:"Feature",id:le.id,geometry:z.newGeometry,properties:K?Wn(le.tags,z):le.tags}]},R);return me=tr(me,R),me[0]}if(K){let me=Me({},le);return me.tags=Wn(me.tags,z),me}return null}function Wn(le,z){if(z.removeAllProperties)return{};let R=Me({},le||{});if(z.removeProperties)for(let j of z.removeProperties)delete R[j];if(z.addOrUpdateProperties)for(let{key:j,value:K}of z.addOrUpdateProperties)R[j]=K;return R}let Qr={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,debug:0};class en{options;tiles;tileCoords;stats={};total=0;source;constructor(z,R){let j=(R=this.options=Object.assign({},Qr,R)).debug;if(j&&console.time("preprocess data"),R.maxZoom<0||R.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(R.promoteId&&R.generateId)throw new Error("promoteId and generateId cannot be used together.");let K=Un(z,R);this.tiles={},this.tileCoords=[],j&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",R.indexMaxZoom,R.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),K=tr(K,R),K.length&&this.splitTile(K,0,0,0),R.updateable&&(this.source=K),j&&(K.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)))}splitTile(z,R,j,K,re,ue,me){let oe=[z,R,j,K],he=this.options,Pe=he.debug;for(;oe.length;){K=oe.pop(),j=oe.pop(),R=oe.pop(),z=oe.pop();let xe=1<<R,ie=Mn(R,j,K),He=this.tiles[ie];if(!He&&(Pe>1&&console.time("creation"),He=this.tiles[ie]=$n(z,R,j,K,he),this.tileCoords.push({z:R,x:j,y:K,id:ie}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",R,j,K,He.numFeatures,He.numPoints,He.numSimplified),console.timeEnd("creation"));let Le=`z${R}`;this.stats[Le]=(this.stats[Le]||0)+1,this.total++}if(He.source=z,re==null){if(R===he.indexMaxZoom||He.numPoints<=he.indexMaxPoints)continue}else{if(R===he.maxZoom||R===re)continue;if(re!=null){let Le=re-R;if(j!==ue>>Le||K!==me>>Le)continue}}if(He.source=null,!z.length)continue;Pe>1&&console.time("clipping");let nt=.5*he.buffer/he.extent,Qe=.5-nt,it=.5+nt,rt=1+nt,st=null,Lt=null,zt=null,Qt=null,Si=Ci(z,xe,j-nt,j+it,0,He.minX,He.maxX,he),Wt=Ci(z,xe,j+Qe,j+rt,0,He.minX,He.maxX,he);Si&&(st=Ci(Si,xe,K-nt,K+it,1,He.minY,He.maxY,he),Lt=Ci(Si,xe,K+Qe,K+rt,1,He.minY,He.maxY,he)),Wt&&(zt=Ci(Wt,xe,K-nt,K+it,1,He.minY,He.maxY,he),Qt=Ci(Wt,xe,K+Qe,K+rt,1,He.minY,He.maxY,he)),Pe>1&&console.timeEnd("clipping"),oe.push(st||[],R+1,2*j,2*K),oe.push(Lt||[],R+1,2*j,2*K+1),oe.push(zt||[],R+1,2*j+1,2*K),oe.push(Qt||[],R+1,2*j+1,2*K+1)}}getTile(z,R,j){z=+z,R=+R,j=+j;let K=this.options,{extent:re,debug:ue}=K;if(z<0||z>24)return null;let me=1<<z,oe=Mn(z,R=R+me&me-1,j);if(this.tiles[oe])return qn(this.tiles[oe],re);ue>1&&console.log("drilling down to z%d-%d-%d",z,R,j);let he,Pe=z,xe=R,ie=j;for(;!he&&Pe>0;)Pe--,xe>>=1,ie>>=1,he=this.tiles[Mn(Pe,xe,ie)];return he!=null&&he.source?(ue>1&&(console.log("found parent tile z%d-%d-%d",Pe,xe,ie),console.time("drilling down")),this.splitTile(he.source,Pe,xe,ie,z,R,j),ue>1&&console.timeEnd("drilling down"),this.tiles[oe]?qn(this.tiles[oe],re):null):null}invalidateTiles(z){let R=this.options,{debug:j}=R,K=1/0,re=-1/0,ue=1/0,me=-1/0;for(let Pe of z)K=Math.min(K,Pe.minX),re=Math.max(re,Pe.maxX),ue=Math.min(ue,Pe.minY),me=Math.max(me,Pe.maxY);let oe=R.buffer/R.extent,he=new Set;for(let Pe in this.tiles){let xe=this.tiles[Pe],ie=1<<xe.z,He=(xe.x-oe)/ie,nt=(xe.x+1+oe)/ie,Qe=(xe.y-oe)/ie,it=(xe.y+1+oe)/ie;if(re<He||K>=nt||me<Qe||ue>=it)continue;let rt=!1;for(let st of z)if(st.maxX>=He&&st.minX<nt&&st.maxY>=Qe&&st.minY<it){rt=!0;break}if(rt){if(j){j>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",xe.z,xe.x,xe.y,xe.numFeatures,xe.numPoints,xe.numSimplified);let st=`z${xe.z}`;this.stats[st]=(this.stats[st]||0)-1,this.total--}delete this.tiles[Pe],he.add(Pe)}}he.size&&(this.tileCoords=this.tileCoords.filter(Pe=>!he.has(Pe.id)))}updateData(z){let R=this.options,j=R.debug;if(!R.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:K,source:re}=function(xe,ie,He){let nt=function(it){var rt,st;
2return it?{removeAll:it.removeAll,remove:new Set(it.remove||[]),add:new Map((rt=it.add)==null?void 0:rt.map(Lt=>[Lt.id,Lt])),update:new Map((st=it.update)==null?void 0:st.map(Lt=>[Lt.id,Lt]))}:{remove:new Set,add:new Map,update:new Map}}(ie),Qe=[];if(nt.removeAll&&(Qe=xe,xe=[]),nt.remove.size||nt.add.size){let it=[];for(let rt of xe){let{id:st}=rt;(nt.remove.has(st)||nt.add.has(st))&&it.push(rt)}if(it.length){Qe.push(...it);let rt=new Set(it.map(st=>st.id));xe=xe.filter(st=>!rt.has(st.id))}if(nt.add.size){let rt=Un({type:"FeatureCollection",features:Array.from(nt.add.values())},He);rt=tr(rt,He),Qe.push(...rt),xe.push(...rt)}}if(nt.update.size)for(let[it,rt]of nt.update){let st=xe.findIndex(Qt=>Qt.id===it);if(st===-1)continue;let Lt=xe[st],zt=In(Lt,rt,He);zt&&(Qe.push(Lt,zt),xe[st]=zt)}return{affected:Qe,source:xe}}(this.source,z,R);if(!K.length)return;this.source=re,j>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(K),j>1&&console.timeEnd("invalidating");let[ue,me,oe]=[0,0,0],he=$n(this.source,ue,me,oe,this.options);he.source=this.source;let Pe=Mn(ue,me,oe);if(this.tiles[Pe]=he,this.tileCoords.push({z:ue,x:me,y:oe,id:Pe}),j){let xe=`z${ue}`;this.stats[xe]=(this.stats[xe]||0)+1,this.total++}}}function Mn(le,z,R){return 32*((1<<le)*R+z)+le}class Ia{constructor(z,R,j,K=lo){this._dataUpdateable=new Map,this.actor=z,this.layerIndex=R,this.availableImages=j,this.tileState=new Ee,this._createGeoJSONIndex=K}loadVectorTile(z){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let{z:R,x:j,y:K}=z.tileID.canonical,re=this._geoJSONIndex.getTile(R,j,K);return re?Ge(new b.d3(re.features,{version:2,extent:b.a5})):null}loadTile(z){return b._(this,void 0,void 0,function*(){let{uid:R}=z,j=new _e(z);j.abort=new AbortController;try{let K=this.loadVectorTile(z);if(!K)return null;let{vectorTile:re,rawData:ue}=K;j.vectorTile=re,this.tileState.markLoaded(R,j);let me={rawData:ue};this.tileState.setParsing(R,me);try{return yield this._parseWorkerTile(j,z,me)}finally{this.tileState.clearParsing(R)}}catch(K){throw j.status="done",this.tileState.markLoaded(R,j),K}})}_reloadLoadedTile(z){return b._(this,void 0,void 0,function*(){let R=z.uid,j=this.tileState.getLoaded(R);if(!j)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(j.showCollisionBoxes=z.showCollisionBoxes,j.status==="parsing"){let K=this.tileState.consumeParsing(R);return yield this._parseWorkerTile(j,z,K)}if(j.status==="done"&&j.vectorTile)return yield this._parseWorkerTile(j,z)})}_parseWorkerTile(z,R,j){return b._(this,void 0,void 0,function*(){let K=yield z.parse(z.vectorTile,this.layerIndex,this.availableImages,this.actor,R.subdivisionGranularity);if(j){let{rawData:re}=j;K=b.e({rawTileData:re.slice(0)},K)}return K})}abortTile(z){return b._(this,void 0,void 0,function*(){this.tileState.abort(z.uid)})}removeTile(z){return b._(this,void 0,void 0,function*(){this.tileState.removeLoaded(z.uid)})}loadData(z){return b._(this,void 0,void 0,function*(){var R;(R=this._pendingRequest)===null||R===void 0||R.abort();let j=this._startRequestTiming(z);this._pendingRequest=new AbortController;try{(!this._pendingData||z.request||z.data||z.dataDiff)&&(this._pendingData=this.loadAndProcessGeoJSON(z,this._pendingRequest));let K=yield this._pendingData;this._geoJSONIndex=this._createGeoJSONIndex(K,z),this.tileState.clearLoaded();let re={};return z.request&&(re.data=K),this._finishRequestTiming(j,z,re),re}catch(K){if(delete this._pendingRequest,b.Z(K))return{abandoned:!0};throw K}})}_startRequestTiming(z){var R;if(!((R=z.request)===null||R===void 0)&&R.collectResourceTiming)return new b.c$(z.request.url)}_finishRequestTiming(z,R,j){let K=z==null?void 0:z.finish();K&&(j.resourceTiming={[R.source]:JSON.parse(JSON.stringify(K))})}getData(){return b._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(z){return this.tileState.getLoaded(z.uid)?this._reloadLoadedTile(z):this.loadTile(z)}loadAndProcessGeoJSON(z,R){return b._(this,void 0,void 0,function*(){let j;if(z.request?j=yield this.loadGeoJSONFromUrl(z.request,z.promoteId,R):z.data?j=this._loadGeoJSONFromObject(z.data,z.promoteId):z.dataDiff&&(j=this._loadGeoJSONFromDiff(z.dataDiff,z.promoteId,z.source)),delete this._pendingRequest,typeof j!="object")throw new Error(`Input data given to '${z.source}' is not a valid GeoJSON object.`);return wi(j,!0),z.filter&&(j=this._filterGeoJSON(j,z.filter)),j})}loadGeoJSONFromUrl(z,R,j){return b._(this,void 0,void 0,function*(){let K=yield b.j(z,j);return this._dataUpdateable=b.a7(K.data,R),K.data})}_loadGeoJSONFromObject(z,R){return this._dataUpdateable=b.a7(z,R),z}_loadGeoJSONFromDiff(z,R,j){if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${j}`);b.a8(this._dataUpdateable,z,R);let K=Array.from(this._dataUpdateable.values());return this._toFeatureCollection(K)}
2_filterGeoJSON(z,R){let j=b.d4(R,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(j.result==="error")throw new Error(j.value.map(re=>`${re.key}: ${re.message}`).join(", "));let K=z.features.filter(re=>j.value.evaluate({zoom:0},re));return this._toFeatureCollection(K)}_toFeatureCollection(z){return{type:"FeatureCollection",features:z}}removeSource(z){return b._(this,void 0,void 0,function*(){var R;(R=this._pendingRequest)===null||R===void 0||R.abort()})}getClusterExpansionZoom(z){return this._geoJSONIndex.getClusterExpansionZoom(z.clusterId)}getClusterChildren(z){return this._geoJSONIndex.getChildren(z.clusterId)}getClusterLeaves(z){return this._geoJSONIndex.getLeaves(z.clusterId,z.limit,z.offset)}}function lo(le,z){return z.cluster?new Li(function({superclusterOptions:R,clusterProperties:j}){if(!j||!R)return R;let K={},re={},ue={accumulated:null,zoom:0},me={properties:null},oe=Object.keys(j);for(let he of oe){let[Pe,xe]=j[he],ie=b.d4(xe),He=b.d4(typeof Pe=="string"?[Pe,["accumulated"],["get",he]]:Pe);K[he]=ie.value,re[he]=He.value}return R.map=he=>{me.properties=he;let Pe={};for(let xe of oe)Pe[xe]=K[xe].evaluate(ue,me);return Pe},R.reduce=(he,Pe)=>{me.properties=Pe;for(let xe of oe)ue.accumulated=he[xe],he[xe]=re[xe].evaluate(ue,me)},R}(z)).load(le.features):function(R,j){return new en(R,j)}(le,z.geojsonVtOptions)}class Ma{constructor(z){this.self=z,this.actor=new b.L(z),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(R,j)=>{if(this.externalWorkerSourceTypes[R])throw new Error(`Worker source with name "${R}" already registered.`);this.externalWorkerSourceTypes[R]=j},this.self.addProtocol=b.cK,this.self.removeProtocol=b.cL,this.self.registerRTLTextPlugin=R=>{b.d5.setMethods(R)},this.actor.registerMessageHandler("LDT",(R,j)=>this._getDEMWorkerSource(R,j.source).loadTile(j)),this.actor.registerMessageHandler("RDT",(R,j)=>b._(this,void 0,void 0,function*(){this._getDEMWorkerSource(R,j.source).removeTile(j)})),this.actor.registerMessageHandler("GCEZ",(R,j)=>b._(this,void 0,void 0,function*(){return this._getWorkerSource(R,j.type,j.source).getClusterExpansionZoom(j)})),this.actor.registerMessageHandler("GCC",(R,j)=>b._(this,void 0,void 0,function*(){return this._getWorkerSource(R,j.type,j.source).getClusterChildren(j)})),this.actor.registerMessageHandler("GCL",(R,j)=>b._(this,void 0,void 0,function*(){return this._getWorkerSource(R,j.type,j.source).getClusterLeaves(j)})),this.actor.registerMessageHandler("LD",(R,j)=>this._getWorkerSource(R,j.type,j.source).loadData(j)),this.actor.registerMessageHandler("GD",(R,j)=>this._getWorkerSource(R,j.type,j.source).getData()),this.actor.registerMessageHandler("LT",(R,j)=>this._getWorkerSource(R,j.type,j.source).loadTile(j)),this.actor.registerMessageHandler("RT",(R,j)=>this._getWorkerSource(R,j.type,j.source).reloadTile(j)),this.actor.registerMessageHandler("AT",(R,j)=>this._getWorkerSource(R,j.type,j.source).abortTile(j)),this.actor.registerMessageHandler("RMT",(R,j)=>this._getWorkerSource(R,j.type,j.source).removeTile(j)),this.actor.registerMessageHandler("RS",(R,j)=>b._(this,void 0,void 0,function*(){if(!this.workerSources[R]||!this.workerSources[R][j.type]||!this.workerSources[R][j.type][j.source])return;let K=this.workerSources[R][j.type][j.source];delete this.workerSources[R][j.type][j.source],K.removeSource!==void 0&&K.removeSource(j)})),this.actor.registerMessageHandler("RM",R=>b._(this,void 0,void 0,function*(){delete this.layerIndexes[R],delete this.availableImages[R],delete this.workerSources[R],delete this.demWorkerSources[R],this.globalStates.delete(R)})),this.actor.registerMessageHandler("SR",(R,j)=>b._(this,void 0,void 0,function*(){this.referrer=j})),this.actor.registerMessageHandler("SRPS",(R,j)=>this._syncRTLPluginState(R,j)),this.actor.registerMessageHandler("IS",(R,j)=>b._(this,void 0,void 0,function*(){this.self.importScripts(j)})),this.actor.registerMessageHandler("SI",(R,j)=>this._setImages(R,j)),this.actor.registerMessageHandler("UL",(R,j)=>b._(this,void 0,void 0,function*(){this._getLayerIndex(R).update(j.layers,j.removedIds,this._getGlobalState(R))})),this.actor.registerMessageHandler("UGS",(R,j)=>b._(this,void 0,void 0,function*(){let K=this._getGlobalState(R);for(let re in j)K[re]=j[re]})),this.actor.registerMessageHandler("SL",(R,j)=>b._(this,void 0,void 0,function*(){this._getLayerIndex(R).replace(j,this._getGlobalState(R))}))}_getGlobalState(z){let R=this.globalStates.get(z);return R||(R={},this.globalStates.set(z,R)),R}_setImages(z,R){return b._(this,void 0,void 0,function*(){this.availableImages[z]=R;for(let j in this.workerSources[z]){let K=this.workerSources[z][j];for(let re in K)K[re].availableImages=R}})}_syncRTLPluginState(z,R){return b._(this,void 0,void 0,function*(){return yield b.d5.syncState(R,this.self.importScripts)})}_getAvailableImages(z){let R=this.availableImages[z];return R||(R=[]),R}_getLayerIndex(z){let R=this.layerIndexes[z];return R||(R=this.layerIndexes[z]=new l),R}_getWorkerSource(z,R,j){if(this.workerSources[z]||(this.workerSources[z]={}),this.workerSources[z][R]||(this.workerSources[z][R]={}),!this.workerSources[z][R][j]){let K={sendAsync:(re,ue)=>(re.targetMapId=z,this.actor.sendAsync(re,ue))};switch(R){case"vector":this.workerSources[z][R][j]=new Dt(K,this._getLayerIndex(z),this._getAvailableImages(z));break;case"geojson":this.workerSources[z][R][j]=new Ia(K,this._getLayerIndex(z),this._getAvailableImages(z));break;default:this.workerSources[z][R][j]=new this.externalWorkerSourceTypes[R](K,this._getLayerIndex(z),this._getAvailableImages(z))}}return this.workerSources[z][R][j]}_getDEMWorkerSource(z,R){return this.demWorkerSources[z]||(this.demWorkerSources[z]={}),this.demWorkerSources[z][R]||(this.demWorkerSources[z][R]=new gt),this.demWorkerSources[z][R]}}return b.i(self)&&(self.worker=new Ma(self)),Ma}),G("index",["exports","./shared"],function(b,l){"use strict";var U="5.19.0";function _e(){var d=new l.A(4);return l.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}let Te,Ee,Oe,Ve={frame(d,t,n,o){let c=o||window,p=c.requestAnimationFrame(_=>{m(),t(_)}),{unsubscribe:m}=l.s(d.signal,"abort",()=>{m(),c.cancelAnimationFrame(p),n(new l.a(d.signal.reason))},!1)},frameAsync(d,t){return new Promise((n,o)=>{this.frame(d,n,o,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<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return Oe!==void 0?Oe:!!matchMedia&&(Ee==null&&(Ee=matchMedia("(prefers-reduced-motion: reduce)")),Ee.matches)},set prefersReducedMotion(d){Oe=d}},ke=new class{constructor(){this._realTime=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:this._realTime()}setNow(d){this._frozenAt=d}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Ge(){return ke.getCurrentTime()}class ce{static testProp(t){if(!ce.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in ce.docStyle)return t[n];return t[0]}static create(t,n,o){let c=window.document.createElement(t);return n!==void 0&&(c.className=n),o&&o.appendChild(c),c}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){ce.docStyle&&ce.selectProp&&(ce.userSelect=ce.docStyle[ce.selectProp],ce.docStyle[ce.selectProp]="none")}static enableDrag(){ce.docStyle&&ce.selectProp&&(ce.docStyle[ce.selectProp]=ce.userSelect)}static setTransform(t,n){t.style[ce.transformProp]=n}static addEventListener(t,n,o,c={}){t.addEventListener(n,o,"passive"in c?c:c.capture)}static removeEventListener(t,n,o,c={}){t.removeEventListener(n,o,"passive"in c?c:c.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ce.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ce.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ce.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,o){let c=n.boundingClientRect;return new l.P((o.clientX-c.left)/n.x-t.clientLeft,(o.clientY-c.top)/n.y-t.clientTop)}static mousePos(t,n){let o=ce.getScale(t);return ce.getPoint(t,o,n)}static touchPos(t,n){let o=[],c=ce.getScale(t);for(let p=0;p<n.length;p++)o.push(ce.getPoint(t,c,n[p]));return o}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){let n=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),o=n.querySelectorAll("script");for(let c of o)c.remove();return ce.clean(n),n.innerHTML}static isPossiblyDangerous(t,n){let o=n.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!o.includes("javascript:")&&!o.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){let n=t.children;for(let o of n)ce.removeAttributes(o),ce.clean(o)}static removeAttributes(t){for(let{name:n,value:o}of t.attributes)ce.isPossiblyDangerous(n,o)&&t.removeAttribute(n)}}ce.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ce.selectProp=ce.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ce.transformProp=ce.testProp(["transform","WebkitTransform"]);let Dt={supported:!1,testSupport:function(d){!Ot&&ft&&(di?wi(d):gt=d)}},gt,ft,Ot=!1,di=!1;function wi(d){let t=d.createTexture();d.bindTexture(d.TEXTURE_2D,t);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,ft),d.isContextLost())return;Dt.supported=!0}
2catch{}d.deleteTexture(t),Ot=!0}var gi;typeof document<"u"&&(ft=document.createElement("img"),ft.onload=()=>{gt&&wi(gt),gt=null,di=!0},ft.onerror=()=>{Ot=!0,gt=null},ft.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(d){let t,n,o,c;d.resetRequestQueue=()=>{t=[],n=0,o=0,c={}},d.addThrottleControl=v=>{let T=o++;return c[T]=v,T},d.removeThrottleControl=v=>{delete c[v],m()},d.getImage=(v,T,P=!0)=>new Promise((E,C)=>{Dt.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),l.e(v,{type:"image"}),t.push({abortController:T,requestParameters:v,supportImageRefresh:P,state:"queued",onError:D=>{C(D)},onSuccess:D=>{E(D)}}),m()});let p=v=>l._(this,void 0,void 0,function*(){v.state="running";let{requestParameters:T,supportImageRefresh:P,onError:E,onSuccess:C,abortController:D}=v,B=P===!1&&!l.i(self)&&!l.g(T.url)&&(!T.headers||Object.keys(T.headers).reduce(($,Y)=>$&&Y==="accept",!0));n++;let q=B?_(T,D):l.m(T,D);try{let $=yield q;delete v.abortController,v.state="completed",$.data instanceof HTMLImageElement||l.b($.data)?C($):$.data&&C({data:yield(W=$.data,typeof createImageBitmap=="function"?l.f(W):l.h(W)),cacheControl:$.cacheControl,expires:$.expires})}catch($){delete v.abortController,E($)}finally{n--,m()}var W}),m=()=>{let v=(()=>{for(let T of Object.keys(c))if(c[T]())return!0;return!1})()?l.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let T=n;T<v&&t.length>0;T++){let P=t.shift();P.abortController.signal.aborted?T--:p(P)}},_=(v,T)=>new Promise((P,E)=>{let C=new Image,D=v.url,B=v.credentials;B&&B==="include"?C.crossOrigin="use-credentials":(B&&B==="same-origin"||!l.d(D))&&(C.crossOrigin="anonymous"),T.signal.addEventListener("abort",()=>{C.src="",E(new l.a(T.signal.reason))}),C.fetchPriority="high",C.onload=()=>{C.onerror=C.onload=null,P({data:C})},C.onerror=()=>{C.onerror=C.onload=null,T.signal.aborted||E(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."))},C.src=D})}(gi||(gi={})),gi.resetRequestQueue();class Xr{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 Lr(d){let t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){let n=[];for(let{id:o,url:c}of d){let p=`${o}${c}`;n.indexOf(p)===-1&&(n.push(p),t.push({id:o,url:c}))}}return t}function Li(d,t,n){try{let o=new URL(d);return o.pathname+=`${t}${n}`,o.toString()}catch{throw new Error(`Invalid sprite URL "${d}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Yr(d){let{userImage:t}=d;return!!(t&&t.render&&t.render())&&(d.data.replace(new Uint8Array(t.data.buffer)),!0)}class Or extends l.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.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 l.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:o}of this.requestors)o(this._getImagesForIds(n));this.requestors=[]}}getImage(t){let n=this.images[t];if(n&&!n.data&&n.spriteData){let o=n.spriteData;n.data=new l.R({width:o.width,height:o.height},o.context.getImageData(o.x,o.y,o.width,o.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 o=!0,c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new l.k(new Error(`Image "${t}" has invalid "stretchX" value`))),o=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new l.k(new Error(`Image "${t}
2" has invalid "stretchY" value`))),o=!1),this._validateContent(n.content,n)||(this.fire(new l.k(new Error(`Image "${t}" has invalid "content" value`))),o=!1),o}_validateStretch(t,n){if(!t)return!0;let o=0;for(let c of t){if(c[0]<o||c[1]<c[0]||n<c[1])return!1;o=c[1]}return!0}_validateContent(t,n){if(!t)return!0;if(t.length!==4)return!1;let o=n.spriteData,c=o&&o.width||n.data.width,p=o&&o.height||n.data.height;return!(t[0]<0||c<t[0]||t[1]<0||p<t[1]||t[2]<0||c<t[2]||t[3]<0||p<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,n,o=!0){let c=this.getImage(t);if(o&&(c.data.width!==n.data.width||c.data.height!==n.data.height))throw new Error(`size mismatch between old image (${c.data.width}x${c.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=c.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){let n=this.images[t];delete this.images[t],delete this.patterns[t],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((n,o)=>{let c=!0;if(!this.isLoaded())for(let p of t)this.images[p]||(c=!1);this.isLoaded()||c?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})})}_getImagesForIds(t){let n={};for(let o of t){let c=this.getImage(o);c||(this.fire(new l.l("styleimagemissing",{id:o})),c=this.getImage(o)),c?n[o]={data:c.data.clone(),pixelRatio:c.pixelRatio,sdf:c.sdf,version:c.version,stretchX:c.stretchX,stretchY:c.stretchY,content:c.content,textFitWidth:c.textFitWidth,textFitHeight:c.textFitHeight,hasRenderCallback:!!(c.userImage&&c.userImage.render)}:l.w(`Image "${o}" 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 n}getPixelSize(){let{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){let n=this.patterns[t],o=this.getImage(t);if(!o)return null;if(n&&n.position.version===o.version)return n.position;if(n)n.position.version=o.version;else{let c={w:o.data.width+2,h:o.data.height+2,x:0,y:0},p=new l.I(c,o);this.patterns[t]={bin:c,position:p}}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 l.T(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let p in this.patterns)t.push(this.patterns[p].bin);let{w:n,h:o}=l.p(t),c=this.atlasImage;c.resize({width:n||1,height:o||1});for(let p in this.patterns){let{bin:m}=this.patterns[p],_=m.x+1,v=m.y+1,T=this.getImage(p).data,P=T.width,E=T.height;l.R.copy(T,c,{x:0,y:0},{x:_,y:v},{width:P,height:E}),l.R.copy(T,c,{x:0,y:E-1},{x:_,y:v-1},{width:P,height:1}),l.R.copy(T,c,{x:0,y:0},{x:_,y:v+E},{width:P,height:1}),l.R.copy(T,c,{x:P-1,y:0},{x:_-1,y:v},{width:1,height:E}),l.R.copy(T,c,{x:0,y:0},{x:_+P,y:v},{width:1,height:E})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;let o=this.getImage(n);o||l.w(`Image with ID: "${n}" was not found`),Yr(o)&&this.updateImage(n,o)}}cloneImages(){let t={};for(let n in this.images){let o=this.images[n];t[n]=Object.assign(Object.assign({},o),{data:o.data?o.data.clone():null})}return t}}let Br=1e20;function Sn(d,t,n,o,c,p,m,_,v){for(let T=t;T<t+o;T++)oo(d,n*p+T,p,c,m,_,v);for(let T=n;T<n+c;T++)oo(d,T*p+t,1,o,m,_,v)}function oo(d,t,n,o,c,p,m){p[0]=0,m[0]=-Br,m[1]=Br,c[0]=d[t];for(let _=1,v=0,T=0;_<o;_++){c[_]=d[t+_*n];let P=_*_;do{let E=p[v];T=(c[_]-c[E]+P-E*E)/(_-E)/2}while(T<=m[v]&&--v>-1);v++,p[v]=_,m[v]=T,m[v+1]=Br}for(let _=0,v=0;_<o;_++){for(;m[v+1]<_;)v++;let T=p[v],P=_-T;d[t+_*n]=c[T]+P*P}}let wa=l.v.layout_symbol["text-font"].default.join(",");class Kr{constructor(t,n,o){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={},this.lang=o}setURL(t){this.url=t}getGlyphs(t){return l._(this,void 0,void 0,function*(){let n=[];for(let p in t)for(let m of t[p])n.push(this._getAndCacheGlyphsPromise(p,m));let o=yield Promise.all(n),c={};for(let{stack:p,id:m,glyph:_}of o)c[p]||(c[p]={}),c[p][m]=_&&{id:_.id,bitmap:_.bitmap.clone(),metrics:_.metrics};return c})}_getAndCacheGlyphsPromise(t,n){return l._(this,void 0,void 0,function*(){let o=this.entries[t];o||(o=this.entries[t]={glyphs:{},requests:{},ranges:{}});let c=o.glyphs[n];return c!==void 0?{stack:t,id:n,glyph:c}
2:!this.url||this._charUsesLocalIdeographFontFamily(n)?(c=o.glyphs[n]=this._drawGlyph(o,t,n),{stack:t,id:n,glyph:c}):yield this._downloadAndCacheRangePromise(t,n)})}_downloadAndCacheRangePromise(t,n){return l._(this,void 0,void 0,function*(){let o=this.entries[t],c=Math.floor(n/256);if(o.ranges[c])return{stack:t,id:n,glyph:null};if(!o.requests[c]){let p=Kr.loadGlyphRange(t,c,this.url,this.requestManager);o.requests[c]=p}try{let p=yield o.requests[c];for(let m in p)o.glyphs[+m]=p[+m];return o.ranges[c]=!0,{stack:t,id:n,glyph:p[n]||null}}catch(p){let m=o.glyphs[n]=this._drawGlyph(o,t,n);return this._warnOnMissingGlyphRange(m,c,n,p),{stack:t,id:n,glyph:m}}})}_warnOnMissingGlyphRange(t,n,o,c){let p=256*n,m=p+255,_=o.toString(16).padStart(4,"0").toUpperCase();l.w(`Unable to load glyph range ${n}, ${p}-${m}. Rendering codepoint U+${_} locally instead. ${c}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&l.q(t)}_drawGlyph(t,n,o){let c=n===wa&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(o),p=c?"ideographTinySDF":"tinySDF";t[p]||(t[p]=this._createTinySDF(c?this.localIdeographFontFamily:n));let m=t[p].draw(String.fromCodePoint(o)),_=new RegExp("^\\p{gc=Cf}+$","u").test(String.fromCodePoint(o));return{id:o,bitmap:new l.r({width:m.width||60,height:m.height||60},m.data),metrics:{width:_?0:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:_?0:m.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){let n=t?t.split(","):[];n.push("sans-serif");let o=n.map(c=>/[-\w]+/.test(c)?c:`'${CSS.escape(c)}'`).join(",");return new Kr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,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},o;for(let[c,p]of Object.entries(n))new RegExp(`\\b${c}\\b`,"i").test(t)&&(o=`${p}`);return o}destroy(){for(let t in this.entries){let n=this.entries[t];n.tinySDF&&(n.tinySDF=null),n.ideographTinySDF&&(n.ideographTinySDF=null),n.glyphs={},n.requests={},n.ranges={}}this.entries={}}}Kr.loadGlyphRange=function(d,t,n,o){return l._(this,void 0,void 0,function*(){let c=256*t,p=c+255,m=o.transformRequest(n.replace("{fontstack}",d).replace("{range}",`${c}-${p}`),"Glyphs"),_=yield l.n(m,new AbortController);if(!_||!_.data)throw new Error(`Could not load glyph range. range: ${t}, ${c}-${p}`);let v={};for(let T of l.o(_.data))v[T.id]=T;return v})},Kr.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:n=8,cutoff:o=.25,fontFamily:c="sans-serif",fontWeight:p="normal",fontStyle:m="normal",lang:_=null}={}){this.buffer=t,this.cutoff=o,this.radius=n,this.lang=_;let v=this.size=d+4*t,T=this._createCanvas(v),P=this.ctx=T.getContext("2d",{willReadFrequently:!0});P.font=`${m} ${p} ${d}px ${c}`,P.textBaseline="alphabetic",P.textAlign="left",P.fillStyle="black",this.gridOuter=new Float64Array(v*v),this.gridInner=new Float64Array(v*v),this.f=new Float64Array(v),this.z=new Float64Array(v+1),this.v=new Uint16Array(v)}_createCanvas(d){let t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:o,actualBoundingBoxLeft:c,actualBoundingBoxRight:p}=this.ctx.measureText(d),m=Math.ceil(n),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(p-c))),v=Math.min(this.size-this.buffer,m+Math.ceil(o)),T=_+2*this.buffer,P=v+2*this.buffer,E=Math.max(T*P,0),C=new Uint8ClampedArray(E),D={data:C,width:T,height:P,glyphWidth:_,glyphHeight:v,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(_===0||v===0)return D;let{ctx:B,buffer:q,gridInner:W,gridOuter:$}=this;this.lang&&(B.lang=this.lang),B.clearRect(q,q,_,v),B.fillText(d,q,q+m);let Y=B.getImageData(q,q,_,v);$.fill(Br,0,E),W.fill(0,0,E);for(let ee=0;ee<v;ee++)for(let X=0;X<_;X++){let te=Y.data[4*(ee*_+X)+3]/255;if(te===0)continue;let ne=(ee+q)*T+X+q;if(te===1)$[ne]=0,W[ne]=Br;else{let J=.5-te;$[ne]=J>0?J*J:0,W[ne]=J<0?J*J:0}}Sn($,0,0,T,P,T,this.f,this.v,this.z),Sn(W,q,q,_,v,T,this.f,this.v,this.z);for(let ee=0;ee<E;ee++){let X=Math.sqrt($[ee])-Math.sqrt(W[ee]);C[ee]=Math.round(255-255*(X/this.radius+this.cutoff))}return D}};class ai{constructor(){this.specification=l.u.light.position}possiblyEvaluate(t,n){return l.F(t.expression.evaluate(n))}interpolate(t,n,o){return{x:l.G.number(t.x,n.x,o),y:l.G.number(t.y,n.y,o),z:l.G.number(t.z,n.z,o)}}}let bt;class Un extends l.E{constructor(t){super(),bt=bt||new l.t({anchor:new l.D(l.u.light.anchor),position:new ai,color:new l.D(l.u.light.color),intensity:new l.D(l.u.light.intensity)}),this._transitionable=new l.x(bt,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}
vendor: 4,017 bytes, line 2
2){if(!this._validate(l.y,t,n))for(let o in t){let c=t[o];o.endsWith(l.z)?this._transitionable.setTransition(o.slice(0,-l.z.length),c):this._transitionable.setValue(o,c)}}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,o){return(!o||o.validate!==!1)&&l.B(this,t.call(l.C,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:l.u}))}}let jr=new l.t({"sky-color":new l.D(l.u.sky["sky-color"]),"horizon-color":new l.D(l.u.sky["horizon-color"]),"fog-color":new l.D(l.u.sky["fog-color"]),"fog-ground-blend":new l.D(l.u.sky["fog-ground-blend"]),"horizon-fog-blend":new l.D(l.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new l.D(l.u.sky["sky-horizon-blend"]),"atmosphere-blend":new l.D(l.u.sky["atmosphere-blend"])});class so extends l.E{constructor(t){super(),this._transitionable=new l.x(jr,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new l.H(0))}setSky(t,n={}){if(!this._validate(l.J,t,n)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let o in t){let c=t[o];o.endsWith(l.z)?this._transitionable.setTransition(o.slice(0,-l.z.length),c):this._transitionable.setValue(o,c)}}}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,o={}){return(o==null?void 0:o.validate)!==!1&&l.B(this,t.call(l.C,l.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:l.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Sa{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){let o=t.join(",")+String(n);return this.dashEntry[o]||(this.dashEntry[o]=this.addDash(t,n)),this.dashEntry[o]}getDashRanges(t,n,o){let c=[],p=t.length%2==1?-t[t.length-1]*o:0,m=t[0]*o,_=!0;c.push({left:p,right:m,isDash:_,zeroLength:t[0]===0});let v=t[0];for(let T=1;T<t.length;T++){_=!_;let P=t[T];p=v*o,v+=P,m=v*o,c.push({left:p,right:m,isDash:_,zeroLength:P===0})}return c}addRoundDash(t,n,o){let c=n/2;for(let p=-o;p<=o;p++){let m=this.width*(this.nextRow+o+p),_=0,v=t[_];for(let T=0;T<this.width;T++){T/v.right>1&&(v=t[++_]);let P=Math.abs(T-v.left),E=Math.abs(T-v.right),C=Math.min(P,E),D,B=p/o*(c+1);if(v.isDash){let q=c-Math.abs(B);D=Math.sqrt(C*C+q*q)}else D=c-Math.sqrt(C*C+B*B);this.data[m+T]=Math.max(0,Math.min(255,D+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){let v=t[_],T=t[_+1];v.zeroLength?t.splice(_,1):T&&T.isDash===v.isDash&&(T.left=v.left,t.splice(_,1))}let n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);let c=this.width*this.nextRow,p=0,m=t[p];for(let _=0;_<this.width;_++){_/m.right>1&&(m=t[++p]);let v=Math.abs(_-m.left),T=Math.abs(_-m.right),P=Math.min(v,T);this.data[c+_]=Math.max(0,Math.min(255,(m.isDash?P:-P)+128))}}addDash(t,n){let o=n?7:0,c=2*o+1;if(this.nextRow+c>this.height)return l.w("LineAtlas out of space"),null;let p=0;for(let _=0;_<t.length;_++)p+=t[_];if(p!==0){let _=this.width/p,v=this.getDashRanges(t,this.width,_);n?this.addRoundDash(v,_,o):this.addRegularDash(v)}let m={y:this.nextRow+o,height:2*o,width:p};return this.nextRow+=c,this.dirty=!0,m}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.L
2INEAR),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 Tn="maplibre_preloaded_worker_pool";class Jr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Jr.workerCount;)this.workers.push(new Worker(l.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(n=>{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tn]}numActive(){return Object.keys(this.active).length}}let yr=Math.floor(Ve.hardwareConcurrency/2),Ci,Wi;function Ta(){return Ci||(Ci=new Jr),Ci}Jr.workerCount=l.K(globalThis)?Math.max(Math.min(yr,3),1):1;class Gn{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;let o=this.workerPool.acquire(n);for(let c=0;c<o.length;c++){let p=new l.L(o[c],n);p.name=`Worker ${c}`,this.actors.push(p)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n){let o=[];for(let c of this.actors)o.push(c.sendAsync({type:t,data:n}));return Promise.all(o)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(let o of this.actors)o.registerMessageHandler(t,n)}unregisterMessageHandler(t){for(let n of this.actors)n.unregisterMessageHandler(t)}}function Zn(){return Wi||(Wi=new Gn(Ta(),l.M),Wi.registerMessageHandler("GR",(d,t,n)=>l.m(t,n))),Wi}function Ei(d,t){let n=l.N();return l.O(n,n,[1,1,0]),l.Q(n,n,[.5*d.width,.5*d.height,1]),d.calculatePosMatrix?l.S(n,n,d.calculatePosMatrix(t.toUnwrapped())):n}function hs(d,t,n,o,c,p,m){var _;let v=function(C,D,B){if(C)for(let q of C){let W=D[q];
2if(W&&W.source===B&&W.type==="fill-extrusion")return!0}else for(let q in D){let W=D[q];if(W.source===B&&W.type==="fill-extrusion")return!0}return!1}((_=c==null?void 0:c.layers)!==null&&_!==void 0?_:null,t,d.id),T=p.maxPitchScaleFactor(),P=d.tilesIn(o,T,v);P.sort(ki);let E=[];for(let C of P)E.push({wrappedTileID:C.tileID.wrapped().key,queryResults:C.tile.queryRenderedFeatures(t,n,d.getState(),C.queryGeometry,C.cameraQueryGeometry,C.scale,c,p,T,Ei(p,C.tileID),m?(D,B)=>m(C.tileID,D,B):void 0)});return function(C,D){for(let B in C)for(let q of C[B])tr(q,D);return C}(function(C){let D={},B={};for(let q of C){let W=q.queryResults,$=q.wrappedTileID,Y=B[$]=B[$]||{};for(let ee in W){let X=W[ee],te=Y[ee]=Y[ee]||{},ne=D[ee]=D[ee]||[];for(let J of X)te[J.featureIndex]||(te[J.featureIndex]=!0,ne.push(J))}}return D}(E),d)}function ki(d,t){let n=d.tileID,o=t.tileID;return n.overscaledZ-o.overscaledZ||n.canonical.y-o.canonical.y||n.wrap-o.wrap||n.canonical.x-o.canonical.x}function tr(d,t){let n=d.feature,o=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=o}function Vr(d,t,n,o){return l._(this,void 0,void 0,function*(){let c=d;if(d.url?c=(yield l.j(t.transformRequest(d.url,"Source"),n)).data:yield Ve.frameAsync(n,o),!c)return null;let p=l.U(l.e(c,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in c&&c.vector_layers&&(p.vectorLayerIds=c.vector_layers.map(m=>m.id)),p})}class Bt{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 l.V?new l.V(t.lng,t.lat):l.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof l.V?new l.V(t.lng,t.lat):l.V.convert(t),this}extend(t){let n=this._sw,o=this._ne,c,p;if(t instanceof l.V)c=t,p=t;else{if(!(t instanceof Bt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Bt.convert(t)):this.extend(l.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(l.V.convert(t)):this;if(c=t._sw,p=t._ne,!c||!p)return this}return n||o?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),o.lng=Math.max(p.lng,o.lng),o.lat=Math.max(p.lat,o.lat)):(this._sw=new l.V(c.lng,c.lat),this._ne=new l.V(p.lng,p.lat)),this}getCenter(){return new l.V((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 l.V(this.getWest(),this.getNorth())}getSouthEast(){return new l.V(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:o}=l.V.convert(t),c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&c}intersects(t){if(!((t=Bt.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let n=Math.abs(this.getEast()-this.getWest()),o=Math.abs(t.getEast()-t.getWest());if(n>=360||o>=360)return!0;let c=l.W(this.getWest(),-180,180),p=l.W(this.getEast(),-180,180),m=l.W(t.getWest(),-180,180),_=l.W(t.getEast(),-180,180),v=c>p,T=m>_;return!(!v||!T)||(v?_>=c||m<=p:T?p>=m||c<=_:m<=p&&_>=c)}static convert(t){return t instanceof Bt?t:t&&new Bt(t)}static fromLngLat(t,n=0){let o=360*n/40075017,c=o/Math.cos(Math.PI/180*t.lat);return new Bt(new l.V(t.lng-c,t.lat-o),new l.V(t.lng+c,t.lat+o))}adjustAntiMeridian(){let t=new l.V(this._sw.lng,this._sw.lat),n=new l.V(this._ne.lng,this._ne.lat);return new Bt(t,t.lng>n.lng?new l.V(n.lng+360,n.lat):n)}}class qn{constructor(t,n,o){this.bounds=Bt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=o||24}
2validateBounds(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),o=Math.floor(l.Y(this.bounds.getWest())*n),c=Math.floor(l.X(this.bounds.getNorth())*n),p=Math.ceil(l.Y(this.bounds.getEast())*n),m=Math.ceil(l.X(this.bounds.getSouth())*n);return t.x>=o&&t.x<p&&t.y>=c&&t.y<m}}class Pa extends l.E{constructor(t,n,o,c){if(super(),this.id=t,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.e(this,l.U(n,["url","scheme","tileSize","promoteId","encoding"])),this._options=l.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(c)}load(){return l._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new l.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let t=yield Vr(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,this.map.style.tileManagers[this.id].clearTiles(),t&&(l.e(this,t),t.bounds&&(this.tileBounds=new qn(t.bounds,this.minzoom,this.maxzoom)),this.fire(new l.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.l("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,l.Z(t)||this.fire(new l.k(t))}})}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()}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 l.e({},this._options)}loadTile(t){return l._(this,void 0,void 0,function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o={request:this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
2ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:this._getOverzoomParameters(t)};o.request.collectResourceTiming=this._collectResourceTiming;let c="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise((p,m)=>{t.reloadPromise={resolve:p,reject:m}})}else t.actor=this.dispatcher.getActor(),c="LT";t.abortController=new AbortController;try{let p=yield t.actor.sendAsync({type:c,data:o},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,p)}catch(p){if(delete t.abortController,t.aborted)return;if(p&&p.status!==404)throw p;this._afterTileLoadWorkerResponse(t,null)}})}_getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let n=t.tileID.scaledTo(this.maxzoom).canonical,o=n.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:n,overzoomRequest:this.map._requestManager.transformRequest(o,"Tile")}}_afterTileLoadWorkerResponse(t,n){if(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),t.reloadPromise){let o=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(o.resolve).catch(o.reject)}}abortTile(t){return l._(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.t
2ype,source:this.id}}))})}unloadTile(t){return l._(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 $n extends l.E{constructor(t,n,o,c){super(),this.id=t,this.dispatcher=o,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.e({type:"raster"},n),l.e(this,l.U(n,["url","scheme","tileSize"]))}load(){return l._(this,arguments,void 0,function*(t=!1){this._loaded=!1,this.fire(new l.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let n=yield Vr(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,n&&(l.e(this,n),n.bounds&&(this.tileBounds=new qn(n.bounds,this.minzoom,this.maxzoom)),this.fire(new l.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(n){this._tileJSONRequest=null,this._loaded=!0,l.Z(n)||this.fire(new l.k(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 l.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return l._(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 o=yield gi.getImage(this.map._requestManager.transformRequest(n,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(o&&o.data){this.map._refreshExpiredTiles&&(o.cacheControl||o.expires)&&t.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});let c=this.map.painter.context,p=c.gl,m=o.data;t.texture=this.map.painter.getTileTexture(m.width),t.texture?t.texture.update(m,{useMipmap:!0}):(t.texture=new l.T(c,m,p.RGBA,{useMipmap:!0}),t.texture.bind(p.LINEAR,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(o){if(delete t.abortController,t.aborted)t.state="unloaded";else if(o)throw t.state="errored",o}})}abortTile(t){return l._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return l._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class Pn extends $n{constructor(t,n,o,c){super(t,n,o,c),this.type="raster-dem",this.maxzoom=22,this._options=l.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 l._(this,void 0,void 0,function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),o=this.map._requestManager.transformRequest(n,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let c=yield gi.getImage(o,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(c&&c.data){let p=c.data;this.map._refreshExpiredTiles&&(c.cacheControl||c.expires)&&t.setExpiryData({cacheControl:c.cacheControl,expires:c.expires});let m=l.b(p)&&l.$()?p:yield this.readImageNow(p),_={type:this.type,uid:t.uid,source:this.id,rawImageData:m,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();let v=yield t.actor.sendAsync({type:"LDT",data:_});t.dem=v,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}
2catch(c){if(delete t.abortController,t.aborted)t.state="unloaded";else if(c)throw t.state="errored",c}})}readImageNow(t){return l._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&l.a0()){let n=t.width+2,o=t.height+2;try{return new l.R({width:n,height:o},yield l.a1(t,-1,-1,n,o))}catch{}}return Ve.getImageData(t,1)})}_getNeighboringTiles(t){let n=t.canonical,o=Math.pow(2,n.z),c=(n.x-1+o)%o,p=n.x===0?t.wrap-1:t.wrap,m=(n.x+1+o)%o,_=n.x+1===o?t.wrap+1:t.wrap,v={};return v[new l.a2(t.overscaledZ,p,n.z,c,n.y).key]={backfilled:!1},v[new l.a2(t.overscaledZ,_,n.z,m,n.y).key]={backfilled:!1},n.y>0&&(v[new l.a2(t.overscaledZ,p,n.z,c,n.y-1).key]={backfilled:!1},v[new l.a2(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},v[new l.a2(t.overscaledZ,_,n.z,m,n.y-1).key]={backfilled:!1}),n.y+1<o&&(v[new l.a2(t.overscaledZ,p,n.z,c,n.y+1).key]={backfilled:!1},v[new l.a2(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},v[new l.a2(t.overscaledZ,_,n.z,m,n.y+1).key]={backfilled:!1}),v}unloadTile(t){return l._(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 Nr(d){return d&&d.length!==0?typeof d[0]=="number"?[d]:d.flatMap(t=>Nr(t)):[]}function In(d){return d.type==="GeometryCollection"?d.geometries.flatMap(t=>In(t)):Nr(d.coordinates)}function Wn(d){let t=new Bt,n;switch(d.type){case"FeatureCollection":n=d.features.flatMap(o=>In(o.geometry));break;case"Feature":n=In(d.geometry);break;default:n=In(d)}if(n.length===0)return t;for(let o=0;o<n.length;o++){let[c,p]=n[o];t.extend([c,p])}return t}class Qr extends l.E{constructor(t,n,o,c){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=o.getActor(),this.setEventedParent(c),this._data=typeof n.data=="str
2ing"?{url:n.data}:{geojson:n.data},this._options=l.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&&l.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=l.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(n.buffer!==void 0?n.buffer:128),tolerance:this._pixelsToTileUnits(n.tolerance!==void 0?n.tolerance:.375),extent:l.a5,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(n.clusterMaxZoom),minPoints:Math.max(2,n.clusterMinPoints||2),extent:l.a5,radius:this._pixelsToTileUnits(n.clusterRadius||50),log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.optionsChanged}_pixelsToTileUnits(t){return t*(l.a5/this.tileSize)}_getClusterMaxZoom(t){let n=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||l.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${n}"`),n}load(){return l._(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 o=this._updateWorkerData();return n?o:this}updateData(t,n){this._pendingWorkerUpdate.diff=l.a6(this._pendingWorkerUpdate.diff,t);let o=this._updateWorkerData();return n?o:this}getData(){return l._(this,void 0,void 0,function*(){let t=l.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})})}getBounds(){return l._(this,void 0,void 0,function*(){return Wn(yield this.getData())})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMa
2xZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.optionsChanged=!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,o){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:n,offset:o}})}_updateWorkerData(){return l._(this,void 0,void 0,function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void l.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:n}=this._pendingWorkerUpdate,o=this._getLoadGeoJSONParameters(t,n);t!==void 0?this._pendingWorkerUpdate.data=void 0:n&&(this._pendingWorkerUpdate.diff=void 0),this._pendingWorkerUpdate.optionsChanged=void 0,yield this._dispatchWorkerUpdate(o)})}_getLoadGeoJSONParameters(t,n){let o=l.e({type:this.type},this.workerOptions);return typeof t=="string"?(o.request=this.map._requestManager.transformRequest(Ve.resolveURL(t),"Source"),o.request.collectResourceTiming=this._collectResourceTiming,o):t!==void 0?(o.data=t,o):(n&&(o.dataDiff=n),o)}_dispatchWorkerUpdate(t){return l._(this,void 0,void 0,function*(){this._isUpdatingWorker=!0,this.fire(new l.l("dataloading",{dataType:"source"}));try{let n=yield this.actor.sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||n.abandoned)return void this.fire(new l.l("dataabort",{dataType:"source"}));n.data&&(this._data={geojson:n.data});let o=this._applyDiffToSource(t.dataDiff),c=this._getShouldReloadTileOptions(o),p={dataType:"source"};this._applyResourceTiming(p,n),this.fire(new l.l("data",Object.assign(Object.assign({},p),{sourceDataType:"metadata"}))),this.fire(new l.l("data",Object.assign(Object.assign({},p),{sourceDataType:"content",shouldReloadTileOptions:c})))}catch(n){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new l.l("dataabort",{dataType:"source"}));this.fire(new l.k(n))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}})}_applyResourceTiming(t,n){var o;if(!this._collectResourceTiming)return;let c=(o=n.resourceTiming)===null||o===void 0?void 0:o[this.id];if(!c)return;let p=c.slice(0);p!=null&&p.length&&l.e(t,{resourceTiming:p})}_applyDiffToSource(t){if(!t)return;let n=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let c=l.a7(this._data.geojson,n);if(!c)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:c}}if(!this._data.updateable)return;let o=l.a8(this._data.updateable,t,n);return t.removeAll||this._options.cluster?void 0:o}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map(n=>Wn(n))}}shouldReloadTile(t,{affectedBounds:n}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;let{buffer:o,extent:c}=this.workerOptions.geojsonVtOptions,p=function({x:m,y:_,z:v},T=0){let P=l.a3((m-T)/Math.pow(2,v)),E=l.a4((_+1+T)/Math.pow(2,v)),C=l.a3((m+1+T)/Math.pow(2,v)),D=l.a4((_-T)/Math.pow(2,v));return new Bt([P,E],[C,D])}(t.tileID.canonical,o/c);for(let m of n)if(p.intersects(m))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return l._(this,void 0,void 0,function*(){let n=t.actor?"RT":"LT";t.actor=this.actor;let o={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 c=yield this.actor.sendAsync({type:n,data:o},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(c,this.map.painter,n==="RT")})}abortTile(t){return l._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return l._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
2ype,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return l.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 en extends l.E{constructor(t,n,o,c){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=o,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}load(t){return l._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new l.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let n=yield gi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,l.Z(n)||this.fire(new l.k(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 l.l("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(l.a9.fromLngLat);var o;return this.tileID=function(c){let p=l.aa.fromPoints(c),m=p.width(),_=p.height(),v=Math.max(m,_),T=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),P=Math.pow(2,T);return new l.ac(T,Math.floor((p.minX+p.maxX)/2*P),Math.floor((p.minY+p.maxY)/2*P))}(n),this.terrainTileRanges=this._getOverlappingTileRanges(n),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=n.map(c=>this.tileID.getTilePoint(c)._round()),this.flippedWindingOrder=((o=this.tileCoords)[1].x-o[0].x)*(o[2].y-o[0].y)-(o[1].y-o[0].y)*(o[2].x-o[0].x)<0,this.fire(new l.l("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 l.T(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let o=!1;for(let c in this.tiles){let p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,o=!0)}o&&this.fire(new l.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return l._(this,void 0,void 0,function*(){this.tileID&&this.tileID.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:o,maxX:c,maxY:p}=l.aa.fromPoints(t),m={};for(let _=0;_<=l.ab;_++){let v=Math.pow(2,_),T=Math.floor(n*v),P=Math.floor(o*v),E=Math.floor(c*v),C=Math.floor(p*v),D=(T%v+v)%v,B=E%v,q=Math.floor(T/v),W=Math.floor(E/v);m[_]={minWrap:q,maxWrap:W,minTileXWrapped:D,maxTileXWrapped:B,minTileY:P,maxTileY:C}}return m}}class Mn extends en{constructor(t,n,o,c){super(t,n,o,c),this.roundZoom=!0,this.type="video",this.options=n}load(){return l._(this,void 0,void 0,function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{let n=yield l.ad(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new l.k(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 l.k(new l.ae(`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}
2onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}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 l.T(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let o=!1;for(let c in this.tiles){let p=this.tiles[c];p.state!=="loaded"&&(p.state="loaded",p.texture=this.texture,o=!0)}o&&this.fire(new l.l("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 Ia extends en{constructor(t,n,o,c){super(t,n,o,c),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(p=>!Array.isArray(p)||p.length!==2||p.some(m=>typeof m!="number"))||this.fire(new l.k(new l.ae(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.k(new l.ae(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new l.k(new l.ae(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new l.k(new l.ae(`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 l.k(new l.ae(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return l._(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 l.k(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,o=n.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new l.T(n,this.canvas,o.RGBA,{premultiply:!0}),this.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE));let c=!1;for(let p in this.tiles){let m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,c=!0)}c&&this.fire(new l.l("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 lo={},Ma=d=>{switch(d){case"geojson":return Qr;case"image":return en;case"raster":return $n;case"raster-dem":return Pn;case"vector":return Pa;case"video":return Mn;case"canvas":return Ia}return lo[d]},le="RTLPluginLoaded";class z extends l.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Zn()}_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 l._(this,arguments,void 0,function*(n,o=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Ve.resolveURL(n),!this.url)throw new Error(`requested url ${n}
2 is invalid`);if(this.status==="unavailable"){if(!o)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return l._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new l.l(le))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let R=null;function j(){return R||(R=new z),R}var K,re;(function(d){d[d.Base=0]="Base",d[d.Parent=1]="Parent"})(K||(K={})),function(d){d[d.Departing=0]="Departing",d[d.Incoming=1]="Incoming"}(re||(re={}));class ue{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=l.af(),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:o,fadeEndTime:c}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=n,this.fadingParentID=o,this.fadeEndTime=c}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=Ge(),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,o){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,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(c,p){let m={};if(!p)return m;for(let _ of c){let v=_.layerIds.map(T=>p.getLayer(T)).filter(Boolean);if(v.length!==0){_.layers=v,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(T=>v.filter(P=>P.id===T)[0]));for(let T of v)m[T.id]=_}}return m}(t.buckets,n==null?void 0:n.style),this.hasSymbolBuckets=!1;for(let c in this.buckets){let p=this.buckets[c];if(p instanceof l.ah){if(this.hasSymbolBuckets=!0,!o)break;p.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let c in this.buckets){let p=this.buckets[c];if(p instanceof l.ah&&p.hasRTLText){this.hasRTLText=!0,j().lazyLoad();break}}this.queryPadding=0;for(let c in this.buckets){let p=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(
2p))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new l.ag}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let o in this.buckets){let c=this.buckets[o];c.uploadPending()&&c.upload(t)}let n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new l.T(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new l.T(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,o,c,p,m,_,v,T,P,E){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:p,scale:m,tileSize:this.tileSize,pixelPosMatrix:P,transform:v,params:_,queryPadding:this.queryPadding*T,getElevation:E},t,n,o):{}}querySourceFeatures(t,n){let o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;let c=o.loadVTLayers(),p=n&&n.sourceLayer?n.sourceLayer:"",m=c[l.ai]||c[p];if(!m)return;let _=l.aj(n==null?void 0:n.filter,n==null?void 0:n.globalState),{z:v,x:T,y:P}=this.tileID.canonical,E={z:v,x:T,y:P};for(let C=0;C<m.length;C++){let D=m.feature(C);if(_.needGeometry){let W=l.ak(D,!0);if(!_.filter(new l.H(this.tileID.overscaledZ),W,this.tileID.canonical))continue}else if(!_.filter(new l.H(this.tileID.overscaledZ),D))continue;let B=o.getId(D,p),q=new l.al(D,v,T,P,B);q.tile=E,t.push(q)}}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 o=l.am(t.cacheControl);o["max-age"]&&(this.expirationTime=Date.now()+1e3*o["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let o=Date.now(),c=!1;if(this.expirationTime>o)c=!1;else if(n)if(this.expirationTime<n)c=!0;else{let p=this.expirationTime-n;p?this.expirationTime=o+Math.max(p,3e4):c=!0}else c=!0;c?(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){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;let o=this.latestFeatureIndex.loadVTLayers();for(let c in this.buckets){if(!n.style.hasLayer(c))continue;let p=this.buckets[c],m=p.layers[0].sourceLayer||l.ai,_=o[m],v=t[m];if(!_||!v||Object.keys(v).length===0)continue;p.update(v,_,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let T=n&&n.style&&n.style.getLayer(c);
2T&&(this.queryPadding=Math.max(this.queryPadding,T.queryRadius(p)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ge()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=Ge()+t}setDependencies(t,n){let o={};for(let c of n)o[c]=!0;this.dependencies[t]=o}hasDependency(t,n){for(let o of t){let c=this.dependencies[o];if(c){for(let p of n)if(c[p])return!0}}return!1}}class me{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,n,o){let c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},l.e(this.stateChanges[t][c],o),this.deletedStates[t]===null){this.deletedStates[t]={};for(let p in this.state[t])p!==c&&(this.deletedStates[t][p]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(let p in this.state[t][c])o[p]||(this.deletedStates[t][c][p]=null)}else for(let p in o)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][p]===null&&delete this.deletedStates[t][c][p]}removeFeatureState(t,n,o){if(this.deletedStates[t]===null)return;let c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},o&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][o]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(o in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][o]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){let o=String(n),c=l.e({},(this.state[t]||{})[o],(this.stateChanges[t]||{})[o]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let p=this.deletedStates[t][n];if(p===null)return{};for(let m in p)delete c[m]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){let o={};for(let c in this.stateChanges){this.state[c]=this.state[c]||{};let p={};for(let m in this.stateChanges[c])this.state[c][m]||(this.state[c][m]={}),l.e(this.state[c][m],this.stateChanges[c][m]),p[m]=this.state[c][m];o[c]=p}for(let c in this.deletedStates){this.state[c]=this.state[c]||{};let p={};if(this.deletedStates[c]===null)for(let m in this.state[c])p[m]={},this.state[c][m]={};else for(let m in this.deletedStates[c]){if(this.deletedStates[c][m]===null)this.state[c][m]={};else for(let _ of Object.keys(this.deletedStates[c][m]))delete this.state[c][m][_];p[m]=this.state[c][m]}o[c]=o[c]||{},l.e(o[c],p)}this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0&&(this.revision++,t.setFeatureState(o,n))}}let oe=89.25;function he(d,t){let n=l.an(t.lat,-l.ao,l.ao);return new l.P(l.Y(t.lng)*d,l.X(n)*d)}function Pe(d,t){return new l.a9(t.x/d,t.y/d).toLngLat()}function xe(d){return d.cameraToCenterDistance*Math.min(.85*Math.tan(l.ap(90-d.pitch)),Math.tan(l.ap(oe-d.pitch)))}function ie(d,t){let n=d.canonical,o=t/l.aq(n.z),c=n.x+Math.pow(2,n.z)*d.wrap,p=l.ar(new Float64Array(16));return l.O(p,p,[c*o,n.y*o,0]),l.Q(p,p,[o/l.a5,o/l.a5,1]),p}function He(d,t,n,o,c){let p=l.a9.fromLngLat(d,t),m=c*l.as(1,d.lat),{x:_,y:v,z:T}=nt(n,o);return new l.a9(p.x+m*-_,p.y+m*-v,p.z+m*-T)}
vendor: 3,724 bytes, line 2
2function nt(d,t){let n=l.ap(d),o=l.ap(t),c=Math.cos(-n),p=Math.sin(n);return{x:p*Math.sin(o),y:-p*Math.cos(o),z:c}}function Qe(d,t,n){let o=t.intersectsFrustum(d);if(!n||o===0)return o;let c=t.intersectsPlane(n);return c===0?0:o===2&&c===2?2:1}function it(d,t,n){let o=0,c=(n-t)/10;for(let p=0;p<10;p++)o+=c*Math.pow(Math.cos(t+(p+.5)/10*(n-t)),d);return o}function rt(d,t){return function(n,o,c,p,m){let _=2*((d-1)/l.at(Math.cos(l.ap(oe-m))/Math.cos(l.ap(oe)))-1),v=Math.acos(c/p),T=2*it(_-1,0,l.ap(m/2)),P=Math.min(l.ap(oe),v+l.ap(m/2)),E=it(_-1,Math.min(P,v-l.ap(m/2)),P),C=Math.atan(o/c),D=Math.hypot(o,c),B=n;return B+=l.at(p/D/Math.max(.5,Math.cos(l.ap(m/2)))),B+=_*l.at(Math.cos(C))/2,B-=l.at(Math.max(1,E/T/t))/2,B}}let st=rt(9.314,3);function Lt(d,t){let n=(t.roundZoom?Math.round:Math.floor)(d.zoom+l.at(d.tileSize/t.tileSize));return Math.max(0,n)}function zt(d,t){let n=d.getCameraFrustum(),o=d.getClippingPlane(),c=d.screenPointToMercatorCoordinate(d.getCameraPoint()),p=l.a9.fromLngLat(d.center,d.elevation);c.z=p.z+Math.cos(d.pitchInRadians)*d.cameraToCenterDistance/d.worldSize;let m=d.getCoveringTilesDetailsProvider(),_=m.allowVariableZoom(d,t),v=Lt(d,t),T=t.minzoom||0,P=t.maxzoom!==void 0?t.maxzoom:d.maxZoom,E=Math.min(Math.max(0,v),P),C=Math.pow(2,E),D=[C*c.x,C*c.y,0],B=[C*p.x,C*p.y,0],q=Math.hypot(p.x-c.x,p.y-c.y),W=Math.abs(p.z-c.z),$=Math.hypot(q,W),Y=te=>({zoom:0,x:0,y:0,wrap:te,fullyVisible:!1}),ee=[],X=[];if(d.renderWorldCopies&&m.allowWorldCopies())for(let te=1;te<=3;te++)ee.push(Y(-te)),ee.push(Y(te));for(ee.push(Y(0));ee.length>0;){let te=ee.pop(),ne=te.x,J=te.y,se=te.fullyVisible,ye={x:ne,y:J,z:te.zoom},fe=m.getTileBoundingVolume(ye,te.wrap,d.elevation,t);if(!se){let Fe=Qe(n,fe,o);if(Fe===0)continue;se=Fe===2}let pe=m.distanceToTile2d(c.x,c.y,ye,fe),ge=v;_&&(ge=(t.calculateTileZoom||st)(d.zoom+l.at(d.tileSize/t.tileSize),pe,W,$,d.fov)),ge=(t.roundZoom?Math.round:Math.floor)(ge),ge=Math.max(0,ge);let Re=Math.min(ge,P);if(te.wrap=m.getWrap(p,ye,te.wrap),te.zoom>=Re){if(te.zoom<T)continue;let Fe=E-te.zoom,ve=D[0]-.5-(ne<<Fe),qe=D[1]-.5-(J<<Fe),lt=t.reparseOverscaled?Math.max(te.zoom,ge):te.zoom;X.push({tileID:new l.a2(te.zoom===P?lt:te.zoom,te.wrap,te.zoom,ne,J),distanceSq:l.au([B[0]-.5-ne,B[1]-.5-J]),tileDistanceToCamera:Math.sqrt(ve*ve+qe*qe)})}else for(let Fe=0;Fe<4;Fe++)ee.push({zoom:te.zoom+1,x:(ne<<1)+Fe%2,y:(J<<1)+(Fe>>1),wrap:te.wrap,fullyVisible:se})}return X.sort((te,ne)=>te.distanceSq-ne.distanceSq).map(te=>te.tileID)}let Qt=l.aa.fromPoints([new l.P(0,0),new l.P(l.a5,l.a5)]);function Si(d){return d==="raster"||d==="image"||d==="video"}function Wt(d,t,n,o,c,p,m){if(!t.hasData())return!1;let{tileID:_,fadingRole:v,fadingDirection:T,fadingParentID:P}=t;if(v===K.Base&&T===re.Incoming&&P)return n[P.key]=P,!0;let E=Math.max(_.overscaledZ-c,p);for(let C=_.overscaledZ-1;C>=E;C--){let D=_.scaledTo(C),B=d.getLoadedTile(D);if(B)return t.setCrossFadeLogic({fadingRole:K.Base,fadingDirection:re.Incoming,fadingParentID:B.tileID,fadeEndTime:o+m}),B.setCrossFadeLogic({fadingRole:K.Parent,fadingDirection:re.Departing,fadeEndTime:o+m}),n[D.key]=D,!0}return!1}function Le(d,t,n,o,c,p){if(!t.hasData())return!1;let m=t.tileID.children(c),_=vt(d,t,m,n,o,c,p);if(_)return!0;for(let v of m)vt(d,t,v.children(c),n,o,c,p)&&(_=!0);return _}function vt(d,t,n,o,c,p,m){if(n[0].overscaledZ>=p)return!1;let _=!1;for(let v of n){let T=d.getLoadedTile(v);if(!T)continue;let{fadingRole:P,fadingDirection:E,fadingParentID:C}=T;P===K.Base&&E===re.Departing&&C||(T.setCrossFadeLogic({fadingRole:K.Base,fadingDirection:re.Departing,fadingParentID:t.tileID,fadeEndTime:c+m}),t.setCrossFadeLogic({fadingRole:K.Parent,fadingDirection:re.Incoming,fadeEndTime:c+m})),o[v.key]=v,_=!0}return _}
2function jt(d,t,n,o){let c=d.tileID;return!!d.selfFading||!d.hasData()&&!!t.has(c)&&(d.setSelfFadeLogic(n+o),!0)}function Hn(d,t){var n;d.needsHillshadePrepare=!0,d.needsTerrainPrepare=!0;let o=t.tileID.canonical.x-d.tileID.canonical.x,c=t.tileID.canonical.y-d.tileID.canonical.y,p=Math.pow(2,d.tileID.canonical.z),m=t.tileID.key;o===0&&c===0||Math.abs(c)>1||(Math.abs(o)>1&&(Math.abs(o+p)===1?o+=p:Math.abs(o-p)===1&&(o-=p)),t.dem&&d.dem&&(d.dem.backfillBorder(t.dem,o,c),!((n=d.neighboringTiles)===null||n===void 0)&&n[m]&&(d.neighboringTiles[m].backfilled=!0)))}class tn{constructor(){this._tiles={}}handleWrapJump(t){let n={};for(let o in this._tiles){let c=this._tiles[o];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+t),n[c.tileID.key]=c}this._tiles=n}setFeatureState(t,n){for(let o in this._tiles)this._tiles[o].setFeatureState(t,n)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map(n=>n.tileID).sort(l.aw).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 o;return(o=this.getTileById(t))===null||o===void 0?void 0:o.isRenderable(n)}getRenderableIds(t=0,n){let o=[];for(let c of this.getAllIds())this.isIdRenderable(c,n)&&o.push(this.getTileById(c));return n?o.sort((c,p)=>{let m=c.tileID,_=p.tileID,v=new l.P(m.canonical.x,m.canonical.y)._rotate(-t),T=new l.P(_.canonical.x,_.canonical.y)._rotate(-t);return m.overscaledZ-_.overscaledZ||T.y-v.y||T.x-v.x}).map(c=>c.tileID.key):o.map(c=>c.tileID).sort(l.aw).map(c=>c.key)}}class Ae extends l.E{constructor(t,n,o){super(),this.id=t,this.dispatcher=o,this.on("data",c=>this._dataHandler(c)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((c,p,m,_)=>{let v=new(Ma(p.type))(c,p,m,_);if(v.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${v.id}`);return v})(t,n,o,this),this._inViewTiles=new tn,this._outOfViewCache=new l.ax(0,c=>this._unloadTile(c)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new me,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){for(let n of this._inViewTiles.getAllTiles())n.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new tn}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,o){return l._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,n,o)}catch(c){t.state="errored",c.status!==404?this._source.fire(new l.k(c,{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 l.l("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 o=this.getLoadedTile(t.scaledTo(n));if(o)return this._inViewTiles.isIdRenderable(o.tileID.key)}return!1}reload(t,n=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let o of this._inViewTiles.getAllIds()){let c=this._inViewTiles.getTileById(o);n&&!this._source.shouldReloadTile(c,n)||(t?this._reloadTile(o,"expired"):c.state!=="errored"&&this._reloadTile(o,"reloading"))}}}_reloadTile(t,n){return l._(this,void 0,void 0,function*(){let o=this._inViewTiles.getTileById(t);o&&(o.state!=="loading"&&(o.state=n),yield this._loadTile(o,t,n))})}_tileLoaded(t,n,o){t.timeAdded=Ge(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),o==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.get
2Source().type==="raster-dem"&&t.dem&&function(c,p){var m,_;let v=p.getRenderableIds();for(let T of v){if(!c.neighboringTiles||!c.neighboringTiles[T])continue;let P=p.getTileById(T);c.neighboringTiles[T].backfilled||Hn(c,P),!((_=(m=P.neighboringTiles)===null||m===void 0?void 0:m[c.tileID.key])===null||_===void 0)&&_.backfilled||Hn(P,c)}}(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new l.l("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 o=this._getLoadedDescendents(n),c=new Set;for(let p of n){let m=o[p.key];if(!(m!=null&&m.length)){c.add(p);continue}let _=p.overscaledZ+Ae.maxOverzooming,v=m.filter(E=>E.tileID.overscaledZ<=_);if(!v.length){c.add(p);continue}let T=Math.min(...v.map(E=>E.tileID.overscaledZ)),P=v.filter(E=>E.tileID.overscaledZ===T).map(E=>E.tileID);for(let E of P)t[E.key]=E;this._areDescendentsComplete(P,T,p.overscaledZ)||c.add(p)}return c}_getLoadedDescendents(t){var n;let o={};for(let c of this._inViewTiles.getAllTiles().filter(p=>p.hasData()))for(let p of t)c.tileID.isChildOf(p)&&(o[n=p.key]||(o[n]=[])).push(c);return o}_areDescendentsComplete(t,n,o){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===n:Math.pow(4,n-o)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let n=Math.ceil(t.width/this._source.tileSize)+1,o=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*o*(this._maxTileCacheZoomLevels===null?l.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),p=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._outOfViewCache.setMaxSize(p)}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 o;this.transform=t,this.terrain=n,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?o=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(v=>new l.a2(v.canonical.z,v.wrap,v.canonical.z,v.canonical.x,v.canonical.y)):(o=zt(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&&(o=o.filter(v=>this._source.hasTile(v)))):o=[],this.usedForTerrain&&(o=this._addTerrainIdealTiles(o));let c=o.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,c&&this.fire(new l.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let p=Lt(t,this._source),m=this._updateRetainedTiles(o,p),_=Si(this._source.type);_&&this._rasterFadeDuration>0&&!n&&function(v,T,P,E,C,D,B){let q=Ge(),W=l.av(T);for(let $ of T){let Y=v.getTileById($.key);Y.fadingDirection!==re.Departing&&Y.fadeOpacity!==0||Y.resetFadeLogic(),Wt(v,Y,P,q,E,C,B)||Le(v,Y,P,q,D,B)||jt(Y,W,q,B)||Y.resetFadeLogic()}}(this._inViewTiles,o,m,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),_?this._cleanUpRasterTiles(m):this._cleanUpVectorTiles(m)}_cleanUpRasterTiles(t){for(let n of this._inViewTiles.getAllIds())t[n]||this._removeTile(n)}_cleanUpVectorTiles(t){for(let n of this._inViewTiles.getAllIds()){let o=this._inViewTiles.getTileById(n);t[n]?o.clearSymbolFadeHold():o.hasSymbolBuckets?o.holdingForSymbolFade()?o.symbolFadeFinished()&&this._removeTile(n):o.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(n)}}_addTerrainIdealTiles(t){let n=[];for(let o of t)if(o.canonical.z>this._source.minzoom){let c=o.scaledTo(o.canonical.z-1);n.push(c);let p=o.scaledTo(Math.max(this._source.minzoom,Math.min(o.canonical.z,5)));n.push(p)}return t.concat(n)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){var o;let c=new Set;for(let T of t)this._addTile(T).hasData()||c.add(T);let p=t.reduce((T,P)=>(T[P.key]=P,T),{}),m=this._retainLoadedChildren(p,c),_={},v=Math.max(n-Ae.maxUnderzooming,this._source.minzoom);for(let T of m){let P=this._inViewTiles.getTileById(T.key),E=P==null?void 0:P.wasRequested();for(let C=T.overscaledZ-1;C>=v;--C){let D=T.scaledTo(C);if(_[D.key])break;if(_[D.key]=!0,P=this.getTile(D),!P&&E&&(P=this._addTile(D)),P){let B=P.hasData();if((B||!(!((o=this.map)===null||o===void 0)&&o.cancelPendingTileRequestsWhileZooming)||E)&&(p[D.key]=D),E=P.wasRequested(),B)break}}}return p}_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 o=n;return n||(n=new ue(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._inViewTiles.setTile(t.key,n),o||this._source.fire(new l.l("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){this._clearTileReloadTimer(t);let o=n.getExpiryTimeout();o&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},o))}_clearTileReloadTimer(t){let n=this._timers[t];
2n&&(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 o=this._inViewTiles.getTileById(n);(this._inViewTiles.isIdRenderable(n)||o.state=="errored")&&t.some(c=>c.equals(o.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,o){let c=[],p=this.transform;if(!p)return c;let m=p.getCoveringTilesDetailsProvider().allowWorldCopies(),_=o?p.getCameraQueryGeometry(t):t,v=D=>p.screenPointToMercatorCoordinate(D,this.terrain),T=this.transformBbox(t,v,!m),P=this.transformBbox(_,v,!m),E=this.getIds(),C=l.aa.fromPoints(P);for(let D=0;D<E.length;D++){let B=this._inViewTiles.getTileById(E[D]);if(B.holdingForSymbolFade())continue;let q=m?[B.tileID]:[B.tileID.unwrapTo(-1),B.tileID.unwrapTo(0)],W=Math.pow(2,p.zoom-B.tileID.overscaledZ),$=n*B.queryPadding*l.a5/B.tileSize/W;for(let Y of q){let ee=C.map(X=>Y.getTilePoint(new l.a9(X.x,X.y)));if(ee.expandBy($),ee.intersects(Qt)){let X=T.map(ne=>Y.getTilePoint(ne)),te=P.map(ne=>Y.getTilePoint(ne));c.push({tile:B,tileID:m?Y:Y.unwrapTo(0),queryGeometry:X,cameraQueryGeometry:te,scale:W})}}}return c}transformBbox(t,n,o){let c=t.map(n);if(o){let p=l.aa.fromPoints(t);p.shrinkBy(.001*Math.min(p.width(),p.height()));let m=p.map(n);l.aa.fromPoints(c).covers(m)||(c=c.map(_=>_.x>.5?new l.a9(_.x-1,_.y,_.z):_))}return c}getVisibleCoordinates(t){let n=this.getRenderableIds(t).map(o=>this._inViewTiles.getTileById(o).tileID);return this.transform&&this.transform.populateCache(n),n}hasTransition(){return!!this._source.hasTransition()||!(!Si(this._source.type)||!function(t,n){if(n<=0)return!1;let o=Ge();for(let c of t.getAllTiles())if(c.fadeEndTime>=o)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,n,o){this._state.updateState(t=t||l.ai,n,o)}removeFeatureState(t,n,o){this._state.removeFeatureState(t=t||l.ai,n,o)}getFeatureState(t,n){return this._state.getState(t=t||l.ai,n)}setDependencies(t,n,o){let c=this._inViewTiles.getTileById(t);c&&c.setDependencies(n,o)}reloadTilesForDependencies(t,n){for(let o of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(o).hasDependency(t,n)&&this._reloadTile(o,"reloading");this._outOfViewCache.filter(o=>!o.hasDependency(t,n))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}Ae.maxUnderzooming=10,Ae.maxOverzooming=3;class at{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let o=1;o<this.points.length;o++)this._distances[o]=this._distances[o-1]+this.points[o].dist(this.points[o-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=l.an(t,0,1);let n=1,o=this._distances[n],c=t*this.paddedLength+this.padding;for(;o<c&&n<this._distances.length;)o=this._distances[++n];let p=n-1,m=this._distances[p],_=o-m,v=_>0?(c-m)/_:0;return this.points[p].mult(1-v).add(this.points[n].mult(v))}}function ot(d,t){let n=!0;return d==="always"||d!=="never"&&t!=="never"||(n=!1),n}class _r{constructor(t,n,o){let c=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(t/o),this.yCellCount=Math.ceil(n/o);for(let m=0;m<this.xCellCount*this.yCellCount;m++)c.push([]),p.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}
vendor: 19,128 bytes, line 2
2insert(t,n,o,c,p){this._forEachCell(n,o,c,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(o),this.bboxes.push(c),this.bboxes.push(p)}insertCircle(t,n,o,c){this._forEachCell(n-c,o-c,n+c,o+c,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(o),this.circles.push(c)}_insertBoxCell(t,n,o,c,p,m){this.boxCells[p].push(m)}_insertCircleCell(t,n,o,c,p,m){this.circleCells[p].push(m)}_query(t,n,o,c,p,m,_){if(o<0||t>this.width||c<0||n>this.height)return[];let v=[];if(t<=0&&n<=0&&this.width<=o&&this.height<=c){if(p)return[{key:null,x1:t,y1:n,x2:o,y2:c}];for(let T=0;T<this.boxKeys.length;T++)v.push({key:this.boxKeys[T],x1:this.bboxes[4*T],y1:this.bboxes[4*T+1],x2:this.bboxes[4*T+2],y2:this.bboxes[4*T+3]});for(let T=0;T<this.circleKeys.length;T++){let P=this.circles[3*T],E=this.circles[3*T+1],C=this.circles[3*T+2];v.push({key:this.circleKeys[T],x1:P-C,y1:E-C,x2:P+C,y2:E+C})}}else this._forEachCell(t,n,o,c,this._queryCell,v,{hitTest:p,overlapMode:m,seenUids:{box:{},circle:{}}},_);return v}query(t,n,o,c){return this._query(t,n,o,c,!1,null)}hitTest(t,n,o,c,p,m){return this._query(t,n,o,c,!0,p,m).length>0}hitTestCircle(t,n,o,c,p){let m=t-o,_=t+o,v=n-o,T=n+o;if(_<0||m>this.width||T<0||v>this.height)return!1;let P=[];return this._forEachCell(m,v,_,T,this._queryCellCircle,P,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:o},seenUids:{box:{},circle:{}}},p),P.length>0}_queryCell(t,n,o,c,p,m,_,v){let{seenUids:T,hitTest:P,overlapMode:E}=_,C=this.boxCells[p];if(C!==null){let B=this.bboxes;for(let q of C)if(!T.box[q]){T.box[q]=!0;let W=4*q,$=this.boxKeys[q];if(t<=B[W+2]&&n<=B[W+3]&&o>=B[W+0]&&c>=B[W+1]&&(!v||v($))&&(!P||!ot(E,$.overlapMode))&&(m.push({key:$,x1:B[W],y1:B[W+1],x2:B[W+2],y2:B[W+3]}),P))return!0}}let D=this.circleCells[p];if(D!==null){let B=this.circles;for(let q of D)if(!T.circle[q]){T.circle[q]=!0;let W=3*q,$=this.circleKeys[q];if(this._circleAndRectCollide(B[W],B[W+1],B[W+2],t,n,o,c)&&(!v||v($))&&(!P||!ot(E,$.overlapMode))){let Y=B[W],ee=B[W+1],X=B[W+2];if(m.push({key:$,x1:Y-X,y1:ee-X,x2:Y+X,y2:ee+X}),P)return!0}}}return!1}_queryCellCircle(t,n,o,c,p,m,_,v){let{circle:T,seenUids:P,overlapMode:E}=_,C=this.boxCells[p];if(C!==null){let B=this.bboxes;for(let q of C)if(!P.box[q]){P.box[q]=!0;let W=4*q,$=this.boxKeys[q];if(this._circleAndRectCollide(T.x,T.y,T.radius,B[W+0],B[W+1],B[W+2],B[W+3])&&(!v||v($))&&!ot(E,$.overlapMode))return m.push(!0),!0}}let D=this.circleCells[p];if(D!==null){let B=this.circles;for(let q of D)if(!P.circle[q]){P.circle[q]=!0;let W=3*q,$=this.circleKeys[q];if(this._circlesCollide(B[W],B[W+1],B[W+2],T.x,T.y,T.radius)&&(!v||v($))&&!ot(E,$.overlapMode))return m.push(!0),!0}}}_forEachCell(t,n,o,c,p,m,_,v){let T=this._convertToXCellCoord(t),P=this._convertToYCellCoord(n),E=this._convertToXCellCoord(o),C=this._convertToYCellCoord(c);for(let D=T;D<=E;D++)for(let B=P;B<=C;B++)if(p.call(this,t,n,o,c,this.xCellCount*B+D,m,_,v))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,o,c,p,m){let _=c-t,v=p-n,T=o+m;return T*T>_*_+v*v}_circleAndRectCollide(t,n,o,c,p,m,_){let v=(m-c)/2,T=Math.abs(t-(c+v));if(T>v+o)return!1;let P=(_-p)/2,E=Math.abs(n-(p+P));if(E>P+o)return!1;if(T<=v||E<=P)return!0;let C=T-v,D=E-P;return C*C+D*D<=o*o}}function La(d,t,n){let o=l.N();if(!d){let{vecSouth:E,vecEast:C}=ut(t),D=_e();D[0]=C[0],D[1]=C[1],D[2]=E[0],D[3]=E[1],c=D,(P=(m=(p=D)[0])*(T=p[3])-(v=p[2])*(_=p[1]))&&(c[0]=T*(P=1/P),c[1]=-_*P,c[2]=-v*P,c[3]=m*P),o[0]=D[0],o[1]=D[1],o[4]=D[2],o[5]=D[3]}var c,p,m,_,v,T,P;return l.Q(o,o,[1/n,1/n,1]),o}function Xn(d,t,n,o){if(d){let c=l.N();if(!t){let{vecSouth:p,vecEast:m}=ut(n);c[0]=m[0],c[1]=m[1],c[4]=p[0],c[5]=p[1]}return l.Q(c,c,[o,o,1]),c}return n.pixelsToClipSpaceMatrix}function ut(d){let t=Math.cos(d.rollInRadians),n=Math.sin(d.rollInRadians),o=Math.cos(d.pitchInRadians),c=Math.cos(d.bearingInRadians),p=Math.sin(d.bearingInRadians),m=l.aC();m[0]=-c*o*n-p*t,m[1]=-p*o*n+c*t;let _=l.aD(m);_<1e-9?l.aE(m):l.aF(m,m,1/_);let v=l.aC();v[0]=c*o*t-p*n,v[1]=p*o*t+c*n;let T=l.aD(v);return T<1e-9?l.aE(v):l.aF(v,v,1/T),{vecEast:v,vecSouth:m}}function Ca(d,t,n,o){let c;o?(c=[d,t,o(d,t),1],l.aH(c,c,n)):(c=[d,t,0,1],En(c,c,n));let p=c[3];return{point:new l.P(c[0]/p,c[1]/p),signedDistanceFromCamera:p,isOccluded:!1}}function Ea(d,t){return .5+d/t*.5}function us(d,t){return d.x>=-t[0]&&d.x<=t[0]&&d.y>=-t[1]&&d.y<=t[1]}function co(d,t,n,o,c,p,m,_,v,T,P,E,C){let D=n?d.textSizeData:d.iconSizeData,B=l.ay(D,t.transform.zoom),q=[256/t.width*2+1,256/t.height*2+1],W=n?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;W.clear();let $=d.lineVertexArray,Y=n?d.text.placedSymbolArray:d.icon.placedSymbolArray,ee=t.transform.width/t.transform.height,X=!1;for(let te=0;te<Y.length;te++){let ne=Y.get(te);if(ne.hidden||ne.writingMode===l.az.vertical&&!X){Kn(ne.numGlyphs,W);continue}X=!1;let J=new l.P(ne.anchorX,ne.anchorY),se={getElevation:C,pitchedLabelPlaneMatrix:o,lineVertexArray:$,pitchWithMap:p,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:J,unwrappedTileID:v,width:T,height:P,translation:E},ye=ds(ne.anchorX,ne.anchorY,se);if(!us(ye.point,q)){Kn(ne.numGlyphs,W);continue}let fe=Ea(t.transform.cameraToCenterDistance,ye.signedDistanceFromCamera),pe=l.aA(D,B,ne),ge=p?pe*t.transform.getPitchedTextCorrection(ne.anchorX,ne.anchorY,v)/fe:pe*fe,Re=uo({projectionContext:se,pitchedLabelPlaneMatrixInverse:c,symbol:ne,fontSize:ge,flip:!1,keepUpright:m,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:W,aspectRatio:ee,rotateToLine:_});X=Re.useVertical,(Re.notEnoughRoom||X||Re.needsFlipping&&uo({projectionContext:se,pitchedLabelPlaneMatrixInverse:c,symbol:ne,fontSize:ge,flip:!0,keepUpright:m,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:W,aspectRatio:ee,rotateToLine:_}).notEnoughRoom)&&Kn(ne.numGlyphs,W)}n?d.text.dynamicLayoutVertexBuffer.updateData(W):d.icon.dynamicLayoutVertexBuffer.updateData(W)}function ho(d,t,n,o,c,p,m,_){let v=p.glyphStartIndex+p.numGlyphs,T=p.lineStartIndex,P=p.lineStartIndex+p.lineLength,E=t.getoffsetX(p.glyphStartIndex),C=t.getoffsetX(v-1),D=po(d*E,n,o,c,p.segment,T,P,_,m);if(!D)return null;let B=po(d*C,n,o,c,p.segment,T,P,_,m);return B?_.projectionCache.anyProjectionOccluded?null:{first:D,last:B}:null}function ka(d,t,n,o){return d===l.az.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*o?{useVertical:!0}:(d===l.az.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function uo(d){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:n,symbol:o,fontSize:c,flip:p,keepUpright:m,glyphOffsetArray:_,dynamicLayoutVertexArray:v,aspectRatio:T,rotateToLine:P}=d,E=c/24,C=o.lineOffsetX*E,D=o.lineOffsetY*E,B;if(o.numGlyphs>1){let q=o.glyphStartIndex+o.numGlyphs,W=o.lineStartIndex,$=o.lineStartIndex+o.lineLength,Y=ho(E,_,C,D,p,o,P,t);if(!Y)return{notEnoughRoom:!0};let ee=Ln(Y.first.point.x,Y.first.point.y,t,n),X=Ln(Y.last.point.x,Y.last.point.y,t,n);if(m&&!p){let te=ka(o.writingMode,ee,X,T);if(te)return te}B=[Y.first];for(let te=o.glyphStartIndex+1;te<q-1;te++){let ne=po(E*_.getoffsetX(te),C,D,p,o.segment,W,$,t,P);if(!ne)return{notEnoughRoom:!0};B.push(ne)}B.push(Y.last)}else{if(m&&!p){let W=Yn(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,$=o.lineStartIndex+o.segment+1,Y=new l.P(t.lineVertexArray.getx($),t.lineVertexArray.gety($)),ee=Yn(Y.x,Y.y,t),X=ee.signedDistanceFromCamera>0?ee.point:Hi(t.tileAnchorPoint,Y,W,1,t),te=Ln(W.x,W.y,t,n),ne=Ln(X.x,X.y,t,n),J=ka(o.writingMode,te,ne,T);if(J)return J}let q=po(E*_.getoffsetX(o.glyphStartIndex),C,D,p,o.segment,o.lineStartIndex,o.lineStartIndex+o.lineLength,t,P);if(!q||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};B=[q]}for(let q of B)l.aG(v,q.point,q.angle);return{}}function Hi(d,t,n,o,c){let p=d.add(d.sub(t)._unit()),m=Yn(p.x,p.y,c).point,_=n.sub(m);return n.add(_._mult(o/_.mag()))}function Rt(d,t,n){let o=t.projectionCache;if(o.projections[d])return o.projections[d];let c=new l.P(t.lineVertexArray.getx(d),t.lineVertexArray.gety(d)),p=Yn(c.x,c.y,t);if(p.signedDistanceFromCamera>0)return o.projections[d]=p.point,o.anyProjectionOccluded=o.anyProjectionOccluded||p.isOccluded,p.point;let m=d-n.direction;return Hi(n.distanceFromAnchor===0?t.tileAnchorPoint:new l.P(t.lineVertexArray.getx(m),t.lineVertexArray.gety(m)),c,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,t)}function Yn(d,t,n){let o=d+n.translation[0],c=t+n.translation[1],p;return n.pitchWithMap?(p=Ca(o,c,n.pitchedLabelPlaneMatrix,n.getElevation),p.isOccluded=!1):(p=n.transform.projectTileCoordinates(o,c,n.unwrappedTileID,n.getElevation),p.point.x=(.5*p.point.x+.5)*n.width,p.point.y=(.5*-p.point.y+.5)*n.height),p}function Ln(d,t,n,o){if(n.pitchWithMap){let c=[d,t,0,1];return l.aH(c,c,o),n.transform.projectTileCoordinates(c[0]/c[3],c[1]/c[3],n.unwrappedTileID,n.getElevation).point}return{x:d/n.width*2-1,y:1-t/n.height*2}}function ds(d,t,n){return n.transform.projectTileCoordinates(d,t,n.unwrappedTileID,n.getElevation)}function rn(d,t,n){return d._unit()._perp()._mult(t*n)}function Cn(d,t,n,o,c,p,m,_,v){if(_.projectionCache.offsets[d])return _.projectionCache.offsets[d];let T=n.add(t);if(d+v.direction<o||d+v.direction>=c)return _.projectionCache.offsets[d]=T,T;let P=Rt(d+v.direction,_,v),E=rn(P.sub(n),m,v.direction),C=n.add(E),D=P.add(E);return _.projectionCache.offsets[d]=l.aI(p,T,C,D)||T,_.projectionCache.offsets[d]}function po(d,t,n,o,c,p,m,_,v){let T=o?d-t:d+t,P=T>0?1:-1,E=0;o&&(P*=-1,E=Math.PI),P<0&&(E+=Math.PI);let C,D=P>0?p+c:p+c+1;_.projectionCache.cachedAnchorPoint?C=_.projectionCache.cachedAnchorPoint:(C=Yn(_.tileAnchorPoint.x,_.tileAnchorPoint.y,_).point,_.projectionCache.cachedAnchorPoint=C);let B,q,W=C,$=C,Y=0,ee=0,X=Math.abs(T),te=[],ne;for(;Y+ee<=X;){if(D+=P,D<p||D>=m)return null;Y+=ee,$=W,q=B;let ye={absOffsetX:X,direction:P,distanceFromAnchor:Y,previousVertex:$};if(W=Rt(D,_,ye),n===0)te.push($),ne=W.sub($);else{let fe,pe=W.sub($);fe=pe.mag()===0?rn(Rt(D+P,_,ye).sub(W),n,P):rn(pe,n,P),q||(q=$.add(fe)),B=Cn(D,fe,W,p,m,q,n,_,ye),te.push(q),ne=B.sub(q)}ee=ne.mag()}let J=ne._mult((X-Y)/ee)._add(q||$),se=E+Math.atan2(W.y-$.y,W.x-$.x);return te.push(J),{point:J,angle:v?se:0,path:te}}let Sh=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Kn(d,t){for(let n=0;n<d;n++){let o=t.length;t.resize(o+4),t.float32.set(Sh,3*o)}}function En(d,t,n){let o=t[0],c=t[1];return d[0]=n[0]*o+n[4]*c+n[12],d[1]=n[1]*o+n[5]*c+n[13],d[3]=n[3]*o+n[7]*c+n[15],d}let pi=100;class _d{constructor(t,n=new _r(t.width+200,t.height+200,25),o=new _r(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=o,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+pi,this.screenBottomBoundary=t.height+pi,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,o,c,p,m,_,v,T,P,E,C){let D=this.projectAndGetPerspectiveRatio(t.anchorPointX+v[0],t.anchorPointY+v[1],p,P,C),B=o*D.perspectiveRatio,q;if(m||_)q=this._projectCollisionBox(t,B,c,p,m,_,v,D,P,E,C);else{let ne=D.x+(E?E.x*B:0),J=D.y+(E?E.y*B:0);q={allPointsOccluded:!1,box:[ne+t.x1*B,J+t.y1*B,ne+t.x2*B,J+t.y2*B]}}let[W,$,Y,ee]=q.box,X=m?q.allPointsOccluded:D.isOccluded,te=X;return te||(te=D.perspectiveRatio<this.perspectiveRatioCutoff),te||(te=!this.isInsideGrid(W,$,Y,ee)),te||n!=="always"&&this.grid.hitTest(W,$,Y,ee,n,T)?{box:[W,$,Y,ee],placeable:!1,offscreen:!1,occluded:X}:{box:[W,$,Y,ee],placeable:!0,offscreen:this.isOffscreen(W,$,Y,ee),occluded:X}}placeCollisionCircles(t,n,o,c,p,m,_,v,T,P,E,C,D,B){let q=[],W=new l.P(n.anchorX,n.anchorY),$=this.getPerspectiveRatio(W.x,W.y,m,B),Y=(T?p*this.transform.getPitchedTextCorrection(n.anchorX,n.anchorY,m)/$:p*$)/l.aM,ee={getElevation:B,pitchedLabelPlaneMatrix:_,lineVertexArray:o,pitchWithMap:T,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:W,unwrappedTileID:m,width:this.transform.width,height:this.transform.height,translation:D},X=ho(Y,c,n.lineOffsetX*Y,n.lineOffsetY*Y,!1,n,!1,ee),te=!1,ne=!1,J=!0;if(X){let se=.5*E*$+C,ye=new l.P(-100,-100),fe=new l.P(this.screenRightBoundary,this.screenBottomBoundary),pe=new at,ge=X.first,Re=X.last,Fe=[];for(let lt=ge.path.length-1;lt>=1;lt--)Fe.push(ge.path[lt]);for(let lt=1;lt<Re.path.length;lt++)Fe.push(Re.path[lt]);let ve=2.5*se;if(T){let lt=this.projectPathToScreenSpace(Fe,ee);Fe=lt.some(St=>St.signedDistanceFromCamera<=0)?[]:lt.map(St=>St.point)}let qe=[];if(Fe.length>0){let lt=Fe[0].clone(),St=Fe[0].clone();for(let At=1;At<Fe.length;At++)lt.x=Math.min(lt.x,Fe[At].x),lt.y=Math.min(lt.y,Fe[At].y),St.x=Math.max(St.x,Fe[At].x),St.y=Math.max(St.y,Fe[At].y);qe=lt.x>=ye.x&&St.x<=fe.x&<.y>=ye.y&&St.y<=fe.y?[Fe]:St.x<ye.x||lt.x>fe.x||St.y<ye.y||lt.y>fe.y?[]:l.aJ([Fe],ye.x,ye.y,fe.x,fe.y)}for(let lt of qe){pe.reset(lt,.25*se);let St=0;St=pe.length<=.5*se?1:Math.ceil(pe.paddedLength/ve)+1;for(let At=0;At<St;At++){let kt=At/Math.max(St-1,1),Vt=pe.lerp(kt),Tt=Vt.x+pi,ci=Vt.y+pi;q.push(Tt,ci,se,0);let Nt=Tt-se,Pi=ci-se,Ht=Tt+se,Xt=ci+se;if(J=J&&this.isOffscreen(Nt,Pi,Ht,Xt),ne=ne||this.isInsideGrid(Nt,Pi,Ht,Xt),t!=="always"&&this.grid.hitTestCircle(Tt,ci,se,t,P)&&(te=!0,!v))return{circles:[],offscreen:!1,collisionDetected:te}}}}return{circles:!v&&te||!ne||$<this.perspectiveRatioCutoff?[]:q,offscreen:J,collisionDetected:te}}projectPathToScreenSpace(t,n){let o=function(c,p){let m=l.N();return l.aB(m,p.pitchedLabelPlaneMatrix),c.map(_=>{let v=Ca(_.x,_.y,m,p.getElevation),T=p.transform.projectTileCoordinates(v.point.x,v.point.y,p.unwrappedTileID,p.getElevation);return T.point.x=(.5*T.point.x+.5)*p.width,T.point.y=(.5*-T.point.y+.5)*p.height,T})}(t,n);return function(c){let p=0,m=0,_=0,v=0;for(let T=0;T<c.length;T++)c[T].isOccluded?(_=T+1,v=0):(v++,v>m&&(m=v,p=_));return c.slice(p,p+m)}(o)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let n=[],o=new l.aa;for(let E of t){let C=new l.P(E.x+pi,E.y+pi);o.extend(C),n.push(C)}let{minX:c,minY:p,maxX:m,maxY:_}=o,v=this.grid.query(c,p,m,_).concat(this.ignoredGrid.query(c,p,m,_)),T={},P={};for(let E of v){let C=E.key;if(T[C.bucketInstanceId]===void 0&&(T[C.bucketInstanceId]={}),T[C.bucketInstanceId][C.featureIndex])continue;let D=[new l.P(E.x1,E.y1),new l.P(E.x2,E.y1),new l.P(E.x2,E.y2),new l.P(E.x1,E.y2)];l.aK(n,D)&&(T[C.bucketInstanceId][C.featureIndex]=!0,P[C.bucketInstanceId]===void 0&&(P[C.bucketInstanceId]=[]),P[C.bucketInstanceId].push(C.featureIndex))}return P}insertCollisionBox(t,n,o,c,p,m){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:c,featureIndex:p,collisionGroupID:m,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,o,c,p,m){let _=o?this.ignoredGrid:this.grid,v={bucketInstanceId:c,featureIndex:p,collisionGroupID:m,overlapMode:n};for(let T=0;T<t.length;T+=4)_.insertCircle(v,t[T],t[T+1],t[T+2])}projectAndGetPerspectiveRatio(t,n,o,c,p){if(p){let m;c?(m=[t,n,c(t,n),1],l.aH(m,m,p)):(m=[t,n,0,1],En(m,m,p));let _=m[3];return{x:(m[0]/_+1)/2*this.transform.width+pi,y:(-m[1]/_+1)/2*this.transform.height+pi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/_*.5,isOccluded:!1,signedDistanceFromCamera:_}}{let m=this.transform.projectTileCoordinates(t,n,o,c);return{x:(m.point.x+1)/2*this.transform.width+pi,y:(1-m.point.y)/2*this.transform.height+pi,perspectiveRatio:.5+this.transform.cameraToCenterDistance/m.signedDistanceFromCamera*.5,isOccluded:m.isOccluded,signedDistanceFromCamera:m.signedDistanceFromCamera}}}getPerspectiveRatio(t,n,o,c){let p=this.transform.projectTileCoordinates(t,n,o,c);return .5+this.transform.cameraToCenterDistance/p.signedDistanceFromCamera*.5}isOffscreen(t,n,o,c){return o<pi||t>=this.screenRightBoundary||c<pi||n>this.screenBottomBoundary}isInsideGrid(t,n,o,c){return o>=0&&t<this.gridRightBoundary&&c>=0&&n<this.gridBottomBoundary}getViewportMatrix(){let t=l.ar([]);return l.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,n,o,c,p,m,_,v,T,P,E){let C=1,D=0,B=0,q=1,W=t.anchorPointX+_[0],$=t.anchorPointY+_[1];if(m&&!p){let Fe=this.projectAndGetPerspectiveRatio(W+1,$,c,T,E),ve=Fe.x-v.x,qe=Math.atan((Fe.y-v.y)/ve)+(ve<0?Math.PI:0),lt=Math.sin(qe),St=Math.cos(qe);C=St,D=lt,B=-lt,q=St}else if(!m&&p){let Fe=ut(this.transform);C=Fe.vecEast[0],D=Fe.vecEast[1],B=Fe.vecSouth[0],q=Fe.vecSouth[1]}let Y=v.x,ee=v.y,X=n;p&&(Y=W,ee=$,X=Math.pow(2,-(this.transform.zoom-o.overscaledZ)),X*=this.transform.getPitchedTextCorrection(W,$,c),P||(X*=l.an(.5+v.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),P&&(Y+=C*P.x*X+B*P.y*X,ee+=D*P.x*X+q*P.y*X);let te=t.x1*X,ne=t.x2*X,J=(te+ne)/2,se=t.y1*X,ye=t.y2*X,fe=(se+ye)/2,pe=[{offsetX:te,offsetY:se},{offsetX:J,offsetY:se},{offsetX:ne,offsetY:se},{offsetX:ne,offsetY:fe},{offsetX:ne,offsetY:ye},{offsetX:J,offsetY:ye},{offsetX:te,offsetY:ye},{offsetX:te,offsetY:fe}],ge=[];for(let{offsetX:Fe,offsetY:ve}of pe)ge.push(new l.P(Y+C*Fe+B*ve,ee+D*Fe+q*ve));let Re=!1;if(p){let Fe=ge.map(ve=>this.projectAndGetPerspectiveRatio(ve.x,ve.y,c,T,E));Re=Fe.some(ve=>!ve.isOccluded),ge=Fe.map(ve=>new l.P(ve.x,ve.y))}else Re=!0;return{box:l.aL(ge),allPointsOccluded:!Re}}}class Th{constructor(t,n,o,c){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):c&&o?1:0,this.placed=o}isHidden(){return this.opacity===0&&!this.placed}}class fo{constructor(t,n,o,c,p){this.text=new Th(t?t.text:null,n,o,p),this.icon=new Th(t?t.icon:null,n,c,p)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ml{constructor(t,n,o){this.text=t,this.icon=n,this.skipFade=o}}class Ph{constructor(t,n,o,c,p){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=o,this.bucketIndex=c,this.tileID=p}}class Ll{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:o=>o.collisionGroupID===n}}return this.collisionGroups[t]}}function ps(d,t,n,o,c){let{horizontalAlign:p,verticalAlign:m}=l.aS(d);return new l.P(-(p-.5)*t+o[0]*c,-(m-.5)*n+o[1]*c)}class Ih{constructor(t,n,o,c,p){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new _d(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new Ll(c),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=p,p&&(p.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let n=this.terrain;return n?(o,c)=>n.getElevation(t,o,c):null}getBucketParts(t,n,o,c){let p=o.getBucket(n),m=o.latestFeatureIndex;if(!p||!m||n.id!==p.layerIds[0])return;let _=o.collisionBoxArray,v=p.layers[0].layout,T=p.layers[0].paint,P=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ
2),E=o.tileSize/l.a5,C=o.tileID.toUnwrapped(),D=v.get("text-rotation-alignment")==="map",B=l.aN(o,1,this.transform.zoom),q=l.aO(this.collisionIndex.transform,o,T.get("text-translate"),T.get("text-translate-anchor")),W=l.aO(this.collisionIndex.transform,o,T.get("icon-translate"),T.get("icon-translate-anchor")),$=La(D,this.transform,B);this.retainedQueryData[p.bucketInstanceId]=new Ph(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,o.tileID);let Y={bucket:p,layout:v,translationText:q,translationIcon:W,unwrappedTileID:C,pitchedLabelPlaneMatrix:$,scale:P,textPixelRatio:E,holdingForFade:o.holdingForSymbolFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:l.ay(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(c)for(let ee of p.sortKeyRanges){let{sortKey:X,symbolInstanceStart:te,symbolInstanceEnd:ne}=ee;t.push({sortKey:X,symbolInstanceStart:te,symbolInstanceEnd:ne,parameters:Y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:Y})}attemptAnchorPlacement(t,n,o,c,p,m,_,v,T,P,E,C,D,B,q,W,$,Y,ee,X){let te=l.aP[t.textAnchor],ne=[t.textOffset0,t.textOffset1],J=ps(te,o,c,ne,p),se=this.collisionIndex.placeCollisionBox(n,C,v,T,P,_,m,W,E.predicate,ee,J,X);if((!Y||this.collisionIndex.placeCollisionBox(Y,C,v,T,P,_,m,$,E.predicate,ee,J,X).placeable)&&se.placeable){let ye;if(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(ye=this.prevPlacement.variableOffsets[D.crossTileID].anchor),D.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[D.crossTileID]={textOffset:ne,width:o,height:c,anchor:te,textBoxScale:p,prevAnchor:ye},this.markUsedJustification(B,te,D,q),B.allowVerticalPlacement&&(this.markUsedOrientation(B,q,D),this.placedOrientations[D.crossTileID]=q),{shift:J,placedGlyphBoxes:se}}}placeLayerBucketPart(t,n,o){let{bucket:c,layout:p,translationText:m,translationIcon:_,unwrappedTileID:v,pitchedLabelPlaneMatrix:T,textPixelRatio:P,holdingForFade:E,collisionBoxArray:C,partiallyEvaluatedTextSize:D,collisionGroup:B}=t.parameters,q=p.get("text-optional"),W=p.get("icon-optional"),$=l.aQ(p,"text-overlap","text-allow-overlap"),Y=$==="always",ee=l.aQ(p,"icon-overlap","icon-allow-overlap"),X=ee==="always",te=p.get("text-rotation-alignment")==="map",ne=p.get("text-pitch-alignment")==="map",J=p.get("icon-text-fit")!=="none",se=p.get("symbol-z-order")==="viewport-y",ye=Y&&(X||!c.hasIconData()||W),fe=X&&(Y||!c.hasTextData()||q);!c.collisionArrays&&C&&c.deserializeCollisionBoxes(C);let pe=this.retainedQueryData[c.bucketInstanceId].tileID,ge=this._getTerrainElevationFunc(pe),Re=this.transform.getFastPathSimpleProjectionMatrix(pe),Fe=(ve,qe,lt)=>{var St,At;if(n[ve.crossTileID])return;if(E)return void(this.placements[ve.crossTileID]=new Ml(!1,!1,!1));let kt=!1,Vt=!1,Tt=!0,ci=null,Nt={box:null,placeable:!1,offscreen:null,occluded:!1},Pi={placeable:!1},Ht=null,Xt=null,Ni=null,pn=0,qr=0,Ui=0;qe.textFeatureIndex?pn=qe.textFeatureIndex:ve.useRuntimeCollisionCircles&&(pn=ve.featureIndex),qe.verticalTextFeatureIndex&&(qr=qe.verticalTextFeatureIndex);let fn=qe.textBox;if(fn){let Yi=It=>{let Ut=l.az.horizontal;if(c.allowVerticalPlacement&&!It&&this.prevPlacement){let hr=this.prevPlacement.placedOrientations[ve.crossTileID];hr&&(this.placedOrientations[ve.crossTileID]=hr,Ut=hr,this.markUsedOrientation(c,Ut,ve))}return Ut},Sr=(It,Ut)=>{if(c.allowVerticalPlacement&&ve.numVerticalGlyphVertices>0&&qe.verticalTextBox){for(let hr of c.writingModes)if(hr===l.az.vertical?(Nt=Ut(),Pi=Nt):Nt=It(),Nt&&Nt.placeable)break}else Nt=It()},lr=ve.textAnchorOffsetStartIndex,cr=ve.textAnchorOffsetEndIndex;if(cr===lr){let It=(Ut,hr)=>{let mi=this.collisionIndex.placeCollisionBox(Ut,$,P,pe,v,ne,te,m,B.predicate,ge,void 0,Re);return mi&&mi.placeable&&(this.markUsedOrientation(c,hr,ve),this.placedOrientations[ve.crossTileID]=hr),mi};Sr(()=>It(fn,l.az.horizontal),()=>{let Ut=qe.verticalTextBox;return c.allowVerticalPlacement&&ve.numVerticalGlyphVertices>0&&Ut?It(Ut,l.az.vertical):{box:null,offscreen:null}}),Yi(Nt&&Nt.placeable)}else{let It=l.aP[(At=(St=this.prevPlacement)===null||St===void 0?void 0:St.variableOffsets[ve.crossTileID])===null||At===void 0?void 0:At.anchor],Ut=(mi,Pu,da)=>{let Zd=mi.x2-mi.x1,Iu=mi.y2-mi.y1,gc=ve.textBoxScale,Mu=J&&ee==="never"?Pu:null,ur=null,Fn=$==="never"?1:2,yc="never";It&&Fn++;for(let Lu=0;Lu<Fn;Lu++){for(let Ko=lr;Ko<cr;Ko++){let _c=c.textAnchorOffsets.get(Ko);if(It&&_c.textAnchor!==It)continue;let Ha=this.attemptAnchorPlacement(_c,mi,Zd,Iu,gc,te,ne,P,pe,v,B,yc,ve,c,da,m,_,Mu,ge);if(Ha&&(ur=Ha.placedGlyphBoxes,ur&&ur.placeable))return kt=!0,ci=Ha.shift,ur}It?It=null:yc=$}return o&&!ur&&(ur={box:this.collisionIndex.placeCollisionBox(fn,"always",P,pe,v,ne,te,m,B.predicate,ge,void 0,Re).box,offscreen:!1,placeable:!1,occluded:!1}),ur};Sr(()=>Ut(fn,qe.iconBox,l.az.horizontal),()=>{let mi=qe.verticalTextBox;return c.allowVerticalPlacement&&(!Nt||!Nt.placeable)&&ve.numVerticalGlyphVertices>0&&mi?Ut(mi,qe.verticalIconBox,l.az.vertical):{box:null,occluded:!0,offscreen:null}}),Nt&&(kt=Nt.placeable,Tt=Nt.offscreen);let hr=Yi(Nt&&Nt.placeable);if(!kt&&this.prevPlacement){let mi=this.prevPlacement.variableOffsets[ve.crossTileID];mi&&(this.variableOffsets[ve.crossTileID]=mi,this.markUsedJustification(c,mi.anchor,ve,hr))}}}if(Ht=Nt,kt=Ht&&Ht.placeable,Tt=Ht&&Ht.offscreen,ve.useRuntimeCollisionCircles&&ve.centerJustifiedTextSymbolIndex>=0){let Yi=c.text.placedSymbolArray.get(ve.centerJustifiedTextSymbolIndex),Sr=l.aA(c.textSizeData,D,Yi),lr=p.get("text-padding");Xt=this.collisionIndex.placeCollisionCircles($,Yi,c.lineVertexArray,c.glyphOffsetArray,Sr,v,T,o,ne,B.predicate,ve.collisionCircleDiameter,lr,m,ge),Xt.circles.length&&Xt.collisionDetected&&!o&&l.w("Collisions detected, but collision boxes are not shown"),kt=Y||Xt.circles.length>0&&!Xt.collisionDetected,Tt=Tt&&Xt.offscreen}if(qe.iconFeatureIndex&&(Ui=qe.iconFeatureIndex),qe.iconBox){let Yi=Sr=>this.collisionIndex.placeCollisionBox(Sr,ee,P,pe,v,ne,te,_,B.predicate,ge,J&&ci?ci:void 0,Re);Pi&&Pi.placeable&&qe.verticalIconBox?(Ni=Yi(qe.verticalIconBox),Vt=Ni.placeable):(Ni=Yi(qe.iconBox),Vt=Ni.placeable),Tt=Tt&&Ni.offscreen}let Xo=q||ve.numHorizontalGlyphVertices===0&&ve.numVerticalGlyphVertices===0,Yo=W||ve.numIconVertices===0;Xo||Yo?Yo?Xo||(Vt=Vt&&kt):kt=Vt&&kt:Vt=kt=Vt&&kt;let Wa=Vt&&Ni.placeable;if(kt&&Ht.placeable&&this.collisionIndex.insertCollisionBox(Ht.box,$,p.get("text-ignore-placement"),c.bucketInstanceId,Pi&&Pi.placeable&&qr?qr:pn,B.ID),Wa&&this.collisionIndex.insertCollisionBox(Ni.box,ee,p.get("icon-ignore-placement"),c.bucketInstanceId,Ui,B.ID),Xt&&kt&&this.collisionIndex.insertCollisionCircles(Xt.circles,$,p.get("text-ignore-placement"),c.bucketInstanceId,pn,B.ID),o&&this.storeCollisionData(c.bucketInstanceId,lt,qe,Ht,Ni,Xt),ve.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(c.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ve.crossTileID]=new Ml((kt||ye)&&!(Ht!=null&&Ht.occluded),(Vt||fe)&&!(Ni!=null&&Ni.occluded),Tt||c.justReloaded),n[ve.crossTileID]=!0};if(se){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");
vendor: 4,695 bytes, line 2
2let ve=c.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let qe=ve.length-1;qe>=0;--qe){let lt=ve[qe];Fe(c.symbolInstances.get(lt),c.collisionArrays[lt],lt)}}else for(let ve=t.symbolInstanceStart;ve<t.symbolInstanceEnd;ve++)Fe(c.symbolInstances.get(ve),c.collisionArrays[ve],ve);c.justReloaded=!1}storeCollisionData(t,n,o,c,p,m){if(o.textBox||o.iconBox){let _,v;this.collisionBoxArrays.has(t)?_=this.collisionBoxArrays.get(t):(_=new Map,this.collisionBoxArrays.set(t,_)),_.has(n)?v=_.get(n):(v={text:null,icon:null},_.set(n,v)),o.textBox&&(v.text=c.box),o.iconBox&&(v.icon=p.box)}if(m){let _=this.collisionCircleArrays[t];_===void 0&&(_=this.collisionCircleArrays[t]=[]);for(let v=0;v<m.circles.length;v+=4)_.push(m.circles[v+0]-pi),_.push(m.circles[v+1]-pi),_.push(m.circles[v+2]),_.push(m.collisionDetected?1:0)}}markUsedJustification(t,n,o,c){let p;p=c===l.az.vertical?o.verticalPlacedTextSymbolIndex:{left:o.leftJustifiedTextSymbolIndex,center:o.centerJustifiedTextSymbolIndex,right:o.rightJustifiedTextSymbolIndex}[l.aR(n)];let m=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex,o.verticalPlacedTextSymbolIndex];for(let _ of m)_>=0&&(t.text.placedSymbolArray.get(_).crossTileID=p>=0&&_!==p?0:o.crossTileID)}markUsedOrientation(t,n,o){let c=n===l.az.horizontal||n===l.az.horizontalOnly?n:0,p=n===l.az.vertical?n:0,m=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(let _ of m)t.text.placedSymbolArray.get(_).placedOrientation=c;o.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=p)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let n=this.prevPlacement,o=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;let c=n?n.symbolFadeChange(t):1,p=n?n.opacities:{},m=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(let v in this.placements){let T=this.placements[v],P=p[v];P?(this.opacities[v]=new fo(P,c,T.text,T.icon),o=o||T.text!==P.text.placed||T.icon!==P.icon.placed):(this.opacities[v]=new fo(null,c,T.text,T.icon,T.skipFade),o=o||T.text||T.icon)}for(let v in p){let T=p[v];if(!this.opacities[v]){let P=new fo(T,c,!1,!1);P.isHidden()||(this.opacities[v]=P,o=o||T.text.placed||T.icon.placed)}}for(let v in m)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=m[v]);for(let v in _)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=_[v]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");o?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){let o={};for(let c of n){let p=c.getBucket(t);p&&c.latestFeatureIndex&&t.id===p.layerIds[0]&&this.updateBucketOpacities(p,c.tileID,o,c.collisionBoxArray)}}updateBucketOpacities(t,n,o,c){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 p=t.layers[0],m=p.layout,_=new fo(null,0,!1,!1,!0),v=m.get("text-allow-overlap"),T=m.get("icon-allow-overlap"),P=p._unevaluatedLayout.hasValue("text-variable-anchor")||p._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=m.get("text-rotation-alignment")==="map",C=m.get("text-pitch-alignment")==="map",D=m.get("icon-text-fit")!=="none",B=new fo(null,0,v&&(T||!t.hasIconData()||m.get("icon-optional")),T&&(v||!t.hasTextData()||m.get("text-optional")),!0);!t.collisionArrays&&c&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(c);let q=($,Y,ee)=>{for(let X=0;X<Y/4;X++)$.opacityVertexArray.emplaceBack(ee);$.hasVisibleVertices=$.hasVisibleVertices||ee!==xr},W=this.collisionBoxArrays.get(t.bucketInstanceId);for(let $=0;$<t.symbolInstances.length;$++){let Y=t.symbolInstances.get($),{numHorizontalGlyphVertices:ee,numVerticalGlyphVertices:X,crossTileID:te}=Y,ne=this.opacities[te];o[te]?ne=_:ne||(ne=B,this.opacities[te]=ne),o[te]=!0;let J=Y.numIconVertices>0,se=this.placedOrientations[Y.crossTileID],ye=se===l.az.vertical,fe=se===l.az.horizontal||se===l.az.horizontalOnly;if(ee>0||X>0){let ge=Ch(ne.text);q(t.text,ee,ye?xr:ge),q(t.text,X,fe?xr:ge);let Re=ne.text.isHidden();[Y.rightJustifiedTextSymbolIndex,Y.centerJustifiedTextSymbolIndex,Y.leftJustifiedTextSymbolIndex].forEac
2h(qe=>{qe>=0&&(t.text.placedSymbolArray.get(qe).hidden=Re||ye?1:0)}),Y.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(Y.verticalPlacedTextSymbolIndex).hidden=Re||fe?1:0);let Fe=this.variableOffsets[Y.crossTileID];Fe&&this.markUsedJustification(t,Fe.anchor,Y,se);let ve=this.placedOrientations[Y.crossTileID];ve&&(this.markUsedJustification(t,"left",Y,ve),this.markUsedOrientation(t,ve,Y))}if(J){let ge=Ch(ne.icon),Re=!(D&&Y.verticalPlacedIconSymbolIndex&&ye);Y.placedIconSymbolIndex>=0&&(q(t.icon,Y.numIconVertices,Re?ge:xr),t.icon.placedSymbolArray.get(Y.placedIconSymbolIndex).hidden=ne.icon.isHidden()),Y.verticalPlacedIconSymbolIndex>=0&&(q(t.icon,Y.numVerticalIconVertices,Re?xr:ge),t.icon.placedSymbolArray.get(Y.verticalPlacedIconSymbolIndex).hidden=ne.icon.isHidden())}let pe=W&&W.has($)?W.get($):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let ge=t.collisionArrays[$];if(ge){let Re=new l.P(0,0);if(ge.textBox||ge.verticalTextBox){let Fe=!0;if(P){let ve=this.variableOffsets[te];ve?(Re=ps(ve.anchor,ve.width,ve.height,ve.textOffset,ve.textBoxScale),E&&Re._rotate(C?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Fe=!1}if(ge.textBox||ge.verticalTextBox){let ve;ge.textBox&&(ve=ye),ge.verticalTextBox&&(ve=fe),fs(t.textCollisionBox.collisionVertexArray,ne.text.placed,!Fe||ve,pe.text,Re.x,Re.y)}}if(ge.iconBox||ge.verticalIconBox){let Fe=!!(!fe&&ge.verticalIconBox),ve;ge.iconBox&&(ve=Fe),ge.verticalIconBox&&(ve=!Fe),fs(t.iconCollisionBox.collisionVertexArray,ne.icon.placed,ve,pe.icon,D?Re.x:0,D?Re.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 o=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*o>t}setStale(){this.stale=!0}}function fs(d,t,n,o,c,p){o&&o.length!==0||(o=[0,0,0,0]);let m=o[0]-pi,_=o[1]-pi,v=o[2]-pi,T=o[3]-pi;d.emplaceBack(t?1:0,n?1:0,c||0,p||0,m,_),d.emplaceBack(t?1:0,n?1:0,c||0,p||0,v,_),d.emplaceBack(t?1:0,n?1:0,c||0,p||0,v,T),d.emplaceBack(t?1:0,n?1:0,c||0,p||0,m,T)}let Cl=Math.pow(2,25),xd=Math.pow(2,24),mo=Math.pow(2,17),ms=Math.pow(2,16),Mh=Math.pow(2,9),za=Math.pow(2,8),Lh=Math.pow(2,1);function Ch(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*Cl+t*xd+n*mo+t*ms+n*Mh+t*za+n*Lh+t}let xr=0;class Aa{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,o,c,p){let m=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(m,c,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort((_,v)=>
2_.sortKey-v.sortKey));this._currentPartIndex<m.length;)if(n.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,o),this._currentPartIndex++,p())return!0;return!1}}class mt{constructor(t,n,o,c,p,m,_,v){this.placement=new Ih(t,n,m,_,v),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=c,this._showCollisionBoxes=p,this._done=!1}isDone(){return this._done}continuePlacement(t,n,o){let c=Ge(),p=()=>!this._forceFullPlacement&&Ge()-c>2;for(;this._currentPlacementIndex>=0;){let m=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=_)&&(!m.maxzoom||m.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new Aa(m)),this._inProgressLayer.continuePlacement(o[m.source],this.placement,this._showCollisionBoxes,m,p))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let Jn=512/l.a5/2;class vd{constructor(t,n,o){this.tileID=t,this.bucketInstanceId=o,this._symbolsByKey={};let c=new Map;for(let p=0;p<n.length;p++){let m=n.get(p),_=m.key,v=c.get(_);v?v.push(m):c.set(_,[m])}for(let[p,m]of c){let _={positions:m.map(v=>({x:Math.floor(v.anchorX*Jn),y:Math.floor(v.anchorY*Jn)})),crossTileIDs:m.map(v=>v.crossTileID)};if(_.positions.length>128){let v=new l.aT(_.positions.length,16,Uint16Array);for(let{x:T,y:P}of _.positions)v.add(T,P);v.finish(),delete _.positions,_.index=v}this._symbolsByKey[p]=_}}getScaledCoordinates(t,n){let{x:o,y:c,z:p}=this.tileID.canonical,{x:m,y:_,z:v}=n.canonical,T=Jn/Math.pow(2,v-p),P=(_*l.a5+t.anchorY)*T,E=c*l.a5*Jn;return{x:Math.floor((m*l.a5+t.anchorX)*T-o*l.a5*Jn),y:Math.floor(P-E)}}findMatches(t,n,o){let c=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let p=0;p<t.length;p++){let m=t.get(p);if(m.crossTileID)continue;let _=this._symbolsByKey[m.key];if(!_)continue;let v=this.getScaledCoordinates(m,n);if(_.index){let T=_.index.range(v.x-c,v.y-c,v.x+c,v.y+c).sort();for(let P of T){let E=_.crossTileIDs[P];if(!o[E]){o[E]=!0,m.crossTileID=E;break}}}else if(_.positions)for(let T=0;T<_.positions.length;T++){let P=_.positions[T],E=_.crossTileIDs[T];if(Math.abs(P.x-v.x)<=c&&Math.abs(P.y-v.y)<=c&&!o[E]){o[E]=!0,m.crossTileID=E;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class El{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ir{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let n=Math.round((t-this.lng)/360);if(n!==0)for(let o in this.indexes){let c=this.indexes[o],p={};for(let m in c){let _=c[m];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),p[_.tileID.key]=_}this.indexes[o]=p}this.lng=t}addBucket(t,n,o){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][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 p=0;p<n.symbolInstances.length;p++)n.symbolInstances.get(p).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});let c=this.usedCrossTileIDs[t.overscaledZ];for(let p in this.indexes){let m=this.indexes[p];if(Number(p)>t.overscaledZ)for(let _ in m){let v=m[_];v.tileID.isChildOf(t)&&v.findMatches(n.symbolInstances,t,c)}else{let _=m[t.scaledTo(Number(p)).key];_&&_.findMatches(n.symbolInstances,t,c)}}for(let p=0;p<n.symbolInstances.length;p++){let m=n.symbolInstances.get(p);m.crossTileID||(m.crossTileID=o.generate(),c[m.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new vd(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(let o of n.getCrossTileIDsLists())for(let c of o)delete this.usedCrossTileIDs[t][c]}removeStaleBuckets(t){let n=!1;for(let o in this.indexes){let c=this.indexes[o];for(let p in c)t[c[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(o,c[p]),delete c[p],n=!0)}return n}}class zi{constructor(){this.layerIndexes={},this.crossTileIDs=new El,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,o){let c=this.layerIndexes[t.id];c===void 0&&(c=this.layerIndexes[t.id]=new ir);let p=!1,m={};c.handleWrapJump(o);for(let _ of n){let v=_.getBucket(t);v&&t.id===v.layerIds[0]&&(v.bucketInstanceId||(v.bucketInstanceId=++this.maxBucketInstanceId),c.addBucket(_.tileID,v,this.crossTileIDs)&&(p=!0),m[v.bucketInstanceId]=!0)}return c.removeStaleBuckets(m)&&(p=!0),p}pruneUnusedLayers(t){let n={};t.forEach(o=>{n[o]=!0});for(let o in this.layerIndexes)n[o]||delete this.layerIndexes[o]}}var Ai="void main() {fragColor=vec4(1.0);}";let Ft={prelude:Je(`#ifdef GL_ES 3precision mediump float; 4#else 5#if !defined(lowp) 6#define lowp 7#endif 8#if !defined(mediump) 9#define mediump 10#endif 11#if !defined(highp) 12#define highp 13#endif 14#endif 15out highp vec4 fragColor;`,`#ifdef GL_ES 16precision highp float; 17#else 18#if !defined(lowp) 19#define lowp 20#endif 21#if !defined(mediump) 22#define mediump 23#endif 24#if !defined(highp) 25#define highp 26#endif 27#endif 28vec2 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 29);}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);
29return (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 30);} 31#ifdef TERRAIN3D 32uniform 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; 33#endif 34const 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) { 35#ifdef TERRAIN3D 36highp 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)); 37#else 38return 1.0; 39#endif 40}float calculate_visibility(vec4 pos) { 41#ifdef TERRAIN3D 42vec3 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; 43#else 44return 1.0; 45#endif 46}float ele(vec2 pos) { 47#ifdef TERRAIN3D 48vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 49#else 50return 0.0; 51#endif 52}float get_elevation(vec2 pos) { 53#ifdef TERRAIN3D 54#ifdef GLOBE 55if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} 56#endif 57vec2 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; 58#else 59return 0.0; 60#endif 61}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Je("","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:Je("",`#define GLOBE_RADIUS 6371008.8 62uniform 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 63);}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); 64if (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 65);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:Je(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity; 66#ifdef OVERDRAW_INSPECTOR 67fragColor=vec4(1.0); 68#endif 69}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Je(`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;
69uniform 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; 70#ifdef OVERDRAW_INSPECTOR 71fragColor=vec4(1.0); 72#endif 73}`,"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:Je(`in vec3 v_data;in float v_visibility; 74#pragma mapbox: define highp vec4 color 75#pragma mapbox: define mediump float radius 76#pragma mapbox: define lowp float blur 77#pragma mapbox: define lowp float opacity 78#pragma mapbox: define highp vec4 stroke_color 79#pragma mapbox: define mediump float stroke_width 80#pragma mapbox: define lowp float stroke_opacity 81void main() { 82#pragma mapbox: initialize highp vec4 color 83#pragma mapbox: initialize mediump float radius 84#pragma mapbox: initialize lowp float blur 85#pragma mapbox: initialize lowp float opacity 86#pragma mapbox: initialize highp vec4 stroke_color 87#pragma mapbox: initialize mediump float stroke_width 88#pragma mapbox: initialize lowp float stroke_opacity 89vec2 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;} 90#ifdef OVERDRAW_INSPECTOR 91fragColor=vec4(1.0); 92#endif 93}`,`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; 94#pragma mapbox: define highp vec4 color 95#pragma mapbox: define mediump float radius 96#pragma mapbox: define lowp float blur 97#pragma mapbox: define lowp float opacity 98#pragma mapbox: define highp vec4 stroke_color 99#pragma mapbox: define mediump float stroke_width 100#pragma mapbox: define lowp float stroke_opacity 101void main(void) { 102#pragma mapbox: initialize highp vec4 color 103#pragma mapbox: initialize mediump float radius 104#pragma mapbox: initialize lowp float blur 105#pragma mapbox: initialize lowp float opacity 106#pragma mapbox: initialize highp vec4 stroke_color 107#pragma mapbox: initialize mediump float stroke_width 108#pragma mapbox: initialize lowp float stroke_opacity 109vec2 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) { 110#ifdef GLOBE 111vec3 center_vector=projectToSphere(circle_center); 112#endif 113float 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 { 114#ifdef GLOBE 115vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); 116#else 117vec4 projected_center=projectTileWithElevation(circle_center,ele); 118#endif 119corner_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);} 120#ifdef GLOBE 121vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); 122#else 123gl_Position=projectTileWithElevation(corner_position,ele); 124#endif 125} 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:Je(Ai,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Je(`uniform highp float u_intensity;in vec2 v_extrude; 126#pragma mapbox: define highp float weight 127#define GAUSS_COEF 0.3989422804014327 128void main() { 129#pragma mapbox: initialize highp float weight 130float 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); 131#ifdef OVERDRAW_INSPECTOR 132fragColor=vec4(1.0); 133#endif 134}`,`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; 135#pragma mapbox: define highp float weight 136#pragma mapbox: define mediump float radius 137const highp float ZERO=1.0/255.0/16.0; 138#define GAUSS_COEF 0.3989422804014327 139void main(void) { 140#pragma mapbox: initialize highp float weight 141#pragma mapbox: initialize mediump float radius 142vec2 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); 143#ifdef GLOBE 144vec2 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); 145#else 146gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); 147#endif 148}`),heatmapTexture:Je(`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; 149#ifdef OVERDRAW_INSPECTOR 150fragColor=vec4(0.0); 151#endif 152}`,"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:Je("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:Je("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:Je(`#ifdef GL_ES 153precision highp float; 154#endif 155uniform 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 156{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)); 157#ifdef OVERDRAW_INSPECTOR 158fragColor=vec4(1.0); 159#endif 160}`,"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:Je("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:Je(Ai,`in vec2 a_pos;void main() { 161#ifdef GLOBE 162gl_Position=projectTileFor3D(a_pos,0.0); 163#else 164gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); 165#endif 166}`),fill:Je(`#pragma mapbox: define highp vec4 color 167#pragma mapbox: define lowp float opacity 168void main() { 169#pragma mapbox: initialize highp vec4 color 170#pragma mapbox: initialize lowp float opacity 171fragColor=color*opacity; 172#ifdef OVERDRAW_INSPECTOR 173fragColor=vec4(1.0); 174#endif 175}`,`uniform vec2 u_fill_translate;in vec2 a_pos; 176#pragma mapbox: define highp vec4 color 177#pragma mapbox: define lowp float opacity 178void main() { 179#pragma mapbox: initialize highp vec4 color 180#pragma mapbox: initialize lowp float opacity 181gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Je(`in vec2 v_pos; 182#ifdef GLOBE 183in float v_depth; 184#endif 185#pragma mapbox: define highp vec4 outline_color 186#pragma mapbox: define lowp float opacity 187void main() { 188#pragma mapbox: initialize highp vec4 outline_color 189#pragma mapbox: initialize lowp float opacity 190float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); 191#ifdef GLOBE 192if (v_depth > 1.0) {discard;} 193#endif 194#ifdef OVERDRAW_INSPECTOR 195fragColor=vec4(1.0); 196#endif 197}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos; 198#ifdef GLOBE 199out float v_depth; 200#endif 201#pragma mapbox: define highp vec4 outline_color 202#pragma mapbox: define lowp float opacity 203void main() { 204#pragma mapbox: initialize highp vec4 outline_color 205#pragma mapbox: initialize lowp float opacity 206gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world; 207#ifdef GLOBE 208v_depth=gl_Position.z/gl_Position.w; 209#endif 210}`),fillOutlinePattern:Je(`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; 211#ifdef GLOBE 212in float v_depth; 213#endif 214#pragma mapbox: define lowp float opacity 215#pragma mapbox: define lowp vec4 pattern_from 216#pragma mapbox: define lowp vec4 pattern_to 217void main() { 218#pragma mapbox: initialize lowp float opacity 219#pragma mapbox: initialize mediump vec4 pattern_from 220#pragma mapbox: initialize mediump vec4 pattern_to 221vec2 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; 222#ifdef GLOBE 223if (v_depth > 1.0) {discard;} 224#endif 225#ifdef OVERDRAW_INSPECTOR 226fragColor=vec4(1.0); 227#endif 228}`,`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; 229#ifdef GLOBE 230out float v_depth; 231#endif 232#pragma mapbox: define lowp float opacity 233#pragma mapbox: define lowp vec4 pattern_from 234#pragma mapbox: define lowp vec4 pattern_to 235#pragma mapbox: define lowp float pixel_ratio_from 236#pragma mapbox: define lowp float pixel_ratio_to 237void main() { 238#pragma mapbox: initialize lowp float opacity 239#pragma mapbox: initialize mediump vec4 pattern_from 240#pragma mapbox: initialize mediump vec4 pattern_to 241#pragma mapbox: initialize lowp float pixel_ratio_from 242#pragma mapbox: initialize lowp float pixel_ratio_to 243vec2 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; 244#ifdef GLOBE 245v_depth=gl_Position.z/gl_Position.w; 246#endif 247}`),fillPattern:Je(`#ifdef GL_ES 248precision highp float; 249#endif 250uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; 251#pragma mapbox: define lowp float opacity 252#pragma mapbox: define lowp vec4 pattern_from 253#pragma mapbox: define lowp vec4 pattern_to 254void main() { 255#pragma mapbox: initialize lowp float opacity 256#pragma mapbox: initialize mediump vec4 pattern_from 257#pragma mapbox: initialize mediump vec4 pattern_to 258vec2 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; 259#ifdef OVERDRAW_INSPECTOR 260fragColor=vec4(1.0); 261#endif 262}`,`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; 263#pragma mapbox: define lowp float opacity 264#pragma mapbox: define lowp vec4 pattern_from 265#pragma mapbox: define lowp vec4 pattern_to 266#pragma mapbox: define lowp float pixel_ratio_from 267#pragma mapbox: define lowp float pixel_ratio_to 268void main() { 269#pragma mapbox: initialize lowp float opacity 270#pragma mapbox: initialize mediump vec4 pattern_from 271#pragma mapbox: initialize mediump vec4 pattern_to 272#pragma mapbox: initialize lowp float pixel_ratio_from 273#pragma mapbox: initialize lowp float pixel_ratio_to 274vec2 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_siz
274e_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:Je(`in vec4 v_color;void main() {fragColor=v_color; 275#ifdef OVERDRAW_INSPECTOR 276fragColor=vec4(1.0); 277#endif 278}`,`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; 279#ifdef TERRAIN3D 280in vec2 a_centroid; 281#endif 282out vec4 v_color; 283#pragma mapbox: define highp float base 284#pragma mapbox: define highp float height 285#pragma mapbox: define highp vec4 color 286void main() { 287#pragma mapbox: initialize highp float base 288#pragma mapbox: initialize highp float height 289#pragma mapbox: initialize highp vec4 color 290vec3 normal=a_normal_ed.xyz; 291#ifdef TERRAIN3D 292float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 293#else 294float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 295#endif 296base=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; 297#ifdef GLOBE 298vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 299#else 300gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 301#endif 302float 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); 303#ifdef GLOBE 304mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); 305#endif 306directional=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:Je(`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; 307#pragma mapbox: define lowp float base 308#pragma mapbox: define lowp float height 309#pragma mapbox: define lowp vec4 pattern_from 310#pragma mapbox: define lowp vec4 pattern_to 311#pragma mapbox: define lowp float pixel_ratio_from 312#pragma mapbox: define lowp float pixel_ratio_to 313void main() { 314#pragma mapbox: initialize lowp float base 315#pragma mapbox: initialize lowp float height 316#pragma mapbox: initialize mediump vec4 pattern_from 317#pragma mapbox: initialize mediump vec4 pattern_to 318#pragma mapbox: initialize lowp float pixel_ratio_from 319#pragma mapbox: initialize lowp float pixel_ratio_to 320vec2 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; 321#ifdef OVERDRAW_INSPECTOR 322fragColor=vec4(1.0); 323#endif 324}`,`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; 325#ifdef TERRAIN3D 326in vec2 a_centroid; 327#endif 328#ifdef GLOBE 329out vec3 v_sphere_pos; 330#endif 331out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; 332#pragma mapbox: define lowp float base 333#pragma mapbox: define lowp float height 334#pragma mapbox: define lowp vec4 pattern_from 335#pragma mapbox: define lowp vec4 pattern_to 336#pragma mapbox: define lowp float pixel_ratio_from 337#pragma mapbox: define lowp float pixel_ratio_to 338void main() { 339#pragma mapbox: initialize lowp float base 340#pragma mapbox: initialize lowp float height 341#pragma mapbox: initialize mediump vec4 pattern_from 342#pragma mapbox: initialize mediump vec4 pattern_to 343#pragma mapbox: initialize lowp float pixel_ratio_from 344#pragma mapbox: initialize lowp float pixel_ratio_to 345vec2 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; 346#ifdef TERRAIN3D 347float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 348#else 349float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 350#endif 351base=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; 352#ifdef GLOBE 353vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 354#else 355gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 356#endif 357vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 358? a_pos 359: 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:Je(`#ifdef GL_ES 360precision highp float; 361#endif 362uniform 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/p
362ow(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); 363#ifdef OVERDRAW_INSPECTOR 364fragColor=vec4(1.0); 365#endif 366}`,"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:Je(`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]; 367#define PI 3.141592653589793 368#define STANDARD 0 369#define COMBINED 1 370#define IGOR 2 371#define MULTIDIRECTIONAL 3 372#define BASIC 4 373float 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 374{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 375{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);} 376#ifdef OVERDRAW_INSPECTOR 377fragColor=vec4(1.0); 378#endif 379}`,"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:Je(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; 380#ifdef GLOBE 381in float v_depth; 382#endif 383#pragma mapbox: define highp vec4 color 384#pragma mapbox: define lowp float blur 385#pragma mapbox: define lowp float opacity 386void main() { 387#pragma mapbox: initialize highp vec4 color 388#pragma mapbox: initialize lowp float blur 389#pragma mapbox: initialize lowp float opacity 390float 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); 391#ifdef GLOBE 392if (v_depth > 1.0) {discard;} 393#endif 394#ifdef OVERDRAW_INSPECTOR 395fragColor=vec4(1.0); 396#endif 397}`,` 398#define scale 0.015873016 399in 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; 400#ifdef GLOBE 401out float v_depth; 402#endif 403#pragma mapbox: define highp vec4 color 404#pragma mapbox: define lowp float blur 405#pragma mapbox: define lowp float opacity 406#pragma mapbox: define mediump float gapwidth 407#pragma mapbox: define lowp float offset 408#pragma mapbox: define mediump float width 409void main() { 410#pragma mapbox: initialize highp vec4 color 411#pragma mapbox: initialize lowp float blur 412#pragma mapbox: initialize lowp float opacity 413#pragma mapbox: initialize mediump float gapwidth 414#pragma mapbox: initialize lowp float offset 415#pragma mapbox: initialize mediump float width 416float 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);
416float 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; 417#ifdef GLOBE 418v_depth=gl_Position.z/gl_Position.w; 419#endif 420#ifdef TERRAIN3D 421v_gamma_scale=1.0; 422#else 423float 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; 424#endif 425v_width2=vec2(outset,inset);}`),lineGradient:Je(`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; 426#ifdef GLOBE 427in float v_depth; 428#endif 429#pragma mapbox: define lowp float blur 430#pragma mapbox: define lowp float opacity 431void main() { 432#pragma mapbox: initialize lowp float blur 433#pragma mapbox: initialize lowp float opacity 434float 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); 435#ifdef GLOBE 436if (v_depth > 1.0) {discard;} 437#endif 438#ifdef OVERDRAW_INSPECTOR 439fragColor=vec4(1.0); 440#endif 441}`,` 442#define scale 0.015873016 443in 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; 444#ifdef GLOBE 445out float v_depth; 446#endif 447#pragma mapbox: define lowp float blur 448#pragma mapbox: define lowp float opacity 449#pragma mapbox: define mediump float gapwidth 450#pragma mapbox: define lowp float offset 451#pragma mapbox: define mediump float width 452void main() { 453#pragma mapbox: initialize lowp float blur 454#pragma mapbox: initialize lowp float opacity 455#pragma mapbox: initialize mediump float gapwidth 456#pragma mapbox: initialize lowp float offset 457#pragma mapbox: initialize mediump float width 458float 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; 459#ifdef GLOBE 460v_depth=gl_Position.z/gl_Position.w; 461#endif 462#ifdef TERRAIN3D 463v_gamma_scale=1.0; 464#else 465float 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; 466#endif 467v_width2=vec2(outset,inset);}`),linePattern:Je(`#ifdef GL_ES 468precision highp float; 469#endif 470uniform 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; 471#ifdef GLOBE 472in float v_depth; 473#endif 474#pragma mapbox: define lowp vec4 pattern_from 475#pragma mapbox: define lowp vec4 pattern_to 476#pragma mapbox: define lowp float pixel_ratio_from 477#pragma mapbox: define lowp float pixel_ratio_to 478#pragma mapbox: define lowp float blur 479#pragma mapbox: define lowp float opacity 480void main() { 481#pragma mapbox: initialize mediump vec4 pattern_from 482#pragma mapbox: initialize mediump vec4 pattern_to 483#pragma mapbox: initialize lowp float pixel_ratio_from 484#pragma mapbox: initialize lowp float pixel_ratio_to 485#pragma mapbox: initialize lowp float blur 486#pragma mapbox: initialize lowp float opacity 487vec2 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; 488#ifdef GLOBE 489if (v_depth > 1.0) {discard;} 490#endif 491#ifdef OVERDRAW_INSPECTOR 492fragColor=vec4(1.0); 493#endif 494}`,` 495#define scale 0.015873016 496#define LINE_DISTANCE_SCALE 2.0 497in 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; 498#ifdef GLOBE 499out float v_depth; 500#endif 501#pragma mapbox: define lowp float blur 502#pragma mapbox: define lowp float opacity 503#pragma mapbox: define lowp float offset 504#pragma mapbox: define mediump float gapwidth 505#pragma mapbox: define mediump float width 506#pragma mapbox: define lowp float floorwidth 507#pragma mapbox: define lowp vec4 pattern_from 508#pragma mapbox: define lowp vec4 pattern_to 509#pragma mapbox: define lowp float pixel_ratio_from 510#pragma mapbox: define lowp float pixel_ratio_to 511void main() { 512#pragma mapbox: initialize lowp float blur 513#pragma mapbox: initialize lowp float opacity 514#pragma mapbox: initialize lowp float offset 515#pragma mapbox: initialize mediump float gapwidth 516#pragma mapbox: initialize mediump float width 517#pragma mapbox: initialize lowp float floorwidth 518#pragma mapbox: initialize mediump vec4 pattern_from 519#pragma mapbox: initialize mediump vec4 pattern_to 520#pragma mapbox: initialize lowp float pixel_ratio_from 521#pragma mapbox: initialize lowp float pixel_ratio_to 522float 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);
522float 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; 523#ifdef GLOBE 524v_depth=gl_Position.z/gl_Position.w; 525#endif 526#ifdef TERRAIN3D 527v_gamma_scale=1.0; 528#else 529float 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; 530#endif 531v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Je(`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; 532#ifdef GLOBE 533in float v_depth; 534#endif 535#pragma mapbox: define highp vec4 color 536#pragma mapbox: define lowp float blur 537#pragma mapbox: define lowp float opacity 538#pragma mapbox: define mediump float width 539#pragma mapbox: define lowp float floorwidth 540#pragma mapbox: define mediump vec4 dasharray_from 541#pragma mapbox: define mediump vec4 dasharray_to 542void main() { 543#pragma mapbox: initialize highp vec4 color 544#pragma mapbox: initialize lowp float blur 545#pragma mapbox: initialize lowp float opacity 546#pragma mapbox: initialize mediump float width 547#pragma mapbox: initialize lowp float floorwidth 548#pragma mapbox: initialize mediump vec4 dasharray_from 549#pragma mapbox: initialize mediump vec4 dasharray_to 550float 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);
550float 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); 551#ifdef GLOBE 552if (v_depth > 1.0) {discard;} 553#endif 554#ifdef OVERDRAW_INSPECTOR 555fragColor=vec4(1.0); 556#endif 557}`,` 558#define scale 0.015873016 559#define LINE_DISTANCE_SCALE 2.0 560in 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; 561#ifdef GLOBE 562out float v_depth; 563#endif 564#pragma mapbox: define highp vec4 color 565#pragma mapbox: define lowp float blur 566#pragma mapbox: define lowp float opacity 567#pragma mapbox: define mediump float gapwidth 568#pragma mapbox: define lowp float offset 569#pragma mapbox: define mediump float width 570#pragma mapbox: define lowp float floorwidth 571#pragma mapbox: define mediump vec4 dasharray_from 572#pragma mapbox: define mediump vec4 dasharray_to 573void main() { 574#pragma mapbox: initialize highp vec4 color 575#pragma mapbox: initialize lowp float blur 576#pragma mapbox: initialize lowp float opacity 577#pragma mapbox: initialize mediump float gapwidth 578#pragma mapbox: initialize lowp float offset 579#pragma mapbox: initialize mediump float width 580#pragma mapbox: initialize lowp float floorwidth 581#pragma mapbox: initialize mediump vec4 dasharray_from 582#pragma mapbox: initialize mediump vec4 dasharray_to 583float 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; 584#ifdef GLOBE 585v_depth=gl_Position.z/gl_Position.w; 586#endif 587#ifdef TERRAIN3D 588v_gamma_scale=1.0; 589#else 590float 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; 591#endif 592float 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:Je(`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; 593#ifdef GLOBE 594in float v_depth; 595#endif 596#pragma mapbox: define lowp float blur 597#pragma mapbox: define lowp float opacity 598#pragma mapbox: define mediump float width 599#pragma mapbox: define lowp float floorwidth 600#pragma mapbox: define mediump vec4 dasharray_from 601#pragma mapbox: define mediump vec4 dasharray_to 602void main() { 603#pragma mapbox: initialize lowp float blur 604#pragma mapbox: initialize lowp float opacity 605#pragma mapbox: initialize mediump float width 606#pragma mapbox: initialize lowp float floorwidth 607#pragma mapbox: initialize mediump vec4 dasharray_from 608#pragma mapbox: initialize mediump vec4 dasharray_to 609float 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);
609float 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); 610#ifdef GLOBE 611if (v_depth > 1.0) {discard;} 612#endif 613#ifdef OVERDRAW_INSPECTOR 614fragColor=vec4(1.0); 615#endif 616}`,` 617#define scale 0.015873016 618#define LINE_DISTANCE_SCALE 2.0 619in 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; 620#ifdef GLOBE 621out float v_depth; 622#endif 623#pragma mapbox: define lowp float blur 624#pragma mapbox: define lowp float opacity 625#pragma mapbox: define mediump float gapwidth 626#pragma mapbox: define lowp float offset 627#pragma mapbox: define mediump float width 628#pragma mapbox: define lowp float floorwidth 629#pragma mapbox: define mediump vec4 dasharray_from 630#pragma mapbox: define mediump vec4 dasharray_to 631void main() { 632#pragma mapbox: initialize lowp float blur 633#pragma mapbox: initialize lowp float opacity 634#pragma mapbox: initialize mediump float gapwidth 635#pragma mapbox: initialize lowp float offset 636#pragma mapbox: initialize mediump float width 637#pragma mapbox: initialize lowp float floorwidth 638#pragma mapbox: initialize mediump vec4 dasharray_from 639#pragma mapbox: initialize mediump vec4 dasharray_to 640float 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; 641#ifdef GLOBE 642v_depth=gl_Position.z/gl_Position.w; 643#endif 644#ifdef TERRAIN3D 645v_gamma_scale=1.0; 646#else 647float 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; 648#endif 649float 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:Je(`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); 650#ifdef OVERDRAW_INSPECTOR 651fragColor=vec4(1.0); 652#endif 653}`,`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; 654#ifdef GLOBE 655if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;} 656#endif 657v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Je(`uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity; 658#pragma mapbox: define lowp float opacity 659void main() { 660#pragma mapbox: initialize lowp float opacity 661lowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha; 662#ifdef OVERDRAW_INSPECTOR 663fragColor=vec4(1.0); 664#endif 665}`,`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_fade_opacity; 666#pragma mapbox: define lowp float opacity 667void main() { 668#pragma mapbox: initialize lowp float opacity 669vec2 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);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 670camera_to_anchor_distance/u_camera_to_center_distance : 671u_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; 672#ifdef GLOBE 673if(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);} 674#endif 675vec4 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;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_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Je(`#define SDF_PX 8.0 676uniform bool u_is_halo;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; 677#pragma mapbox: define highp vec4 fill_color 678#pragma mapbox: define highp vec4 halo_color 679#pragma mapbox: define lowp float opacity 680#pragma mapbox: define lowp float halo_width 681#pragma mapbox: define lowp float halo_blur 682void main() { 683#pragma mapbox: initialize highp vec4 fill_color 684#pragma mapbox: initialize highp vec4 halo_color 685#pragma mapbox: initialize lowp float opacity 686#pragma mapbox: initialize lowp float halo_width 687#pragma mapbox: initialize lowp float halo_blur 688float 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 fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity); 689#ifdef OVERDRAW_INSPECTOR 690fragColor=vec4(1.0); 691#endif 692}`,`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; 693#pragma mapbox: define highp vec4 fill_color 694#pragma mapbox: define highp vec4 halo_color 695#pragma mapbox: define lowp float opacity 696#pragma mapbox: define lowp float halo_width 697#pragma mapbox: define lowp float halo_blur 698void main() { 699#pragma mapbox: initialize highp vec4 fill_color 700#pragma mapbox: initialize highp vec4 halo_color 701#pragma mapbox: initialize lowp float opacity 702#pragma mapbox: initialize lowp float halo_width 703#pragma mapbox: initialize lowp float halo_blur 704vec2 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);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 705camera_to_anchor_distance/u_camera_to_center_distance : 706u_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; 707#ifdef GLOBE 708if(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);} 709#endif 710vec4 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;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));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Je(`#define SDF_PX 8.0 711#define SDF 1.0 712#define ICON 0.0 713uniform bool u_is_halo;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; 714#pragma mapbox: define highp vec4 fill_color 715#pragma mapbox: define highp vec4 halo_color 716#pragma mapbox: define lowp float opacity 717#pragma mapbox: define lowp float halo_width 718#pragma mapbox: define lowp float halo_blur 719void main() { 720#pragma mapbox: initialize highp vec4 fill_color 721#pragma mapbox: initialize highp vec4 halo_color 722#pragma mapbox: initialize lowp float opacity 723#pragma mapbox: initialize lowp float halo_width 724#pragma mapbox: initialize lowp float halo_blur 725float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
725fragColor=texture(u_texture_icon,tex_icon)*alpha; 726#ifdef OVERDRAW_INSPECTOR 727fragColor=vec4(1.0); 728#endif 729return;}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;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity); 730#ifdef OVERDRAW_INSPECTOR 731fragColor=vec4(1.0); 732#endif 733}`,`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; 734#pragma mapbox: define highp vec4 fill_color 735#pragma mapbox: define highp vec4 halo_color 736#pragma mapbox: define lowp float opacity 737#pragma mapbox: define lowp float halo_width 738#pragma mapbox: define lowp float halo_blur 739void main() { 740#pragma mapbox: initialize highp vec4 fill_color 741#pragma mapbox: initialize highp vec4 halo_color 742#pragma mapbox: initialize lowp float opacity 743#pragma mapbox: initialize lowp float halo_width 744#pragma mapbox: initialize lowp float halo_blur 745vec2 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);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 746camera_to_anchor_distance/u_camera_to_center_distance : 747u_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; 748#ifdef GLOBE 749if(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);} 750#endif 751vec4 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;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));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Je("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 && 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);
751float 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,get_elevation(a_pos3d.xy)-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:Je("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:Je("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:Je("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:Je(`#ifdef GL_ES 752precision highp float; 753#endif 754in 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 755);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:Je("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);}")};
755function Je(d,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=t.match(/in ([\w]+) ([\w]+)/g),c=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),p=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=p?p.concat(c):c,_={};return{fragmentSource:d=d.replace(n,(v,T,P,E,C)=>(_[C]=!0,T==="define"?` 756#ifndef HAS_UNIFORM_u_${C} 757in ${P} ${E} ${C}; 758#else 759uniform ${P} ${E} u_${C}; 760#endif 761`:` 762#ifdef HAS_UNIFORM_u_${C} 763 ${P} ${E} ${C} = u_${C}; 764#endif 765`)),vertexSource:t=t.replace(n,(v,T,P,E,C)=>{let D=E==="float"?"vec2":"vec4",B=C.match(/color/)?"color":D;return _[C]?T==="define"?` 766#ifndef HAS_UNIFORM_u_${C} 767uniform lowp float u_${C}_t; 768in ${P} ${D} a_${C}; 769out ${P} ${E} ${C}; 770#else 771uniform ${P} ${E} u_${C}; 772#endif 773`:B==="vec4"?` 774#ifndef HAS_UNIFORM_u_${C} 775 ${C} = a_${C}; 776#else 777 ${P} ${E} ${C} = u_${C}; 778#endif 779`:` 780#ifndef HAS_UNIFORM_u_${C} 781 ${C} = unpack_mix_${B}(a_${C}, u_${C}_t); 782#else 783 ${P} ${E} ${C} = u_${C}; 784#endif 785`:T==="define"?` 786#ifndef HAS_UNIFORM_u_${C} 787uniform lowp float u_${C}_t; 788in ${P} ${D} a_${C}; 789#else 790uniform ${P} ${E} u_${C}; 791#endif 792`:B==="vec4"?` 793#ifndef HAS_UNIFORM_u_${C} 794 ${P} ${E} ${C} = a_${C}; 795#else 796 ${P} ${E} ${C} = u_${C}; 797#endif 798`:` 799#ifndef HAS_UNIFORM_u_${C} 800 ${P} ${E} ${C} = unpack_mix_${B}(a_${C}, u_${C}_t); 801#else 802 ${P} ${E} ${C} = u_${C}; 803#endif 804`}),staticAttributes:o,staticUniforms:m}}class Da{constructor(t,n,o){this.vertexBuffer=t,this.indexBuffer=n,this.segments=o}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var oi=l.aU([{name:"a_pos",type:"Int16",components:2}]);let rr="#define PROJECTION_MERCATOR",Xi="mercator";class gs{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Xi}get shaderDefine(){return rr}get shaderPreludeCode(){return Ft.projectionMercator}get vertexShaderPreludeCode(){return Ft.projectionMercator.vertexSource}get subdivisionGranularity(){return l.aV.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,n,o,c,p){if(this._cachedMesh)return this._cachedMesh;let m=new l.aW;m.emplaceBack(0,0),m.emplaceBack(l.a5,0),m.emplaceBack(0,l.a5),m.emplaceBack(l.a5,l.a5);let _=t.createVertexBuffer(m,oi.members),v=l.aX.simpleSegment(0,0,4,2),T=new l.aY;T.emplaceBack(1,0,2),T.emplaceBack(1,2,3);let P=t.createIndexBuffer(T);return this._cachedMesh=new Da(_,P,v),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class nn{constructor(t=0,n=0,o=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(o)||o<0||isNaN(c)||c<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=o,this.right=c}interpolate(t,n,o){return n.top!=null&&t.top!=null&&(this.top=l.G.number(t.top,n.top,o)),n.bottom!=null&&t.bottom!=null&&(this.bottom=l.G.number(t.bottom,n.bottom,o)),n.left!=null&&t.left!=null&&(this.left=l.G.number(t.left,n.left,o)),n.right!=null&&t.right!=null&&(this.right=l.G.number(t.right,n.right,o)),this}getCenter(t,n){let o=l.an((this.left+t-this.right)/2,0,t),c=l.an((this.top+n-this.bottom)/2,0,n);return new l.P(o,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new nn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Zt(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 Ra(d){return Math.max(0,Math.floor(d))}class an{constructor(t,n){var o;this.applyConstrain=(c,p)=>this._constrainOverride!==null?this._constrainOverride(c,p):this._callbacks.defaultConstrain(c,p),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=(o=n==null?void 0:n.constrainOverride)!==null&&o!==void 0?o:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new l.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Ra(this._zoom),this._scale=l.aq(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new nn,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,n,o){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=Ra(this._zoom),this._scale=l.aq(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 nn(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=!o&&t.autoCalculateNearFarZ,n&&this.constrainInternal(),this._calcMatrices()}
vendor: 10,862 bytes, line 804
804get 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 l.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){let n=l.W(t,-180,180)*Math.PI/180;var o,c,p,m,_,v,T,P,E;this._bearingInRadians!==n&&(this._unmodified=!1,this._bearingInRadians=n,this._calcMatrices(),this._rotationMatrix=_e(),o=this._rotationMatrix,p=-this._bearingInRadians,m=(c=this._rotationMatrix)[0],_=c[1],v=c[2],T=c[3],P=Math.sin(p),E=Math.cos(p),o[0]=m*E+v*P,o[1]=_*E+T*P,o[2]=m*-P+v*E,o[3]=_*-P+T*E)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let n=l.an(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 l.aZ(this._fovInRadians)}setFov(t){t=l.an(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=l.ap(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=l.aq(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,o){this._unmodified=!1,this._edgeInsets.interpolate(t,n,o),this.constrainInternal(),this._calcMatrices()}resize(t,n,o=!0){this._width=t,this._height=n,o&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&this._latRange.length===2&&this._lngRange&&this._lngRange.length===2?new Bt([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-l.ao,l.ao])}getCameraQueryGeometry(t,n){if(n.length===1)return[n[0],t];{let{minX:o,minY:c,maxX:p,maxY:m}=l.aa.fromPoints(n).extend(t);return[new l.P(o,c),new l.P(p,c),new l.P(p,m),new l.P(o,m),new l.P(o,c)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:n,zoom:o}=this.applyConstrain(this.center,this.zoom);this.setCenter(n),this.setZoom(o),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=l.ar(new Float64Array(16));l.Q(t,t,[this._width/2,-this._height/2,1]),l.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=l.ar(new Float64Array(16)),l.Q(t,t,[1,-1,1]),l.O(t,t,[-1,-1,0]),l.Q(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,o,c){let p=o!==void 0?o:this.bearing,m=c=c!==void 0?c:this.pitch,{distanceToCenter:_,clampedElevation:v}=this._distanceToCenterFromAltElevationPitch(n,this.elevation,m),{x:T,y:P}=nt(m,p),E=l.a9.fromLngLat(t,n),C,D,B=l.a_(1,E.y),q=0;do{if(q+=1,q>10)break;D=_/B,C=new l.a9(E.x+T*D,E.y+P*D),B=1/C.meterInMercatorCoordinateUnits()}while(Math.abs(_-D*B)>1e-12);return{center:C.toLngLat(),elevation:v,zoom:l.at(this.height/2/Math.tan(this.fovInRadians/2)/D/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let n=1/this.worldSize,o=l.as(1,this.center.lat)*this.worldSize,c=l.a9.fromLngLat(this.center,this.elevation),p=c.x/n,m=c.y/n,_=c.z/n,v=this.pitch,T=this.bearing,{x:P,y:E,z:C}=nt(v,T),D=this.cameraToCenterDistance,B=p+D*-P,q=m+D*-E,W=_+D*C,{distanceToCenter:$,clampedElevation:Y}=this._distanceToCenterFromAltElevationPitch(W/o,t,v),ee=$*o,X=new l.a9((B+P*ee)*n,(q+E*ee)*n,0).toLngLat(),te=l.as(1,X.lat),ne=l.at(this.height/2/Math.tan(this.fovInRadians/2)/$/te/this.tileSize);this._elevation=Y,this._center=X,this.setZoom(ne)}_distanceToCenterFromAltElevationPitch(t,n,o){let c=-Math.cos(l.ap(o)),p=t-n,m,_=n;return c*p>=0||Math.abs(c)<.1?(m=1e4,_=t+m*c):m=-p/c,{distanceToCenter:m,clampedElevation:_}}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.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=l.as(1,this.center.lat)*this.worldSize;return He(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/l.a5,1/n/l.a5]}}class Qn{constructor(t,n){this.min=t,this.max=n,this.center=l.a$([],l.b0([],this.min,this.max),.5)}quadrant(t){let n=[t%2==0,t<2],o=l.b1(this.min),c=l.b1(this.max);for(let p=0;p<n.length;p++)o[p]=n[p]?this.min[p]:this.center[p],c[p]=n[p]?this.center[p]:this.max[p];return c[2]=this.max[2],new Qn(o,c)}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 o=0;o<t.planes.length;o++){let c=this.intersectsPlane(t.planes[o]);if(c===0)return 0;c===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],o=t[3];for(let c=0;c<3;c++)t[c]>0?(n+=t[c]*this.min[c],o+=t[c]*this.max[c]):(o+=t[c]*this.min[c],n+=t[c]*this.max[c]);return n>=0?2:o<0?0:1}}class Cr{distanceToTile2d(t,n,o,c){let p=c.distanceX([t,n]),m=c.distanceY([t,n]);return Math.hypot(p,m)}getWrap(t,n,o){return o}getTileBoundingVolume(t,n,o,c){var p,m;let _=0,v=0;if(c!=null&&c.terrain){let P=new l.a2(t.z,n,t.z,t.x,t.y),E=c.terrain.getMinMaxElevation(P);_=(p=E.minElevation)!==null&&p!==void 0?p:Math.min(0,o),v=(m=E.maxElevation)!==null&&m!==void 0?m:Math.max(0,o)}let T=1<<t.z;return new Qn([n+t.x/T,t.y/T,_],[n+(t.x+1)/T,(t.y+1)/T,v])}allowVariableZoom(t,n){let o=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,c=l.an(78.5-o/2,0,60);return!!n.terrain||t.pitch>c}allowWorldCopies(){return!0}prepareNextFrame(){}}class go{constructor(t,n,o){this.points=t,this.planes=n,this.aabb=o}static fromInvProjectionMatrix(t,n=1,o=0,c,p){let m=p?[[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]],_=Math.pow(2,o),v=[[-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(C=>function(D,B,q,W){let $=l.aH([],D,B),Y=1/$[3]/q*W;return l.b6($,$,[Y,Y,1/$[3],Y])}(C,t,n,_));c&&function(C,D,B,q){let W=q?4:0,$=q?0:4,Y=0,ee=[],X=[];for(let J=0;J<4;J++){let se=l.b2([],C[J+$],C[J+W]),ye=l.b7(se);l.a$(se,se,1/ye),ee.push(ye),X.push(se)}for(let J=0;J<4;J++){let se=l.b8(C[J+W],X[J],B);Y=se!==null&&se>=0?Math.max(Y,se):Math.max(Y,ee[J])}let te=function(J,se){let ye=l.b2([],J[se[0]],J[se[1]]),fe=l.b2([],J[se[2]],J[se[1]]),pe=[0,0,0,0];return l.b3(pe,l.b4([],ye,fe)),pe[3]=-l.b5(pe,J[se[0]]),pe}(C,D),ne=function(J,se){let ye=l.b9(J),fe=l.ba([],J,1/ye),pe=l.b2([],se,l.a$([],fe,l.b5(se,fe))),ge=l.b9(pe);if(ge>0){let Re=Math.sqrt(1-fe[3]*fe[3]),Fe=l.a$([],fe,-fe[3]),ve=l.b0([],Fe,l.a$([],pe,Re/ge));return l.bb(se,ve)}return null}(B,te);if(ne!==null){let J=ne/l.b5(X[0],te);Y=Math.min(Y,J)}for(let J=0;J<4;J++){let se=Math.min(Y,ee[J]);C[J+$]=[C[J+W][0]+X[J][0]*se,C[J+W][1]+X[J][1]*se,C[J+W][2]+X[J][2]*se,1]}}(v,m[0],c,p);let T=m.map(C=>{let D=l.b2([],v[C[0]],v[C[1]]),B=l.b2([],v[C[2]],v[C[1]]),q=l.b3([],l.b4([],D,B)),W=-l.b5(q,v[C[1]]);return q.concat(W)}),P=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],E=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let C of v)for(let D=0;D<3;
804D++)P[D]=Math.min(P[D],C[D]),E[D]=Math.max(E[D],C[D]);return new go(v,T,new Qn(P,E))}}class nr{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,o){return this._helper.interpolatePadding(t,n,o)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,o=!0){this._helper.resize(t,n,o)}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,o)=>{o=l.an(+o,this.minZoom,this.maxZoom);let c={center:new l.V(n.lng,n.lat),zoom:o},p=this._helper._lngRange;if(!this._helper._renderWorldCopies&&p===null){let X=179.9999999999;p=[-X,X]}let m=this.tileSize*l.aq(c.zoom),_=0,v=m,T=0,P=m,E=0,C=0,{x:D,y:B}=this.size;if(this._helper._latRange){let X=this._helper._latRange;_=l.X(X[1])*m,v=l.X(X[0])*m,v-_<B&&(E=B/(v-_))}p&&(T=l.W(l.Y(p[0])*m,0,m),P=l.W(l.Y(p[1])*m,0,m),P<T&&(P+=m),P-T<D&&(C=D/(P-T)));let{x:q,y:W}=he(m,n),$,Y,ee=Math.max(C||0,E||0);if(ee){let X=new l.P(C?(P+T)/2:q,E?(v+_)/2:W);return c.center=Pe(m,X).wrap(),c.zoom+=l.at(ee),c}if(this._helper._latRange){let X=B/2;W-X<_&&(Y=_+X),W+X>v&&(Y=v-X)}if(p){let X=(T+P)/2,te=q;
804this._helper._renderWorldCopies&&(te=l.W(q,X-m/2,X+m/2));let ne=D/2;te-ne<T&&($=T+ne),te+ne>P&&($=P-ne)}if($!==void 0||Y!==void 0){let X=new l.P($!=null?$:q,Y!=null?Y:W);c.center=Pe(m,X).wrap()}return c},this.applyConstrain=(n,o)=>this._helper.applyConstrain(n,o),this._helper=new an({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,o)=>this.defaultConstrain(n,o)},t),this._coveringTilesDetailsProvider=new Cr}clone(){let t=new nr;return t.apply(this,!1),t}apply(t,n,o){this._helper.apply(t,n,o)}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 l.bc(0,t)];if(this._helper._renderWorldCopies){let o=this.screenPointToMercatorCoordinate(new l.P(0,0)),c=this.screenPointToMercatorCoordinate(new l.P(this._helper._width,0)),p=this.screenPointToMercatorCoordinate(new l.P(this._helper._width,this._helper._height)),m=this.screenPointToMercatorCoordinate(new l.P(0,this._helper._height)),_=Math.floor(Math.min(o.x,c.x,p.x,m.x)),v=Math.floor(Math.max(o.x,c.x,p.x,m.x)),T=1;for(let P=_-T;P<=v+T;P++)P!==0&&n.push(new l.bc(P,t))}return n}getCameraFrustum(){return go.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let n=this.screenPointToLocation(this.centerPoint,t),o=t?t.getElevationForLngLatZoom(n,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(o)}setLocationAtPoint(t,n){let o=l.as(this.elevation,this.center.lat),c=this.screenPointToMercatorCoordinateAtZ(n,o),p=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,o),m=l.a9.fromLngLat(t),_=new l.a9(m.x-(c.x-p.x),m.y-(c.y-p.y));this.setCenter(_==null?void 0:_.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,n){return n?this.coordinatePoint(l.a9.fromLngLat(t),n.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(l.a9.fromLngLat(t))}screenPointToLocation(t,n){var o;return(o=this.screenPointToMercatorCoordinate(t,n))===null||o===void 0?void 0:o.toLngLat()}screenPointToMercatorCoordinate(t,n){if(n){let o=n.pointCoordinate(t);if(o!=null)return o}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,n){let o=n||0,c=[t.x,t.y,0,1],p=[t.x,t.y,1,1];l.aH(c,c,this._pixelMatrixInverse),l.aH(p,p,this._pixelMatrixInverse);let m=c[3],_=p[3],v=c[1]/m,T=p[1]/_,P=c[2]/m,E=p[2]/_,C=P===E?0:(o-P)/(E-P);return new l.a9(l.G.number(c[0]/m,p[0]/_,C)/this.worldSize,l.G.number(v,T,C)/this.worldSize,o)}coordinatePoint(t,n=0,o=this._pixelMatrix){let c=[t.x*this.worldSize,t.y*this.worldSize,n,1];return l.aH(c,c,o),new l.P(c[0]/c[3],c[1]/c[3])}getBounds(){let t=Math.max(0,this._helper._height/2-xe(this));return new Bt().extend(this.screenPointToLocation(new l.P(0,t))).extend(this.screenPointToLocation(new l.P(this._helper._width,t))).extend(this.screenPointToLocation(new l.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new l.P(0,this._helper._height)))}isPointOnMapSurface(t,n){return n?n.pointCoordinate(t)!=null:t.y>this.height/2-xe(this)}calculatePosMatrix(t,n=!1,o){var c;let p=(c=t.key)!==null&&c!==void 0?c:l.bd(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),m=n?this._alignedPosMatrixCache:this._posMatrixCache;if(m.has(p)){let T=m.get(p);return o?T.f32:T.f64}let _=ie(t,this.worldSize);l.S(_,n?this._alignedProjMatrix:this._viewProjMatrix,_);let v={f64:_,f32:new Float32Array(_)};return m.set(p,v),o?v.f32:v.f64}calculateFogMatrix(t){let n=t.key,o=this._fogMatrixCacheF32;if(o.has(n))return o.get(n);let c=ie(t,this.worldSize);return l.S(c,this._fogMatrix,c),o.set(n,new Float32Array(c)),o.get(n)}calculateCenterFromCameraLngLatAlt(t,n,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,o,c)}_calculateNearFarZIfNeeded(t,n,o){if(!this._helper.autoCalculateNearFarZ)return;let c=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),p=t-c*this._helper._pixelPerMeter/Math.cos(n),m=c<0?p:t,_=Math.PI/2+this.pitchInRadians,v=l.ap(this.fov)*(Math.abs(Math.cos(l.ap(this.roll)))*this.height+Math.abs(Math.sin(l.ap(this.roll)))*this.width)/this.height*(.5+o.y/this.height),T=Math.sin(v)*m/Math.sin(l.an(Math.PI-_-v,.01,Math.PI-.01)),P=xe(this),E=Math.atan(P/this._helper.cameraToCenterDistance),C=l.ap(.75),D=E>C?2*E*(.5+o.y/(2*P)):C,B=Math.sin(D)*m/Math.sin(l.an(Math.PI-_-D,.01,Math.PI-.01)),q=Math.min(T,B);this._helper._farZ=1.01*(Math.cos(Math.PI/2-n)*q+m),this._helper._nearZ=this._helper._height/50}
vendor: 53,334 bytes, line 804
804_calcMatrices(){if(!this._helper._height)return;let t=this.centerOffset,n=he(this.worldSize,this.center),o=n.x,c=n.y;this._helper._pixelPerMeter=l.as(1,this.center.lat)*this.worldSize;let p=l.ap(Math.min(this.pitch,oe)),m=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(p)),_;this._calculateNearFarZIfNeeded(m,p,t),_=new Float64Array(16),l.be(_,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),l.aB(this._invProjMatrix,_),_[8]=2*-t.x/this._helper._width,_[9]=2*t.y/this._helper._height,this._projectionMatrix=l.bf(_),l.Q(_,_,[1,-1,1]),l.O(_,_,[0,0,-this._helper.cameraToCenterDistance]),l.bg(_,_,-this.rollInRadians),l.bh(_,_,this.pitchInRadians),l.bg(_,_,-this.bearingInRadians),l.O(_,_,[-o,-c,0]),this._mercatorMatrix=l.Q([],_,[this.worldSize,this.worldSize,this.worldSize]),l.Q(_,_,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=l.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,_),l.O(_,_,[0,0,-this.elevation]),this._viewProjMatrix=_,this._invViewProjMatrix=l.aB([],_);let v=[0,0,-1,1];l.aH(v,v,this._invViewProjMatrix),this._cameraPosition=[v[0]/v[3],v[1]/v[3],v[2]/v[3]],this._fogMatrix=new Float64Array(16),l.be(this._fogMatrix,this.fovInRadians,this.width/this.height,m,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,l.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),l.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),l.bg(this._fogMatrix,this._fogMatrix,-this.rollInRadians),l.bh(this._fogMatrix,this._fogMatrix,this.pitchInRadians),l.bg(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),l.O(this._fogMatrix,this._fogMatrix,[-o,-c,0]),l.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),l.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=l.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,_);let T=this._helper._width%2/2,P=this._helper._height%2/2,E=Math.cos(this.bearingInRadians),C=Math.sin(-this.bearingInRadians),D=o-Math.round(o)+E*T+C*P,B=c-Math.round(c)+E*P+C*T,q=new Float64Array(_);if(l.O(q,q,[D>.5?D-1:D,B>.5?B-1:B,0]),this._alignedProjMatrix=q,_=l.aB(new Float64Array(16),this._pixelMatrix),!_)throw new Error("failed to invert matrix");this._pixelMatrixInverse=_,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new l.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return l.aH(n,n,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=l.as(1,this.center.lat)*this.worldSize;return He(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,n){let o=l.a9.fromLngLat(t),c=[o.x*this.worldSize,o.y*this.worldSize,n,1];return l.aH(c,c,this._viewProjMatrix),c[2]/c[3]}getProjectionData(t){let{overscaledTileID:n,aligned:o,applyTerrainMatrix:c}=t,p=this._helper.getMercatorTileCoordinates(n),m=n?this.calculatePosMatrix(n,o,!0):null,_;return _=n&&n.terrainRttPosMatrix32f&&c?n.terrainRttPosMatrix32f:m||l.bi(),{mainMatrix:_,tileMercatorCoords:p,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:_}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,n,o){return 1}transformLightDirection(t){return l.b1(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,n,o,c){let p=this.calculatePosMatrix(o),m;c?(m=[t,n,c(t,n),1],l.aH(m,m,p)):(m=[t,n,0,1],En(m,m,p));let _=m[3];return{point:new l.P(m[0]/_,m[1]/_),signedDistanceFromCamera:_,isOccluded:!1}}populateCache(t){for(let n of t)this.calculatePosMatrix(n)}getMatrixForModel(t,n){let o=l.a9.fromLngLat(t,n),c=o.meterInMercatorCoordinateUnits(),p=l.bj();return l.O(p,p,[o.x,o.y,o.z]),l.bg(p,p,Math.PI),l.bh(p,p,Math.PI/2),l.Q(p,p,[-c,c,c]),p}getProjectionDataForCustomLayer(t=!0){let n=new l.a2(0,0,0,0,0),o=this.getProjectionData({overscaledTileID:n,applyGlobeMatrix:t}),c=ie(n,this.worldSize);l.S(c,this._viewProjMatrix,c),o.tileMercatorCoords=[0,0,1,1];let p=[l.a5,l.a5,this.worldSize/this._helper.pixelsPerMeter],m=l.bk();return l.Q(m,c,p),o.fallbackMatrix=m,o.mainMatrix=m,o}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function Eh(){l.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function kl(d){if(d.useSlerp)if(d.k<1){let t=l.bl(d.startEulerAngles.roll,d.startEulerAngles.pitch,d.startEulerAngles.bearing),n=l.bl(d.endEulerAngles.roll,d.endEulerAngles.pitch,d.endEulerAngles.bearing),o=new Float64Array(4);l.bm(o,t,n,d.k);let c=l.bn(o);d.tr.setRoll(c.roll),d.tr.setPitch(c.pitch),d.tr.setBearing(c.bearing)}else d.tr.setRoll(d.endEulerAngles.roll),d.tr.setPitch(d.endEulerAngles.pitch),d.tr.setBearing(d.endEulerAngles.bearing);else d.tr.setRoll(l.G.number(d.startEulerAngles.roll,d.endEulerAngles.roll,d.k)),d.tr.setPitch(l.G.number(d.startEulerAngles.pitch,d.endEulerAngles.pitch,d.k)),d.tr.setBearing(l.G.number(d.startEulerAngles.bearing,d.endEulerAngles.bearing,d.k))}function yo(d,t,n,o,c){let p=c.padding,m=he(c.worldSize,n.getNorthWest()),_=he(c.worldSize,n.getNorthEast()),v=he(c.worldSize,n.getSouthEast()),T=he(c.worldSize,n.getSouthWest()),P=l.ap(-o),E=m.rotate(P),C=_.rotate(P),D=v.rotate(P),B=T.rotate(P),q=new l.P(Math.max(E.x,C.x,B.x,D.x),Math.max(E.y,C.y,B.y,D.y)),W=new l.P(Math.min(E.x,C.x,B.x,D.x),Math.min(E.y,C.y,B.y,D.y)),$=q.sub(W),Y=(c.width-(p.left+p.right+t.left+t.right))/$.x,ee=(c.height-(p.top+p.bottom+t.top+t.bottom))/$.y;if(ee<0||Y<0)return void Eh();let X=Math.min(l.at(c.scale*Math.min(Y,ee)),d.maxZoom),te=l.P.convert(d.offset),ne=new l.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(l.ap(o)),J=te.add(ne).mult(c.scale/l.aq(X));return{center:Pe(c.worldSize,m.add(v).div(2).sub(J)),zoom:X,bearing:o}}class ea{get useGlobeControls(){return!1}handlePanInertia(t,n){let o=t.mag(),c=Math.abs(xe(n));return{easingOffset:t.mult(Math.min(.75*c/o,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,o){t.around.distSqr(n.centerPoint)<.01||n.setLocationAtPoint(o,t.around)}cameraForBoxAndBearing(t,n,o,c,p){return yo(t,n,o,c,p)}handleJumpToCenterZoom(t,n){t.zoom!==(n.zoom!==void 0?+n.zoom:t.zoom)&&t.setZoom(+n.zoom),n.center!==void 0&&t.setCenter(l.V.convert(n.center))}handleEaseTo(t,n){let o=t.zoom,c=t.padding,p={roll:t.roll,pitch:t.pitch,bearing:t.bearing},m={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},_=n.zoom!==void 0,v=!t.isPaddingEqual(n.padding),T=!1,P=_?+n.zoom:t.zoom,E=t.centerPoint.add(n.offsetAsPoint),C=t.screenPointToLocation(E),{center:D,zoom:B}=t.applyConstrain(l.V.convert(n.center||C),P!=null?P:o);Zt(t,D);let q=he(t.worldSize,C),W=he(t.worldSize,D).sub(q),$=l.aq(B-o);return T=B!==o,{easeFunc:Y=>{if(T&&t.setZoom(l.G.number(o,B,Y)),l.bo(p,m)||kl({startEulerAngles:p,endEulerAngles:m,tr:t,k:Y,useSlerp:p.roll!=m.roll}),v&&(t.interpolatePadding(c,n.padding,Y),E=t.centerPoint.add(n.offsetAsPoint)),n.around)t.setLocationAtPoint(n.around,n.aroundPoint);else{let ee=l.aq(t.zoom-o),X=B>o?Math.min(2,$):Math.max(.5,$),te=Math.pow(X,1-Y),ne=Pe(t.worldSize,q.add(W.mult(Y*te)).mult(ee));t.setLocationAtPoint(t.renderWorldCopies?ne.wrap():ne,E)}},isZooming:T,elevationCenter:D}}handleFlyTo(t,n){let o=n.zoom!==void 0,c=t.zoom,p=t.applyConstrain(l.V.convert(n.center||n.locationAtOffset),o?+n.zoom:c),m=p.center,_=p.zoom;Zt(t,m);let v=he(t.worldSize,n.locationAtOffset),T=he(t.worldSize,m).sub(v),P=T.mag(),E=l.aq(_-c),C;if(n.minZoom!==void 0){let D=Math.min(+n.minZoom,c,_),B=t.applyConstrain(m,D).zoom;C=l.aq(B-c)}return{easeFunc:(D,B,q,W)=>{t.setZoom(D===1?_:c+l.at(B));let $=D===1?m:Pe(t.worldSize,v.add(T.mult(q)).mult(B));t.setLocationAtPoint(t.renderWorldCopies?$.wrap():$,W)},scaleOfZoom:E,targetCenter:m,scaleOfMinZoom:C,pixelPathLength:P}}}class Ct{constructor(t,n,o){this.blendFunction=t,this.blendColor=n,this.mask=o}}Ct.Replace=[1,0],Ct.disabled=new Ct(Ct.Replace,l.bp.transparent,[!1,!1,!1,!1]),Ct.unblended=new Ct(Ct.Replace,l.bp.transparent,[!0,!0,!0,!0]),Ct.alphaBlended=new Ct([1,771],l.bp.transparent,[!0,!0,!0,!0]);let _o=2305;class yt{constructor(t,n,o){this.enable=t,this.mode=n,this.frontFace=o}}yt.disabled=new yt(!1,1029,_o),yt.backCCW=new yt(!0,1029,_o),yt.frontCCW=new yt(!0,1028,_o);class ct{constructor(t,n,o){this.func=t,this.mask=n,this.range=o}}ct.ReadOnly=!1,ct.ReadWrite=!0,ct.disabled=new ct(519,ct.ReadOnly,[0,1]);let xo=7680;class _t{constructor(t,n,o,c,p,m){this.test=t,this.ref=n,this.mask=o,this.fail=c,this.depthFail=p,this.pass=m}}_t.disabled=new _t({func:519,mask:0},0,0,xo,xo,xo);let Fa=new WeakMap;function vr(d){var t;if(Fa.has(d))return Fa.get(d);{let n=(t=d.getParameter(d.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return Fa.set(d,n),n}}class ta{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,o=n.gl;this._texFormat=o.RGBA,this._texType=o.UNSIGNED_BYTE;let c=new l.aW;c.emplaceBack(-1,-1),c.emplaceBack(2,-1),c.emplaceBack(-1,2);let p=new l.aY;p.emplaceBack(0,1,2),this._fullscreenTriangle=new Da(n.createVertexBuffer(c,oi.members),n.createIndexBuffer(p),l.aX.simpleSegment(0,0,c.length,p.length)),this._resultBuffer=new Uint8Array(4),n.activeTexture.set(o.TEXTURE1);let m=o.createTexture();o.bindTexture(o.TEXTURE_2D,m),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texImage2D(o.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(m),vr(o)&&(this._pbo=o.createBuffer(),o.bindBuffer(o.PIXEL_PACK_BUFFER,this._pbo),o.bufferData(o.PIXEL_PACK_BUFFER,4,o.STREAM_READ),o.bindBuffer(o.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 o=this._updateCount;return this._readbackQueue?o>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():o>=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 o=this._cachedRenderContext.context,c=o.gl;if(this._bindFramebuffer(),o.viewport.set([0,0,this._texWidth,this._texHeight]),o.clear({color:l.bp.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(o,c.TRIANGLES,ct.disabled,_t.disabled,Ct.unblended,yt.disabled,((p,m)=>({u_input:p,u_output_expected:m}))(t,n),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&vr(c)){c.bindBuffer(c.PIXEL_PACK_BUFFER,this._pbo),c.readBuffer(c.COLOR_ATTACHMENT0),c.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null);let p=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:p}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&vr(t)){let n=t.clientWaitSync(this._readbackQueue.sync,0,0);if(n===t.WAIT_FAILED)return l.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=ta._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 ys=l.a5/128;function _s(d,t){let n=d.granularity!==void 0?Math.max(d.granularity,1):1,o=n+(d.generateBorders?2:0),c=n+(d.extendToNorthPole||d.generateBorders?1:0)+(d.extendToSouthPole||d.generateBorders?1:0),p=o+1,m=c+1,_=d.generateBorders?-1:0,v=d.generateBorders||d.extendToNorthPole?-1:0,T=n+(d.generateBorders?1:0),P=n+(d.generateBorders||d.extendToSouthPole?1:0),E=p*m,C=o*c*6,D=p*m>65536;if(D&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let B=D||t==="32bit",q=new Int16Array(2*E),W=0;for(let ee=v;ee<=P;ee++)for(let X=_;X<=T;X++){let te=X/n*l.a5;X===-1&&(te=-ys),X===n+1&&(te=l.a5+ys);let ne=ee/n*l.a5;ee===-1&&(ne=d.extendToNorthPole?l.br:-ys),ee===n+1&&(ne=d.extendToSouthPole?l.bs:l.a5+ys),q[W++]=te,q[W++]=ne}let $=B?new Uint32Array(C):new Uint16Array(C),Y=0;for(let ee=0;ee<c;ee++)for(let X=0;X<o;X++){let te=X+1+ee*p,ne=X+(ee+1)*p,J=X+1+(ee+1)*p;$[Y++]=X+ee*p,$[Y++]=ne,$[Y++]=te,$[Y++]=te,$[Y++]=ne,$[Y++]=J}return{vertices:q.buffer.slice(0),indices:$.buffer.slice(0),uses32bitIndices:B}}let xs=new l.aV({fill:new l.bt(128,2),line:new l.bt(512,0),tile:new l.bt(128,32),stencil:new l.bt(128,1),circle:3});class kh{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 Ft.projectionGlobe}get vertexShaderPreludeCode(){return Ft.projectionMercator.vertexSource}get subdivisionGranularity(){return xs}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new ta(t));let n=l.X(this._errorQueryLatitudeDegrees),o=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI,c=this._errorMeasurement.updateErrorLoop(n,o),p=Ge();c!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=c,this._errorMeasurementLastChangeTime=p);let m=Math.min(Math.max((p-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=l.bu(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,l.bv(m))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,n,o,c,p){let m=(p==="stencil"?xs.stencil:xs.tile).getGranularityForZoomLevel(n.z);return this._getMesh(t,{granularity:m,generateBorders:o,extendToNorthPole:n.y===0&&c,extendToSouthPole:n.y===(1<<n.z)-1&&c})}_getMesh(t,n){let o=this._getMeshKey(n);if(o in this._tileMeshCache)return this._tileMeshCache[o];let c=function(p,m){let _=_s(m,"16bit"),v=l.aW.deserialize({arrayBuffer:_.vertices,length:_.vertices.byteLength/2/2}),T=l.aY.deserialize({arrayBuffer:_.indices,length:_.indices.byteLength/2/3});return new Da(p.createVertexBuffer(v,oi.members),p.createIndexBuffer(T),l.aX.simpleSegment(0,0,v.length,T.length))}(t,n);return this._tileMeshCache[o]=c,c}recalculate(t){}hasTransition(){let t=Ge(),n=!1;return n=n||(t-this._errorMeasurementLastChangeTime)/1e3<.7,n=n||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,n}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let bd=new l.t({type:new l.D(l.u.projection.type)});class ji extends l.E{constructor(t){super(),this._transitionable=new l.x(bd,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new l.H(0)),this._mercatorProjection=new gs,this._verticalPerspectiveProjection=new kh}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 l.bw){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,o,c,p){return this.currentProjection.getMeshFromTileID(t,n,o,c,p)}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 vs(d){let t=vo(d.worldSize,d.center.lat);return 2*Math.PI*t}function Ti(d,t,n,o,c){let p=1/(1<<c),m=t/l.a5*p+o*p,_=l.bz((d/l.a5*p+n*p)*Math.PI*2+Math.PI,2*Math.PI),v=2*Math.atan(Math.exp(Math.PI-m*Math.PI*2))-.5*Math.PI,T=Math.cos(v),P=new Float64Array(3);return P[0]=Math.sin(_)*T,P[1]=Math.sin(v),P[2]=Math.cos(_)*T,P}function fi(d){return function(t,n){let o=Math.cos(n),c=new Float64Array(3);return c[0]=Math.sin(t)*o,c[1]=Math.sin(n),c[2]=Math.cos(t)*o,c}(d.lng*Math.PI/180,d.lat*Math.PI/180)}function vo(d,t){return d/(2*Math.PI)/Math.cos(t*Math.PI/180)}function zl(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 o=d[0]/n,c=Math.acos(d[2]/n),p=(o>0?c:-c)/Math.PI*180;return new l.V(l.W(p,-180,180),t)}return new l.V(0,t)}function on(d){return Math.cos(d*Math.PI/180)}function yi(d,t){let n=on(d),o=on(t);return l.at(o/n)}function zh(d,t){let n=d.rotate(t.bearingInRadians),o=t.zoom+yi(t.center.lat,0),c=l.bu(1/on(t.center.lat),1/on(Math.min(Math.abs(t.center.lat),60)),l.bx(o,7,3,0,1)),p=360/vs({worldSize:t.worldSize,center:{lat:t.center.lat}});return new l.V(t.center.lng-n.x*p*c,l.an(t.center.lat+n.y*p,-l.ao,l.ao))}function Al(d){let t=.5*d,n=Math.sin(t),o=Math.cos(t);return Math.log(n+o)-Math.log(o-n)}function Ah(d,t,n,o){let c=d.lat+n*o;if(Math.abs(n)>1){let p=(Math.sign(d.lat+n)!==Math.sign(d.lat)?-Math.abs(d.lat):Math.abs(d.lat))*Math.PI/180,m=Math.abs(d.lat+n)*Math.PI/180,_=Al(p+o*(m-p)),v=Al(p),T=Al(m);return new l.V(d.lng+t*((_-v)/(T-v)),c)}return new l.V(d.lng+t*o,c)}class wd{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,o,c){let p=`${t.z}_${t.x}_${t.y}_${c!=null&&c.terrain?"t":""}`,m=this._cache.get(p);if(m)return m;let _=this._cachePrevious.get(p);if(_)return this._cache.set(p,_),_;let v=this._boundingVolumeFactory(t,n,o,c);return this._cache.set(p,v),this._hadAnyChanges=!0,v}}class Oa{constructor(t,n,o,c){this.min=o,this.max=c,this.points=t,this.planes=n}static fromAabb(t,n){let o=[];for(let c=0;c<8;c++)o.push([1&~c?t[0]:n[0],(c>>1&1)==1?n[1]:t[1],(c>>2&1)==1?n[2]:t[2]]);return new Oa(o,[[-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,o){let c=l.bB([],o[0],o[1],o[2]),p=l.bC([],[n[0],0,0],c),m=l.bC([],[0,n[1],0],c),_=l.bC([],[0,0,n[2]],c),v=[...t],T=[...t];for(let E=0;E<8;E++)for(let C=0;C<3;C++){let D=t[C]+p[C]*(1&~E?-1:1)+m[C]*((E>>1&1)==1?1:-1)+_[C]*((E>>2&1)==1?1:-1);v[C]=Math.min(v[C],D),T[C]=Math.max(T[C],D)}let P=[];for(let E=0;E<8;E++){let C=[...t];l.b0(C,C,l.a$([],p,1&~E?-1:1)),l.b0(C,C,l.a$([],m,(E>>1&1)==1?1:-1)),l.b0(C,C,l.a$([],_,(E>>2&1)==1?1:-1)),P.push(C)}return new Oa(P,[[...p,-l.b5(p,P[0])],[...m,-l.b5(m,P[0])],[..._,-l.b5(_,P[0])],[-p[0],-p[1],-p[2],-l.b5(p,P[7])],[-m[0],-m[1],-m[2],-l.b5(m,P[7])],[-_[0],-_[1],-_[2],-l.b5(_,P[7])]],v,T)}intersectsFrustum(t){let n=!0,o=this.points.length,c=this.planes.length,p=t.planes.length,m=t.points.length;for(let _=0;_<p;_++){let v=t.planes[_],T=0;for(let P=0;P<o;P++){let E=this.points[P];v[0]*E[0]+v[1]*E[1]+v[2]*E[2]+v[3]>=0&&T++}if(T===0)return 0;T<o&&(n=!1)}if(n)return 2;for(let _=0;_<c;_++){let v=this.planes[_],T=0;for(let P=0;P<m;P++){let E=t.points[P];v[0]*E[0]+v[1]*E[1]+v[2]*E[2]+v[3]>=0&&T++}if(T===0)return 0}return 1}intersectsPlane(t){let n=this.points.length,o=0;for(let c=0;c<n;c++){let p=this.points[c];t[0]*p[0]+t[1]*p[1]+t[2]*p[2]+t[3]>=0&&o++}return o===n?2:o===0?0:1}}function ia(d,t,n){let o=d-t;return o<0?-o:Math.max(0,o-n)}function bo(d,t,n,o,c){let p=d-n,m;return m=p<0?Math.min(-p,1+p-c):p>1?Math.min(Math.max(p-c,0),1-p):0,Math.max(m,ia(t,o,c))}class bs{constructor(){this._boundingVolumeCache=new wd(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,n,o,c){let p=1<<o.z,m=1/p,_=o.x/p,v=o.y/p,T=2;return T=Math.min(T,bo(t,n,_,v,m)),T=Math.min(T,bo(t,n,_+.5,-v-m,m)),T=Math.min(T,bo(t,n,_+.5,2-v-m,m)),T}getWrap(t,n,o){let c=1<<n.z,p=1/c,m=n.x/c,_=ia(t.x,m,p),v=ia(t.x,m-1,p),T=ia(t.x,m+1,p),P=Math.min(_,v,T);return P===T?1:P===v?-1:0}allowVariableZoom(t,n){return Lt(t,n)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,n,o,c){return this._boundingVolumeCache.getTileBoundingVolume(t,n,o,c)}_computeTileBoundingVolume(t,n,o,c){var p,m;let _=0,v=0;if(c!=null&&c.terrain){let T=new l.a2(t.z,n,t.z,t.x,t.y),P=c.terrain.getMinMaxElevation(T);_=(p=P.minElevation)!==null&&p!==void 0?p:Math.min(0,o),v=(m=P.maxElevation)!==null&&m!==void 0?m:Math.max(0,o)}if(_/=l.bE,v/=l.bE,_+=1,v+=1,t.z<=0)return Oa.fromAabb([-v,-v,-v],[v,v,v]);if(t.z===1)return Oa.fromAabb([t.x===0?-v:0,t.y===0?0:-v,-v],[t.x===0?0:v,t.y===0?v:0,v]);{let T=[Ti(0,0,t.x,t.y,t.z),Ti(l.a5,0,t.x,t.y,t.z),Ti(l.a5,l.a5,t.x,t.y,t.z),Ti(0,l.a5,t.x,t.y,t.z)],P=[];for(let pe of T)P.push(l.a$([],pe,v));if(v!==_)for(let pe of T)P.push(l.a$([],pe,_));t.y===0&&P.push([0,1,0]),t.y===(1<<t.z)-1&&P.push([0,-1,0]);let E=[1,1,1],C=[-1,-1,-1];for(let pe of P)for(let ge=0;ge<3;ge++)E[ge]=Math.min(E[ge],pe[ge]),C[ge]=Math.max(C[ge],pe[ge]);let D=Ti(l.a5/2,l.a5/2,t.x,t.y,t.z),B=l.b4([],[0,1,0],D);l.b3(B,B);let q=l.b4([],D,B);l.b3(q,q);let W=l.b4([],T[2],T[1]);l.b3(W,W);let $=l.b4([],T[0],T[3]);l.b3($,$),P.push(l.a$([],D,v)),t.y>=(1<<t.z)/2&&P.push(l.a$([],Ti(l.a5/2,0,t.x,t.y,t.z),v)),t.y<(1<<t.z)/2&&P.push(l.a$([],Ti(l.a5/2,l.a5,t.x,t.y,t.z),v));let Y=ws(D,P),ee=ws(q,P),X=[-D[0],-D[1],-D[2],Y.max],te=[D[0],D[1],D[2],-Y.min],ne=[-q[0],-q[1],-q[2],ee.max],J=[q[0],q[1],q[2],-ee.min],se=[...W,0],ye=[...$,0],fe=[];return t.y===0?fe.push(l.bD(ye,se,X),l.bD(ye,se,te)):fe.push(l.bD(ne,se,X),l.bD(ne,se,te),l.bD(ne,ye,X),l.bD(ne,ye,te)),t.y===(1<<t.z)-1?fe.push(l.bD(ye,se,X),l.bD(ye,se,te)):fe.push(l.bD(J,se,X),l.bD(J,se,te),l.bD(J,ye,X),l.bD(J,ye,te)),new Oa(fe,[X,te,ne,J,se,ye],E,C)}}}function ws(d,t){let n=1/0,o=-1/0;for(let c of t){let p=l.b5(d,c);n=Math.min(n,p),o=Math.max(o,p)}return{min:n,max:o}}class Ba{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,o){return this._helper.interpolatePadding(t,n,o)}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=l.bF(),this._projectionMatrix=l.bj(),this._globeViewProjMatrix32f=l.bi(),this._globeViewProjMatrixNoCorrection=l.bj(),this._globeViewProjMatrixNoCorrectionInverted=l.bj(),this._globeProjMatrixInverted=l.bj(),this._cameraPosition=l.bA(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(n,o)=>{let c=l.an(n.lat,-l.ao,l.ao),p=l.an(+o,this.minZoom+yi(0,c),this.maxZoom);return{center:new l.V(n.lng,c),zoom:p}},this.applyConstrain=(n,o)=>this._helper.applyConstrain(n,o),this._helper=new an({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,o)=>this.defaultConstrain(n,o)},t),this._coveringTilesDetailsProvider=new bs}clone(){let t=new Ba;return t.apply(this,!1),t}apply(t,n,o){this._globeLatitudeErrorCorrectionRadians=o||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=l.bA();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:o}=t,c=this._helper.getMercatorTileCoordinates(n);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:c,clippingPlane:this._cachedClippingPlane,projectionTransition:o?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){let n=this.pitchInRadians,o=this.cameraToCenterDistance/t,c=Math.sin(n)*o,p=Math.cos(n)*o+1,m=1/Math.sqrt(c*c+p*p)*1,_=-c,v=p,T=Math.sqrt(_*_+v*v);_/=T,v/=T;let P=[0,_,v];l.bG(P,P,[0,0,0],-this.bearingInRadians),l.bH(P,P,[0,0,0],-1*this.center.lat*Math.PI/180),l.bI(P,P,[0,0,0],this.center.lng*Math.PI/180);let E=1/l.b7(P);return l.a$(P,P,E),[...P,-m*E]}isLocationOccluded(t){return!this.isSurfacePointVisible(fi(t))}transformLightDirection(t){let n=this._helper._center.lng*Math.PI/180,o=this._helper._center.lat*Math.PI/180,c=Math.cos(o),p=[Math.sin(n)*c,Math.sin(o),Math.cos(n)*c],m=[p[2],0,-p[0]],_=[0,0,0];l.b4(_,m,p),l.b3(m,m),l.b3(_,_);let v=[0,0,0];return l.b3(v,[m[0]*t[0]+_[0]*t[1]+p[0]*t[2],m[1]*t[0]+_[1]*t[1]+p[1]*t[2],m[2]*t[0]+_[2]*t[1]+p[2]*t[2]]),v}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,o){let c=function(_,v,T){let P=1/(1<<T.z);return new l.a9(_/l.a5*P+T.x*P,v/l.a5*P+T.y*P)}(t,n,o.canonical),p=(m=c.y,[l.bz(c.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-m*Math.PI*2))-.5*Math.PI]);var m;return this.getCircleRadiusCorrection()/Math.cos(p[1])}projectTileCoordinates(t,n,o,c){let p=o.canonical,m=Ti(t,n,p.x,p.y,p.z),_=1+(c?c(t,n):0)/l.bE,v=[m[0]*_,m[1]*_,m[2]*_,1];l.aH(v,v,this._globeViewProjMatrixNoCorrection);let T=this._cachedClippingPlane,P=T[0]*m[0]+T[1]*m[1]+T[2]*m[2]+T[3]<0;return{point:new l.P(v[0]/v[3],v[1]/v[3]),signedDistanceFromCamera:v[3],isOccluded:P}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=vo(this.worldSize,this.center.lat),n=l.bk(),o=l.bk();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),l.be(n,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let c=this.centerOffset;n[8]=2*-c.x/this._helper._width,n[9]=2*c.y/this._helper._height,this._projectionMatrix=l.bf(n),this._globeProjMatrixInverted=l.bk(),l.aB(this._globeProjMatrixInverted,n),l.O(n,n,[0,0,-this.cameraToCenterDistance]),l.bg(n,n,this.rollInRadians),l.bh(n,n,-this.pitchInRadians),l.bg(n,n,this.bearingInRadians),l.O(n,n,[0,0,-t]);let p=l.bA();p[0]=t,p[1]=t,p[2]=t,l.bh(o,n,this.center.lat*Math.PI/180),l.bJ(o,o,-this.center.lng*Math.PI/180),l.Q(o,o,p),this._globeViewProjMatrixNoCorrection=o,l.bh(n,n,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),l.bJ(n,n,-this.center.lng*Math.PI/180),l.Q(n,n,p),this._globeViewProjMatrix32f=new Float32Array(n),this._globeViewProjMatrixNoCorrectionInverted=l.bk(),l.aB(this._globeViewProjMatrixNoCorrectionInverted,o);let m=l.bA();this._cameraPosition=l.bA(),this._cameraPosition[2]=this.cameraToCenterDistance/t,l.bG(this._cameraPosition,this._cameraPosition,m,-this.rollInRadians),l.bH(this._cameraPosition,this._cameraPosition,m,this.pitchInRadians),l.bG(this._cameraPosition,this._cameraPosition,m,-this.bearingInRadians),l.b0(this._cameraPosition,this._cameraPosition,[0,0,1]),l.bH(this._cameraPosition,this._cameraPosition,m,-this.center.lat*Math.PI/180),l.bI(this._cameraPosition,this._cameraPosition,m,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let _=l.bf(this._globeViewProjMatrixNoCorrectionInverted);l.Q(_,_,[1,1,-1]),this._cachedFrustum=go.fromInvProjectionMatrix(_,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){l.w("calculateFogMatrix is not supported on globe projection.");let n=l.bk();return l.ar(n),n}getVisibleUnwrappedCoordinates(t){return[new l.bc(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&l.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 o=fi(t);l.a$(o,o,1+n/l.bE);let c=l.bF();return l.aH(c,[o[0],o[1],o[2],1],this._globeViewProjMatrixNoCorrection),c[2]/c[3]}populateCache(t){}getBounds(){let t=.5*this.width,n=.5*this.height,o=[new l.P(0,0),new l.P(t,0),new l.P(this.width,0),new l.P(this.width,n),new l.P(this.width,this.height),new l.P(t,this.height),new l.P(0,this.height),new l.P(0,n)],c=[];for(let E of o)c.push(this.unprojectScreenPoint(E));let p=0,m=0,_=0,v=0,T=this.center;for(let E of c){let C=l.bK(T.lng,E.lng),D=l.bK(T.lat,E.lat);C<m&&(m=C),C>p&&(p=C),D<v&&(v=D),D>_&&(_=D)}let P=[T.lng+m,T.lat+v,T.lng+p,T.lat+_];return this.isSurfacePointOnScreen([0,1,0])&&(P[3]=90,P[0]=-180,P[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(P[1]=-90,P[0]=-180,P[2]=180),new Bt(P)}calculateCenterFromCameraLngLatAlt(t,n,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,o,c)}setLocationAtPoint(t,n){let o=fi(this.unprojectScreenPoint(n)),c=fi(t),p=l.bA();l.bL(p);let m=l.bA();l.bI(m,o,p,-this.center.lng*Math.PI/180),l.bH(m,m,p,this.center.lat*Math.PI/180);let _=c[0]*c[0]+c[2]*c[2],v=m[0]*m[0];if(_<v)return;let T=Math.sqrt(_-v),P=-T,E=l.bM(c[0],c[2],m[0],T),C=l.bM(c[0],c[2],m[0],P),D=l.bA();l.bI(D,c,p,-E);let B=l.bM(D[1],D[2],m[1],m[2]),q=l.bA();l.bI(q,c,p,-C);let W=l.bM(q[1],q[2],m[1],m[2]),$=.5*Math.PI,Y=B>=-$&&B<=$,ee=W>=-$&&W<=$,X,te;if(Y&&ee){let ye=this.center.lng*Math.PI/180,fe=this.center.lat*Math.PI/180;l.bN(E,ye)+l.bN(B,fe)<l.bN(C,ye)+l.bN(W,fe)?(X=E,te=B):(X=C,te=W)}else if(Y)X=E,te=B;else{if(!ee)return;X=C,te=W}let ne=X/Math.PI*180,J=te/Math.PI*180,se=this.center.lat;this.setCenter(new l.V(ne,l.an(J,-90,90))),this.setZoom(this.zoom+yi(se,this.center.lat))}locationToScreenPoint(t,n){let o=fi(t);if(n){let c=n.getElevationForLngLatZoom(t,this._helper._tileZoom);l.a$(o,o,1+c/l.bE)}return this._projectSurfacePointToScreen(o)}_projectSurfacePointToScreen(t){let n=l.bF();return l.aH(n,[...t,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],new l.P((.5*n[0]+.5)*this.width,(.5*-n[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,n){if(n){let o=n.pointCoordinate(t);if(o)return o}return l.a9.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,n){var o;return(o=this.screenPointToMercatorCoordinate(t,n))===null||o===void 0?void 0:o.toLngLat()}isPointOnMapSurface(t,n){let o=this._cameraPosition,c=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(o,c)}getRayDirectionFromPixel(t){let n=l.bF();n[0]=t.x/this.width*2-1,n[1]=-1*(t.y/this.height*2-1),n[2]=1,n[3]=1,l.aH(n,n,this._globeViewProjMatrixNoCorrectionInverted),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3];let o=l.bA();o[0]=n[0]-this._cameraPosition[0],o[1]=n[1]-this._cameraPosition[1],o[2]=n[2]-this._cameraPosition[2];let c=l.bA();return l.b3(c,o),c}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=l.bF();return l.aH(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 o=l.b5(t,n),c=l.bA(),p=l.bA();l.a$(p,n,o),l.b2(c,t,p);let m=1-l.b5(c,c);if(m<0)return null;let _=l.b5(t,t)-1,v=-o+(o<0?1:-1)*Math.sqrt(m),T=_/v,P=v;return{tMin:Math.min(T,P),tMax:Math.max(T,P)}}unprojectScreenPoint(t){let n=this._cameraPosition,o=this.getRayDirectionFromPixel(t),c=this.rayPlanetIntersection(n,o);if(c){let P=l.bA();l.b0(P,n,[o[0]*c.tMin,o[1]*c.tMin,o[2]*c.tMin]);let E=l.bA();return l.b3(E,P),zl(E)}let p=this._cachedClippingPlane,m=p[0]*o[0]+p[1]*o[1]+p[2]*o[2],_=-l.bb(p,n)/m,v=l.bA();if(_>0)l.b0(v,n,[o[0]*_,o[1]*_,o[2]*_]);else{let P=l.bA();l.b0(P,n,[2*o[0],2*o[1],2*o[2]]);let E=l.bb(this._cachedClippingPlane,P);l.b2(v,P,[this._cachedClippingPlane[0]*E,this._cachedClippingPlane[1]*E,this._cachedClippingPlane[2]*E])}let T=function(P){let E=l.bA();return E[0]=P[0]*-P[3],E[1]=P[1]*-P[3],E[2]=P[2]*-P[3],{center:E,radius:Math.sqrt(1-P[3]*P[3])}}(p);return zl(function(P,E,C){let D=l.bA();l.b2(D,C,P);let B=l.bA();return l.by(B,P,D,E/l.b9(D)),B}(T.center,T.radius,v))}getMatrixForModel(t,n){let o=l.V.convert(t),c=1/l.bE,p=l.bj();return l.bJ(p,p,o.lng/180*Math.PI),l.bh(p,p,-o.lat/180*Math.PI),l.O(p,p,[0,0,1+n/l.bE]),l.bh(p,p,.5*Math.PI),l.Q(p,p,[c,c,c]),p}getProjectionDataForCustomLayer(t=!0){let n=this.getProjectionData({overscaledTileID:new l.a2(0,0,0,0,0),applyGlobeMatrix:t});return n.tileMercatorCoords=[0,0,1,1],n}getFastPathSimpleProjectionMatrix(t){}}class ar{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,o){return this._helper.interpolatePadding(t,n,o)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,o=!0){this._helper.resize(t,n,o)}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,o)=>this.currentTransform.defaultConstrain(n,o),this.applyConstrain=(n,o)=>this._helper.applyConstrain(n,o),this._helper=new an({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(n,o)=>this.defaultConstrain(n,o)},t),this._globeness=1,this._mercatorTransform=new nr,this._verticalPerspectiveTransform=new Ba}clone(){let t=new ar;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),o=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?o.mainMatrix:n.mainMatrix,clippingPlane:o.clippingPlane,tileMercatorCoords:o.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 l.bu(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return l.bu(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,n,o){let c=this._mercatorTransform.getPitchedTextCorrection(t,n,o),p=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,n,o);return l.bu(c,p,this._globeness)}projectTileCoordinates(t,n,o,c){return this.currentTransform.projectTileCoordinates(t,n,o,c)}_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,o,c){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,o,c)}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 o=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return o.fallbackMatrix=n.mainMatrix,o}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Er{get useGlobeControls(){return!0}handlePanInertia(t,n){let o=zh(t,n);return Math.abs(o.lng-n.center.lng)>180&&(o.lng=n.center.lng+179.5*Math.sign(o.lng-n.center.lng)),{easingCenter:o,easingOffset:new l.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,n){let o=t.around,c=n.screenPointToLocation(o);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 p=n.zoom;t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta);let m=n.zoom-p;if(m===0)return;let _=l.bK(n.center.lng,c.lng),v=_/(Math.abs(_/180)+1),T=l.bK(n.center.lat,c.lat),P=n.getRayDirectionFromPixel(o),E=n.cameraPosition,C=-1*l.b5(E,P),D=l.bA();l.b0(D,E,[P[0]*C,P[1]*C,P[2]*C]);let B=l.b7(D)-1,q=Math.exp(.5*-Math.max(B-.3,0)),W=vo(n.worldSize,n.center.lat)/Math.min(n.width,n.height),$=l.bx(W,.9,.5,1,.25),Y=(1-l.aq(-m))*Math.min(q,$),ee=n.center.lat,X=n.zoom,te=new l.V(n.center.lng+v*Y,l.an(n.center.lat+T*Y,-l.ao,l.ao));n.setLocationAtPoint(c,o);let ne=n.center,J=l.bx(Math.abs(_),45,85,0,1),se=l.bx(W,.75,.35,0,1),ye=Math.pow(Math.max(J,se),.25),fe=l.bK(ne.lng,te.lng),pe=l.bK(ne.lat,te.lat);n.setCenter(new l.V(ne.lng+fe*ye,ne.lat+pe*ye).wrap()),n.setZoom(X+yi(ee,n.center.lat))}handleMapControlsPan(t,n,o){if(!t.panDelta)return;let c=n.center.lat,p=n.zoom;n.setCenter(zh(t.panDelta,n).wrap()),n.setZoom(p+yi(c,n.center.lat))}cameraForBoxAndBearing(t,n,o,c,p){let m=yo(t,n,o,c,p),_=n.left/p.width*2-1,v=(p.width-n.right)/p.width*2-1,T=n.top/p.height*-2+1,P=(p.height-n.bottom)/p.height*-2+1,E=l.bK(o.getWest(),o.getEast())<0,C=E?o.getEast():o.getWest(),D=E?o.getWest():o.getEast(),B=Math.max(o.getNorth(),o.getSouth()),q=Math.min(o.getNorth(),o.getSouth()),W=C+.5*l.bK(C,D),$=B+.5*l.bK(B,q),Y=p.clone();Y.setCenter(m.center),Y.setBearing(m.bearing),Y.setPitch(0),Y.setRoll(0),Y.setZoom(m.zoom);let ee=Y.modelViewProjectionMatrix,X=[fi(o.getNorthWest()),fi(o.getNorthEast()),fi(o.getSouthWest()),fi(o.getSouthEast()),fi(new l.V(D,$)),fi(new l.V(C,$)),fi(new l.V(W,B)),fi(new l.V(W,q))],te=fi(m.center),ne=Number.POSITIVE_INFINITY;for(let J of X)_<0&&(ne=Er.getLesserNonNegativeNonNull(ne,Er.solveVectorScale(J,te,ee,"x",_))),v>0&&(ne=Er.getLesserNonNegativeNonNull(ne,Er.solveVectorScale(J,te,ee,"x",v))),T>0&&(ne=Er.getLesserNonNegativeNonNull(ne,Er.solveVectorScale(J,te,ee,"y",T))),P<0&&(ne=Er.getLesserNonNegativeNonNull(ne,Er.solveVectorScale(J,te,ee,"y",P)));if(Number.isFinite(ne)&&ne!==0)return m.zoom=Y.zoom+l.at(ne),m;Eh()}handleJumpToCenterZoom(t,n){let o=t.center.lat,c=t.applyConstrain(n.center?l.V.convert(n.center):t.center,t.zoom).center;t.setCenter(c.wrap());let p=n.zoom!==void 0?+n.zoom:t.zoom+yi(o,c.lat);t.zoom!==p&&t.setZoom(p)}handleEaseTo(t,n){let o=t.zoom,c=t.center,p=t.padding,m={roll:t.roll,pitch:t.pitch,bearing:t.bearing},_={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},v=n.zoom!==void 0,T=!t.isPaddingEqual(n.padding),P=!1,E=n.center?l.V.convert(n.center):c,C=t.applyConstrain(E,o).center;Zt(t,C);let D=t.clone();D.setCenter(C),D.setZoom(v?+n.zoom:o+yi(c.lat,E.lat)),D.setBearing(n.bearing);let B=new l.P(l.an(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),l.an(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));D.setLocationAtPoint(C,B);let q=(n.offset&&n.offsetAsPoint.mag())>0?D.center:C,W=v?+n.zoom:o+yi(c.lat,q.lat),$=o+yi(c.lat,0),Y=W+yi(q.lat,0),ee=l.bK(c.lng,q.lng),X=l.bK(c.lat,q.lat),te=l.aq(Y-$);return P=W!==o,{easeFunc:ne=>{if(l.bo(m,_)||kl({startEulerAngles:m,endEulerAngles:_,tr:t,k:ne,useSlerp:m.roll!=_.roll}),T&&t.interpolatePadding(p,n.padding,ne),n.around)l.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(n.around,n.aroundPoint);else{let J=Y>$?Math.min(2,te):Math.max(.5,te),se=Math.pow(J,1-ne),ye=Ah(c,ee,X,ne*se);t.setCenter(ye.wrap())}if(P){let J=l.G.number($,Y,ne)+yi(0,t.center.lat);t.setZoom(J)}},isZooming:P,elevationCenter:q}}handleFlyTo(t,n){let o=n.zoom!==void 0,c=t.center,p=t.zoom,m=t.padding,_=!t.isPaddingEqual(n.padding),v=t.applyConstrain(l.V.convert(n.center||n.locationAtOffset),p).center,T=o?+n.zoom:t.zoom+yi(t.center.lat,v.lat),P=t.clone();P.setCenter(v),P.setZoom(T),P.setBearing(n.bearing);let E=new l.P(l.an(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),l.an(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));P.setLocationAtPoint(v,E);let C=P.center;Zt(t,C);let D=function(X,te,ne){let J=fi(te),se=fi(ne),ye=l.b5(J,se),fe=Math.acos(ye),pe=vs(X);return fe/(2*Math.PI)*pe}(t,c,C),B=p+yi(c.lat,0),q=T+yi(C.lat,0),W=l.aq(q-B),$;if(typeof n.minZoom=="number"){let X=+n.minZoom+yi(C.lat,0),te=Math.min(X,B,q)+yi(0,C.lat),ne=t.applyConstrain(C,te).zoom+yi(C.lat,0);$=l.aq(ne-B)}let Y=l.bK(c.lng,C.lng),ee=l.bK(c.lat,C.lat);return{easeFunc:(X,te,ne,J)=>{let se=Ah(c,Y,ee,ne);_&&t.interpolatePadding(m,n.padding,X);let ye=X===1?C:se;t.setCenter(ye.wrap());let fe=B+l.at(te);t.setZoom(X===1?T:fe+yi(0,ye.lat))},scaleOfZoom:W,targetCenter:C,scaleOfMinZoom:$,pixelPathLength:D}}static solveVectorScale(t,n,o,c,p){let m=c==="x"?[o[0],o[4],o[8],o[12]]:[o[1],o[5],o[9],o[13]],_=[o[3],o[7],o[11],o[15]],v=t[0]*m[0]+t[1]*m[1]+t[2]*m[2],T=t[0]*_[0]+t[1]*_[1]+t[2]*_[2],P=n[0]*m[0]+n[1]*m[1]+n[2]*m[2],E=n[0]*_[0]+n[1]*_[1]+n[2]*_[2];return P+p*T===v+p*E||_[3]*(v-P)+m[3]*(E-T)+v*E==P*T?null:(P+m[3]-p*E-p*_[3])/(P-v-p*E+p*T)}static getLesserNonNegativeNonNull(t,n){return n!==null&&n>=0&&n<t?n:t}}class Ss{constructor(t){this._globe=t,this._mercatorCameraHelper=new ea,this._verticalPerspectiveCameraHelper=new Er}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){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,n)}handleMapControlsPan(t,n,o){this.currentHelper.handleMapControlsPan(t,n,o)}cameraForBoxAndBearing(t,n,o,c,p){return this.currentHelper.cameraForBoxAndBearing(t,n,o,c,p)}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 kn=(d,t)=>l.B(d,t&&t.filter(n=>n.identifier!=="source.canvas")),wo=l.bO();class Dl extends l.E{constructor(t,n={}){var o,c;super(),this._rtlPluginLoaded=()=>
804{for(let m in this.tileManagers){let _=this.tileManagers[m].getSource().type;_!=="vector"&&_!=="geojson"||this.tileManagers[m].reload()}},this.map=t,this.dispatcher=new Gn(Ta(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(m,_)=>this.getGlyphs(m,_)),this.dispatcher.registerMessageHandler("GI",(m,_)=>this.getImages(m,_)),this.dispatcher.registerMessageHandler("GDA",(m,_)=>this.getDashes(m,_)),this.imageManager=new Or,this.imageManager.setEventedParent(this);let p=((o=t._container)===null||o===void 0?void 0:o.lang)||typeof document<"u"&&((c=document.documentElement)===null||c===void 0?void 0:c.lang)||void 0;this.glyphManager=new Kr(t._requestManager,n.localIdeographFontFamily,p),this.lineAtlas=new Sa(256,512),this.crossTileSymbolIndex=new zi,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",l.bP()),j().on(le,this._rtlPluginLoaded),this.on("data",m=>{if(m.dataType!=="source"||m.sourceDataType!=="metadata")return;let _=this.tileManagers[m.sourceId];if(!_)return;let v=_.getSource();if(v&&v.vectorLayerIds)for(let T in this._layers){let P=this._layers[T];P.source===v.id&&this._validateLayer(P)}})}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new l.bQ,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 o,c,p;this._checkLoaded();let m=n===null?(p=(c=(o=this.stylesheet.state)===null||o===void 0?void 0:o[t])===null||c===void 0?void 0:c.default)!==null&&p!==void 0?p:null:n;if(l.bR(m,this._globalState[t]))return this;this._globalState[t]=m,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let n=[];for(let o in t)!l.bR(this._globalState[o],t[o].default)&&(n.push(o),this._globalState[o]=t[o].default);this._applyGlobalStateChanges(n)}_applyGlobalStateChanges(t){if(t.length===0)return;let n=new Set,o={};for(let c of t){o[c]=this._globalState[c];for(let p in this._layers){let m=this._layers[p],_=m.getLayoutAffectingGlobalStateRefs(),v=m.getPaintAffectingGlobalStateRefs(),T=m.getVisibilityAffectingGlobalStateRefs();if(_.has(c)&&n.add(m.source),v.has(c))for(let{name:P,value:E}of v.get(c))this._updatePaintProperty(m,P,E);T!=null&&T.has(c)&&(m.recalculateVisibility(),this._updateLayer(m))}}this.dispatcher.broadcast("UGS",o);for(let c in this.tileManagers)n.has(c)&&(this._reloadSource(c),this._changed=!0)}loadURL(t,n={},o){this.fire(new l.l("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;let c=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;let p=this._loadStyleRequest;l.j(c,this._loadStyleRequest).then(m=>{this._loadStyleRequest=null,this._load(m.data,n,o)}).catch(m=>{this._loadStyleRequest=null,m&&!p.signal.aborted&&this.fire(new l.k(m))})}loadJSON(t,n={},o){this.fire(new l.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Ve.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,o)}).catch(()=>{})}loadEmpty(){this.fire(new l.l("dataloading",{dataType:"style"})),this._load(wo,{validate:!1})}_load(t,n,o){var c,p;let m=n.transformStyle?n.transformStyle(o,t):t;if(!n.validate||!kn(this,l.C(m))){m=Object.assign({},m),this._loaded=!0,this.stylesheet=m;for(let _ in m.sources)this.addSource(_,m.sources[_],{validate:!1});m.sprite?this._loadSprite(m.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(m.glyphs),this._createLayers(),this.light=new Un(this.stylesheet.light),this._setProjectionInternal(((c=this.stylesheet.projection)===null||c===void 0?void 0:c.type)||"mercator"),this.sky=new so(this.stylesheet.sky),this.map.setTerrain((p=this.stylesheet.terrain)!==null&&p!==void 0?p:null),this.fire(new l.l("data",{dataType:"style"})),this.fire(new l.l("style.load"))}}_createLayers(){var t,n,o;
804let c=l.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",c),this._order=c.map(p=>p.id),this._layers={},this._serializedLayers=null;for(let p of c){let m=l.bT(p,this._globalState);if(m.setEventedParent(this,{layer:{id:p.id}}),this._layers[p.id]=m,l.bU(m)&&this.tileManagers[m.source]){let _=(o=(n=p.paint)===null||n===void 0?void 0:n["raster-fade-duration"])!==null&&o!==void 0?o:m.paint.get("raster-fade-duration");this.tileManagers[m.source].setRasterFadeDuration(_)}}}_loadSprite(t,n=!1,o=void 0){this.imageManager.setLoaded(!1);let c=new AbortController,p;this._spriteRequest=c,function(m,_,v,T){return l._(this,void 0,void 0,function*(){let P=Lr(m),E=v>1?"@2x":"",C={},D={};for(let{id:B,url:q}of P){let W=_.transformRequest(Li(q,E,".json"),"SpriteJSON");C[B]=l.j(W,T);let $=_.transformRequest(Li(q,E,".png"),"SpriteImage");D[B]=gi.getImage($,T)}return yield Promise.all([...Object.values(C),...Object.values(D)]),function(B,q){return l._(this,void 0,void 0,function*(){let W={};for(let $ in B){W[$]={};let Y=Ve.getImageCanvasContext((yield q[$]).data),ee=(yield B[$]).data;for(let X in ee){let{width:te,height:ne,x:J,y:se,sdf:ye,pixelRatio:fe,stretchX:pe,stretchY:ge,content:Re,textFitWidth:Fe,textFitHeight:ve}=ee[X];W[$][X]={data:null,pixelRatio:fe,sdf:ye,stretchX:pe,stretchY:ge,content:Re,textFitWidth:Fe,textFitHeight:ve,spriteData:{width:te,height:ne,x:J,y:se,context:Y}}}}return W})}(C,D)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(m=>{if(this._spriteRequest=null,m)for(let _ in m){this._spritesImagesIds[_]=[];let v=this._spritesImagesIds[_]?this._spritesImagesIds[_].filter(T=>!(T in m)):[];for(let T of v)this.imageManager.removeImage(T),this._changedImages[T]=!0;for(let T in m[_]){let P=_==="default"?T:`${_}:${T}`;this._spritesImagesIds[_].push(P),P in this.imageManager.images?this.imageManager.updateImage(P,m[_][T],!1):this.imageManager.addImage(P,m[_][T]),n&&(this._changedImages[P]=!0)}}}).catch(m=>{this._spriteRequest=null,p=m,c.signal.aborted||this.fire(new l.k(p))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new l.l("data",{dataType:"style"})),o&&o(p)})}_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 l.l("data",{dataType:"style"}))}_validateLayer(t){let n=this.tileManagers[t.source];if(!n)return;let o=t.sourceLayer;if(!o)return;let c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(o)===-1)&&this.fire(new l.k(new Error(`Source layer "${o}" does not exist on source "${c.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 o=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n?l.bV(o):o);let c=[];
804for(let p of t)if(o[p]){let m=n?l.bV(o[p]):o[p];c.push(m)}return c}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let n=Object.keys(this._layers);for(let o of n){let c=this._layers[o];c.type!=="custom"&&(t[o]=c.serialize())}return t}hasTransitions(){var t,n,o;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((n=this.sky)===null||n===void 0)&&n.hasTransition()||!((o=this.projection)===null||o===void 0)&&o.hasTransition())return!0;for(let c in this.tileManagers)if(this.tileManagers[c].hasTransition())return!0;for(let c in this._layers)if(this._layers[c].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 c=Object.keys(this._updatedLayers),p=Object.keys(this._removedLayers);(c.length||p.length)&&this._updateWorkerLayers(c,p);for(let m in this._updatedSources){let _=this._updatedSources[m];if(_==="reload")this._reloadSource(m);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let o={};for(let c in this.tileManagers){let p=this.tileManagers[c];o[c]=p.used,p.used=!1}for(let c of this._order){let p=this._layers[c];p.recalculate(t,this._availableImages),!p.isHidden(t.zoom)&&p.source&&(this.tileManagers[p.source].used=!0)}for(let c in o){let p=this.tileManagers[c];!!o[c]!=!!p.used&&p.fire(new l.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,n&&this.fire(new l.l("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 o;this._checkLoaded();let c=this.serialize();if(t=n.transformStyle?n.transformStyle(c,t):t,((o=n.validate)===null||o===void 0||o)&&kn(this,l.C(t)))return!1;(t=l.bV(t)).layers=l.bS(t.layers);let p=l.bW(c,t),m=this._getOperationsToPerform(p);if(m.unimplemented.length>0)throw new Error(`Unimplemented: ${m.unimplemented.join(", ")}.`);if(m.operations.length===0)return!1;for(let _ of m.operations)_();return this.stylesheet=t,this._serializedLayers=null,this.fire(new l.l("style.load",{style:this})),!0}_getOperationsToPerform(t){let n=[],o=[];for(let c of t)switch(c.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,c.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,c.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,c.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,c.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,c.args));break;case"addSource":n.push(()=>this.addSource.apply(this,c.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,c.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,c.args));break;case"setLight":n.push(()=>this.setLight.apply(this,c.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,c.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,c.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,c.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,c.args));break;case"setSky":n.push(()=>this.setSky.apply(this,c.args));break;case"setProjection":this.setProjection.apply(this,c.args);break;case"setGlobalState":n.push(()=>this.setGlobalState.apply(this,c.args));break;case"setTransition":n.push(()=>{});break;default:o.push(c.command)}return{operations:n,unimplemented:o}}addImage(t,n){if(this.getImage(t))return this.fire(new l.k(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 l.k(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 l.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,o={}){if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);
804if(!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"].indexOf(n.type)>=0&&this._validate(l.C.source,`sources.${t}`,n,null,o))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);let c=this.tileManagers[t]=new Ae(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t})),c.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 o in this._layers)if(this._layers[o].source===t)return this.fire(new l.k(new Error(`Source "${t}" cannot be removed while layer "${o}" is using it.`)));let n=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],n.fire(new l.l("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 o=this.tileManagers[t].getSource();if(o.type!=="geojson")throw new Error(`geojsonSource.type is ${o.type}, which is !== 'geojson`);o.setData(n),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,n,o={}){this._checkLoaded();let c=t.id;if(this.getLayer(c))return void this.fire(new l.k(new Error(`Layer "${c}" already exists on this map.`)));let p;if(t.type==="custom"){if(kn(this,l.bX(t)))return;p=l.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=l.bV(t),t=l.e(t,{source:c})),this._validate(l.C.layer,`layers.${c}`,t,{arrayIndex:-1},o))return;p=l.bT(t,this._globalState),this._validateLayer(p),p.setEventedParent(this,{layer:{id:c}})}let m=n?this._order.indexOf(n):this._order.length;if(n&&m===-1)this.fire(new l.k(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(m,0,c),this._layerOrderChanged=!0,this._layers[c]=p,this._removedLayers[c]&&p.source&&p.type!=="custom"){let _=this._removedLayers[c];delete this._removedLayers[c],_.type!==p.type?this._updatedSources[p.source]="clear":(this._updatedSources[p.source]="reload",this.tileManagers[p.source].pause())}this._updateLayer(p),p.onAdd&&p.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new l.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;let o=this._order.indexOf(t);this._order.splice(o,1);let c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new l.k(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let n=this._layers[t];if(!n)return void this.fire(new l.k(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);let o=this._order.indexOf(t);this._order.splice(o,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,o){this._checkLoaded();let c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===o||(n!=null&&(c.minzoom=n),o!=null&&(c.maxzoom=o),this._updateLayer(c)):this.fire(new l.k(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,o={}){this._checkLoaded();let c=this.getLayer(t);if(c){if(!l.bR(c.filter,n))return n==null?(c.setFilter(void 0),void this._updateLayer(c)):void(this._validate(l.C.filter,`layers.${c.id}.filter`,n,null,o)||(c.setFilter(l.bV(n)),this._updateLayer(c)))}else this.fire(new l.k(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return l.bV(this.getLayer(t).filter)}setLayoutProperty(t,n,o,c={}){this._checkLoaded();let p=this.getLayer(t);p?l.bR(p.getLayoutProperty(n),o)||(p.setLayoutProperty(n,o,c),this._updateLayer(p)):this.fire(new l.k(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){let o=this.getLayer(t);if(o)return o.getLayoutProperty(n);this.fire(new l.k(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,o,c={}){this._checkLoaded();let p=this.getLayer(t);p?l.bR(p.getPaintProperty(n),o)||this._updatePaintProperty(p,n,o,c):this.fire(new l.k(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,n,o,c={}){t.setPaintProperty(n,o,c)&&this._updateLayer(t),l.bU(t)&&n==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(o),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 o=t.source,c=t.sourceLayer,p=this.tileManagers[o];if(p===void 0)return void this.fire(new l.k(new Error(`The source '${o}' does not exist in the map's style.`)));let m=p.getSource().type;m==="geojson"&&c?this.fire(new l.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||c?(t.id===void 0&&this.fire(new l.k(new Error("The feature id parameter must be provided."))),p.setFeatureState(c,t.id,n)):this.fire(new l.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();let o=t.source,c=this.tileManagers[o];if(c===void 0)return void this.fire(new l.k(new Error(`The source '${o}' does not exist in the map's style.`)));let p=c.getSource().type,m=p==="vector"?t.sourceLayer:void 0;p!=="vector"||m?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new l.k(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(m,t.id,n):this.fire(new l.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let n=t.source,o=t.sourceLayer,c=this.tileManagers[n];if(c!==void 0)return c.getSource().type!=="vector"||o?(t.id===void 0&&this.fire(new l.k(new Error("The feature id parameter must be provided."))),c.getFeatureState(
804o,t.id)):void this.fire(new l.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.k(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return l.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=l.bY(this.tileManagers,p=>p.serialize()),n=this._serializeByIds(this._order,!0),o=this.map.getTerrain()||void 0,c=this.stylesheet;return l.bZ({version:c.version,name:c.name,metadata:c.metadata,light:c.light,sky:c.sky,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,projection:c.projection,sources:t,layers:n,terrain:o},p=>p!==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=m=>this._layers[m].type==="fill-extrusion",o={},c=[];for(let m=this._order.length-1;m>=0;m--){let _=this._order[m];if(n(_)){o[_]=m;for(let v of t){let T=v[_];if(T)for(let P of T)c.push(P)}}}c.sort((m,_)=>_.intersectionZ-m.intersectionZ);let p=[];for(let m=this._order.length-1;m>=0;m--){let _=this._order[m];if(n(_))for(let v=c.length-1;v>=0;v--){let T=c[v].feature;if(o[T.layer.id]<m)break;p.push(T),c.pop()}else for(let v of t){let T=v[_];if(T)for(let P of T)p.push(P.feature)}}return p}queryRenderedFeatures(t,n,o){n&&n.filter&&this._validate(l.C.filter,"queryRenderedFeatures.filter",n.filter,null,n);let c={};if(n&&n.layers){if(!(Array.isArray(n.layers)||n.layers instanceof Set))return this.fire(new l.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(let T of n.layers){let P=this._layers[T];if(!P)return this.fire(new l.k(new Error(`The layer '${T}' does not exist in the map's style and cannot be queried for features.`))),[];c[P.source]=!0}}let p=[];n.availableImages=this._availableImages;let m=this._serializedAllLayers(),_=n.layers instanceof Set?n.layers:Array.isArray(n.layers)?new Set(n.layers):null,v=Object.assign(Object.assign({},n),{layers:_,globalState:this._globalState});for(let T in this.tileManagers)n.layers&&!c[T]||p.push(hs(this.tileManagers[T],this._layers,m,t,v,o,this.map.terrain?(P,E,C)=>this.map.terrain.getElevation(P,E,C):void 0));return this.placement&&p.push(function(T,P,E,C,D,B,q){let W={},$=B.queryRenderedSymbols(C),Y=[];for(let ee of Object.keys($).map(Number))Y.push(q[ee]);Y.sort(ki);for(let ee of Y){let X=ee.featureIndex.lookupSymbolFeatures($[ee.bucketInstanceId],P,ee.bucketIndex,ee.sourceLayerIndex,{filterSpec:D.filter,globalState:D.globalState},D.layers,D.availableImages,T);for(let te in X){let ne=W[te]=W[te]||[],J=X[te];J.sort((se,ye)=>{let fe=ee.featureSortOrder;if(fe){let pe=fe.indexOf(se.featureIndex);return fe.indexOf(ye.featureIndex)-pe}return ye.featureIndex-se.featureIndex});for(let se of J)ne.push(se)}}return function(ee,X,te){for(let ne in ee)for(let J of ee[ne])tr(J,te[X[ne].source]);return ee}(W,T,E)}(this._layers,m,this.tileManagers,t,v,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(p)}querySourceFeatures(t,n){n!=null&&n.filter&&this._validate(l.C.filter,"querySourceFeatures.filter",n.filter,null,n);let o=this.tileManagers[t];return o?function(c,p){let m=c.getRenderableIds().map(T=>c.getTileByID(T)),_=[],v={};for(let T=0;T<m.length;T++){let P=m[T],E=P.tileID.canonical.key;v[E]||(v[E]=!0,P.querySourceFeatures(_,p))}return _}(o,n?Object.assign(Object.assign({},n),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();let o=this.light.getLight(),c=!1;for(let m in t)if(!l.bR(t[m],o[m])){c=!0;break}if(!c)return;let p={now:Ge(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(p)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.stylesheet.projection=t,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,n={}){this._checkLoaded();let o=this.getSky(),c=!1;if(!t&&!o)return;if(t&&!o)c=!0;else if(!t&&o)c=!0;else for(let m in t)if(!l.bR(t[m],o[m])){c=!0;break}if(!c)return;let p={now:Ge(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,n),this.sky.updateTransitions(p)}_setProjectionInternal(t){let n=function(o,c){let p={constrainOverride:c};if(Array.isArray(o)){let m=new ji({type:o});return{projection:m,transform:new ar(p),cameraHelper:new Ss(m)}}switch(o){case"mercator":return{projection:new gs,transform:new nr(p),cameraHelper:new ea};case"globe":{let m=new ji({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:m,transform:new ar(p),cameraHelper:new Ss(m)}}case"vertical-perspective":return{projection:new kh,transform:new Ba(p),cameraHelper:new Er};default:return l.w(`Unknown projection name: ${o}. Falling back to mercator projection.`),{projection:new gs,transform:new nr(p),cameraHelper:new ea}}}(t,this.map.transformConstrain);this.projection=n.projection,this.map.migrateProjection(n.transform,n.cameraHelper);for(let o in this.tileManagers)this.tileManagers[o].reload()}_validate(t,n,o,c,p={}){return(!p||p.validate!==!1)&&kn(this,t.call(l.C,l.e({key:n,style:this.serialize(),value:o,styleSpec:l.u},c)))}_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),j().off(le,this._rtlPluginLoaded);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.tileManagers){let o=this.tileManagers[n];o.setEventedParent(null),o.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,o,c,p=!1){let m=!1,_=!1,v={};for(let T of this._order){let P=this._layers[T];if(P.type!=="symbol")continue;if(!v[P.source]){let C=this.tileManagers[P.source];v[P.source]=C.getRenderableIds(!0).map(D=>C.getTileByID(D)).sort((D,B)=>B.tileID.overscaledZ-D.tileID.overscaledZ||(D.tileID.isLessThan(B.tileID)?-1:1))}let E=this.crossTileSymbolIndex.addLayer(P,v[P.source],t.center.lng);m=m||E}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((p=p||this._layerOrderChanged||o===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Ge(),t.zoom))&&(this.pauseablePlacement=new mt(t,this.map.terrain,this._order,p,n,o,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Ge()),_=!0),m&&this.pauseablePlacement.placement.setStale()),_||m)for(let T of this._order){let P=this._layers[T];P.type==="symbol"&&this.placement.updateLayerOpacities(P,v[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Ge())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,n){return l._(this,void 0,void 0,function*(){let o=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();let c=this.tileManagers[n.source];return c&&c.setDependencies(n.tileID.key,n.type,n.icons),o})}getGlyphs(t,n){return l._(this,void 0,void 0,function*(){let o=yield this.glyphManager.getGlyphs(n.stacks),c=this.tileManagers[n.source];return c&&c.setDependencies(n.tileID.key,n.type,[""]),o})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}
vendor: 21,955 bytes, lines 804-806
804){this._checkLoaded(),t&&this._validate(l.C.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,n){return l._(this,void 0,void 0,function*(){let o={};for(let[c,p]of Object.entries(n.dashes))o[c]=this.lineAtlas.getDash(p.dasharray,p.round);return o})}addSprite(t,n,o={},c){this._checkLoaded();let p=[{id:t,url:n}],m=[...Lr(this.stylesheet.sprite),...p];this._validate(l.C.sprite,"sprite",m,null,o)||(this.stylesheet.sprite=m,this._loadSprite(p,!0,c))}removeSprite(t){this._checkLoaded();let n=Lr(this.stylesheet.sprite);if(n.find(o=>o.id===t)){if(this._spritesImagesIds[t])for(let o of this._spritesImagesIds[t])this.imageManager.removeImage(o),this._changedImages[o]=!0;n.splice(n.findIndex(o=>o.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 l.l("data",{dataType:"style"}))}else this.fire(new l.k(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Lr(this.stylesheet.sprite)}setSprite(t,n={},o){this._checkLoaded(),t&&this._validate(l.C.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,o):(this._unloadSprite(),o&&o(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 Ts=l.aU([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Sd{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,o,c,p,m,_,v,T){this.context=t;let P=this.boundPaintVertexBuffers.length!==c.length;for(let E=0;!P&&E<c.length;E++)this.boundPaintVertexBuffers[E]!==c[E]&&(P=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==o||P||this.boundIndexBuffer!==p||this.boundVertexOffset!==m||this.boundDynamicVertexBuffer!==_||this.boundDynamicVertexBuffer2!==v||this.boundDynamicVertexBuffer3!==T?this.freshBind(n,o,c,p,m,_,v,T):(t.bindVertexArray.set(this.vao),_&&_.bind(),p&&p.dynamicDraw&&p.bind(),v&&v.bind(),T&&T.bind())}freshBind(t,n,o,c,p,m,_,v){let T=t.numAttributes,P=this.context,E=P.gl;this.vao&&this.destroy(),this.vao=P.createVertexArray(),P.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=o,this.boundIndexBuffer=c,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=m,this.boundDynamicVertexBuffer2=_,this.boundDynamicVertexBuffer3=v,n.enableAttributes(E,t);for(let C of o)C.enableAttributes(E,t);m&&m.enableAttributes(E,t),_&&_.enableAttributes(E,t),v&&v.enableAttributes(E,t),n.bind(),n.setVertexAttribPointers(E,t,p);for(let C of o)C.bind(),C.setVertexAttribPointers(E,t,p);m&&(m.bind(),m.setVertexAttribPointers(E,t,p)),c&&c.bind(),_&&(_.bind(),_.setVertexAttribPointers(E,t,p)),v&&(v.bind(),v.setVertexAttribPointers(E,t,p)),P.currentNumAttributes=T}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let ja=(d,t,n,o,c)=>({u_texture:0,u_ele_delta:d,u_fog_matrix:t,u_fog_color:n?n.properties.get("fog-color"):l.bp.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:c?0:n?n.calculateFogBlendOpacity(o):0,u_horizon_color:n?n.properties.get("horizon-color"):l.bp.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1,u_is_globe_mode:c?1:0}),Td={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 So(d){let t=[];for(let n=0;n<d.length;n++){if(d[n]===null)continue;let o=d[n].split(" ");t.push(o.pop())}return t}class Pd{constructor(t,n,o,c,p,m,_,v,T=[]){let P=t.gl;this.program=P.createProgram();let E=So(n.staticAttributes),C=o?o.getBinderAttributes():[],D=E.concat(C),B=Ft.prelude.staticUniforms?So(Ft.prelude.staticUniforms):[],q=_.staticUniforms?So(_.staticUniforms):[],W=n.staticUniforms?So(n.staticUniforms):[],$=o?o.getBinderUniforms():[],Y=B.concat(q).concat(W).concat($),ee=[];for(let fe of Y)ee.indexOf(fe)<0&&ee.push(fe);let X=o?o.defines():[];vr(P)&&X.unshift("#version 300 es"),p&&X.push("#define OVERDRAW_INSPECTOR;"),m&&X.push("#define TERRAIN3D;"),v&&X.push(v),T&&X.push(...T);let te=X.concat(Ft.prelude.fragmentSource,_.fragmentSource,n.fragmentSource).join(` 805`),ne=X.concat(Ft.prelude.vertexSource,_.vertexSource,n.vertexSource).join(` 806`);vr(P)||(te=function(fe){return fe.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(te),ne=function(fe){return fe.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(ne));let J=P.createShader(P.FRAGMENT_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(J,te),P.compileShader(J),!P.getShaderParameter(J,P.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${P.getShaderInfoLog(J)}`);P.attachShader(this.program,J);let se=P.createShader(P.VERTEX_SHADER);if(P.isContextLost())return void(this.failedToCreate=!0);if(P.shaderSource(se,ne),P.compileShader(se),!P.getShaderParameter(se,P.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${P.getShaderInfoLog(se)}`);P.attachShader(this.program,se),this.attributes={};let ye={};this.numAttributes=D.length;for(let fe=0;fe<this.numAttributes;fe++)D[fe]&&(P.bindAttribLocation(this.program,fe,D[fe]),this.attributes[D[fe]]=fe);if(P.linkProgram(this.program),!P.getProgramParameter(this.program,P.LINK_STATUS))throw new Error(`Program failed to link: ${P.getProgramInfoLog(this.program)}`);P.deleteShader(se),P.deleteShader(J);for(let fe=0;fe<ee.length;fe++){let pe=ee[fe];if(pe&&!ye[pe]){let ge=P.getUniformLocation(this.program,pe);ge&&(ye[pe]=ge)}}this.fixedUniforms=c(t,ye),this.terrainUniforms=((fe,pe)=>({u_depth:new l.b_(fe,pe.u_depth),u_terrain:new l.b_(fe,pe.u_terrain),u_terrain_dim:new l.bq(fe,pe.u_terrain_dim),u_terrain_matrix:new l.c0(fe,pe.u_terrain_matrix),u_terrain_unpack:new l.c1(fe,pe.u_terrain_unpack),u_terrain_exaggeration:new l.bq(fe,pe.u_terrain_exaggeration)}))(t,ye),this.projectionUniforms=((fe,pe)=>({u_projection_matrix:new l.c0(fe,pe.u_projection_matrix),u_projection_tile_mercator_coords:new l.c1(fe,pe.u_projection_tile_mercator_coords),u_projection_clipping_plane:new l.c1(fe,pe.u_projection_clipping_plane),u_projection_transition:new l.bq(fe,pe.u_projection_transition),u_projection_fallback_matrix:new l.c0(fe,pe.u_projection_fallback_matrix)}))(t,ye),this.binderUniforms=o?o.getUniforms(t,ye):[]}draw(t,n,o,c,p,m,_,v,T,P,E,C,D,B,q,W,$,Y,ee){let X=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(o),t.setStencilMode(c),t.setColorMode(p),t.setCullFace(m),v){t.activeTexture.set(X.TEXTURE2),X.bindTexture(X.TEXTURE_2D,v.depthTexture),t.activeTexture.set(X.TEXTURE3),X.bindTexture(X.TEXTURE_2D,v.texture);for(let ne in this.terrainUniforms)this.terrainUniforms[ne].set(v[ne])}if(T)for(let ne in T)this.projectionUniforms[Td[ne]].set(T[ne]);if(_)for(let ne in this.fixedUniforms)this.fixedUniforms[ne].set(_[ne]);W&&W.setUniforms(t,this.binderUniforms,B,{zoom:q});let te=0;switch(n){case X.LINES:te=2;break;case X.TRIANGLES:te=3;break;case X.LINE_STRIP:te=1}for(let ne of D.get()){let J=ne.vaos||(ne.vaos={});(J[P]||(J[P]=new Sd)).bind(t,this,E,W?W.getPaintVertexBuffers():[],C,ne.vertexOffset,$,Y,ee),X.drawElements(n,ne.primitiveLength*te,X.UNSIGNED_SHORT,ne.primitiveOffset*te*2)}}}function Rl(d,t,n){let o=1/l.aN(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),p=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,m=p*(n.tileID.canonical.x+n.tileID.wrap*c),_=p*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[o,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[m>>16,_>>16],u_pixel_coord_lower:[65535&m,65535&_]}}let Ps=(d,t,n,o)=>{let c=d.style.light,p=c.properties.get("position"),m=[p.x,p.y,p.z],_=l.c4();c.properties.get("anchor")==="viewport"&&l.c5(_,d.transform.bearingInRadians),l.c6(m,m,_);let v=d.transform.transformLightDirection(m),T=c.properties.get("color");return{u_lightpos:m,u_lightpos_globe:v,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+t,u_opacity:n,u_fill_translate:o}},Dh=(d,t,n,o,c,p,m)=>l.e(Ps(d,t,n,o),Rl(p,d,m),{u_height_factor:-Math.pow(2,c.overscaledZ)/m.tileSize/8}),Fl=(d,t,n,o)=>l.e(Rl(t,d,n),{u_fill_translate:o}),Rh=(d,t)=>({u_world:d,u_fill_translate:t}),Fh=(d,t,n,o,c)=>l.e(Fl(d,t,n,c),{u_world:o}),ra=(d,t,n,o,c)=>{let p=d.transform,m,_,v=0;if(n.paint.get("circle-pitch-alignment")==="map"){let T=l.aN(t,1,p.zoom);m=!0,_=[T,T],v=T/(l.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*c}else m=!1,_=p.pixelsToGLUnits;return{u_camera_to_center_distance:p.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+m,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:_,u_globe_extrude_scale:v,u_translate:o}},Oh=d=>({u_pixel_extrude_scale:[1/d.width,1/d.height]}),Bh=d=>({u_viewport_size:[d.width,d.height]}),Va=(d,t=1)=>({u_color:d,u_overlay:0,u_overlay_scale:t}),jh=(d,t,n,o)=>{let c=l.aN(d,1,t)/(l.a5*Math.pow(2,d.tileID.overscaledZ))*2*Math.PI*o;return{u_extrude_scale:l.aN(d,1,t),u_intensity:n,u_globe_extrude_scale:c}},To=(d,t,n,o)=>{let c=l.N();l.c7(c,0,d.width,d.height,0,0,1);let p=d.context.gl;return{u_matrix:c,u_world:[p.drawingBufferWidth,p.drawingBufferHeight],u_image:n,u_color_ramp:o,u_opacity:t.paint.get("heatmap-opacity")}},Id=(d,t,n)=>{let o=n.paint.get("hillshade-accent-color"),c;switch(n.paint.get("hillshade-method")){case"basic":c=4;break;case"combined":c=1;break;case"igor":c=2;break;case"multidirectional":c=3;break;default:c=0}let p=n.getIlluminationProperties();for(let m=0;m<p.directionRadians.length;m++)n.paint.get("hillshade-illumination-anchor")==="viewport"&&(p.directionRadians[m]+=d.transform.bearingInRadians);return{u_image:0,u_latrange:Vh(0,t.tileID),u_exaggeration:n.paint.get("hillshade-exaggeration"),u_altitudes:p.altitudeRadians,u_azimuths:p.directionRadians,u_accent:o,u_method:c,u_highlights:p.highlightColor,u_shadows:p.shadowColor}},Md=(d,t)=>{let n=t.stride,o=l.N();return l.c7(o,0,l.a5,-l.a5,0,0,1),l.O(o,o,[0,-l.a5,0]),{u_matrix:o,u_image:1,u_dimension:[n,n],u_zoom:d.overscaledZ,u_unpack:t.getUnpackVector()}};function Vh(d,t){let n=Math.pow(2,t.canonical.z),o=t.canonical.y;return[new l.a9(0,o/n).toLngLat().lat,new l.a9(0,(o+1)/n).toLngLat().lat]}let Nh=(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")}),Po=(d,t,n,o)=>{let c=d.transform;return{u_translation:Ms(d,t,n),u_ratio:o/l.aN(t,1,c.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Ol=(d,t,n,o,c)=>l.e(Po(d,t,n,o),{u_image:0,u_image_height:c}),Uh=(d,t,n,o,c)=>{let p=d.transform,m=Io(t,p);return{u_translation:Ms(d,t,n),u_texsize:t.imageAtlasTexture.size,u_ratio:o/l.aN(t,1,p.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[m,c.fromScale,c.toScale],u_fade:c.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Is=(d,t,n,o,c)=>{let p=Io(t,d.transform);return l.e(Po(d,t,n,o),{u_tileratio:p,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image:0,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})},sn=(d,t,n,o,c,p)=>{let m=Io(t,d.transform);return l.e(Po(d,t,n,o),{u_image:0,u_image_height:p,u_tileratio:m,u_crossfade_from:c.fromScale,u_crossfade_to:c.toScale,u_image_dash:1,u_mix:c.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})};function Io(d,t){return 1/l.aN(d,1,t.tileZoom)}function Ms(d,t,n){return l.aO(d.transform,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let Bl=(d,t,n,o,c)=>{return{u_tl_parent:d,u_scale_parent:t,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(m=o.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(p=o.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:Gh(o.paint.get("raster-hue-rotate")),u_coords_top:[c[0].x,c[0].y,c[1].x,c[1].y],u_coords_bottom:[c[3].x,c[3].y,c[2].x,c[2].y]};var p,m};function Gh(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 Ls=(d,t,n,o,c,p,m,_,v,T,P,E,C)=>{let D=m.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:D.cameraToCenterDistance,u_pitch:D.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:D.width/D.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_label_plane_matrix:_,u_coord_matrix:v,u_is_text:+P,u_pitch_with_map:+o,u_is_along_line:c,u_is_variable_anchor:p,u_texsize:E,u_texture:0,u_translation:T,u_pitched_scale:C}},zn=(d,t,n,o,c,p,m,_,v,T,P,E,C,D)=>{let B=m.transform;return l.e(Ls(d,t,n,o,c,p,m,_,v,T,P,E,D),{u_gamma_scale:o?Math.cos(B.pitch*Math.PI/180)*B.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:1})},jl=(d,t,n,o,c,p,m,_,v,T,P,E,C)=>l.e(zn(d,t,n,o,c,p,m,_,v,T,!0,P,0,C),{u_texsize_icon:E,u_texture_icon:1}),Ld=(d,t)=>({u_opacity:d,u_color:t}),Cd=(d,t,n,o,c)=>l.e(function(p,m,_,v){let T=_.imageManager.getPattern(p.from.toString()),P=_.imageManager.getPattern(p.to.toString()),{width:E,height:C}=_.imageManager.getPixelSize(),D=Math.pow(2,v.tileID.overscaledZ),B=v.tileSize*Math.pow(2,_.transform.tileZoom)/D,q=B*(v.tileID.canonical.x+v.tileID.wrap*D),W=B*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:P.tl,u_pattern_br_b:P.br,u_texsize:[E,C],u_mix:m.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:P.displaySize,u_scale_a:m.fromScale,u_scale_b:m.toScale,u_tile_units_to_pixels:1/l.aN(v,1,_.transform.tileZoom),u_pixel_coord_upper:[q>>16,W>>16],u_pixel_coord_lower:[65535&q,65535&W]}}(n,c,t,o),{u_opacity:d}),Zh=(d,t)=>{},Ed={fillExtrusion:(d,t)=>({u_lightpos:new l.c2(d,t.u_lightpos),u_lightpos_globe:new l.c2(d,t.u_lightpos_globe),u_lightintensity:new l.bq(d,t.u_lightintensity),u_lightcolor:new l.c2(d,t.u_lightcolor),u_vertical_gradient:new l.bq(d,t.u_vertical_gradient),u_opacity:new l.bq(d,t.u_opacity),u_fill_translate:new l.c3(d,t.u_fill_translate)}),fillExtrusionPattern:(d,t)=>({u_lightpos:new l.c2(d,t.u_lightpos),u_lightpos_globe:new l.c2(d,t.u_lightpos_globe),u_lightintensity:new l.bq(d,t.u_lightintensity),u_lightcolor:new l.c2(d,t.u_lightcolor),u_vertical_gradient:new l.bq(d,t.u_vertical_gradient),u_height_factor:new l.bq(d,t.u_height_factor),u_opacity:new l.bq(d,t.u_opacity),u_fill_translate:new l.c3(d,t.u_fill_translate),u_image:new l.b_(d,t.u_image),u_texsize:new l.c3(d,t.u_texsize),u_pixel_coord_upper:new l.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.c3(d,t.u_pixel_coord_lower),u_scale:new l.c2(d,t.u_scale),u_fade:new l.bq(d,t.u_fade)}),fill:(d,t)=>({u_fill_translate:new l.c3(d,t.u_fill_translate)}),fillPattern:(d,t)=>({u_image:new l.b_(d,t.u_image),u_texsize:new l.c3(d,t.u_texsize),u_pixel_coord_upper:new l.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.c3(d,t.u_pixel_coord_lower),u_scale:new l.c2(d,t.u_scale),u_fade:new l.bq(d,t.u_fade),u_fill_translate:new l.c3(d,t.u_fill_translate)}),fillOutline:(d,t)=>({u_world:new l.c3(d,t.u_world),u_fill_translate:new l.c3(d,t.u_fill_translate)}),fillOutlinePattern:(d,t)=>({u_world:new l.c3(d,t.u_world),u_image:new l.b_(d,t.u_image),u_texsize:new l.c3(d,t.u_texsize),u_pixel_coord_upper:new l.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.c3(d,t.u_pixel_coord_lower),u_scale:new l.c2(d,t.u_scale),u_fade:new l.bq(d,t.u_fade),u_fill_translate:new l.c3(d,t.u_fill_translate)}),circle:(d,t)=>({u_camera_to_center_distance:new l.bq(d,t.u_camera_to_center_distance),u_scale_with_map:new l.b_(d,t.u_scale_with_map),u_pitch_with_map:new l.b_(d,t.u_pitch_with_map),u_extrude_scale:new l.c3(d,t.u_extrude_scale),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_globe_extrude_scale:new l.bq(d,t.u_globe_extrude_scale),u_translate:new l.c3(d,t.u_translate)}),collisionBox:(d,t)=>({u_pixel_extrude_scale:new l.c3(d,t.u_pixel_extrude_scale)}),collisionCircle:(d,t)=>({u_viewport_size:new l.c3(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new l.b$(d,t.u_color),u_overlay:new l.b_(d,t.u_overlay),u_overlay_scale:new l.bq(d,t.u_overlay_scale)}),depth:Zh,clippingMask:Zh,heatmap:(d,t)=>({u_extrude_scale:new l.bq(d,t.u_extrude_scale),u_intensity:new l.bq(d,t.u_intensity),u_globe_extrude_scale:new l.bq(d,t.u_globe_extrude_scale)}),heatmapTexture:(d,t)=>({u_matrix:new l.c0(d,t.u_matrix),u_world:new l.c3(d,t.u_world),u_image:new l.b_(d,t.u_image),u_color_ramp:new l.b_(d,t.u_color_ramp),u_opacity:new l.bq(d,t.u_opacity)}),hillshade:(d,t)=>({u_image:new l.b_(d,t.u_image),u_latrange:new l.c3(d,t.u_latrange),u_exaggeration:new l.bq(d,t.u_exaggeration),u_altitudes:new l.c9(d,t.u_altitudes),u_azimuths:new l.c9(d,t.u_azimuths),u_accent:new l.b$(d,t.u_accent),u_method:new l.b_(d,t.u_method),u_shadows:new l.c8(d,t.u_shadows),u_highlights:new l.c8(d,t.u_highlights)}),hillshadePrepare:(d,t)=>({u_matrix:new l.c0(d,t.u_matrix),u_image:new l.b_(d,t.u_image),u_dimension:new l.c3(d,t.u_dimension),u_zoom:new l.bq(d,t.u_zoom),u_unpack:new l.c1(d,t.u_unpack)}),colorRelief:(d,t)=>({u_image:new l.b_(d,t.u_image),u_unpack:new l.c1(d,t.u_unpack),u_dimension:new l.c3(d,t.u_dimension),u_elevation_stops:new l.b_(d,t.u_elevation_stops),u_color_stops:new l.b_(d,t.u_color_stops),u_color_ramp_size:new l.b_(d,t.u_color_ramp_size),u_opacity:new l.bq(d,t.u_opacity)}),line:(d,t)=>({u_translation:new l.c3(d,t.u_translation),u_ratio:new l.bq(d,t.u_ratio),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.c3(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_translation:new l.c3(d,t.u_translation),u_ratio:new l.bq(d,t.u_ratio),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.c3(d,t.u_units_to_pixels),u_image:new l.b_(d,t.u_image),u_image_height:new l.bq(d,t.u_image_height)}),linePattern:(d,t)=>({u_translation:new l.c3(d,t.u_translation),u_texsize:new l.c3(d,t.u_texsize),u_ratio:new l.bq(d,t.u_ratio),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_image:new l.b_(d,t.u_image),u_units_to_pixels:new l.c3(d,t.u_units_to_pixels),u_scale:new l.c2(d,t.u_scale),u_fade:new l.bq(d,t.u_fade)}),lineSDF:(d,t)=>({u_translation:new l.c3(d,t.u_translation),u_ratio:new l.bq(d,t.u_ratio),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.c3(d,t.u_units_to_pixels),u_image:new l.b_(d,t.u_image),u_mix:new l.bq(d,t.u_mix),u_tileratio:new l.bq(d,t.u_tileratio),u_crossfade_from:new l.bq(d,t.u_crossfade_from),u_crossfade_to:new l.bq(d,t.u_crossfade_to),u_lineatlas_width:new l.bq(d,t.u_lineatlas_width),u_lineatlas_height:new l.bq(d,t.u_lineatlas_height)}),lineGradientSDF:(d,t)=>({u_translation:new l.c3(d,t.u_translation),u_ratio:new l.bq(d,t.u_ratio),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.c3(d,t.u_units_to_pixels),u_image:new l.b_(d,t.u_image),u_image_height:new l.bq(d,t.u_image_height),u_tileratio:new l.bq(d,t.u_tileratio),u_crossfade_from:new l.bq(d,t.u_crossfade_from),u_crossfade_to:new l.bq(d,t.u_crossfade_to),u_image_dash:new l.b_(d,t.u_image_dash),u_mix:new l.bq(d,t.u_mix),u_lineatlas_width:new l.bq(d,t.u_lineatlas_width),u_lineatlas_height:new l.bq(d,t.u_lineatlas_height)}),raster:(d,t)=>({u_tl_parent:new l.c3(d,t.u_tl_parent),u_scale_parent:new l.bq(d,t.u_scale_parent),u_buffer_scale:new l.bq(d,t.u_buffer_scale),u_fade_t:new l.bq(d,t.u_fade_t),u_opacity:new l.bq(d,t.u_opacity),u_image0:new l.b_(d,t.u_image0),u_image1:new l.b_(d,t.u_image1),u_brightness_low:new l.bq(d,t.u_brightness_low),u_brightness_high:new l.bq(d,t.u_brightness_high),u_saturation_factor:new l.bq(d,t.u_saturation_factor),u_contrast_factor:new l.bq(d,t.u_contrast_factor),u_spin_weights:new l.c2(d,t.u_spin_weights),u_coords_top:new l.c1(d,t.u_coords_top),u_coords_bottom:new l.c1(d,t.u_coords_bottom)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new l.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.b_(d,t.u_is_size_feature_constant),u_size_t:new l.bq(d,t.u_size_t),u_size:new l.bq(d,t.u_size),u_camera_to_center_distance:new l.bq(d,t.u_camera_to_center_distance),u_pitch:new l.bq(d,t.u_pitch),u_rotate_symbol:new l.b_(d,t.u_rotate_symbol),u_aspect_ratio:new l.bq(d,t.u_aspect_ratio),u_fade_change:new l.bq(d,t.u_fade_change),u_label_plane_matrix:new l.c0(d,t.u_label_plane_matrix
806),u_coord_matrix:new l.c0(d,t.u_coord_matrix),u_is_text:new l.b_(d,t.u_is_text),u_pitch_with_map:new l.b_(d,t.u_pitch_with_map),u_is_along_line:new l.b_(d,t.u_is_along_line),u_is_variable_anchor:new l.b_(d,t.u_is_variable_anchor),u_texsize:new l.c3(d,t.u_texsize),u_texture:new l.b_(d,t.u_texture),u_translation:new l.c3(d,t.u_translation),u_pitched_scale:new l.bq(d,t.u_pitched_scale)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new l.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.b_(d,t.u_is_size_feature_constant),u_size_t:new l.bq(d,t.u_size_t),u_size:new l.bq(d,t.u_size),u_camera_to_center_distance:new l.bq(d,t.u_camera_to_center_distance),u_pitch:new l.bq(d,t.u_pitch),u_rotate_symbol:new l.b_(d,t.u_rotate_symbol),u_aspect_ratio:new l.bq(d,t.u_aspect_ratio),u_fade_change:new l.bq(d,t.u_fade_change),u_label_plane_matrix:new l.c0(d,t.u_label_plane_matrix),u_coord_matrix:new l.c0(d,t.u_coord_matrix),u_is_text:new l.b_(d,t.u_is_text),u_pitch_with_map:new l.b_(d,t.u_pitch_with_map),u_is_along_line:new l.b_(d,t.u_is_along_line),u_is_variable_anchor:new l.b_(d,t.u_is_variable_anchor),u_texsize:new l.c3(d,t.u_texsize),u_texture:new l.b_(d,t.u_texture),u_gamma_scale:new l.bq(d,t.u_gamma_scale),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_is_halo:new l.b_(d,t.u_is_halo),u_translation:new l.c3(d,t.u_translation),u_pitched_scale:new l.bq(d,t.u_pitched_scale)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new l.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.b_(d,t.u_is_size_feature_constant),u_size_t:new l.bq(d,t.u_size_t),u_size:new l.bq(d,t.u_size),u_camera_to_center_distance:new l.bq(d,t.u_camera_to_center_distance),u_pitch:new l.bq(d,t.u_pitch),u_rotate_symbol:new l.b_(d,t.u_rotate_symbol),u_aspect_ratio:new l.bq(d,t.u_aspect_ratio),u_fade_change:new l.bq(d,t.u_fade_change),u_label_plane_matrix:new l.c0(d,t.u_label_plane_matrix),u_coord_matrix:new l.c0(d,t.u_coord_matrix),u_is_text:new l.b_(d,t.u_is_text),u_pitch_with_map:new l.b_(d,t.u_pitch_with_map),u_is_along_line:new l.b_(d,t.u_is_along_line),u_is_variable_anchor:new l.b_(d,t.u_is_variable_anchor),u_texsize:new l.c3(d,t.u_texsize),u_texsize_icon:new l.c3(d,t.u_texsize_icon),u_texture:new l.b_(d,t.u_texture),u_texture_icon:new l.b_(d,t.u_texture_icon),u_gamma_scale:new l.bq(d,t.u_gamma_scale),u_device_pixel_ratio:new l.bq(d,t.u_device_pixel_ratio),u_is_halo:new l.b_(d,t.u_is_halo),u_translation:new l.c3(d,t.u_translation),u_pitched_scale:new l.bq(d,t.u_pitched_scale)}),background:(d,t)=>({u_opacity:new l.bq(d,t.u_opacity),u_color:new l.b$(d,t.u_color)}),backgroundPattern:(d,t)=>({u_opacity:new l.bq(d,t.u_opacity),u_image:new l.b_(d,t.u_image),u_pattern_tl_a:new l.c3(d,t.u_pattern_tl_a),u_pattern_br_a:new l.c3(d,t.u_pattern_br_a),u_pattern_tl_b:new l.c3(d,t.u_pattern_tl_b),u_pattern_br_b:new l.c3(d,t.u_pattern_br_b),u_texsize:new l.c3(d,t.u_texsize),u_mix:new l.bq(d,t.u_mix),u_pattern_size_a:new l.c3(d,t.u_pattern_size_a),u_pattern_size_b:new l.c3(d,t.u_pattern_size_b),u_scale_a:new l.bq(d,t.u_scale_a),u_scale_b:new l.bq(d,t.u_scale_b),u_pixel_coord_upper:new l.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.c3(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new l.bq(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_texture:new l.b_(d,t.u_texture),u_ele_delta:new l.bq(d,t.u_ele_delta),u_fog_matrix:new l.c0(d,t.u_fog_matrix),u_fog_color:new l.b$(d,t.u_fog_color),u_fog_ground_blend:new l.bq(d,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new l.bq(d,t.u_fog_ground_blend_opacity),u_horizon_color:new l.b$(d,t.u_horizon_color),u_horizon_fog_blend:new l.bq(d,t.u_horizon_fog_blend),u_is_globe_mode:new l.bq(d,t.u_is_globe_mode)}),terrainDepth:(d,t)=>({u_ele_delta:new l.bq(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_texture:new l.b_(d,t.u_texture),u_terrain_coords_id:new l.bq(d,t.u_terrain_coords_id),u_ele_delta:new l.bq(d,t.u_ele_delta)}),projectionErrorMeasurement:(d,t)=>({u_input:new l.bq(d,t.u_input),u_output_expected:new l.bq(d,t.u_output_expected)}),atmosphere:(d,t)=>({u_sun_pos:new l.c2(d,t.u_sun_pos),u_atmosphere_blend:new l.bq(d,t.u_atmosphere_blend),u_globe_position:new l.c2(d,t.u_globe_position),u_globe_radius:new l.bq(d,t.u_globe_radius),u_inv_proj_matrix:new l.c0(d,t.u_inv_proj_matrix)}),sky:(d,t)=>({u_sky_color:new l.b$(d,t.u_sky_color),u_horizon_color:new l.b$(d,t.u_horizon_color),u_horizon:new l.c3(d,t.u_horizon),u_horizon_normal:new l.c3(d,t.u_horizon_normal),u_sky_horizon_blend:new l.bq(d,t.u_sky_horizon_blend),u_sky_blend:new l.bq(d,t.u_sky_blend)})};class qh{constructor(t,n,o){this.context=t;let c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!o,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}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 kd={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class $h{constructor(t,n,o,c){this.length=n.length,this.attributes=o,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;let p=t.gl;this.buffer=p.createBuffer(),t.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}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)}
vendor: 7,140 bytes, line 806
806enableAttributes(t,n){for(let o=0;o<this.attributes.length;o++){let c=n.attributes[this.attributes[o].name];c!==void 0&&t.enableVertexAttribArray(c)}}setVertexAttribPointers(t,n,o){for(let c=0;c<this.attributes.length;c++){let p=this.attributes[c],m=n.attributes[p.name];m!==void 0&&t.vertexAttribPointer(m,p.components,t[kd[p.type]],!1,this.itemSize,p.offset+this.itemSize*(o||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class xt{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 Cs extends xt{getDefault(){return l.bp.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 Es extends xt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Vl extends xt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class na extends xt{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 Mo extends xt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Na extends xt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class br extends xt{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 Wh extends xt{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 Hh extends xt{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 Nl extends xt{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 aa extends xt{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 ks extends xt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class zs extends xt{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 Lo extends xt{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 As extends xt{getDefault(){return l.bp.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 Xh extends xt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Ua extends xt{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 Ga extends xt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Yh extends xt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Ul extends xt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class pt extends xt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Ds extends xt{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 zd extends xt{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 Kh extends xt{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 Co extends xt{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 Ad extends xt{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 Dd extends xt{getDefault(){return null}set(t){let n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Jh extends xt{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;let o=this.gl;vr(o)?o.bindVertexArray(t):(n=o.getExtension("OES_vertex_array_object"))===null||n===void 0||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Rd extends xt{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 Gl extends xt{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 Rs extends xt{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 oa extends xt{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class Fs extends oa{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 Zl extends oa{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 Qh extends oa{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 Eo="Framebuffer is not complete";class Os{constructor(t,n,o,c,p){this.context=t,this.width=n,this.height=o;let m=t.gl,_=this.framebuffer=m.createFramebuffer();
806if(this.colorAttachment=new Fs(t,_),c)this.depthAttachment=p?new Qh(t,_):new Zl(t,_);else if(p)throw new Error("Stencil cannot be set without depth");if(m.checkFramebufferStatus(m.FRAMEBUFFER)!==m.FRAMEBUFFER_COMPLETE)throw new Error(Eo)}destroy(){let t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){let o=this.depthAttachment.get();o&&t.deleteRenderbuffer(o)}t.deleteFramebuffer(this.framebuffer)}}class ko{constructor(t){var n,o;if(this.gl=t,this.clearColor=new Cs(this),this.clearDepth=new Es(this),this.clearStencil=new Vl(this),this.colorMask=new na(this),this.depthMask=new Mo(this),this.stencilMask=new Na(this),this.stencilFunc=new br(this),this.stencilOp=new Wh(this),this.stencilTest=new Hh(this),this.depthRange=new Nl(this),this.depthTest=new aa(this),this.depthFunc=new ks(this),this.blend=new zs(this),this.blendFunc=new Lo(this),this.blendColor=new As(this),this.blendEquation=new Xh(this),this.cullFace=new Ua(this),this.cullFaceSide=new Ga(this),this.frontFace=new Yh(this),this.program=new Ul(this),this.activeTexture=new pt(this),this.viewport=new Ds(this),this.bindFramebuffer=new zd(this),this.bindRenderbuffer=new Kh(this),this.bindTexture=new Co(this),this.bindVertexBuffer=new Ad(this),this.bindElementBuffer=new Dd(this),this.bindVertexArray=new Jh(this),this.pixelStoreUnpack=new Rd(this),this.pixelStoreUnpackPremultiplyAlpha=new Gl(this),this.pixelStoreUnpackFlipY=new Rs(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_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),vr(t)){this.HALF_FLOAT=t.HALF_FLOAT;let c=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(n=t.RGBA16F)!==null&&n!==void 0?n:c==null?void 0:c.RGBA16F_EXT,this.RGB16F=(o=t.RGB16F)!==null&&o!==void 0?o:c==null?void 0:c.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let c=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=c==null?void 0:c.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 qh(this,t,n)}createVertexBuffer(t,n,o){return new $h(this,t,n,o)}createRenderbuffer(t,n,o){let c=this.gl,p=c.createRenderbuffer();return this.bindRenderbuffer.set(p),c.renderbufferStorage(c.RENDERBUFFER,t,n,o),this.bindRenderbuffer.set(null),p}createFramebuffer(t,n,o,c){return new Os(this,t,n,o,c)}clear({color:t,depth:n,stencil:o}){let c=this.gl,p=0;t&&(p|=c.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=c.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),o!==void 0&&(p|=c.STENCIL_BUFFER_BIT,this.clearStencil.set(o),this.stencilMask.set(255)),c.clear(p)}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){l.bR(t.blendFunction,Ct.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 vr(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;return vr(this.gl)?this.gl.deleteVertexArray(t):(n=this.gl.getExtension("OES_vertex_array_object"))===null||n===void 0?void 0:n.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let ln;function Bs(d,t,n,o,c){let p=d.context,m=d.transform,_=p.gl,v=d.useProgram("collisionBox"),T=[],P=0,E=0;for(let $=0;$<o.length;$++){let Y=o[$],ee=t.getTile(Y).getBucket(n);if(!ee)continue;let X=c?ee.textCollisionBox:ee.iconCollisionBox,te=ee.collisionCircleArray;te.length>
vendor: 6,032 bytes, line 806
8060&&(T.push({circleArray:te,circleOffset:E,coord:Y}),P+=te.length/4,E=P),X&&v.draw(p,_.LINES,ct.disabled,_t.disabled,d.colorModeForRenderPass(),yt.disabled,Oh(d.transform),d.style.map.terrain&&d.style.map.terrain.getTerrainData(Y),m.getProjectionData({overscaledTileID:Y,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,null,d.transform.zoom,null,null,X.collisionVertexBuffer)}if(!c||!T.length)return;let C=d.useProgram("collisionCircle"),D=new l.ca;D.resize(4*P),D._trim();let B=0;for(let $ of T)for(let Y=0;Y<$.circleArray.length/4;Y++){let ee=4*Y,X=$.circleArray[ee+0],te=$.circleArray[ee+1],ne=$.circleArray[ee+2],J=$.circleArray[ee+3];D.emplace(B++,X,te,ne,J,0),D.emplace(B++,X,te,ne,J,1),D.emplace(B++,X,te,ne,J,2),D.emplace(B++,X,te,ne,J,3)}(!ln||ln.length<2*P)&&(ln=function($){let Y=2*$,ee=new l.cc;ee.resize(Y),ee._trim();for(let X=0;X<Y;X++){let te=6*X;ee.uint16[te+0]=4*X+0,ee.uint16[te+1]=4*X+1,ee.uint16[te+2]=4*X+2,ee.uint16[te+3]=4*X+2,ee.uint16[te+4]=4*X+3,ee.uint16[te+5]=4*X+0}return ee}(P));let q=p.createIndexBuffer(ln,!0),W=p.createVertexBuffer(D,l.cb.members,!0);for(let $ of T){let Y=Bh(d.transform);C.draw(p,_.TRIANGLES,ct.disabled,_t.disabled,d.colorModeForRenderPass(),yt.disabled,Y,d.style.map.terrain&&d.style.map.terrain.getTerrainData($.coord),null,n.id,W,q,l.aX.simpleSegment(0,2*$.circleOffset,$.circleArray.length,$.circleArray.length/2),null,d.transform.zoom,null,null,null)}W.destroy(),q.destroy()}let Fd=l.ar(new Float32Array(16));function zo(d,t,n,o,c,p){let{horizontalAlign:m,verticalAlign:_}=l.aS(d);return new l.P((-(m-.5)*t/c+o[0])*p,(-(_-.5)*n/c+o[1])*p)}function Od(d,t,n,o,c,p){let m=t.tileAnchorPoint.add(new l.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let _=o.mult(p);n||(_=_.rotate(-c));let v=m.add(_);return Ca(v.x,v.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(n){let _=Yn(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(d),v=Math.atan(_.y/_.x)+(_.x<0?Math.PI:0);return d.add(o.rotate(v))}return d.add(o)}function eu(d,t,n,o,c,p,m,_,v,T,P,E){let C=d.text.placedSymbolArray,D=d.text.dynamicLayoutVertexArray,B=d.icon.dynamicLayoutVertexArray,q={};D.clear();for(let W=0;W<C.length;W++){let $=C.get(W),Y=$.hidden||!$.crossTileID||d.allowVerticalPlacement&&!$.placedOrientation?null:o[$.crossTileID];if(Y){let ee=new l.P($.anchorX,$.anchorY),X={getElevation:E,width:c.width,height:c.height,pitchedLabelPlaneMatrix:p,pitchWithMap:n,transform:c,tileAnchorPoint:ee,translation:T,unwrappedTileID:P},te=n?ds(ee.x,ee.y,X):Yn(ee.x,ee.y,X),ne=Ea(c.cameraToCenterDistance,te.signedDistanceFromCamera),J=l.aA(d.textSizeData,_,$)*ne/l.aM;n&&(J*=d.tilePixelRatio/m);let{width:se,height:ye,anchor:fe,textOffset:pe,textBoxScale:ge}=Y,Re=zo(fe,se,ye,pe,ge,J),Fe=c.getPitchedTextCorrection(ee.x+T[0],ee.y+T[1],P),ve=Od(te.point,X,t,Re,-c.bearingInRadians,Fe),qe=d.allowVerticalPlacement&&$.placedOrientation===l.az.vertical?Math.PI/2:0;for(let lt=0;lt<$.numGlyphs;lt++)l.aG(D,ve,qe);v&&$.associatedIconIndex>=0&&(q[$.associatedIconIndex]={shiftedAnchor:ve,angle:qe})}else Kn($.numGlyphs,D)}if(v){B.clear();let W=d.icon.placedSymbolArray;for(let $=0;$<W.length;$++){let Y=W.get($);if(Y.hidden)Kn(Y.numGlyphs,B);else{let ee=q[$];if(ee)for(let X=0;X<Y.numGlyphs;X++)l.aG(B,ee.shiftedAnchor,ee.angle);else Kn(Y.numGlyphs,B)}}d.icon.dynamicLayoutVertexBuffer.updateData(B)}d.text.dynamicLayoutVertexBuffer.updateData(D)}function js(d,t,n){return n.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function Vs(d,t,n,o,c,p,m,_,v,T,P,E,C){let D=d.context,B=D.gl,q=d.transform,W=_==="map",$=v==="map",Y=_!=="viewport"&&n.layout.get("symbol-placement")!=="point",ee=W&&!$&&!Y,X=!n.layout.get("symbol-sort-key").isConstant(),te=!1,ne=d.getDepthModeForSublayer(0,ct.ReadOnly),J=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),se=[],ye=q.getCircleRadiusCorrection();for(let fe of o){let pe=t.getTile(fe),ge=pe.getBucket(n);if(!ge)continue;let Re=c?ge.text:ge.icon;if(!Re||!Re.segments.get().length||!Re.hasVisibleVertices)continue;let Fe=Re.programConfigurations.get(n.id),ve=c||ge.sdfIcons,qe=c?ge.textSizeData:ge.iconSizeData,lt=$||q.pitch!==0,St=d.useProgram(js(ve,c,ge),Fe),At=l.ay(qe,q.zoom),kt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(fe),Vt,Tt,ci,Nt,Pi=[0,0],Ht=null;if(c)Tt=pe.glyphAtlasTexture,ci=B.LINEAR,Vt=pe.glyphAtlasTexture.size,ge.iconsInText&&(Pi=pe.imageAtlasTexture.size,Ht=pe.imageAtlasTexture,Nt=lt||d.options.rotating||d.options.zooming||qe.kind==="composite"||qe.kind==="camera"?B.LINEAR:B.NEAREST);else{let It=n.layout.get("icon-size").constantOr(0)!==1||ge.iconsNeedLinear;Tt=pe.imageAtlasTexture,ci=ve||d.options.rotating||d.options.zooming||It||lt?B.LINEAR:B.NEAREST,Vt=pe.imageAtlasTexture.size}let Xt=l.aN(pe,1,d.transform.zoom),Ni=La(W,d.transform,Xt),pn=l.N();l.aB(pn,Ni);let qr=Xn($,W,d.transform,Xt),Ui=l.aO(q,pe,p,m),fn=q.getProjectionData({overscaledTileID:fe,applyGlobeMatrix:!C,applyTerrainMatrix:!0}),Xo=J&&ge.hasTextData(),Yo=n.layout.get("icon-text-fit")!=="none"&&Xo&&ge.hasIconData();if(Y){let It=d.style.map.terrain?(hr,mi)=>d.style.map.terrain.getElevation(fe,hr,mi):null,Ut=n.layout.get("text-rotation-alignment")==="map";co(ge,d,c,Ni,pn,$,T,Ut,fe.toUnwrapped(),q.width,q.height,Ui,It)}let Wa=c&&J||Yo,Yi=Y||Wa?Fd:$?Ni:d.transform.clipSpaceToPixelsMatrix,Sr=ve&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0,lr;lr=ve?ge.iconsInText?jl(qe.kind,At,ee,$,Y,Wa,d,Yi,qr,Ui,Vt,Pi,ye):zn(qe.kind,At,ee,$,Y,Wa,d,Yi,qr,Ui,c,Vt,0,ye):Ls(qe.kind,At,ee,$,Y,Wa,d,Yi,qr,Ui,c,Vt,ye);let cr={program:St,buffers:Re,uniformValues:lr,projectionData:fn,atlasTexture:Tt,atlasTextureIcon:Ht,atlasInterpolation:ci,atlasInterpolationIcon:Nt,isSDF:ve,hasHalo:Sr};if(X&&ge.canOverlap){te=!0;let It=Re.segments.get();for(let Ut of It)se.push({segments:new l.aX([Ut]),sortKey:Ut.sortKey,state:cr,terrainData:kt})}else se.push({segments:Re.segments,sortKey:0,state:cr,terrainData:kt})}te&&se.sort((fe,pe)=>
806fe.sortKey-pe.sortKey);for(let fe of se){let pe=fe.state;if(D.activeTexture.set(B.TEXTURE0),pe.atlasTexture.bind(pe.atlasInterpolation,B.CLAMP_TO_EDGE),pe.atlasTextureIcon&&(D.activeTexture.set(B.TEXTURE1),pe.atlasTextureIcon&&pe.atlasTextureIcon.bind(pe.atlasInterpolationIcon,B.CLAMP_TO_EDGE)),pe.isSDF){let ge=pe.uniformValues;pe.hasHalo&&(ge.u_is_halo=1,ql(pe.buffers,fe.segments,n,d,pe.program,ne,P,E,ge,pe.projectionData,fe.terrainData)),ge.u_is_halo=0}ql(pe.buffers,fe.segments,n,d,pe.program,ne,P,E,pe.uniformValues,pe.projectionData,fe.terrainData)}}function ql(d,t,n,o,c,p,m,_,v,T,P){let E=o.context;c.draw(E,E.gl.TRIANGLES,p,m,_,yt.backCCW,v,P,T,n.id,d.layoutVertexBuffer,d.indexBuffer,t,n.paint,o.transform.zoom,d.programConfigurations.get(n.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function tu(d,t,n,o,c){let p=d.context,m=p.gl,_=_t.disabled,v=new Ct([m.ONE,m.ONE],l.bp.transparent,[!0,!0,!0,!0]),T=t.getBucket(n);if(!T)return;let P=o.key,E=n.heatmapFbos.get(P);E||(E=Us(p,t.tileSize,t.tileSize),n.heatmapFbos.set(P,E)),p.bindFramebuffer.set(E.framebuffer),p.viewport.set([0,0,t.tileSize,t.tileSize]),p.clear({color:l.bp.transparent});let C=T.programConfigurations.get(n.id),D=d.useProgram("heatmap",C,!c),B=d.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),q=d.style.map.terrain.getTerrainData(o);D.draw(p,m.TRIANGLES,ct.disabled,_,v,yt.disabled,jh(t,d.transform.zoom,n.paint.get("heatmap-intensity"),1),q,B,n.id,T.layoutVertexBuffer,T.indexBuffer,T.segments,n.paint,d.transform.zoom,C)}function Ns(d,t,n,o,c){let p=d.context,m=p.gl,_=d.transform;p.setColorMode(d.colorModeForRenderPass());let v=iu(p,t),T=n.key,P=t.heatmapFbos.get(T);if(!P)return;p.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,P.colorAttachment.get()),p.activeTexture.set(m.TEXTURE1),v.bind(m.LINEAR,m.CLAMP_TO_EDGE);let E=_.getProjectionData({overscaledTileID:n,applyTerrainMatrix:c,applyGlobeMatrix:!o});d.useProgram("heatmapTexture").draw(p,m.TRIANGLES,ct.disabled,_t.disabled,d.colorModeForRenderPass(),yt.disabled,To(d,t,0,1),null,E,t.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,t.paint,_.zoom),P.destroy(),t.heatmapFbos.delete(T)}function Us(d,t,n){var o,c;let p=d.gl,m=p.createTexture();p.bindTexture(p.TEXTURE_2D,m),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR);let _=(o=d.HALF_FLOAT)!==null&&o!==void 0?o:p.UNSIGNED_BYTE,v=(c=d.RGBA16F)!==null&&c!==void 0?c:p.RGBA;p.texImage2D(p.TEXTURE_2D,0,v,t,n,0,p.RGBA,_,null);let T=d.createFramebuffer(t,n,!1,!1);return T.colorAttachment.set(m),T}function iu(d,t){return t.colorRampTexture||(t.colorRampTexture=new l.T(d,t.colorRamp,d.gl.RGBA)),t.colorRampTexture}function $l(d,t,n,o,c,p,m,_){let v=256;if(c.stepInterpolant){let T=t.getSource().maxzoom,P=m.canonical.z===T?Math.ceil(1<<d.transform.maxZoom-m.canonical.z):1;v=l.an(l.ce(p.maxLineLength/l.a5*1024*P),256,n.maxTextureSize)}return _.gradient=l.cf({expression:c.gradientExpression(),evaluationKey:"lineProgress",resolution:v,image:_.gradient||void 0,clips:p.lineClipsArray}),_.texture?_.texture.update(_.gradient):_.texture=new l.T(n,_.gradient,o.RGBA),_.version=c.gradientVersion,_.texture}function ei(d,t,n,o,c){d.activeTexture.set(t.TEXTURE0),n.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),o.updatePaintBuffers(c)}function sa(d,t,n,o,c,p){(c||d.lineAtlas.dirty)&&(t.activeTexture.set(n.TEXTURE0),d.lineAtlas.bind(t)),o.updatePaintBuffers(p)}function or(d,t,n,o,c,p,m){let _=p.gradients[c.id],v=_.texture;c.gradientVersion!==_.version&&(v=$l(d,t,n,o,c,p,m,_)),n.activeTexture.set(o.TEXTURE0),v.bind(c.stepInterpolant?o.NEAREST:o.LINEAR,o.CLAMP_TO_EDGE)}function Wl(d,t,n,o,c,p,m,_,v){let T=p.gradients[c.id],P=T.texture;c.gradientVersion!==T.version&&(P=$l(d,t,n,o,c,p,m,T)),n.activeTexture.set(o.TEXTURE0),P.bind(c.stepInterpolant?o.NEAREST:o.LINEAR,o.CLAMP_TO_EDGE),n.activeTexture.set(o.TEXTURE1),d.lineAtlas.bind(n),_.updatePaintBuffers(v)}function Ao(d,t,n,o,c){if(!n||!o||!o.imageAtlas)return;let p=o.imageAtlas.patternPositions,m=p[n.to.toString()],_=p[n.from.toString()];if(!m&&_&&(m=_),!_&&m&&(_=m),!m||!_){let v=c.getPaintProperty(t);m=p[v],_=p[v]}m&&_&&d.setConstantPatternPositions(m,_)}function Hl(d,t,n,o,c,p,m,_){let v=d.context.gl,T="fill-pattern",P=n.paint.get(T),E=P&&P.constantOr(1),C=n.getCrossfadeParameters(),D,B,q,W,$,Y=d.transform,ee=n.paint.get("fill-translate"),X=n.paint.get("fill-translate-anchor");m?(B=E&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",D=v.LINES):(B=E?"fillPattern":"fill",D=v.TRIANGLES);let te=P.constantOr(null);for(let ne of o){let J=t.getTile(ne);if(E&&!J.patternsLoaded())continue;let se=J.getBucket(n);if(!se)continue;let ye=se.programConfigurations.get(n.id),fe=d.useProgram(B,ye),pe=d.style.map.terrain&&d.style.map.terrain.getTerrainData(ne);E&&(d.context.activeTexture.set(v.TEXTURE0),J.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),ye.updatePaintBuffers(C)),Ao(ye,T,te,J,n);let ge=Y.getProjectionData({overscaledTileID:ne,applyGlobeMatrix:!_,applyTerrainMatrix:!0}),Re=l.aO(Y,J,ee,X);if(m){W=se.indexBuffer2,$=se.segments2;let ve=[v.drawingBufferWidth,v.drawingBufferHeight];q=B==="fillOutlinePattern"&&E?Fh(d,C,J,ve,Re):Rh(ve,Re)}else W=se.indexBuffer,$=se.segments,q=E?Fl(d,C,J,Re):{u_fill_translate:Re};let Fe=d.stencilModeForClipping(ne);fe.draw(d.context,D,c,Fe,p,yt.backCCW,q,pe,ge,n.id,se.layoutVertexBuffer,W,$,n.paint,d.transform.zoom,ye)}}function An(d,t,n,o,c,p,m,_){let v=d.context,T=v.gl,P="fill-extrusion-pattern",E=n.paint.get(P),C=E.constantOr(1),D=n.getCrossfadeParameters(),B=n.paint.get("fill-extrusion-opacity"),q=E.constantOr(null),W=d.transform;
806for(let $ of o){let Y=t.getTile($),ee=Y.getBucket(n);if(!ee)continue;let X=d.style.map.terrain&&d.style.map.terrain.getTerrainData($),te=ee.programConfigurations.get(n.id),ne=d.useProgram(C?"fillExtrusionPattern":"fillExtrusion",te);C&&(d.context.activeTexture.set(T.TEXTURE0),Y.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),te.updatePaintBuffers(D));let J=W.getProjectionData({overscaledTileID:$,applyGlobeMatrix:!_,applyTerrainMatrix:!0});Ao(te,P,q,Y,n);let se=l.aO(W,Y,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ye=n.paint.get("fill-extrusion-vertical-gradient"),fe=C?Dh(d,ye,B,se,$,D,Y):Ps(d,ye,B,se);ne.draw(v,v.gl.TRIANGLES,c,p,m,yt.backCCW,fe,X,J,n.id,ee.layoutVertexBuffer,ee.indexBuffer,ee.segments,n.paint,d.transform.zoom,te,d.style.map.terrain&&ee.centroidVertexBuffer)}}function Do(d,t,n,o,c,p,m,_,v){var T;let P=d.style.projection,E=d.context,C=d.transform,D=E.gl,B=[`#define NUM_ILLUMINATION_SOURCES ${n.paint.get("hillshade-highlight-color").values.length}`],q=d.useProgram("hillshade",null,!1,B),W=!d.options.moving;for(let $ of o){let Y=t.getTile($),ee=Y.fbo;if(!ee)continue;let X=P.getMeshFromTileID(E,$.canonical,_,!0,"raster"),te=(T=d.style.map.terrain)===null||T===void 0?void 0:T.getTerrainData($);E.activeTexture.set(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,ee.colorAttachment.get());let ne=C.getProjectionData({overscaledTileID:$,aligned:W,applyGlobeMatrix:!v,applyTerrainMatrix:!0});q.draw(E,D.TRIANGLES,p,c[$.overscaledZ],m,yt.backCCW,Id(d,Y,n),te,ne,n.id,X.vertexBuffer,X.indexBuffer,X.segments)}}function la(d,t,n,o,c,p,m,_,v){var T;let P=d.style.projection,E=d.context,C=d.transform,D=E.gl,B=d.useProgram("colorRelief"),q=!d.options.moving,W=!0,$=0;for(let Y of o){let ee=t.getTile(Y),X=ee.dem;if(W){let fe=D.getParameter(D.MAX_TEXTURE_SIZE),{elevationTexture:pe,colorTexture:ge}=n.getColorRampTextures(E,fe,X.getUnpackVector());E.activeTexture.set(D.TEXTURE1),pe.bind(D.NEAREST,D.CLAMP_TO_EDGE),E.activeTexture.set(D.TEXTURE4),ge.bind(D.LINEAR,D.CLAMP_TO_EDGE),W=!1,$=pe.size[0]}if(!X||!X.data)continue;let te=X.stride,ne=X.getPixels();if(E.activeTexture.set(D.TEXTURE0),E.pixelStoreUnpackPremultiplyAlpha.set(!1),ee.demTexture=ee.demTexture||d.getTileTexture(te),ee.demTexture){let fe=ee.demTexture;fe.update(ne,{premultiply:!1}),fe.bind(D.LINEAR,D.CLAMP_TO_EDGE)}else ee.demTexture=new l.T(E,ne,D.RGBA,{premultiply:!1}),ee.demTexture.bind(D.LINEAR,D.CLAMP_TO_EDGE);let J=P.getMeshFromTileID(E,Y.canonical,_,!0,"raster"),se=(T=d.style.map.terrain)===null||T===void 0?void 0:T.getTerrainData(Y),ye=C.getProjectionData({overscaledTileID:Y,aligned:q,applyGlobeMatrix:!v,applyTerrainMatrix:!0});B.draw(E,D.TRIANGLES,p,c[Y.overscaledZ],m,yt.backCCW,Nh(n,ee.dem,$),se,ye,n.id,J.vertexBuffer,J.indexBuffer,J.segments)}}let Ro=[new l.P(0,0),new l.P(l.a5,0),new l.P(l.a5,l.a5),new l.P(0,l.a5)];function Fo(d,t,n,o,c,p,m,_,v=!1,T=!1){let P=o[o.length-1].overscaledZ,E=d.context,C=E.gl,D=d.useProgram("raster"),B=d.transform,q=d.style.projection,W=d.colorModeForRenderPass(),$=!d.options.moving,Y=n.paint.get("raster-opacity"),ee=n.paint.get("raster-resampling"),X=n.paint.get("raster-fade-duration"),te=!!d.style.map.terrain;for(let ne of o){let J=d.getDepthModeForSublayer(ne.overscaledZ-P,Y===1?ct.ReadWrite:ct.ReadOnly,C.LESS),se=t.getTile(ne),ye=ee==="nearest"?C.NEAREST:C.LINEAR;E.activeTexture.set(C.TEXTURE0),se.texture.bind(ye,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),E.activeTexture.set(C.TEXTURE1);let{parentTile:fe,parentScaleBy:pe,parentTopLeft:ge,fadeValues:Re}=ru(se,t,X,te);se.fadeOpacity=Re.tileOpacity,fe?(fe.fadeOpacity=Re.parentTileOpacity,fe.texture.bind(ye,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST)):se.texture.bind(ye,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),se.texture.useMipmap&&E.extTextureFilterAnisotropic&&d.transform.pitch>d.options.anisotropicFilterPitch&&C.texParameterf(C.TEXTURE_2D,E.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,E.extTextureFilterAnisotropicMax);let Fe=d.style.map.terrain&&d.style.map.terrain.getTerrainData(ne),ve=B.getProjectionData({overscaledTileID:ne,aligned:$,applyGlobeMatrix:!T,applyTerrainMatrix:!0}),qe=Bl(ge,pe,Re.fadeMix,n,_),lt=q.getMeshFromTileID(E,ne.canonical,p,m,"raster");D.draw(E,C.TRIANGLES,J,c?c[ne.overscaledZ]:_t.disabled,W,v?yt.frontCCW:yt.backCCW,qe,Fe,ve,n.id,lt.vertexBuffer,lt.indexBuffer,lt.segments)}}function ru(d,t,n,o){let c={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(n===0||o)return c;if(d.fadingParentID){let p=t.getLoadedTile(d.fadingParentID);if(!p)return c;
806let m=Math.pow(2,p.tileID.overscaledZ-d.tileID.overscaledZ),_=[d.tileID.canonical.x*m%1,d.tileID.canonical.y*m%1],v=function(T,P,E){let C=Ge(),D=(C-P.timeAdded)/E,B=T.fadingDirection===re.Incoming,q=l.an((C-T.timeAdded)/E,0,1),W=l.an(1-D,0,1),$=B?q:W;return{tileOpacity:$,parentTileOpacity:B?W:q,fadeMix:{opacity:1,mix:1-$}}}(d,p,n);return{parentTile:p,parentScaleBy:m,parentTopLeft:_,fadeValues:v}}if(d.selfFading){let p=function(m,_){let v=(Ge()-m.timeAdded)/_,T=l.an(v,0,1);return{tileOpacity:T,fadeMix:{opacity:T,mix:0}}}(d,n);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:p}}return c}let nu=new l.bp(1,0,0,1),au=new l.bp(0,1,0,1),ou=new l.bp(0,0,1,1),Dn=new l.bp(1,0,1,1),su=new l.bp(0,1,1,1);function Xl(d,t,n,o){Oo(d,0,t+n/2,d.transform.width,n,o)}function Yl(d,t,n,o){Oo(d,t-n/2,0,n,d.transform.height,o)}function Oo(d,t,n,o,c,p){let m=d.context,_=m.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*d.pixelRatio,n*d.pixelRatio,o*d.pixelRatio,c*d.pixelRatio),m.clear({color:p}),_.disable(_.SCISSOR_TEST)}function lu(d,t,n){let o=d.context,c=o.gl,p=d.useProgram("debug"),m=ct.disabled,_=_t.disabled,v=d.colorModeForRenderPass(),T="$debug",P=d.style.map.terrain&&d.style.map.terrain.getTerrainData(n);o.activeTexture.set(c.TEXTURE0);let E=t.getTileByID(n.key).latestRawTileData,C=Math.floor((E&&E.byteLength||0)/1024),D=t.getTile(n).tileSize,B=512/Math.min(D,512)*(n.overscaledZ/d.transform.zoom)*.5,q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=` => ${n.overscaledZ}`),function($,Y){$.initDebugOverlayCanvas();let ee=$.debugOverlayCanvas,X=$.context.gl,te=$.debugOverlayCanvas.getContext("2d");te.clearRect(0,0,ee.width,ee.height),te.shadowColor="white",te.shadowBlur=2,te.lineWidth=1.5,te.strokeStyle="white",te.textBaseline="top",te.font="bold 36px Open Sans, sans-serif",te.fillText(Y,5,5),te.strokeText(Y,5,5),$.debugOverlayTexture.update(ee),$.debugOverlayTexture.bind(X.LINEAR,X.CLAMP_TO_EDGE)}(d,`${q} ${C}kB`);let W=d.transform.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(o,c.TRIANGLES,m,_,Ct.alphaBlended,yt.disabled,Va(l.bp.transparent,B),null,W,T,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),p.draw(o,c.LINE_STRIP,m,_,v,yt.disabled,Va(l.bp.red),P,W,T,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function Kl(d,t,n,o){let{isRenderingGlobe:c}=o,p=d.context,m=p.gl,_=d.transform,v=d.colorModeForRenderPass(),T=d.getDepthModeFor3D(),P=d.useProgram("terrain");p.bindFramebuffer.set(null),p.viewport.set([0,0,d.width,d.height]);for(let E of n){let C=t.getTerrainMesh(E.tileID),D=d.renderToTexture.getTexture(E),B=t.getTerrainData(E.tileID);p.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,D.texture);let q=t.getMeshFrameDelta(_.zoom),W=_.calculateFogMatrix(E.tileID.toUnwrapped()),$=ja(q,W,d.style.sky,_.pitch,c),Y=_.getProjectionData({overscaledTileID:E.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});P.draw(p,m.TRIANGLES,T,_t.disabled,v,yt.backCCW,$,B,Y,"terrain",C.vertexBuffer,C.indexBuffer,C.segments)}}function Jl(d,t){if(!t.mesh){let n=new l.aW;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1);let o=new l.aY;o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),t.mesh=new Da(d.createVertexBuffer(n,oi.members),d.createIndexBuffer(o),l.aX.simpleSegment(0,0,n.length,o.length))}return t.mesh}class cu{constructor(t,n){this.context=new ko(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:l.ar(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ae.maxOverzooming+Ae.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new zi}resize(t,n,o){if(this.width=Math.floor(t*o),this.height=Math.floor(n*o),this.pixelRatio=o,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let c of this.style._order)this.style._layers[c].resize()}setup(){let t=this.context,n=new l.aW;n.emplaceBack(0,0),n.emplaceBack(l.a5,0),n.emplaceBack(0,l.a5),n.emplaceBack(l.a5,l.a5),this.tileExtentBuffer=t.createVertexBuffer(n,oi.members),this.tileExtentSegments=l.aX.simpleSegment(0,0,4,2);let o=new l.aW;o.emplaceBack(0,0),o.emplaceBack(l.a5,0),o.emplaceBack(0,l.a5),o.emplaceBack(l.a5,l.a5),this.debugBuffer=t.createVertexBuffer(o,oi.members),this.debugSegments=l.aX.simpleSegment(0,0,4,5);let c=new l.ch;c.emplaceBack(0,0,0,0),c.emplaceBack(l.a5,0,l.a5,0),c.emplaceBack(0,l.a5,0,l.a5),c.emplaceBack(l.a5,l.a5,l.a5,l.a5),this.rasterBoundsBuffer=t.createVertexBuffer(c,Ts.members),this.rasterBoundsSegments=l.aX.simpleSegment(0,0,4,2);let p=new l.aW;p.emplaceBack(0,0),p.emplaceBack(l.a5,0),p.emplaceBack(0,l.a5),p.emplaceBack(l.a5,l.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(p,oi.members),this.rasterBoundsSegmentsPosOnly=l.aX.simpleSegment(0,0,4,5);let m=new l.aW;
vendor: 8,219 bytes, line 806
806m.emplaceBack(0,0),m.emplaceBack(1,0),m.emplaceBack(0,1),m.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(m,oi.members),this.viewportSegments=l.aX.simpleSegment(0,0,4,2);let _=new l.ci;_.emplaceBack(0),_.emplaceBack(1),_.emplaceBack(3),_.emplaceBack(2),_.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(_);let v=new l.aY;v.emplaceBack(1,0,2),v.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(v);let T=this.context.gl;this.stencilClearMode=new _t({func:T.ALWAYS,mask:0},0,255,T.ZERO,T.ZERO,T.ZERO),this.tileExtentMesh=new Da(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let o=l.N();l.c7(o,0,this.width,this.height,0,0,1),l.Q(o,o,[n.drawingBufferWidth,n.drawingBufferHeight,0]);let c={mainMatrix:o,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o};this.useProgram("clippingMask",null,!0).draw(t,n.TRIANGLES,ct.disabled,this.stencilClearMode,Ct.disabled,yt.disabled,null,null,c,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n,o){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();let c=this.context;c.setColorMode(Ct.disabled),c.setDepthMode(ct.disabled);let p={};for(let m of n)p[m.key]=this.nextStencilID++;this._renderTileMasks(p,n,o,!0),this._renderTileMasks(p,n,o,!1),this._tileClippingMaskIDs=p}_renderTileMasks(t,n,o,c){let p=this.context,m=p.gl,_=this.style.projection,v=this.transform,T=this.useProgram("clippingMask");for(let P of n){let E=t[P.key],C=this.style.map.terrain&&this.style.map.terrain.getTerrainData(P),D=_.getMeshFromTileID(this.context,P.canonical,c,!0,"stencil"),B=v.getProjectionData({overscaledTileID:P,applyGlobeMatrix:!o,applyTerrainMatrix:!0});T.draw(p,m.TRIANGLES,ct.disabled,new _t({func:m.ALWAYS,mask:0},E,255,m.KEEP,m.KEEP,m.REPLACE),Ct.disabled,o?yt.disabled:yt.backCCW,null,C,B,"$clipping",D.vertexBuffer,D.indexBuffer,D.segments)}}_renderTilesDepthBuffer(){let t=this.context,n=t.gl,o=this.style.projection,c=this.transform,p=this.useProgram("depth"),m=this.getDepthModeFor3D(),_=zt(c,{tileSize:c.tileSize});for(let v of _){let T=this.style.map.terrain&&this.style.map.terrain.getTerrainData(v),P=o.getMeshFromTileID(this.context,v.canonical,!0,!0,"raster"),E=c.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(t,n.TRIANGLES,m,_t.disabled,Ct.disabled,yt.backCCW,null,T,E,"$clipping",P.vertexBuffer,P.indexBuffer,P.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new _t({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new _t({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let n=this.context.gl,o=t.sort((m,_)=>_.overscaledZ-m.overscaledZ),c=o[o.length-1].overscaledZ,p=o[0].overscaledZ-c+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();let m={};for(let _=0;_<p;_++)m[_+c]=new _t({func:n.GEQUAL,mask:255},_+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=p,[m,o]}return[{[c]:_t.disabled},o]}stencilConfigForOverlapTwoPass(t){let n=this.context.gl,o=t.sort((m,_)=>_.overscaledZ-m.overscaledZ),c=o[o.length-1].overscaledZ,p=o[0].overscaledZ-c+1;if(this.clearStencil(),p>1){let m={},_={};for(let v=0;v<p;v++)m[v+c]=new _t({func:n.GREATER,mask:255},p+1+v,255,n.KEEP,n.KEEP,n.REPLACE),_[v+c]=new _t({func:n.GREATER,mask:255},1+v,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*p+1,[m,_,o]}return this.nextStencilID=3,[{[c]:new _t({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[c]:new _t({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},o]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new Ct([t.CONSTANT_COLOR,t.ONE],new l.bp(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ct.unblended:Ct.alphaBlended}getDepthModeForSublayer(t,n,o){if(!this.opaquePassEnabledForLayer())return ct.disabled;let c=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new ct(o||this.context.gl.LEQUAL,n,[c,c])}getDepthModeFor3D(){return new ct(this.context.gl.LEQUAL,ct.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){var o,c;this.style=t,this.options=n,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(Ge()),this.imageManager.beginFrame();let p=this.style._order,m=this.style.tileManagers,_={},v={},T={},P={isRenderingToTexture:!1,isRenderingGlobe:((o=t.projection)===null||o===void 0?void 0:o.transitionState)>0};for(let C in m){let D=m[C];D.used&&D.prepare(this.context),_[C]=D.getVisibleCoordinates(!1),v[C]=_[C].slice().reverse(),T[C]=D.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let C=0;C<p.length;C++)if(this.style._layers[p[C]].is3D()){this.opaquePassCutoff=C;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let C of p){let D=this.style._layers[C];if(!D.hasOffscreenPass()||D.isHidden(this.transform.zoom))continue;let B=v[D.source];(D.type==="custom"||B.length)&&this.renderLayer(this,m[D.source],D,B,P)}if((c=this.style.projection)===null||c===void 0||c.updateGPUdependent({context:this.context,useProgram:C=>this.useProgram(C)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?l.bp.black:l.bp.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(C,D){let B=C.context,q=B.gl,W=((ne,J,se)=>{let ye=Math.cos(J.rollInRadians),fe=Math.sin(J.rollInRadians),pe=xe(J),ge=J.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:ne.properties.get("sky-color"),u_horizon_color:ne.properties.get("horizon-color"),u_horizon:[(J.width/2-pe*fe)*se,(J.height/2+pe*ye)*se],u_horizon_normal:[-fe,ye],u_sky_horizon_blend:ne.properties.get("sky-horizon-blend")*J.height/2*se,u_sky_blend:ge}})(D,C.style.map.transform,C.pixelRatio),$=new ct(q.LEQUAL,ct.ReadWrite,[0,1]),Y=_t.disabled,ee=C.colorModeForRenderPass(),X=C.useProgram("sky"),te=Jl(B,D);X.draw(B,q.TRIANGLES,$,Y,ee,yt.disabled,W,null,void 0,"sky",te.vertexBuffer,te.indexBuffer,te.segments)}(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=p.length-1;this.currentLayer>=0;this.currentLayer--){let C=this.style._layers[p[this.currentLayer]],D=m[C.source],B=_[C.source];this._renderTileClippingMasks(C,B,!1),this.renderLayer(this,D,C,B,P)}this.renderPass="translucent";let E=!1;for(this.currentLayer=0;this.currentLayer<p.length;this.currentLayer++){let C=this.style._layers[p[this.currentLayer]],D=m[C.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(C,P))continue;this.opaquePassEnabledForLayer()||E||(E=!0,P.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let B=(C.type==="symbol"?T:v)[C.source];this._renderTileClippingMasks(C,_[C.source],!!this.renderToTexture),this.renderLayer(this,D,C,B,P)}if(P.isRenderingGlobe&&function(C,D,B){let q=C.context,W=q.gl,$=C.useProgram("atmosphere"),Y=new ct(W.LEQUAL,ct.ReadOnly,[0,1]),ee=C.transform,X=function(ge,Re){let Fe=ge.properties.get("position"),ve=[-Fe.x,-Fe.y,-Fe.z],qe=l.ar(new Float64Array(16));return ge.properties.get("anchor")==="map"&&(l.bg(qe,qe,Re.rollInRadians),l.bh(qe,qe,-Re.pitchInRadians),l.bg(qe,qe,Re.bearingInRadians),l.bh(qe,qe,Re.center.lat*Math.PI/180),l.bJ(qe,qe,-Re.center.lng*Math.PI/180)
806),l.cg(ve,ve,qe),ve}(B,C.transform),te=ee.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),ne=D.properties.get("atmosphere-blend")*te.projectionTransition;if(ne===0)return;let J=vo(ee.worldSize,ee.center.lat),se=ee.inverseProjectionMatrix,ye=new Float64Array(4);ye[3]=1,l.aH(ye,ye,ee.modelViewProjectionMatrix),ye[0]/=ye[3],ye[1]/=ye[3],ye[2]/=ye[3],ye[3]=1,l.aH(ye,ye,se),ye[0]/=ye[3],ye[1]/=ye[3],ye[2]/=ye[3],ye[3]=1;let fe=((ge,Re,Fe,ve,qe)=>({u_sun_pos:ge,u_atmosphere_blend:Re,u_globe_position:Fe,u_globe_radius:ve,u_inv_proj_matrix:qe}))(X,ne,[ye[0],ye[1],ye[2]],J,se),pe=Jl(q,D);$.draw(q,W.TRIANGLES,Y,_t.disabled,Ct.alphaBlended,yt.disabled,fe,null,null,"atmosphere",pe.vertexBuffer,pe.indexBuffer,pe.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let C=function(D,B){let q=null,W=Object.values(D._layers).flatMap(X=>X.source&&!X.isHidden(B)?[D.tileManagers[X.source]]:[]),$=W.filter(X=>X.getSource().type==="vector"),Y=W.filter(X=>X.getSource().type!=="vector"),ee=X=>{(!q||q.getSource().maxzoom<X.getSource().maxzoom)&&(q=X)};return $.forEach(X=>ee(X)),q||Y.forEach(X=>ee(X)),q}(this.style,this.transform.zoom);C&&function(D,B,q){for(let W=0;W<q.length;W++)lu(D,B,q[W])}(this,C,C.getVisibleCoordinates())}this.options.showPadding&&function(C){let D=C.transform.padding;Xl(C,C.transform.height-(D.top||0),3,nu),Xl(C,D.bottom||0,3,au),Yl(C,D.left||0,3,ou),Yl(C,C.transform.width-(D.right||0),3,Dn);let B=C.transform.centerPoint;(function(q,W,$,Y){Oo(q,W-1,$-10,2,20,Y),Oo(q,W-10,$-1,20,2,Y)})(C,B.x,C.transform.height-B.y,su)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;let n=this.terrainFacilitator.matrix,o=this.transform.modelViewProjectionMatrix,c=this.terrainFacilitator.dirty;c||(c=t?!l.cj(n,o):!l.ck(n,o)),c||(c=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),c&&(l.cl(n,o),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(p,m){let _=p.context,v=_.gl,T=p.transform,P=Ct.unblended,E=new ct(v.LEQUAL,ct.ReadWrite,[0,1]),C=m.tileManager.getRenderableTiles(),D=p.useProgram("terrainDepth");_.bindFramebuffer.set(m.getFramebuffer("depth").framebuffer),_.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),_.clear({color:l.bp.transparent,depth:1});for(let B of C){let q=m.getTerrainMesh(B.tileID),W=m.getTerrainData(B.tileID),$=T.getProjectionData({overscaledTileID:B.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),Y={u_ele_delta:m.getMeshFrameDelta(T.zoom)};D.draw(_,v.TRIANGLES,E,_t.disabled,P,yt.backCCW,Y,W,$,"terrain",q.vertexBuffer,q.indexBuffer,q.segments)}_.bindFramebuffer.set(null),_.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain),function(p,m){let _=p.context,v=_.gl,T=p.transform,P=Ct.unblended,E=new ct(v.LEQUAL,ct.ReadWrite,[0,1]),C=m.getCoordsTexture(),D=m.tileManager.getRenderableTiles(),B=p.useProgram("terrainCoords");_.bindFramebuffer.set(m.getFramebuffer("coords").framebuffer),_.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),_.clear({color:l.bp.transparent,depth:1}),m.coordsIndex=[];for(let q of D){let W=m.getTerrainMesh(q.tileID),$=m.getTerrainData(q.tileID);_.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,C.texture);let Y={u_terrain_coords_id:(255-m.coordsIndex.length)/255,u_texture:0,u_ele_delta:m.getMeshFrameDelta(T.zoom)},ee=T.getProjectionData({overscaledTileID:q.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});B.draw(_,v.TRIANGLES,E,_t.disabled,P,yt.backCCW,Y,$,ee,"terrain",W.vertexBuffer,W.indexBuffer,W.segments),m.coordsIndex.push(q.tileID.key)}_.bindFramebuffer.set(null),_.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain))}renderLayer(t,n,o,c,p){o.isHidden(this.transform.zoom)||(o.type==="background"||o.type==="custom"||(c||[]).length)&&(this.id=o.id,l.cm(o)?function(m,_,v,T,P,E){if(m.renderPass!=="translucent")return;let{isRenderingToTexture:C}=E,D=_t.disabled,B=m.colorModeForRenderPass();(v._unevaluatedLayout.hasValue("text-variable-anchor")||v._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(q,W,$,Y,ee,X,te,ne,J){let se=W.transform,ye=W.style.map.terrain,fe=ee==="map",pe=X==="map";for(let ge of q){let Re=Y.getTile(ge),Fe=Re.getBucket($);if(!Fe||!Fe.text||!Fe.text.segments.get().length)continue;let ve=l.ay(Fe.textSizeData,se.zoom),qe=l.aN(Re,1,W.transform.zoom),lt=La(fe,W.transform,qe),St=$.layout.get("icon-text-fit")!=="none"&&Fe.hasIconData();
vendor: 6,525 bytes, line 806
806if(ve){let At=Math.pow(2,se.zoom-Re.tileID.overscaledZ),kt=ye?(Vt,Tt)=>ye.getElevation(ge,Vt,Tt):null;eu(Fe,fe,pe,J,se,lt,At,ve,St,l.aO(se,Re,te,ne),ge.toUnwrapped(),kt)}}}(T,m,v,_,v.layout.get("text-rotation-alignment"),v.layout.get("text-pitch-alignment"),v.paint.get("text-translate"),v.paint.get("text-translate-anchor"),P),v.paint.get("icon-opacity").constantOr(1)!==0&&Vs(m,_,v,T,!1,v.paint.get("icon-translate"),v.paint.get("icon-translate-anchor"),v.layout.get("icon-rotation-alignment"),v.layout.get("icon-pitch-alignment"),v.layout.get("icon-keep-upright"),D,B,C),v.paint.get("text-opacity").constantOr(1)!==0&&Vs(m,_,v,T,!0,v.paint.get("text-translate"),v.paint.get("text-translate-anchor"),v.layout.get("text-rotation-alignment"),v.layout.get("text-pitch-alignment"),v.layout.get("text-keep-upright"),D,B,C),_.map.showCollisionBoxes&&(Bs(m,_,v,T,!0),Bs(m,_,v,T,!1))}(t,n,o,c,this.style.placement.variableOffsets,p):l.cn(o)?function(m,_,v,T,P){if(m.renderPass!=="translucent")return;let{isRenderingToTexture:E}=P,C=v.paint.get("circle-opacity"),D=v.paint.get("circle-stroke-width"),B=v.paint.get("circle-stroke-opacity"),q=!v.layout.get("circle-sort-key").isConstant();if(C.constantOr(1)===0&&(D.constantOr(1)===0||B.constantOr(1)===0))return;let W=m.context,$=W.gl,Y=m.transform,ee=m.getDepthModeForSublayer(0,ct.ReadOnly),X=_t.disabled,te=m.colorModeForRenderPass(),ne=[],J=Y.getCircleRadiusCorrection();for(let se=0;se<T.length;se++){let ye=T[se],fe=_.getTile(ye),pe=fe.getBucket(v);if(!pe)continue;let ge=v.paint.get("circle-translate"),Re=v.paint.get("circle-translate-anchor"),Fe=l.aO(Y,fe,ge,Re),ve=pe.programConfigurations.get(v.id),qe=m.useProgram("circle",ve),lt=pe.layoutVertexBuffer,St=pe.indexBuffer,At=m.style.map.terrain&&m.style.map.terrain.getTerrainData(ye),kt={programConfiguration:ve,program:qe,layoutVertexBuffer:lt,indexBuffer:St,uniformValues:ra(m,fe,v,Fe,J),terrainData:At,projectionData:Y.getProjectionData({overscaledTileID:ye,applyGlobeMatrix:!E,applyTerrainMatrix:!0})};if(q){let Vt=pe.segments.get();for(let Tt of Vt)ne.push({segments:new l.aX([Tt]),sortKey:Tt.sortKey,state:kt})}else ne.push({segments:pe.segments,sortKey:0,state:kt})}q&&ne.sort((se,ye)=>se.sortKey-ye.sortKey);for(let se of ne){let{programConfiguration:ye,program:fe,layoutVertexBuffer:pe,indexBuffer:ge,uniformValues:Re,terrainData:Fe,projectionData:ve}=se.state;fe.draw(W,$.TRIANGLES,ee,X,te,yt.backCCW,Re,Fe,ve,v.id,pe,ge,se.segments,v.paint,m.transform.zoom,ye)}}(t,n,o,c,p):l.co(o)?function(m,_,v,T,P){if(v.paint.get("heatmap-opacity")===0)return;let E=m.context,{isRenderingToTexture:C,isRenderingGlobe:D}=P;if(m.style.map.terrain){for(let B of T){let q=_.getTile(B);_.hasRenderableParent(B)||(m.renderPass==="offscreen"?tu(m,q,v,B,D):m.renderPass==="translucent"&&Ns(m,v,B,C,D))}E.viewport.set([0,0,m.width,m.height])}else m.renderPass==="offscreen"?function(B,q,W,$){let Y=B.context,ee=Y.gl,X=B.transform,te=_t.disabled,ne=new Ct([ee.ONE,ee.ONE],l.bp.transparent,[!0,!0,!0,!0]);(function(J,se,ye){let fe=J.gl;J.activeTexture.set(fe.TEXTURE1),J.viewport.set([0,0,se.width/4,se.height/4]);let pe=ye.heatmapFbos.get(l.cd);pe?(fe.bindTexture(fe.TEXTURE_2D,pe.colorAttachment.get()),J.bindFramebuffer.set(pe.framebuffer)):(pe=Us(J,se.width/4,se.height/4),ye.heatmapFbos.set(l.cd,pe))})(Y,B,W),Y.clear({color:l.bp.transparent});for(let J=0;J<$.length;J++){let se=$[J];if(q.hasRenderableParent(se))continue;let ye=q.getTile(se),fe=ye.getBucket(W);if(!fe)continue;let pe=fe.programConfigurations.get(W.id),ge=B.useProgram("heatmap",pe),Re=X.getProjectionData({overscaledTileID:se,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Fe=X.getCircleRadiusCorrection();ge.draw(Y,ee.TRIANGLES,ct.disabled,te,ne,yt.backCCW,jh(ye,X.zoom,W.paint.get("heatmap-intensity"),Fe),null,Re,W.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,W.paint,X.zoom,pe)}Y.viewport.set([0,0,B.width,B.height])}(m,_,v,T):m.renderPass==="translucent"&&function(B,q){let W=B.context,$=W.gl;W.setColorMode(B.colorModeForRenderPass());let Y=q.heatmapFbos.get(l.cd);Y&&(W.activeTexture.set($.TEXTURE0),$.bindTexture($.TEXTURE_2D,Y.colorAttachment.get()),W.activeTexture.set($.TEXTURE1),iu(W,q).bind($.LINEAR,$.CLAMP_TO_EDGE),B.useProgram("heatmapTexture").draw(W,$.TRIANGLES,ct.disabled,_t.disabled,B.colorModeForRenderPass(),yt.disabled,To(B,q,0,1),null,null,q.id,B.viewportBuffer,B.quadTriangleIndexBuffer,B.viewportSegments,q.paint,B.transform.zoom))}(m,v)}(t,n,o,c,p):l.cp(o)?function(m,_,v,T,P){if(m.renderPass!=="translucent")return;let{isRenderingToTexture:E}=P,C=v.paint.get("line-opacity"),D=v.paint.get("line-width");if(C.constantOr(1)===0||D.constantOr(1)===0)return;let B=m.getDepthModeForSublayer(0,ct.ReadOnly),q=m.colorModeForRenderPass(),W=v.paint.get("line-dasharray"),$=W.constantOr(1),Y=v.paint.get("line-pattern"),ee=Y.constantOr(1),X=v.paint.get("line-gradient"),te=v.getCrossfadeParameters(),ne;ne=ee?"linePattern":$&&X?"lineGradientSDF":$?"lineSDF":X?"lineGradient":"line";let J=m.context,se=J.gl,ye=m.transform,fe=!0;for(let pe of T){let ge=_.getTile(pe);if(ee&&!ge.patternsLoaded())continue;let Re=ge.getBucket(v);if(!Re)continue;let Fe=Re.programConfigurations.get(v.id),ve=m.context.program.get(),qe=m.useProgram(ne,Fe),lt=fe||qe.program!==ve,St=m.style.map.terrain&&m.style.map.terrain.getTerrainData(pe),At=Y.constantOr(null),kt=W&&W.constantOr(null);if(At&&ge.imageAtlas){let Pi=ge.imageAtlas,Ht=Pi.patternPositions[At.to.toString()],Xt=Pi.patternPositions[At.from.toString()];Ht&&Xt&&Fe.setConstantPatternPositions(Ht,Xt)}else if(kt){let Pi=v.layout.get("line-cap")==="round",Ht=m.lineAtlas.getDash(kt.to,Pi),Xt=m.lineAtlas.getDash(kt.from,Pi);Fe.setConstantDashPositions(Ht,Xt)}let Vt=ye.getProjectionData({overscaledTileID:pe,applyGlobeMatrix:!E,applyTerrainMatrix:!0}),Tt=ye.getPixelScale(),ci;ee?(ci=Uh(m,ge,v,Tt,te),ei(J,se,ge,Fe,te)):$&&X?(ci=sn(m,ge,v,Tt,te,Re.lineClipsArray.length),Wl(m,_,J,se,v,Re,pe,Fe,te)):$?(ci=Is(m,ge,v,Tt,te),sa(m,J,se,Fe,lt,te)):X?(ci=Ol(m,ge,v,Tt,Re.lineClipsArray.length),or(m,_,J,se,v,Re,pe)):ci=Po(m,ge,v,Tt);let Nt=m.stencilModeForClipping(pe);qe.draw(J,se.TRIANGLES,B,Nt,q,yt.disabled,ci,St,Vt,v.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,v.paint,m.transform.zoom,Fe,Re.layoutVertexBuffer2),fe=!1}}(t,n,o,c,p):l.cq(o)?function(m,_,v,T,P){let E=v.paint.get("fill-color"),C=v.paint.get("fill-opacity");if(C.constantOr(1)===0)return;let{isRenderingToTexture:D}=P,B=m.colorModeForRenderPass(),q=v.paint.get("fill-pattern"),W=m.opaquePassEnabledForLayer()&&!q.constantOr(1)&&E.c
806onstantOr(l.bp.transparent).a===1&&C.constantOr(0)===1?"opaque":"translucent";if(m.renderPass===W){let $=m.getDepthModeForSublayer(1,m.renderPass==="opaque"?ct.ReadWrite:ct.ReadOnly);Hl(m,_,v,T,$,B,!1,D)}if(m.renderPass==="translucent"&&v.paint.get("fill-antialias")){let $=m.getDepthModeForSublayer(v.getPaintProperty("fill-outline-color")?2:0,ct.ReadOnly);Hl(m,_,v,T,$,B,!0,D)}}(t,n,o,c,p):l.cr(o)?function(m,_,v,T,P){let E=v.paint.get("fill-extrusion-opacity");if(E===0)return;let{isRenderingToTexture:C}=P;if(m.renderPass==="translucent"){let D=new ct(m.context.gl.LEQUAL,ct.ReadWrite,m.depthRangeFor3D);if(E!==1||v.paint.get("fill-extrusion-pattern").constantOr(1))An(m,_,v,T,D,_t.disabled,Ct.disabled,C),An(m,_,v,T,D,m.stencilModeFor3D(),m.colorModeForRenderPass(),C);else{let B=m.colorModeForRenderPass();An(m,_,v,T,D,_t.disabled,B,C)}}}(t,n,o,c,p):l.cs(o)?function(m,_,v,T,P){if(m.renderPass!=="offscreen"&&m.renderPass!=="translucent")return;let{isRenderingToTexture:E}=P,C=m.context,D=m.style.projection.useSubdivision,B=m.getDepthModeForSublayer(0,ct.ReadOnly),q=m.colorModeForRenderPass();if(m.renderPass==="offscreen")(function(W,$,Y,ee,X,te,ne){let J=W.context,se=J.gl;for(let ye of Y){let fe=$.getTile(ye),pe=fe.dem;if(!pe||!pe.data||!fe.needsHillshadePrepare)continue;let ge=pe.dim,Re=pe.stride,Fe=pe.getPixels();if(J.activeTexture.set(se.TEXTURE1),J.pixelStoreUnpackPremultiplyAlpha.set(!1),fe.demTexture=fe.demTexture||W.getTileTexture(Re),fe.demTexture){let qe=fe.demTexture;qe.update(Fe,{premultiply:!1}),qe.bind(se.NEAREST,se.CLAMP_TO_EDGE)}else fe.demTexture=new l.T(J,Fe,se.RGBA,{premultiply:!1}),fe.demTexture.bind(se.NEAREST,se.CLAMP_TO_EDGE);J.activeTexture.set(se.TEXTURE0);let ve=fe.fbo;if(!ve){let qe=new l.T(J,{width:ge,height:ge,data:null},se.RGBA);qe.bind(se.LINEAR,se.CLAMP_TO_EDGE),ve=fe.fbo=J.createFramebuffer(ge,ge,!0,!1),ve.colorAttachment.set(qe.texture)}J.bindFramebuffer.set(ve.framebuffer),J.viewport.set([0,0,ge,ge]),W.useProgram("hillshadePrepare").draw(J,se.TRIANGLES,X,te,ne,yt.disabled,Md(fe.tileID,pe),null,null,ee.id,W.rasterBoundsBuffer,W.quadTriangleIndexBuffer,W.rasterBoundsSegments),fe.needsHillshadePrepare=!1}})(m,_,T,v,B,_t.disabled,q),C.viewport.set([0,0,m.width,m.height]);else if(m.renderPass==="translucent")if(D){let[W,$,Y]=m.stencilConfigForOverlapTwoPass(T);Do(m,_,v,Y,W,B,q,!1,E),Do(m,_,v,Y,$,B,q,!0,E)}else{let[W,$]=m.getStencilConfigForOverlapAndUpdateStencilID(T);Do(m,_,v,$,W,B,q,!1,E)}}(t,n,o,c,p):l.ct(o)?function(m,_,v,T,P){if(m.renderPass!=="translucent"||!T.length)return;let{isRenderingToTexture:E}=P,C=m.style.projection.useSubdivision,D=m.getDepthModeForSublayer(0,ct.ReadOnly),B=m.colorModeForRenderPass();if(C){let[q,W,$]=m.stencilConfigForOverlapTwoPass(T);la(m,_,v,$,q,D,B,!1,E),la(m,_,v,$,W,D,B,!0,E)}else{let[q,W]=m.getStencilConfigForOverlapAndUpdateStencilID(T);la(m,_,v,W,q,D,B,!1,E)}}(t,n,o,c,p):l.bU(o)?function(m,_,v,T,P){if(m.renderPass!=="translucent"||v.paint.get("raster-opacity")===0||!T.length)return;let{isRenderingToTexture:E}=P,C=_.getSource(),D=m.style.projection.useSubdivision;if(C instanceof en)Fo(m,_,v,T,null,!1,!1,C.tileCoords,C.flippedWindingOrder,E);else if(D){let[B,q,W]=m.stencilConfigForOverlapTwoPass(T);Fo(m,_,v,W,B,!1,!0,Ro,!1,E),Fo(m,_,v,W,q,!0,!0,Ro,!1,E)}else{let[B,q]=m.getStencilConfigForOverlapAndUpdateStencilID(T);Fo(m,_,v,q,B,!1,!0,Ro,!1,E)}}(t,n,o,c,p):l.cu(o)?function(m,_,v,T,P){let E=v.paint.get("background-color"),C=v.paint.get("background-opacity");if(C===0)return;let{isRenderingToTexture:D}=P,B=m.context,q=B.gl,W=m.style.projection,$=m.transform,Y=$.tileSize,ee=v.paint.get("background-pattern");if(m.isPatternMissing(ee))return;let X=!ee&&E.a===1&&C===1&&m.opaquePassEnabledForLayer()?"opaque":"translucent";if(m.renderPass!==X)return;let te=_t.disabled,ne=m.getDepthModeForSublayer(0,X==="opaque"?ct.ReadWrite:ct.ReadOnly),J=m.colorModeForRenderPass(),se=m.useProgram(ee?"backgroundPattern":"background"),ye=T||zt($,{tileSize:Y,terrain:m.style.map.terrain});ee&&(B.activeTexture.set(q.TEXTURE0),m.imageManager.bind(m.context));let fe=v.getCrossfadeParameters();for(let pe of ye){let ge=$.getProjectionData({overscaledTileID:pe,applyGlobeMatrix:!D,applyTerrainMatrix:!0}),Re=ee?Cd(C,m,ee,{tileID:pe,tileSize:Y},fe):Ld(C,E),Fe=m.style.map.terrain&&m.style.map.terrain.getTerrainData(pe),ve=W.getMeshFromTileID(B,pe.canonical,!1,!0,"raster");se.draw(B,q.TRIANGLES,ne,te,J,yt.backCCW,Re,Fe,ge,v.id,ve.vertexBuffer,ve.indexBuffer,ve.segments)}}(t,0,o,c,p):l.cv(o)&&function(m,_,v,T){let{isRenderingGlobe:P}=T,E=m.context,C=v.implementation,D=m.style.projection,B=m.transform,q=B.getProjectionDataForCustomLayer(P),W={farZ:B.farZ,nearZ:B.nearZ,fov:B.fov*Math.PI/180,modelViewProjectionMatrix:B.modelViewProjectionMatrix,projectionMatrix:B.projectionMatrix,shaderData:{variantName:D.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; 807uniform mat4 u_projection_matrix; 808${D.shaderPreludeCode.vertexSource}`,define:D.shaderDefine},defaultProjectionData:q},$=C.renderingMode?C.renderingMode:"2d";if(m.renderPass==="offscreen"){let Y=C.prerender;Y&&(m.setCustomLayerDefaults(),E.setColorMode(m.colorModeForRenderPass()),Y.call(C,E.gl,W),E.setDirty(),m.setBaseState())}
808else if(m.renderPass==="translucent"){m.setCustomLayerDefaults(),E.setColorMode(m.colorModeForRenderPass()),E.setStencilMode(_t.disabled);let Y=$==="3d"?m.getDepthModeFor3D():m.getDepthModeForSublayer(0,ct.ReadOnly);E.setDepthMode(Y),C.render(E.gl,W),E.setDirty(),m.setBaseState(),E.bindFramebuffer.set(null)}}(t,0,o,p))}saveTileTexture(t){let n=this._tileTextures[t.size[0]];n?n.push(t):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()),o=this.imageManager.getPattern(t.to.toString());return!n||!o}useProgram(t,n,o=!1,c=[]){this.cache=this.cache||{};let p=!!this.style.map.terrain,m=this.style.projection,_=o?Ft.projectionMercator:m.shaderPreludeCode,v=o?rr:m.shaderDefine,T=t+(n?n.cacheKey:"")+`/${o?Xi:m.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(p?"/terrain":"")+(c?`/${c.join("/")}`:"");return this.cache[T]||(this.cache[T]=new Pd(this.context,Ft[t],n,Ed[t],this._showOverdrawInspector,p,_,v,c)),this.cache[T]}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 l.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,n;if(this._tileTextures){for(let o in this._tileTextures){let c=this._tileTextures[o];if(c)for(let p of c)p.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 o in this.cache){let c=this.cache[o];c&&c.program&&this.context.gl.deleteProgram(c.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 Ql(d,t){let n,o=!1,c=null,p=null,m=()=>{c=null,o&&(d.apply(p,n),c=setTimeout(m,t),o=!1)};return(..._)=>(o=!0,p=this,n=_,c||m(),c)}class Bo{constructor(t){this._getCurrentHash=()=>{let n=window.location.hash.replace("#","");if(this._hashName){let o;return n.split("&").map(c=>c.split("=")).forEach(c=>{c[0]===this._hashName&&(o=c)}),(o&&o[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{let n=this._getCurrentHash();if(!this._isValidHash(n))return!1;let o=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:o,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 o=n.join("/"),c=o;c.split("&").length>0&&(c=c.split("&")[0]),this._hashName&&(c=`${this._hashName}=${o}`);let p=window.location.hash.replace(c,"");p.startsWith("#&")?p=p.slice(0,1)+p.slice(2):p==="#"&&(p="");let m=window.location.href.replace(/(#.+)?$/,p);m=m.replace("&&","&"),window.history.replaceState(window.history.state,null,m)},this._updateHash=Ql(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(),o=Math.round(100*this._map.getZoom())/100,c=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,c),m=Math.round(n.lng*p)/p,_=Math.round(n.lat*p)/p,v=this._map.getBearing(),T=this._map.getPitch(),P="";if(P+=t?`/${m}/${_}/${o}`:`${o}/${_}/${m}`,(v||T)&&(P+="/"+Math.round(10*v)/10),T&&(P+=`/${Math.round(T)}`),this._hashName){let E=this._hashName,C=!1,D=window.location.hash.slice(1).split("&").map(B=>{let q=B.split("=")[0];return q===E?(C=!0,`${q}=${P}`):B}
vendor: 41,922 bytes, line 808
808).filter(B=>B);return C||D.push(`${E}=${P}`),`#${D.join("&")}`}return`#${P}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new l.V(+t[2],+t[1])}catch{return!1}let n=+t[0],o=+(t[3]||0),c=+(t[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&o>=-180&&o<=180&&c>=this._map.getMinPitch()&&c<=this._map.getMaxPitch()}}let Za={linearity:.3,easing:l.cw(0,0,.3,1)},wr=l.e({deceleration:2500,maxSpeed:1400},Za),kr=l.e({deceleration:20,maxSpeed:1400},Za),hu=l.e({deceleration:1e3,maxSpeed:360},Za),zr=l.e({deceleration:1e3,maxSpeed:90},Za),Bd=l.e({deceleration:1e3,maxSpeed:360},Za);class jd{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Ge(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=Ge();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 l.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:p}of this._inertiaBuffer)n.zoom+=p.zoomDelta||0,n.bearing+=p.bearingDelta||0,n.pitch+=p.pitchDelta||0,n.roll+=p.rollDelta||0,p.panDelta&&n.pan._add(p.panDelta),p.around&&(n.around=p.around),p.pinchAround&&(n.pinchAround=p.pinchAround);let o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){let p=Ur(n.pan.mag(),o,l.e({},wr,t||{})),m=n.pan.mult(p.amount/n.pan.mag()),_=this._map.cameraHelper.handlePanInertia(m,this._map.transform);c.center=_.easingCenter,c.offset=_.easingOffset,jo(c,p)}if(n.zoom){let p=Ur(n.zoom,o,kr),m=l.cx(this._map.transform.zoom+p.amount,this._map.getZoomSnap(),p.amount);c.zoom=m,jo(c,p)}if(n.bearing){let p=Ur(n.bearing,o,hu);c.bearing=this._map.transform.bearing+l.an(p.amount,-179,179),jo(c,p)}if(n.pitch){let p=Ur(n.pitch,o,zr);c.pitch=this._map.transform.pitch+p.amount,jo(c,p)}if(n.roll){let p=Ur(n.roll,o,Bd);c.roll=this._map.transform.roll+l.an(p.amount,-179,179),jo(c,p)}if(c.zoom||c.bearing){let p=n.pinchAround===void 0?n.around:n.pinchAround;c.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),l.e(c,{noMoveStart:!0})}}function jo(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function Ur(d,t,n){let{maxSpeed:o,linearity:c,deceleration:p}=n,m=l.an(d*c/(t/1e3),-o,o),_=Math.abs(m)/(p*c);return{easing:n.easing,duration:1e3*_,amount:m*(_/2)}}class sr extends l.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,o,c={}){o=o instanceof MouseEvent?o:new MouseEvent(t,o);let p=ce.mousePos(n.getCanvas(),o),m=n.unproject(p);super(t,l.e({point:p,lngLat:m,originalEvent:o},c)),this._defaultPrevented=!1,this.target=n}}class Vo extends l.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,o){let c=t==="touchend"?o.changedTouches:o.touches,p=ce.touchPos(n.getCanvasContainer(),c),m=p.map(v=>n.unproject(v)),_=p.reduce((v,T,P,E)=>v.add(T.div(E.length)),new l.P(0,0));super(t,{points:p,point:_,lngLats:m,lngLat:n.unproject(_),originalEvent:o}),this._defaultPrevented=!1}}class uu extends l.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,o){super(t,{originalEvent:o}),this._defaultPrevented=!1}}class Vd{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new uu(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new sr(t.type,this._map,t))}mouseup(t){this._map.fire(new sr(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new sr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new sr(t.type,this._map,t))}mouseover(t){this._map.fire(new sr(t.type,this._map,t))}mouseout(t){this._map.fire(new sr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Vo(t.type,this._map,t))}touchmove(t){this._map.fire(new Vo(t.type,this._map,t))}touchend(t){this._map.fire(new Vo(t.type,this._map,t))}touchcancel(t){this._map.fire(new Vo(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class du{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new sr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new sr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new sr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class cn{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(l.P.convert(t),this._map.terrain)}}class Gr{constructor(t,n){this._map=t,this._tr=new cn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}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&&(ce.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;let o=n;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)<this._clickTolerance)return;let c=this._startPos;this._lastPos=o,this._box||(this._box=ce.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let p=Math.min(c.x,o.x),m=Math.max(c.x,o.x),_=Math.min(c.y,o.y),v=Math.max(c.y,o.y);ce.setTransform(this._box,`translate(${p}px,${_}px)`),this._box.style.width=m-p+"px",this._box.style.height=v-_+"px"}mouseupWindow(t,n){if(!this._active||t.button!==0)return;let o=this._startPos,c=n;if(this.reset(),ce.suppressClick(),o.x!==c.x||o.y!==c.y)return this._map.fire(new l.l("boxzoomend",{originalEvent:t})),{cameraAnimation:p=>p.fitScreenCoordinates(o,c,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&&(ce.remove(this._box),this._box=null),ce.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new l.l(t,{originalEvent:n}))}}function Ue(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 o=0;o<d.length;o++)n[d[o].identifier]=t[o];return n}class pu{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,o){(this.centroid||o.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=function(c){let p=new l.P(0,0);for(let m of c)p._add(m);return p.div(c.length)}(n),this.touches=Ue(o,n)))}touchmove(t,n,o){if(this.aborted||!this.centroid)return;let c=Ue(o,n);for(let p in this.touches){let m=c[p];(!m||m.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(t,n,o){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){let c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class No{constructor(t){this.singleTap=new pu(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,o){this.singleTap.touchstart(t,n,o)}touchmove(t,n,o){this.singleTap.touchmove(t,n,o)}touchend(t,n,o){let c=this.singleTap.touchend(t,n,o);if(c){let p=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(c)<30;if(p&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class fu{constructor(t){this._tr=new cn(t),this._zoomIn=new No({numTouches:1,numTaps:2}),this._zoomOut=new No({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,o){this._zoomIn.touchstart(t,n,o),this._zoomOut.touchstart(t,n,o)}touchmove(t,n,o){this._zoomIn.touchmove(t,n,o),this._zoomOut.touchmove(t,n,o)}touchend(t,n,o){let c=this._zoomIn.touchend(t,n,o),p=this._zoomOut.touchend(t,n,o),m=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:l.cx(m.zoom+1,_.getZoomSnap()),around:m.unproject(c)},{originalEvent:t})}):p?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:l.cx(m.zoom-1,_.getZoomSnap()),around:m.unproject(p)},{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 hn{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 o=this._lastPoint;if(!o)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let c=Array.isArray(n)?n[0]:n;return!this._moved&&c.dist(o)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=c,this._move(o,c))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&ce.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 Uo=0,ec=2,Nd={[Uo]:1,[ec]:2};class ca{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let n=ce.mouseButton(t);this._eventButton=n}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(n,o){let c=Nd[o];return n.buttons===void 0||(n.buttons&c)!==c}(t,this._eventButton)}isValidEndEvent(t){return ce.mouseButton(t)===this._eventButton}}class mu{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 tc{constructor(t=new ca({checkCorrectEvent:()=>!0}),n=new mu){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,o){return t instanceof MouseEvent?n(t):typeof TouchEvent<"u"&&t instanceof TouchEvent?o(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 Gs=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=t=>{t.preventDefault()}};class gu{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new l.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,o){return this._calculateTransform(t,n,o)}touchmove(t,n,o){if(this._active){if(!this._shouldBePrevented(o.length))return t.preventDefault(),this._calculateTransform(t,n,o);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,n,o){this._calculateTransform(t,n,o),this._active&&this._shouldBePrevented(o.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,o){o.length>0&&(this._active=!0);let c=Ue(o,n),p=new l.P(0,0),m=new l.P(0,0),_=0;for(let T in c){let P=c[T],E=this._touches[T];E&&(p._add(P),m._add(P.sub(E)),_++,c[T]=P)}if(this._touches=c,this._shouldBePrevented(_)||!m.mag())return;let v=m.div(_);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:p.div(_),panDelta:v}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ic{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,o){this._firstTwoTouches||o.length<2||(this._firstTwoTouches=[o[0].identifier,o[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,o){if(!this._firstTwoTouches)return;t.preventDefault();let[c,p]=this._firstTwoTouches,m=Zs(o,n,c),_=Zs(o,n,p);if(!m||!_)return;let v=this._aroundCenter?null:m.add(_).div(2);return this._move([m,_],v,t)}touchend(t,n,o){if(!this._firstTwoTouches)return;let[c,p]=this._firstTwoTouches,m=Zs(o,n,c),_=Zs(o,n,p);m&&_||(this._active&&ce.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 Zs(d,t,n){for(let o=0;o<d.length;o++)if(d[o].identifier===n)return t[o]}function rc(d,t){return Math.log(d/t)/Math.LN2}class yu extends ic{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let o=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(rc(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:rc(this._distance,o),pinchAround:n}}}function nc(d,t){return 180*d.angleWith(t)/Math.PI}class _u extends ic{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,o){let c=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:nc(this._vector,c),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360,o=nc(t,this._startVector);return Math.abs(o)<n}}function ac(d){return Math.abs(d.y)>Math.abs(d.x)}class un extends ic{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,o){super.touchstart(t,n,o),this._currentTouchCount=o.length}_start(t){this._lastPoints=t,ac(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,o){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let c=t[0].sub(this._lastPoints[0]),p=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,p,o.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,o){if(this._valid!==void 0)return this._valid;let c=t.mag()>=2,p=n.mag()>=2;if(!c&&!p)return;if(!c||!p)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;let m=t.y>0==n.y>0;return ac(t)&&ac(n)&&m}}let Et={panStep:100,bearingStep:15,pitchStep:10};class xu{constructor(t){this._tr=new cn(t);let n=Et;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,o=0,c=0,p=0,m=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?o=-1:(t.preventDefault(),p=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),p=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(o=0,c=0),{cameraAnimation:_=>{let v=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:qs,zoom:n?l.cx(v.zoom+n*(t.shiftKey?2:1),_.getZoomSnap()):v.zoom,bearing:v.bearing+o*this._bearingStep,pitch:v.pitch+c*this._pitchStep,offset:[-p*this._panStep,-m*this._panStep],center:v.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 qs(d){return d*(2-d)}let Go=4.000244140625,oc=1/450;class sc{constructor(t,n){this._onTimeout=o=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)},this._map=t,this._tr=new cn(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=oc}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,o=Ge(),c=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,n!==0&&n%Go==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*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._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=ce.mousePos(this._map.getCanvas(),t),o=this._tr;this._aroundPoint=this._aroundCenter?o.transform.locationToScreenPoint(l.V.convert(o.center)):n,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let _=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=_),typeof this._targetZoom=="number"&&(this._targetZoom+=_)}if(this._delta!==0){let _=this._type==="wheel"&&Math.abs(this._delta)>Go?this._wheelZoomRate:this._defaultZoomRate,v=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&v!==0&&(v=1/v);let T=typeof this._targetZoom!="number"?t.scale:l.aq(this._targetZoom),P=t.applyConstrain(t.getCameraLngLat(),l.at(T*v)).zoom,E=this._map.getZoomSnap();if(this._type==="wheel"&&E>0){let C=l.cx(t.zoom,E);this._targetZoom=l.cx(P,E,P-C)}else this._targetZoom=P;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,o=this._startZoom,c=this._easing,p,m=!1;if(this._type==="wheel"&&o&&c){let _=Ge()-this._lastWheelEventTime,v=Math.min((_+5)/200,1),T=c(v);p=l.G.number(o,n,T),v<1?this._frameId||(this._frameId=!0):m=!0}else p=n,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=p,{noInertia:!0,needsRenderFrame:!m,zoomDelta:p-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=l.cz;if(this._prevEase){let o=this._prevEase,c=(Ge()-o.start)/o.duration,p=o.easing(c+.01)-o.easing(c),m=.27/Math.sqrt(p*p+1e-4)*.01,_=Math.sqrt(.0729-m*m);n=l.cw(m,_,.25,1)}return this._prevEase={start:Ge(),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 lc{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 vu{constructor(t){this._tr=new cn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:l.cx(this._tr.zoom+(t.shiftKey?-1:1),o.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 Ud{constructor(){this._tap=new No({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,o){if(!this._swipePoint)if(this._tapTime){let c=n[0],p=t.timeStamp-this._tapTime<500,m=this._tapPoint.dist(c)<30;p&&m?o.length>0&&(this._swipePoint=c,this._swipeTouch=o[0].identifier):this.reset()}else this._tap.touchstart(t,n,o)}touchmove(t,n,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;let c=n[0],p=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(t,n,o)}touchend(t,n,o){if(this._tapTime)this._swipePoint&&o.length===0&&this.reset();else{let c=this._tap.touchend(t,n,o);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}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,o){this._el=t,this._mousePan=n,this._touchPan=o}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 Zo{constructor(t,n,o,c){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=o,this._mouseRoll=c}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 We{constructor(t,n,o,c){this._el=t,this._touchZoom=n,this._touchRotate=o,this._tapDragZoom=c,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()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class et{constructor(t,n){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"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=ce.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let o=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),c=document.createElement("div");c.className="maplibregl-desktop-message",c.textContent=n,this._container.appendChild(c);let p=document.createElement("div");p.className="maplibregl-mobile-message",p.textContent=o,this._container.appendChild(p),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ce.remove(this._container),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 l.l("cooperativegestureprevented",{gestureType:t,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Rn=d=>d.zoom||d.drag||d.roll||d.pitch||d.rotate;class bu extends l.l{}function qa(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta||d.rollDelta}class Vi{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=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,p)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let m=c.type==="renderFrame"?void 0:c,_={needsRenderFrame:!1},v={},T={};for(let{handlerName:C,handler:D,allowed:B}of this._handlers){if(!D.isEnabled())continue;let q;if(this._blockedByActive(T,B,C))D.reset();else if(D[p||c.type]){if(l.cA(c,p||c.type)){let W=ce.mousePos(this._map.getCanvas(),c);q=D[p||c.type](c,W)}else if(l.cB(c,p||c.type)){let W=this._getMapTouches(c.touches),$=ce.touchPos(this._map.getCanvas(),W);q=D[p||c.type](c,$,W)}else l.cC(p||c.type)||(q=D[p||c.type](c));this.mergeHandlerResult(_,v,q,C,m),q&&q.needsRenderFrame&&this._triggerRenderFrame()}(q||D.isActive())&&(T[C]=D)}let P={};for(let C in this._previousActiveHandlers)T[C]||(P[C]=m);this._previousActiveHandlers=T,(Object.keys(P).length||qa(_))&&(this._changes.push([_,v,P]),this._triggerRenderFrame()),(Object.keys(T).length||qa(_))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:E}=_;E&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],E(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new jd(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[c,p,m]of this._listeners)ce.addEventListener(c,p,c===this._ownerDocument?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(let[t,n,o]of this._listeners)ce.removeEventListener(t,n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(t){let n=this._map,o=n.getCanvasContainer();this._add("mapEvent",new Vd(n,t));let c=n.boxZoom=new Gr(n,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();let p=n.cooperativeGestures=new et(n,t.cooperativeGestures);this._add("cooperativeGestures",p),t.cooperativeGestures&&p.enable();let m=new fu(n),_=new vu(n);n.doubleClickZoom=new lc(_,m),this._add("tapZoom",m),this._add("clickZoom",_),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let v=new Ud;this._add("tapDragZoom",v);let T=n.touchPitch=new un(n);this._add("touchPitch",T),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let P=()=>n.project(n.getCenter()),E=function({enable:X,clickTolerance:te,aroundCenter:ne=!0,minPixelCenterThreshold:J=100,rotateDegreesPerPixelMoved:se=.8},ye){let fe=new ca({checkCorrectEvent:pe=>ce.mouseButton(pe)===0&&pe.ctrlKey||ce.mouseButton(pe)===2&&!pe.ctrlKey});return new hn({clickTolerance:te,move:(pe,ge)=>{let Re=ye();if(ne&&Math.abs(Re.y-pe.y)>J)return{bearingDelta:l.cy(new l.P(pe.x,ge.y),ge,Re)};let Fe=(ge.x-pe.x)*se;return ne&&ge.y<Re.y&&(Fe=-Fe),{bearingDelta:Fe}},moveStateManager:fe,enable:X,assignEvents:Gs})}(t,P),C=function({enable:X,clickTolerance:te,pitchDegreesPerPixelMoved:ne=-.5}){let J=new ca({checkCorrectEvent:se=>ce.mouseButton(se)===0&&se.ctrlKey||ce.mouseButton(se)===2});return new hn({clickTolerance:te,move:(se,ye)=>({pitchDelta:(ye.y-se.y)*ne}),moveStateManager:J,enable:X,assignEvents:Gs})}(t),D=function({enable:X,clickTolerance:te,rollDegreesPerPixelMoved:ne=.3},J){let se=new ca({checkCorrectEvent:ye=>ce.mouseButton(ye)===2&&ye.ctrlKey});return new hn({clickTolerance:te,move:(ye,fe)=>{let pe=J(),ge=(fe.x-ye.x)*ne;return fe.y<pe.y&&(ge=-ge),{rollDelta:ge}},moveStateManager:se,enable:X,assignEvents:Gs})}(t,P);n.dragRotate=new Zo(t,E,C,D),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",C,["mouseRotate","mouseRoll"]),this._add("mouseRoll",D,["mousePitch"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let B=function({enable:X,clickTolerance:te}){let ne=new ca({checkCorrectEvent:J=>ce.mouseButton(J)===0&&!J.ctrlKey});return new hn({clickTolerance:te,move:(J,se)=>({around:se,panDelta:se.sub(J)}),activateOnStart:!0,moveStateManager:ne,enable:X,assignEvents:Gs})}(t),q=new gu(t,n);n.dragPan=new Ar(o,B,q),this._add("mousePan",B),this._add("touchPan",q,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let W=new _u,$=new yu;n.touchZoomRotate=new We(o,$,W,v),this._add("touchRotate",W,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new du(n));let Y=n.scrollZoom=new sc(n,()=>this._triggerRenderFrame());this._add("scrollZoom",Y,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let ee=n.keyboard=new xu(n);this._add("keyboard",ee),t.interactive&&t.keyboard&&n.keyboard.enable()}_add(t,n,o){this._handlers.push({handlerName:t,handler:n,allowed:o}),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!!Rn(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,o){for(let c in t)if(c!==o&&(!n||n.indexOf(c)<0))return!0;return!1}_getMapTouches(t){let n=[];for(let o of t)this._el.contains(o.target)&&n.push(o);return n}mergeHandlerResult(t,n,o,c,p){if(!o)return;l.e(t,o);let m={handlerName:c,originalEvent:o.originalEvent||p};o.zoomDelta!==void 0&&(n.zoom=m),o.panDelta!==void 0&&(n.drag=m),o.rollDelta!==void 0&&(n.roll=m),o.pitchDelta!==void 0&&(n.pitch=m),o.bearingDelta!==void 0&&(n.rotate=m)}_applyChanges(){let t={},n={},o={};for(let[c,p,m]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new l.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.rollDelta&&(t.rollDelta=(t.rollDelta||0)+c.rollDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),l.e(n,p),l.e(o,m);this._updateMapTransform(t,n,o),this._changes=[]}_updateMapTransform(t,n,o){let c=this._map,p=c._getTransformForUpdate(),m=c.terrain;if(!(qa(t)||m&&this._terrainMovement))return this._fireEvents(n,o,!0);c._stop(!0);let{panDelta:_,zoomDelta:v,bearingDelta:T,pitchDelta:P,rollDelta:E,around:C,pinchAround:D}=t;D!==void 0&&(C=D),C=C||c.transform.centerPoint,m&&!p.isPointOnMapSurface(C)&&(C=p.centerPoint);let B={panDelta:_,zoomDelta:v,rollDelta:E,pitchDelta:P,bearingDelta:T,around:C};this._map.cameraHelper.useGlobeControls&&!p.isPointOnMapSurface(C)&&(C=p.centerPoint);let q=C.distSqr(p.centerPoint)<.01?p.center:p.screenPointToLocation(_?C.sub(_):C);this._handleMapControls({terrain:m,tr:p,deltasForHelper:B,preZoomAroundLoc:q,combinedEventsInProgress:n,panDelta:_}),c._applyUpdatedTransform(p),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,o,!0)}_handleMapControls({terrain:t,tr:n,deltasForHelper:o,preZoomAroundLoc:c,combinedEventsInProgress:p,panDelta:m}){let _=this._map.cameraHelper;if(_.handleMapControlsRollPitchBearingZoom(o,n),t)return _.useGlobeControls?(this._terrainMovement||!p.drag&&!p.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void _.handleMapControlsPan(o,n,c)):this._terrainMovement||!p.drag&&!p.zoom?void(p.drag&&this._terrainMovement&&m?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(m))):_.handleMapControlsPan(o,n,c)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void _.handleMapControlsPan(o,n,c));_.handleMapControlsPan(o,n,c)}_fireEvents(t,n,o){let c=Rn(this._eventsInProgress),p=Rn(t),m={};for(let E in t){let{originalEvent:C}=t[E];this._eventsInProgress[E]||(m[`${E}start`]=C),this._eventsInProgress[E]=t[E]}!c&&p&&this._fireEvent("movestart",p.originalEvent);for(let E in m)this._fireEvent(E,m[E]);p&&this._fireEvent("move",p.originalEvent);for(let E in t){let{originalEvent:C}=t[E];this._fireEvent(E,C)}let _={},v;for(let E in this._eventsInProgress){let{handlerName:C,originalEvent:D}=this._eventsInProgress[E];this._handlersById[C].isActive()||(delete this._eventsInProgress[E],v=n[C]||D,_[`${E}end`]=v)}for(let E in _)this._fireEvent(E,_[E]);let T=Rn(this._eventsInProgress),P=(c||p)&&!T;if(P&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let E=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&E.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(E)}if(o&&P){this._updatingCamera=!0;let E=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),C=D=>D!==0&&-this._bearingSnap<D&&D<this._bearingSnap;!E||!E.essential&&Ve.prefersReducedMotion?(this._map.fire(new l.l("moveend",{originalEvent:v})),C(this._map.getBearing())&&this._map.resetNorth()):(C(E.bearing||this._map.getBearing())&&(E.bearing=0),E.freezeElevation=!0,this._map.easeTo(E,{originalEvent:v})),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new l.l(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new bu("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Dr extends l.E{constructor(t,n,o){super(),this._renderFrameCallback=()=>{let c=Math.min((Ge()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(c)),c<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=o.bearingSnap,this._zoomSnap=o.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 l.V(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,o){return t=l.P.convert(t).mult(-1),this.panTo(this.transform.center,l.e({offset:t},n),o)}panTo(t,n,o){return this.easeTo(l.e({center:t},n),o)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,o){return this.easeTo(l.e({zoom:t},n),o)}zoomIn(t,n){return this.zoomTo(l.cx(this.getZoom()+1,this._zoomSnap),t,n),this}zoomOut(t,n){return this.zoomTo(l.cx(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 l.l("movestart",n)).fire(new l.l("move",n)).fire(new l.l("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,o){return this.easeTo(l.e({bearing:t},n),o)}resetNorth(t,n){return this.rotateTo(0,l.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(l.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=Bt.convert(t).adjustAntiMeridian();let o=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),o,n)}_cameraForBoxAndBearing(t,n,o,c){let p={top:0,bottom:0,right:0,left:0};if(typeof(c=l.e({padding:p,offset:[0,0],maxZoom:this.transform.maxZoom},c)).padding=="number"){let T=c.padding;c.padding={top:T,bottom:T,right:T,left:T}}let m=l.e(p,c.padding);c.padding=m;let _=this.transform,v=new Bt(t,n);return this.cameraHelper.cameraForBoxAndBearing(c,m,v,o,_)}fitBounds(t,n,o){return this._fitInternal(this.cameraForBounds(t,n),n,o)}fitScreenCoordinates(t,n,o,c,p){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(l.P.convert(t)),this.transform.screenPointToLocation(l.P.convert(n)),o,c),c,p)}_fitInternal(t,n,o){return t?(delete(n=l.e(t,n)).padding,n.linear?this.easeTo(n,o):this.flyTo(n,o)):this}jumpTo(t,n){this.stop();let o=this._getTransformForUpdate(),c=!1,p=!1,m=!1,_=o.zoom;this.cameraHelper.handleJumpToCenterZoom(o,t);let v=o.zoom!==_;return"elevation"in t&&o.elevation!==+t.elevation&&o.setElevation(+t.elevation),"bearing"in t&&o.bearing!==+t.bearing&&(c=!0,o.setBearing(+t.bearing)),"pitch"in t&&o.pitch!==+t.pitch&&(p=!0,o.setPitch(+t.pitch)),"roll"in t&&o.roll!==+t.roll&&(m=!0,o.setRoll(+t.roll)),t.padding==null||o.isPaddingEqual(t.padding)||o.setPadding(t.padding),this._applyUpdatedTransform(o),this.fire(new l.l("movestart",n)).fire(new l.l("move",n)),v&&this.fire(new l.l("zoomstart",n)).fire(new l.l("zoom",n)).fire(new l.l("zoomend",n)),c&&this.fire(new l.l("rotatestart",n)).fire(new l.l("rotate",n)).fire(new l.l("rotateend",n)),p&&this.fire(new l.l("pitchstart",n)).fire(new l.l("pitch",n)).fire(new l.l("pitchend",n)),m&&this.fire(new l.l("rollstart",n)).fire(new l.l("roll",n)).fire(new l.l("rollend",n)),this.fire(new l.l("moveend",n))}calculateCameraOptionsFromTo(t,n,o,c=0){let p=l.a9.fromLngLat(t,n),m=l.a9.fromLngLat(o,c),_=m.x-p.x,v=m.y-p.y,T=m.z-p.z,P=M
808ath.hypot(_,v,T);if(P===0)throw new Error("Can't calculate camera options with same From and To");let E=Math.hypot(_,v),C=l.at(this.transform.cameraToCenterDistance/P/this.transform.tileSize),D=180*Math.atan2(_,-v)/Math.PI,B=180*Math.acos(E/P)/Math.PI;return B=T<0?90-B:90+B,{center:m.toLngLat(),elevation:c,zoom:C,pitch:B,bearing:D}}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,o,c,p){let m=this.transform.calculateCenterFromCameraLngLatAlt(t,n,o,c);return{center:m.center,elevation:m.elevation,zoom:m.zoom,bearing:o,pitch:c,roll:p}}easeTo(t,n){this._stop(!1,t.easeId),((t=l.e({offset:[0,0],duration:500,easing:l.cz},t)).animate===!1||!t.essential&&Ve.prefersReducedMotion)&&(t.duration=0);let o=this._getTransformForUpdate(),c=this.getBearing(),p=o.pitch,m=o.roll,_="bearing"in t?this._normalizeBearing(t.bearing,c):c,v="pitch"in t?+t.pitch:p,T="roll"in t?this._normalizeBearing(t.roll,m):m,P="padding"in t?t.padding:o.padding,E=l.P.convert(t.offset),C,D;t.around&&(C=l.V.convert(t.around),D=o.locationToScreenPoint(C));let B={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},q=this.cameraHelper.handleEaseTo(o,{bearing:_,pitch:v,roll:T,padding:P,around:C,aroundPoint:D,offsetAsPoint:E,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||c!==_,this._pitching=this._pitching||v!==p,this._rolling=this._rolling||T!==m,this._padding=!o.isPaddingEqual(P),this._zooming=this._zooming||q.isZooming,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,B),this.terrain&&this._prepareElevation(q.elevationCenter),this._ease(W=>{q.easeFunc(W),this.terrain&&!t.freezeElevation&&this._updateElevation(W),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},W=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n,W)},t),this}_prepareEase(t,n,o={}){this._moving=!0,n||o.moving||this.fire(new l.l("movestart",t)),this._zooming&&!o.zooming&&this.fire(new l.l("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new l.l("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new l.l("pitchstart",t)),this._rolling&&!o.rolling&&this.fire(new l.l("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 o=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(o-(n-(o*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.setElevation(l.G.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(),o=t.getCameraAltitude(),c=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(o<c){let p=this.calculateCameraOptionsFromTo(n,c,t.center,t.elevation);return{pitch:p.pitch,zoom:p.zoom}}return{}}_applyUpdatedTransform(t){let n=[];if(n.push(c=>this._elevateCameraIfInsideTerrain(c)),this.transformCameraUpdate&&n.push(c=>this.transformCameraUpdate(c)),!n.length)return;let o=t.clone();for(let c of n){let p=o.clone(),{center:m,zoom:_,roll:v,pitch:T,bearing:P,elevation:E}=c(p);m&&p.setCenter(m),E!==void 0&&p.setElevation(E),_!==void 0&&p.setZoom(_),v!==void 0&&p.setRoll(v),T!==void 0&&p.setPitch(T),P!==void 0&&p.setBearing(P),o.apply(p,!1)}this.transform.apply(o,!1)}
vendor: 4,173 bytes, line 808
808_fireMoveEvents(t){this.fire(new l.l("move",t)),this._zooming&&this.fire(new l.l("zoom",t)),this._rotating&&this.fire(new l.l("rotate",t)),this._pitching&&this.fire(new l.l("pitch",t)),this._rolling&&this.fire(new l.l("roll",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let o=this._zooming,c=this._rotating,p=this._pitching,m=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,o&&this.fire(new l.l("zoomend",t)),c&&this.fire(new l.l("rotateend",t)),p&&this.fire(new l.l("pitchend",t)),m&&this.fire(new l.l("rollend",t)),this.fire(new l.l("moveend",t))}flyTo(t,n){if(!t.essential&&Ve.prefersReducedMotion){let ge=l.U(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(ge,n)}this.stop(),t=l.e({offset:[0,0],speed:1.2,curve:1.42,easing:l.cz},t);let o=this._getTransformForUpdate(),c=o.bearing,p=o.pitch,m=o.roll,_=o.padding,v="bearing"in t?this._normalizeBearing(t.bearing,c):c,T="pitch"in t?+t.pitch:p,P="roll"in t?this._normalizeBearing(t.roll,m):m,E="padding"in t?t.padding:o.padding,C=l.P.convert(t.offset),D=o.centerPoint.add(C),B=o.screenPointToLocation(D),q=this.cameraHelper.handleFlyTo(o,{bearing:v,pitch:T,roll:P,padding:E,locationAtOffset:B,offsetAsPoint:C,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),W=t.curve,$=Math.max(o.width,o.height),Y=$/q.scaleOfZoom,ee=q.pixelPathLength;typeof q.scaleOfMinZoom=="number"&&(W=Math.sqrt($/q.scaleOfMinZoom/ee*2));let X=W*W;function te(ge){let Re=(Y*Y-$*$+(ge?-1:1)*X*X*ee*ee)/(2*(ge?Y:$)*X*ee);return Math.log(Math.sqrt(Re*Re+1)-Re)}function ne(ge){return(Math.exp(ge)-Math.exp(-ge))/2}function J(ge){return(Math.exp(ge)+Math.exp(-ge))/2}let se=te(!1),ye=function(ge){return J(se)/J(se+W*ge)},fe=function(ge){return $*((J(se)*(ne(Re=se+W*ge)/J(Re))-ne(se))/X)/ee;var Re},pe=(te(!0)-se)/W;if(Math.abs(ee)<2e-6||!isFinite(pe)){if(Math.abs($-Y)<1e-6)return this.easeTo(t,n);let ge=Y<$?-1:1;pe=Math.abs(Math.log(Y/$))/W,fe=()=>0,ye=Re=>Math.exp(ge*W*Re)}return t.duration="duration"in t?+t.duration:1e3*pe/("screenSpeed"in t?+t.screenSpeed/W:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=c!==v,this._pitching=T!==p,this._rolling=P!==m,this._padding=!o.isPaddingEqual(E),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(q.targetCenter),this._ease(ge=>{let Re=ge*pe,Fe=1/ye(Re),ve=fe(Re);this._rotating&&o.setBearing(l.G.number(c,v,ge)),this._pitching&&o.setPitch(l.G.number(p,T,ge)),this._rolling&&o.setRoll(l.G.number(m,P,ge)),this._padding&&(o.interpolatePadding(_,E,ge),D=o.centerPoint.add(C)),q.easeFunc(ge,Fe,ve,D),this.terrain&&!t.freezeElevation&&this._updateElevation(ge),this._applyUpdatedTransform(o),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 o;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let c=this._onEaseEnd;delete this._onEaseEnd,c.call(this,n)}return t||(o=this.handlers)===null||o===void 0||o.stop(!1),this}_ease(t,n,o){o.animate===!1||o.duration===0?(t(1),n()):(this._easeStart=Ge(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=l.W(t,-180,180);let o=Math.abs(t-n);return Math.abs(t-360-n)<o&&(t-=360),Math.abs(t+360-n)<o&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(l.V.convert(t),this.transform):null}}let cc={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class wu{constructor(t=cc){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=>
808{!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=ce.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ce.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ce.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(){ce.remove(this._container),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 o=this._map._getUIString(`AttributionControl.${n}`);t.title=o,t.setAttribute("aria-label",o)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(c=>typeof c!="string"?"":c)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}let n=this._map.style.tileManagers;for(let c in n){let p=n[c];if(p.used||p.usedForTerrain){let m=p.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(c=>String(c).trim()),t.sort((c,p)=>c.length-p.length),t=t.filter((c,p)=>{for(let m=p+1;m<t.length;m++)if(t[m].indexOf(c)>=0)return!1;return!0});let o=t.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=ce.sanitize(o),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Su{constructor(t={}){this._updateCompact=()=>{let n=this._container.children;if(n.length){let o=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&o.classList.add("maplibregl-compact"):o.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=ce.create("div","maplibregl-ctrl");let n=ce.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ce.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Gd{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,o=n?this._queue.concat(n):this._queue;
vendor: 11,108 bytes, line 808
808for(let c of o)if(c.id===t)return void(c.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 o of n)if(!o.cancelled&&(o.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var qo=l.aU([{name:"a_pos3d",type:"Int16",components:3}]);class qt extends l.E{constructor(t){super(),this._lastTilesetChange=Ge(),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 o={};for(let c of zt(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n,calculateTileZoom:this.tileManager._source.calculateTileZoom}))o[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.terrainRttPosMatrix32f=new Float64Array(16),l.c7(c.terrainRttPosMatrix32f,0,l.a5,l.a5,0,0,1),this._tiles[c.key]=new ue(c,this.tileSize),this._lastTilesetChange=Ge());for(let c in this._tiles)o[c]||delete this._tiles[c]}freeRtt(t){for(let n in this._tiles){let o=this._tiles[n];(!t||o.tileID.equals(t)||o.tileID.isChildOf(t)||t.isChildOf(o.tileID))&&(o.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 o of this._renderableTilesKeys){let c=this._tiles[o].tileID,p=t.clone(),m=l.bk();if(c.canonical.equals(t.canonical))l.c7(m,0,l.a5,l.a5,0,0,1);else if(c.canonical.isChildOf(t.canonical)){let _=c.canonical.z-t.canonical.z,v=c.canonical.x-(c.canonical.x>>_<<_),T=c.canonical.y-(c.canonical.y>>_<<_),P=l.a5>>_;l.c7(m,0,P,P,0,0,1),l.O(m,m,[-v*P,-T*P,0])}else{if(!t.canonical.isChildOf(c.canonical))continue;{let _=t.canonical.z-c.canonical.z,v=t.canonical.x-(t.canonical.x>>_<<_),T=t.canonical.y-(t.canonical.y>>_<<_),P=l.a5>>_;l.c7(m,0,l.a5,l.a5,0,0,1),l.O(m,m,[v*P,T*P,0]),l.Q(m,m,[1/2**_,1/2**_,0])}}p.terrainRttPosMatrix32f=new Float32Array(m),n[o]=p}return n}_getTerrainCoordsForTileRanges(t,n){let o={};for(let c of this._renderableTilesKeys){let p=this._tiles[c].tileID;if(!this._isWithinTileRanges(p,n))continue;let m=t.clone(),_=l.bk();if(p.canonical.z===t.canonical.z){let v=t.canonical.x-p.canonical.x+t.wrap*(1<<t.canonical.z),T=t.canonical.y-p.canonical.y;l.c7(_,0,l.a5,l.a5,0,0,1),l.O(_,_,[v*l.a5,T*l.a5,0])}else if(p.canonical.z>t.canonical.z){let v=p.canonical.z-t.canonical.z,T=p.canonical.x-(p.canonical.x>>v<<v)+t.wrap*(1<<p.canonical.z),P=p.canonical.y-(p.canonical.y>>v<<v),E=t.canonical.x-(p.canonical.x>>v),C=t.canonical.y-(p.canonical.y>>v),D=l.a5>>v;l.c7(_,0,D,D,0,0,1),l.O(_,_,[-T*D+E*l.a5,-P*D+C*l.a5,0])}else{let v=t.canonical.z-p.canonical.z,T=t.canonical.x-(t.canonical.x>>v<<v)+t.wrap*(1<<t.canonical.z),P=t.canonical.y-(t.canonical.y>>v<<v),E=(t.canonical.x>>v)-p.canonical.x,C=(t.canonical.y>>v)-p.canonical.y,D=l.a5<<v;l.c7(_,0,D,D,0,0,1),l.O(_,_,[T*l.a5+E*D,P*l.a5+C*D,0])}m.terrainRttPosMatrix32f=new Float32Array(_),o[c]=m}return o}getSourceTile(t,n){let o=this.tileManager._source,c=t.overscaledZ-this.deltaZoom;if(c>o.maxzoom&&(c=o.maxzoom),c<o.minzoom)return;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(c).key);let p=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(p!=null&&p.dem)&&n)for(;c>=o.minzoom&&!(p!=null&&p.dem);)p=this.findTileInCaches(t.scaledTo(c--).key);return p}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 o=n[t.canonical.z];return!!o&&(t.wrap>o.minWrap||t.wrap<o.maxWrap||t.canonical.x>=o.minTileXWrapped&&t.canonical.x<=o.maxTileXWrapped&&t.canonical.y>=o.minTileY&&t.canonical.y<=o.maxTileY)}}class ti{constructor(t,n,o){this._meshCache={},this.painter=t,this.tileManager=new qt(n),this.options=o,this.exaggeration=typeof o.exaggeration=="number"?o.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,o,c=l.a5){var p;let m=t.normalizeCoordinates(n,o,c);if(!m)return 0;let _=this.getTerrainData(m.tileID),v=(p=_.tile)===null||p===void 0?void 0:p.dem;if(!v)return 0;let T=l.cD([],[m.x/c*l.a5,m.y/c*l.a5],_.u_terrain_matrix),P=[T[0]*v.dim,T[1]*v.dim],E=Math.floor(P[0]),C=Math.floor(P[1]),D=P[0]-E,B=P[1]-C;return v.get(E,C)*(1-D)*(1-B)+v.get(E+1,C)*D*(1-B)+v.get(E,C+1)*(1-D)*B+v.get(E+1,C+1)*D*B}getElevationForLngLatZoom(t,n){if(!l.cE(n,t.wrap()))return 0;let{tileID:o,mercatorX:c,mercatorY:p}=this._getOverscaledTileIDFromLngLatZoom(t,n);return this.getElevation(o,c%l.a5,p%l.a5,l.a5)}getElevationForLngLat(t,n){let o=zt(n,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),c=0;for(let p of o)p.canonical.z>c&&(c=Math.min(p.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,c)}getElevation(t,n,o,c=l.a5){return this.getDEMElevation(t,n,o,c)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let c=this.painter.context,p=new l.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new l.T(c,p,c.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new l.T(c,new l.R({width:1,height:1}),c.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=l.ar([])}let n=this.tileManager.getSourceTile(t,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){let c=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new l.T(c,n.dem.getPixels(),c.gl.RGBA,{premultiply:!1}),n.demTexture.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}let o=n&&n.toString()+n.tileID.key+t.key;if(o&&!this._demMatrixCache[o]){let c=this.tileManager.getSource().maxzoom,p=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=c?p=t.canonical.z-c:l.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let m=t.canonical.x-(t.canonical.x>>p<<p),_=t.canonical.y-(t.canonical.y>>p<<p),v=l.cF(new Float64Array(16),[1/(l.a5<<p),1/(l.a5<<p),0]);l.O(v,v,[m*l.a5,_*l.a5,0]),this._demMatrixCache[t.key]={matrix:v,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:o?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(t){let n=this.painter,o=n.width/devicePixelRatio,c=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===o&&this._fbo.height===c||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new l.T(n.context,{width:o,height:c,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 l.T(n.context,{width:o,height:c,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(o,c,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,o,c))),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 p=0,m=0;p<this._coordsTextureSize;p++)for(let _=0;_<this._coordsTextureSize;_++,m+=4)n[m+0]=255&_,n[m+1]=255&p,n[m+2]=_>>8<<4|p>>8,n[m+3]=0;let o=new l.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new l.T(t,o,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let n=new Uint8Array(4),o=this.painter.context,c=o.gl,p=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),m=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),_=Math.round(this.painter.height/devicePixelRatio);o.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(p,_-m-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),o.bindFramebuffer.set(null);let v=n[0]+(n[2]>>4<<8),T=n[1]+((15&n[2])<<8),P=this.coordsIndex[255-n[3]],E=P&&this.tileManager.getTileByID(P);if(!E)return null;let C=this._coordsTextureSize,D=(1<<E.tileID.canonical.z)*C;return new l.a9((E.tileID.canonical.x*C+v)/D+E.tileID.wrap,(E.tileID.canonical.y*C+T)/D,this.getElevation(E.tileID,v,T,C))}depthAtPoint(t){let n=new Uint8Array(4),o=this.painter.context,c=o.gl;return o.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),o.bindFramebuffer.set(null),(n[0]/16777216+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(t){var n;let o=((n=this.painter.style.projection)===null||n===void 0?void 0:n.transitionState)>0,c=o&&t.canonical.y===0,p=o&&t.canonical.y===(1<<t.canonical.z)-1,m=`m_${c?"n":""}_${p?"s":""}`;if(this._meshCache[m])return this._meshCache[m];let _=this.painter.context,v=new l.cG,T=new l.aY,P=this.meshSize,E=l.a5/P,C=P*P;for(let J=0;J<=P;J++)for(let se=0;se<=P;se++)v.emplaceBack(se*E,J*E,0);for(let J=0;J<C;J+=P+1)for(let se=0;se<P;se++)T.emplaceBack(se+J,P+se+J+1,P+se+J+2),T.emplaceBack(se+J,P+se+J+2,se+J+1);let D=v.length,B=D+(P+1),q=(P+1)*P,W=c?l.br:0,$=c?0:1,Y=p?l.bs:l.a5,ee=p?0:1;for(let J=0;J<=P;J++)v.emplaceBack(J*E,W,$);for(let J=0;J<=P;J++)v.emplaceBack(J*E,Y,ee);for(let J=0;J<P;J++)T.emplaceBack(q+J,B+J,B+J+1),T.emplaceBack(q+J,B+J+1,q+J+1),T.emplaceBack(0+J,D+J+1,D+J),T.emplaceBack(0+J,0+J+1,D+J+1);let X=v.length,te=X+2*(P+1);for(let J of[0,1])for(let se=0;se<=P;se++)for(let ye of[0,1])v.emplaceBack(J*l.a5,se*E,ye);for(let J=0;J<2*P;J+=2)T.emplaceBack(X+J,X+J+1,X+J+3),T.emplaceBack(X+J,X+J+3,X+J+2),T.emplaceBack(te+J,te+J+3,te+J+1),T.emplaceBack(te+J,te+J+2,te+J+3);let ne=new Da(_.createVertexBuffer(v,qo.members),_.createIndexBuffer(T),l.aX.simpleSegment(0,0,v.length,T.length));return this._meshCache[m]=ne,ne}getMeshFrameDelta(t){return 2*Math.PI*l.bE/Math.pow(2,Math.max(t,0))
808/5}getMinTileElevationForLngLatZoom(t,n){var o;if(!l.cE(n,t.wrap()))return 0;let{tileID:c}=this._getOverscaledTileIDFromLngLatZoom(t,n);return(o=this.getMinMaxElevation(c).minElevation)!==null&&o!==void 0?o:0}getMinMaxElevation(t){let n=this.getTerrainData(t).tile,o={minElevation:null,maxElevation:null};return n&&n.dem&&(o.minElevation=n.dem.min*this.exaggeration,o.maxElevation=n.dem.max*this.exaggeration),o}_getOverscaledTileIDFromLngLatZoom(t,n){let o=l.a9.fromLngLat(t.wrap()),c=(1<<n)*l.a5,p=o.x*c,m=o.y*c,_=Math.floor(p/l.a5),v=Math.floor(m/l.a5);return{tileID:new l.a2(n,0,n,_,v),mercatorX:p,mercatorY:m}}}class Tu{constructor(t,n,o){this._context=t,this._size=n,this._tileSize=o,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),o=new l.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return o.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(o.texture),{id:t,fbo:n,texture:o,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 Zr={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class $s{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Tu(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 o,c;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(p=>!t._layers[p].isHidden(n)),this._coordsAscending={};for(let p in t.tileManagers){this._coordsAscending[p]={};let m=t.tileManagers[p].getVisibleCoordinates(),_=t.tileManagers[p].getSource(),v=_ instanceof en?_.terrainTileRanges:null;for(let T of m){let P=this.terrain.tileManager.getTerrainCoords(T,v);for(let E in P)this._coordsAscending[p][E]||(this._coordsAscending[p][E]=[]),this._coordsAscending[p][E].push(P[E])}}this._rttFingerprints={};for(let p of t._order){let m=t._layers[p],_=m.source;if(Zr[m.type]&&!this._rttFingerprints[_]){this._rttFingerprints[_]={};let v=(c=(o=t.tileManagers[_])===null||o===void 0?void 0:o.getState().revision)!==null&&c!==void 0?c:0;for(let T in this._coordsAscending[_])this._rttFingerprints[_][T]=`${this._coordsAscending[_][T].map(P=>P.key).sort().join()}#${v}`}}for(let p of this._renderableTiles)for(let m in this._rttFingerprints){let _=this._rttFingerprints[m][p.tileID.key];_&&_!==p.rttFingerprint[m]&&(p.rtt=[])}}renderLayer(t,n){if(t.isHidden(this.painter.transform.zoom))return!1;let o=Object.assign(Object.assign({},n),{isRenderingToTexture:!0}),c=t.type,p=this.painter,m=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Zr[c]&&(this._prevType&&Zr[this._prevType]||this._stacks.push([]),this._prevType=c,this._stacks[this._stacks.length-1].push(t.id),!m))return!0;if(Zr[this._prevType]||Zr[c]&&m){this._prevType=c;let _=this._stacks.length-1,v=this._stacks[_]||[];
808for(let T of this._renderableTiles){if(this.pool.isFull()&&(Kl(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(T),T.rtt[_]){let E=this.pool.getObjectForId(T.rtt[_].id);if(E.stamp===T.rtt[_].stamp){this.pool.useObject(E);continue}}let P=this.pool.getOrCreateFreeObject();this.pool.useObject(P),this.pool.stampObject(P),T.rtt[_]={id:P.id,stamp:P.stamp},p.context.bindFramebuffer.set(P.fbo.framebuffer),p.context.clear({color:l.bp.transparent,stencil:0}),p.currentStencilSource=void 0;for(let E=0;E<v.length;E++){let C=p.style._layers[v[E]],D=C.source?this._coordsAscending[C.source][T.tileID.key]:[T.tileID];p.context.viewport.set([0,0,P.fbo.width,P.fbo.height]),p._renderTileClippingMasks(C,D,!0),p.renderLayer(p,p.style.tileManagers[C.source],C,D,o),C.source&&(T.rttFingerprint[C.source]=this._rttFingerprints[C.source][T.tileID.key])}}return Kl(this.painter,this.terrain,this._rttTiles,o),this._rttTiles=[],this.pool.freeAllObjects(),Zr[c]}return!1}}let hc={"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"},uc=U,Ws={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:cc,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:l.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},$o={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class dc{constructor(t,n,o=!1){this.mousedown=p=>{this.startMove(p,ce.mousePos(this.element,p)),ce.addEventListener(window,"mousemove",this.mousemove),ce.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=p=>{this.move(p,ce.mousePos(this.element,p))},this.mouseup=p=>{this._rotatePitchHandler.dragEnd(p),this.offTemp()},this.touchstart=p=>{p.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ce.touchPos(this.element,p.targetTouches)[0],this.startMove(p,this._startPos),ce.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ce.addEventListener(window,"touchend",this.touchend))},this.touchmove=p=>{p.targetTouches.length!==1?this.reset():(this._lastPos=ce.touchPos(this.element,p.targetTouches)[0],this.move(p,this._lastPos))},this.touchend=p=>{p.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 c=new tc;this._rotatePitchHandler=new hn({clickTolerance:3,move:(p,m)=>{let _=n.getBoundingClientRect(),v=new l.P((_.bottom-_.top)/2,(_.right-_.left)/2);return{bearingDelta:l.cy(new l.P(p.x,m.y),m,v),pitchDelta:o?-.5*(m.y-p.y):void 0}},moveStateManager:c,enable:!0,assignEvents:()=>{}}),this.map=t,ce.addEventListener(n,"mousedown",this.mousedown),ce.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),ce.addEventListener(n,"touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),ce.disableDrag()}move(t,n){let o=this.map,{bearingDelta:c,pitchDelta:p}=this._rotatePitchHandler.dragMove(t,n)||{};
808c&&o.setBearing(o.getBearing()+c),p&&o.setPitch(o.getPitch()+p)}off(){let t=this.element;ce.removeEventListener(t,"mousedown",this.mousedown),ce.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),ce.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ce.removeEventListener(window,"touchend",this.touchend),ce.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){ce.enableDrag(),ce.removeEventListener(window,"mousemove",this.mousemove),ce.removeEventListener(window,"mouseup",this.mouseup),ce.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ce.removeEventListener(window,"touchend",this.touchend)}}let dn;function Hs(d,t,n,o=!1){if(o||!n.getCoveringTilesDetailsProvider().allowWorldCopies())return d==null?void 0:d.wrap();let c=new l.V(d.lng,d.lat);if(d=new l.V(d.lng,d.lat),t){let p=new l.V(d.lng-360,d.lat),m=new l.V(d.lng+360,d.lat),_=n.locationToScreenPoint(d).distSqr(t);n.locationToScreenPoint(p).distSqr(t)<_?d=p:n.locationToScreenPoint(m).distSqr(t)<_&&(d=m)}for(;Math.abs(d.lng-n.center.lng)>180;){let p=n.locationToScreenPoint(d);if(p.x>=0&&p.y>=0&&p.x<=n.width&&p.y<=n.height)break;d.lng>n.center.lng?d.lng-=360:d.lng+=360}return d.lng!==c.lng&&n.isPointOnMapSurface(n.locationToScreenPoint(d))?d:c}let Wo={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 Xs(d,t,n){let o=d.classList;for(let c in Wo)o.remove(`maplibregl-${n}-anchor-${c}`);o.add(`maplibregl-${n}-anchor-${t}`)}class Ho extends l.E{constructor(t){if(super(),this._onClick=n=>{this.fire(new l.l("click",{originalEvent:n}))},this._onKeyPress=n=>{let o=n.code,c=n.charCode||n.keyCode;o!=="Space"&&o!=="Enter"&&c!==32&&c!==13||this.togglePopup()},this._onMapClick=n=>{let o=n.originalEvent.target,c=this._element;this._popup&&(o===c||c.contains(o))&&this.togglePopup()},this._update=n=>{if(!this._map)return;let o=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!o)&&this._map.once("render",this._update),this._lngLat=Hs(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 c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),ce.setTransform(this._element,`${Wo[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${p} ${c}`),Ve.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(n&&n.type==="moveend")}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){let o=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=o}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 l.l("dragstart"))),this.fire(new l.l("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 l.l("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&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t==null?void 0:t.opacity,t==null?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=l.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ce.create("div");let n=ce.createNS("http://www.w3.org/2000/svg","svg"),o=41,c=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${o}px`),n.setAttributeNS(null,"width",`${c}px`),n.setAttributeNS(null,"viewBox",`0 0 ${c} ${o}`);let p=ce.createNS("http://www.w3.org/2000/svg","g");
808p.setAttributeNS(null,"stroke","none"),p.setAttributeNS(null,"stroke-width","1"),p.setAttributeNS(null,"fill","none"),p.setAttributeNS(null,"fill-rule","evenodd");let m=ce.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");let _=ce.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");let v=[{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 $ of v){let Y=ce.createNS("http://www.w3.org/2000/svg","ellipse");Y.setAttributeNS(null,"opacity","0.04"),Y.setAttributeNS(null,"cx","10.5"),Y.setAttributeNS(null,"cy","5.80029008"),Y.setAttributeNS(null,"rx",$.rx),Y.setAttributeNS(null,"ry",$.ry),_.appendChild(Y)}let T=ce.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill",this._color);let P=ce.createNS("http://www.w3.org/2000/svg","path");P.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"),T.appendChild(P);let E=ce.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");let C=ce.createNS("http://www.w3.org/2000/svg","path");C.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"),E.appendChild(C);let D=ce.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"transform","translate(6.0, 7.0)"),D.setAttributeNS(null,"fill","#FFFFFF");let B=ce.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(8.0, 8.0)");let q=ce.createNS("http://www.w3.org/2000/svg","circle");q.setAttributeNS(null,"fill","#000000"),q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"cx","5.5"),q.setAttributeNS(null,"cy","5.5"),q.setAttributeNS(null,"r","5.4999962");let W=ce.createNS("http://www.w3.org/2000/svg","circle");W.setAttributeNS(null,"fill","#FFFFFF"),W.setAttributeNS(null,"cx","5.5"),W.setAttributeNS(null,"cy","5.5"),W.setAttributeNS(null,"r","5.4999962"),B.appendChild(q),B.appendChild(W),m.appendChild(_),m.appendChild(T),m.appendChild(E),m.a
808ppendChild(D),m.appendChild(B),n.appendChild(m),n.setAttributeNS(null,"height",o*this._scale+"px"),n.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(n),this._offset=l.P.convert(t&&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()}),Xs(this._element,this._anchor,"marker"),this._element.addEventListener("click",this._onClick),t&&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.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),ce.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=l.V.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 c=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":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],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,o;let c=(n=this._map)===null||n===void 0?void 0:n.terrain,p=this._map.transform.isLocationOccluded(this._lngLat);if(!c||p){let D=p?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==D&&(this._element.style.opacity=D))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let m=this._map,_=m.terrain.depthAtPoint(this._pos),v=m.terrain.getElevationForLngLat(this._lngLat,m.transform);if(m.transform.lngLatToCameraDepth(this._lngLat,v)-_<.006)return void(this._element.style.opacity=this._opacity);let T=-this._offset.y/m.transform.pixelsPerMeter,P=Math.sin(m.getPitch()*Math.PI/180)*T,E=m.terrain.depthAtPoint(new l.P(this._pos.x,this._pos.y-this._offset.y)),C=m.transform.lngLatToCameraDepth(this._lngLat,v+P)-E>.006;!((o=this._popup)===null||o===void 0)&&o.isOpen()&&C&&this._popup.remove(),this._element.style.opacity=C?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=l.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=t),n!==void 0&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}let pc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0}
808,$a=0,ha=!1,Ys={maxWidth:100,unit:"metric"};function Ks(d,t,n){let o=n&&n.maxWidth||100,c=d._container.clientHeight/2,p=d._container.clientWidth/2,m=d.unproject([p-o/2,c]),_=d.unproject([p+o/2,c]),v=Math.round(d.project(_).x-d.project(m).x),T=Math.min(o,v,d._container.clientWidth),P=m.distanceTo(_);if(n&&n.unit==="imperial"){let E=3.2808*P;E>5280?ua(t,T,E/5280,d._getUIString("ScaleControl.Miles")):ua(t,T,E,d._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?ua(t,T,P/1852,d._getUIString("ScaleControl.NauticalMiles")):P>=1e3?ua(t,T,P/1e3,d._getUIString("ScaleControl.Kilometers")):ua(t,T,P,d._getUIString("ScaleControl.Meters"))}function ua(d,t,n,o){let c=function(p){let m=Math.pow(10,`${Math.floor(p)}`.length-1),_=p/m;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(v){let T=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*T)/T}(_),m*_}(n);d.style.width=t*(c/n)+"px",d.innerHTML=`${c} ${o}`}let Js={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},fc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Qs(d){if(d){if(typeof d=="number"){let t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new l.P(0,0),top:new l.P(0,d),"top-left":new l.P(t,t),"top-right":new l.P(-t,t),bottom:new l.P(0,-d),"bottom-left":new l.P(t,-t),"bottom-right":new l.P(-t,-t),left:new l.P(d,0),right:new l.P(-d,0)}}if(d instanceof l.P||Array.isArray(d)){let t=l.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:l.P.convert(d.center||[0,0]),top:l.P.convert(d.top||[0,0]),"top-left":l.P.convert(d["top-left"]||[0,0]),"top-right":l.P.convert(d["top-right"]||[0,0]),bottom:l.P.convert(d.bottom||[0,0]),"bottom-left":l.P.convert(d["bottom-left"]||[0,0]),"bottom-right":l.P.convert(d["bottom-right"]||[0,0]),left:l.P.convert(d.left||[0,0]),right:l.P.convert(d.right||[0,0])}}return Qs(new l.P(0,0))}let mc=U;b.AJAXError=l.cJ,b.EXTENT=l.a5,b.Event=l.l,b.Evented=l.E,b.LngLat=l.V,b.MercatorCoordinate=l.a9,b.Point=l.P,b.addProtocol=l.cK,b.config=l.c,b.removeProtocol=l.cL,b.AttributionControl=wu,b.BoxZoomHandler=Gr,b.CanvasSource=Ia,b.CooperativeGesturesHandler=et,b.DoubleClickZoomHandler=lc,b.DragPanHandler=Ar,b.DragRotateHandler=Zo,b.EdgeInsets=nn,b.FullscreenControl=class extends l.E{constructor(d={}){var t;super(),this._onFullscreenChange=()=>{var n;let o=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((n=o==null?void 0:o.shadowRoot)===null||n===void 0)&&n.fullscreenElement;)o=o.shadowRoot.fullscreenElement;o===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&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:l.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=ce.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ce.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let d=this._fullscreenButton=ce.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ce.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 l.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new l.l("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()}},b.GeoJSONSource=Qr,b.GeolocateControl=class extends l.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new l.l("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_E
808RROR":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 l.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new l.V(t.coords.longitude,t.coords.latitude),o=t.coords.accuracy,c=this._map.getBearing(),p=l.e({bearing:c},this.options.fitBoundsOptions),m=Bt.fromLngLat(n,o);this._map.fitBounds(m,p,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new l.V(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&&ha)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new l.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=ce.create("button","maplibregl-ctrl-geolocate",this._container),ce.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){l.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=ce.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ho({element:this._dotElement}),this._circleElement=ce.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ho({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",n=>{let o=(n==null?void 0:n[0])instanceof ResizeObserverEntry;n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o||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 l.l("trackuserlocationend")),this.fire(new l.l("userlocationlostfocus")))})}},this.options=l.e({},pc,d)}onAdd(d){return this._map=d,this._container=ce.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return l._(this,arguments,void 0,function*(t=!1){if(dn!==void 0&&!t)return dn;if(window.navigator.permissions===void 0)return dn=!!window.navigator.geolocation,dn;try{dn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{dn=!!window.navigator.geolocation}return dn})}().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(),ce.remove(this._container),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,$a=0,ha=!1}
vendor: 5,490 bytes, line 808
808_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]),o=d.distanceTo(n)/100,c=2*this._accuracy/o;this._circleElement.style.width=`${c.toFixed(2)}px`,this._circleElement.style.height=`${c.toFixed(2)}px`}trigger(){if(!this._setup)return l.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 l.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$a--,ha=!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 l.l("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 l.l("trackuserlocationstart")),this.fire(new l.l("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"),$a++,$a>1?(d={maximumAge:6e5,timeout:0},ha=!0):(d=this.options.positionOptions,ha=!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)}},b.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=ce.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=ce.create("button","maplibregl-ctrl-globe",this._container),ce.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(){ce.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}}
808,b.Hash=Bo,b.ImageSource=en,b.KeyboardHandler=xu,b.LngLatBounds=Bt,b.LogoControl=Su,b.Map=class extends Dr{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;l.cH.mark(l.cI.create);let o=Object.assign(Object.assign(Object.assign({},Ws),d),{canvasContextAttributes:Object.assign(Object.assign({},Ws.canvasContextAttributes),d.canvasContextAttributes)});if(o.minZoom!=null&&o.maxZoom!=null&&o.minZoom>o.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(o.minPitch!=null&&o.maxPitch!=null&&o.minPitch>o.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(o.minPitch!=null&&o.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(o.maxPitch!=null&&o.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");let c=new nr,p=new ea;o.minZoom!==void 0&&c.setMinZoom(o.minZoom),o.maxZoom!==void 0&&c.setMaxZoom(o.maxZoom),o.minPitch!==void 0&&c.setMinPitch(o.minPitch),o.maxPitch!==void 0&&c.setMaxPitch(o.maxPitch),o.renderWorldCopies!==void 0&&c.setRenderWorldCopies(o.renderWorldCopies),o.transformConstrain!==null&&c.setConstrainOverride(o.transformConstrain),super(c,p,{bearingSnap:o.bearingSnap,zoomSnap:o.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Gd,this._controls=[],this._mapId=l.af(),this._lostContextStyle={style:null,images:null},this._contextLost=_=>{if(_.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let v of Object.values(this.style._layers))if(v.type==="custom"&&console.warn(`Custom layer with id '${v.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),v._listeners)for(let[T]of Object.entries(v._listeners))console.warn(`Custom layer with id '${v.id}' had event listeners for event '${T}' 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 l.l("webglcontextlost",{originalEvent:_}))}else this.fire(new l.l("webglcontextlost",{originalEvent:_}))},this._contextRestored=_=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new l.l("webglcontextrestored",{originalEvent:_}))},this._onMapScroll=_=>{if(_.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=o.interactive,this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},o.canvasContextAttributes),this._trackResize=o.trackResize===!0,this._bearingSnap=o.bearingSnap,this._zoomSnap=o.zoomSnap,this._centerClampedToGround=o.centerClampedToGround,this._refreshExpiredTiles=o.refreshExpiredTiles===!0,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=o.crossSourceCollisions===!0,this._collectResourceTiming=o.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},hc),o.locale),this._clickTolerance=o.clickTolerance,this._overridePixelRatio=o.pixelRatio,this._maxCanvasSize=o.maxCanvasSize,this._zoomLevelsToOverscale=o.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=o.transformCameraUpdate,this.transformConstrain=o.transformConstrain,this.cancelPendingTileRequestsWhileZooming=o.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(o.anisotropicFilterPitch),o.reduceMotion!==void 0&&(Ve.prefersReducedMotion=o.reduceMotion),this._imageQueueHandle=gi.addThrottleControl(()=>this.isMoving()),this._requestManager=new Xr(o.transformRequest),this._container=this._resolveContainer(o.container),o.maxBounds&&this.setMaxBounds(o.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.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Vi(this,o),this._hash=o.hash&&new Bo(typeof o.hash=="string"&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,roll:o.roll}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,l.e({},o.fitBoundsOptions,{duration:0}))));let m=typeof o.style=="string"||((n=(t=o.style)===null||t===void 0?void 0:t.projection)===null||n===void 0?void 0:n.type)!=="globe";this.resize(null,m),this._localIdeographFontFamily=o.localIdeographFontFamily,this._val
808idateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new wu(typeof o.attributionControl=="boolean"?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new Su,o.logoPosition),this.on("style.load",()=>{if(m||this._resizeTransform(),this.transform.unmodified){let _=l.U(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(_)}}),this.on("data",_=>{this._update(_.dataType==="style"),this.fire(new l.l(`${_.dataType}data`,_))}),this.on("dataloading",_=>{this.fire(new l.l(`${_.dataType}dataloading`,_))}),this.on("dataabort",_=>{this.fire(new l.l("sourcedataabort",_))})}_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||!d.onAdd)return this.fire(new l.k(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 o=this._controlPositions[t];return t.indexOf("bottom")!==-1?o.insertBefore(n,o.firstChild):o.appendChild(n),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new l.k(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.indexOf(d)>-1}coveringTiles(d){return zt(this.transform,d)}calculateCameraOptionsFromTo(d,t,n,o){return o==null&&this.terrain&&(o=this.terrain.getElevationForLngLat(n,this.transform)),super.calculateCameraOptionsFromTo(d,t,n,o)}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 l.l("movestart",d)).fire(new l.l("move",d))),this.fire(new l.l("resize",d)),n&&this.fire(new l.l("moveend",d)),this}_resizeInternal(d=!0){let[t,n]=this._containerDimensions(),o=this._getClampedPixelRatio(t,n);if(this._resizeCanvas(t,n,o),this.painter.resize(t,n,o),this.painter.overLimit()){let c=this.painter.context.gl;this._maxCanvasSize=[c.drawingBufferWidth,c.drawingBufferHeight];let p=this._getClampedPixelRatio(t,n);this._resizeCanvas(t,n,p),this.painter.resize(t,n,p)}this._resizeTransform(d)}_resizeTransform(d=!0){var t;let[n,o]=this._containerDimensions();this.transform.resize(n,o,d),(t=this._requestedCameraState)===null||t===void 0||t.resize(n,o,d)}_getClampedPixelRatio(d,t){let{0:n,1:o}=this._maxCanvasSize,c=this.getPixelRatio(),p=d*c,m=t*c;return Math.min(p>n?n/p:1,m>o?o/m:1)*c}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(Bt.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 l.l("zoomstart")).fire(new l.l("zoom")).fire(new l.l("zoomend")).fire(new l.l("movestart")).fire(new l.l("move")).fire(new l.l("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 l.l("zoomstart")).fire(new l.l("zoom")).fire(new l.l("zoomend")).fire(new l.l("movestart")).fire(new l.l("move")).fire(new l.l("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 l.l("pitchstart")).fire(new l.l("pitch")).fire(new l.l("pitchend")).fire(new l.l("movestart")).fire(new l.l("move")).fire(new l.l("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();
808return n.setMaxPitch(d),this._applyUpdatedTransform(n),this._update(),t!==this.transform.pitch&&this.fire(new l.l("pitchstart")).fire(new l.l("pitch")).fire(new l.l("pitchend")).fire(new l.l("movestart")).fire(new l.l("move")).fire(new l.l("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(l.V.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.screenPointToLocation(l.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 o=!1;return{layers:t,listener:n,delegates:{mousemove:p=>{let m=t.filter(v=>this.getLayer(v)),_=m.length!==0?this.queryRenderedFeatures(p.point,{layers:m}):[];_.length?o||(o=!0,n.call(this,new sr(d,this,p.originalEvent,{features:_}))):o=!1},mouseout:()=>{o=!1}}}}if(d==="mouseleave"||d==="mouseout"){let o=!1;return{layers:t,listener:n,delegates:{mousemove:m=>{let _=t.filter(v=>this.getLayer(v));(_.length!==0?this.queryRenderedFeatures(m.point,{layers:_}):[]).length?o=!0:o&&(o=!1,n.call(this,new sr(d,this,m.originalEvent)))},mouseout:m=>{o&&(o=!1,n.call(this,new sr(d,this,m.originalEvent)))}}}}{let o=c=>{let p=t.filter(_=>this.getLayer(_)),m=p.length!==0?this.queryRenderedFeatures(c.point,{layers:p}):[];m.length&&(c.features=m,n.call(this,c),delete c.features)};return{layers:t,listener:n,delegates:{[d]:o}}}}_saveDelegatedListener(d,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(t)}_removeDelegatedListener(d,t,n){if(!this._delegatedListeners||!this._delegatedListeners[d])return;let o=this._delegatedListeners[d];for(let c=0;c<o.length;c++){let p=o[c];if(p.listener===n&&p.layers.length===t.length&&p.layers.every(m=>t.includes(m))){for(let m in p.delegates)this.off(m,p.delegates[m]);return void o.splice(c,1)}}}on(d,t,n){if(n===void 0)return super.on(d,t);let o=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,o,n);this._saveDelegatedListener(d,c);for(let p in c.delegates)this.on(p,c.delegates[p]);return{unsubscribe:()=>{this._removeDelegatedListener(d,o,n)}}}once(d,t,n){if(n===void 0)return super.once(d,t);let o=typeof t=="string"?[t]:t,c=this._createDelegatedListener(d,o,n);for(let p in c.delegates){let m=c.delegates[p];c.delegates[p]=(..._)=>{this._removeDelegatedListener(d,o,n),m(..._)}}this._saveDelegatedListener(d,c);for(let p in c.delegates)this.once(p,c.delegates[p]);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,o=d instanceof l.P||Array.isArray(d),c=o?d:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(o?{}:d)||{},c instanceof l.P||typeof c[0]=="number")n=[l.P.convert(c)];else{let p=l.P.convert(c[0]),m=l.P.convert(c[1]);n=[p,new l.P(m.x,p.y),m,new l.P(p.x,m.y),p]}return this.style.queryRenderedFeatures(n,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=l.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
808idateStyle},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,o;if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(d,t));let c=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Dl(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,c):this.style.loadJSON(d,t,c),this):((o=(n=this.style)===null||n===void 0?void 0:n.projection)===null||o===void 0||o.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Dl(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){if(typeof d=="string"){let n=this._requestManager.transformRequest(d,"Style");l.j(n,new AbortController).then(o=>{this._updateDiff(o.data,t)}).catch(o=>{o&&this.fire(new l.k(o))})}else typeof d=="object"&&this._updateDiff(d,t)}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(n){l.w(`Unable to perform style diff: ${n.message||n.error||n}. 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(){return this.style?this.style.loaded():l.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){let t=this.style&&this.style.tileManagers[d];if(t!==void 0)return t.loaded();this.fire(new l.k(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 o=this.style._layers[n];o.type==="hillshade"&&o.source===d.source&&l.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."),o.type==="color-relief"&&o.source===d.source&&l.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 ti(this.painter,t,d),this.painter.renderToTexture=new $s(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 o;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))),((o=n.source)===null||o===void 0?void 0:o.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.destruct(),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 l.l("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(){let d=this.style&&this.style.tileManagers;for(let t of Object.values(d))if(!t.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 o=this.getSource(n);if(!o)throw new Error(`There is no source with ID "${n}", cannot set LOD parameters`);o.calculateTileZoom=rt(Math.max(1,d),Math.max(1,t))}else for(let o in this.style.tileManagers)this.style.tileManagers[o].getSource().calculateTileZoom=rt(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(o=>new l.ac(o.z,o.x,o.y)))}addImage(d,t,n={}){let{pixelRatio:o=1,sdf:c=!1,stretchX:p,stretchY:m,content:_,textFitWidth:v,textFitHeight:T}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||l.b(t))){if
808(t.width===void 0||t.height===void 0)return this.fire(new l.k(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:P,height:E,data:C}=t,D=t;return this.style.addImage(d,{data:new l.R({width:P,height:E},new Uint8Array(C)),pixelRatio:o,stretchX:p,stretchY:m,content:_,textFitWidth:v,textFitHeight:T,sdf:c,version:0,userImage:D}),D.onAdd&&D.onAdd(this,d),this}}{let{width:P,height:E,data:C}=Ve.getImageData(t);this.style.addImage(d,{data:new l.R({width:P,height:E},C),pixelRatio:o,stretchX:p,stretchY:m,content:_,textFitWidth:v,textFitHeight:T,sdf:c,version:0})}}updateImage(d,t){let n=this.style.getImage(d);if(!n)return this.fire(new l.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let o=t instanceof HTMLImageElement||l.b(t)?Ve.getImageData(t):t,{width:c,height:p,data:m}=o;if(c===void 0||p===void 0)return this.fire(new l.k(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(c!==n.data.width||p!==n.data.height)return this.fire(new l.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));let _=!(t instanceof HTMLImageElement||l.b(t));return n.data.replace(m,_),this.style.updateImage(d,n),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new l.k(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return gi.getImage(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,o={}){return this.style.setPaintProperty(d,t,n,o),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,n,o={}){return this.style.setLayoutProperty(d,t,n,o),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,o=>{o||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=Ql(c=>{this._trackResize&&!this._removed&&(this.resize(c),this.redraw())},50),o=(d=this._ownerWindow.ResizeObserver)!==null&&d!==void 0?d:ResizeObserver;this._resizeObserver=new o(c=>{t?n(c):t=!0}),this._resizeObserver.observe(this._container)}
808_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=ce.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=ce.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(),o=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],o);let c=this._controlContainer=ce.create("div","maplibregl-control-container",d),p=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{p[m]=ce.create("div",`maplibregl-ctrl-${m} `,c)}),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",o=>{t={requestedAttributes:d},o&&(t.statusMessage=o.statusMessage,t.type=o.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 o="Failed to initialize WebGL";throw t?(t.message=o,new Error(JSON.stringify(t))):new Error(o)}this.painter=new cu(n,this.transform),Dt.testSupport(n)}migrateProjection(d,t){super.migrateProjection(d,t),this.painter.transform=d,this.fire(new l.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style&&this.style._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,o,c,p;let m=this._idleTriggered?this._fadeDuration:0,_=((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 v=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let E=this.transform.zoom,C=Ge();this.style.zoomHistory.update(E,C);let D=new l.H(E,{now:C,fadeDuration:m,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),B=D.crossFadingFactor();B===1&&B===this._crossFadingFactor||(v=!0,this._crossFadingFactor=B),this.style.update(D)}let T=((n=this.style.projection)===null||n===void 0?void 0:n.transitionState)>0!==_;(o=this.style.projection)===null||o===void 0||o.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((c=this.style.projection)===null||c===void 0?void 0:c.transitionState,(p=this.style.projection)===null||p===void 0?void 0:p.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||T)&&(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._centerClampedToGroun
808d&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,m,this._crossSourceCollisions,T),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:m,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new l.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.cH.mark(l.cI.load),this.fire(new l.l("load"))),this.style&&(this.style.hasTransitions()||v)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let P=this._sourcesDirty||this._styleDirty||this._placementDirty;return P||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.l("idle")),!this._loaded||this._fullyLoaded||P||(this._fullyLoaded=!0,l.cH.mark(l.cI.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d;this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),gi.removeThrottleControl(this._imageQueueHandle),(d=this._resizeObserver)===null||d===void 0||d.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t!=null&&t.loseContext&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ce.remove(this._canvasContainer),ce.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),l.cH.remove(),this._removed=!0,this.fire(new l.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Ve.frame(this._frameRequest,d=>{l.cH.recordStartOfFrameAt(d),this._frameRequest=null;try{this._render(d)}catch(t){if(!l.Z(t)&&!function(n){return n.message===Eo}(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 uc}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(d){return this._lazyInitEmptyStyle(),this.style.setProjection(d),this._update(!0)}},b.MapMouseEvent=sr,b.MapTouchEvent=Vo,b.MapWheelEvent=uu,b.Marker=Ho,b.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),o=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.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 o=this._map._getUIString(`NavigationControl.${n}`);t.title=o,t.setAttribute("aria-label",o)},this.options=l.e({},$o,d),this._container=ce.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})),ce.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})),ce.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=ce.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 dc(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ce.remove(this._container),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=ce.create("button",d,this._container);return n.type="button",n.addEventListener("click",t),n}},b.Popup=class extends l.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&&ce.remove(this._content),this._container&&(ce.remove(this._container),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("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new l.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ce.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ce.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let m of this.options.className.split(" "))this._container.classList.add(m);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Hs(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;let n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,c=Qs(this.options.offset);if(!o){let m=this._container.offsetWidth,_=this._container.offsetHeight,v=function(P){var E,C,D,B;return P?{top:(E=P.top)!==null&&E!==void 0?E:0,right:(C=P.right)!==null&&C!==void 0?C:0,bottom:(D=P.bottom)!==null&&D!==void 0?D:0,left:(B=P.left)!==null&&B!==void 0?B:0}:{top:0,right:0,bottom:0,left:0}}(this.options.padding),T;T=n.y+c.bottom.y<_+v.top?["top"]:n.y>this._map.transform.height-_-v.bottom?["bottom"]:[],n.x<m/2+v.left?T.push("left"):n.x>this._map.transform.width-m/2-v.right&&T.push("right"),o=T.length===0?"bottom":T.join("-")}let p=n.add(c[o]);this.options.subpixelPositioning||(p=p.round()),ce.setTransform(this._container,`${Wo[o]} translate(${p.x}px,${p.y}px)`),Xs(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=l.e(Object.create(Js),d)}
vendor: 4,533 bytes, line 808
808addTo(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._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),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 l.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=l.V.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._onMouseMove),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._onMouseMove),this._map.on("drag",this._onDrag),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"),o;for(n.innerHTML=d;o=n.firstChild,o;)t.appendChild(o);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=ce.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=ce.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(fc);d&&d.focus()}},b.RasterDEMTileSource=Pn,b.RasterTileSource=$n,b.ScaleControl=class{constructor(d){this._onMove=()=>{Ks(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ks(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ys),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=ce.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ce.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},b.ScrollZoomHandler=sc,b.Style=Dl,b.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=ce.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ce.create("button","maplibregl-ctrl-terrain",this._container),ce.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
808ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ce.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},b.TwoFingersTouchPitchHandler=un,b.TwoFingersTouchRotateHandler=_u,b.TwoFingersTouchZoomHandler=yu,b.TwoFingersTouchZoomRotateHandler=We,b.VectorTileSource=Pa,b.VideoSource=Mn,b.addSourceType=(d,t)=>l._(void 0,void 0,void 0,function*(){if(Ma(d))throw new Error(`A source type called "${d}" already exists.`);((n,o)=>{lo[n]=o})(d,t)}),b.clearPrewarmedResources=function(){let d=Ci;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Tn),Ci=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()"))},b.createTileMesh=_s,b.getMaxParallelImageRequests=function(){return l.c.MAX_PARALLEL_IMAGE_REQUESTS},b.getRTLTextPluginStatus=function(){return j().getRTLTextPluginStatus()},b.getVersion=function(){return mc},b.getWorkerCount=function(){return Jr.workerCount},b.getWorkerUrl=function(){return l.c.WORKER_URL},b.importScriptInWorkers=function(d){return Zn().broadcast("IS",d)},b.isTimeFrozen=function(){return ke.isFrozen()},b.now=Ge,b.prewarm=function(){Ta().acquire(Tn)},b.restoreNow=function(){ke.restoreNow()},b.setMaxParallelImageRequests=function(d){l.c.MAX_PARALLEL_IMAGE_REQUESTS=d},b.setNow=function(d){ke.setNow(d)},b.setRTLTextPlugin=function(d,t){return j().setRTLTextPlugin(d,t)},b.setWorkerCount=function(d){Jr.workerCount=d},b.setWorkerUrl=function(d){l.c.WORKER_URL=d}});var I=y;return I})});function $p(y){y||(td($p),y=li(as));let O=new Mg(G=>y.onDestroy(G.next.bind(G)));return G=>G.pipe(Og(O))}function rd(y,O){var l;!(O!=null&&O.injector)&&td(rd);let G=(l=O==null?void 0:O.injector)!=null?l:li(yl),I=new Lg(1),b=jn(()=>{let U;try{U=y()}catch(_e){qp(()=>I.error(_e));return}qp(()=>I.next(U))},{injector:G,manualCleanup:!0});return G.get(as).onDestroy(()=>{b.destroy(),I.complete()}),I.asObservable()}function cx(y,O){var _e,Te;let G=!(O!=null&&O.manualCleanup);G&&!(O!=null&&O.injector)&&td(cx);let I=G?(Te=(_e=O==null?void 0:O.injector)==null?void 0:_e.get(as))!=null?Te:li(as):null,b=hx(O==null?void 0:O.equal),l;O!=null&&O.requireSync?l=mr({kind:0},{equal:b}):l=mr({kind:1,value:O==null?void 0:O.initialValue},{equal:b});let U=y.subscribe({next:Ee=>l.set({kind:1,value:Ee}),error:Ee=>{if(O!=null&&O.rejectErrors)throw Ee;l.set({kind:2,error:Ee})}});if(O!=null&&O.requireSync&&l().kind===0)throw new Zp(601,!1);return I==null||I.onDestroy(U.unsubscribe.bind(U)),vn(()=>{let Ee=l();switch(Ee.kind){case 1:return Ee.value;case 2:throw Ee.error;case 0:throw new Zp(601,!1)}},{equal:O==null?void 0:O.equal})}function hx(y=Object.is){return(O,G)=>O.kind===1&&G.kind===1&&y(O.value,G.value)}var ga=function(y){return y.Start="start",y.Through="through",y.End="end",y}(ga||{});var _l=function(y){return y.Tourist="tourist",y.Hiking="hiking",y}(_l||{});var Jg=(()=>{let O=class O{constructor(){this.API_URL_ROUTING=Xg.apiRoutingUrl,this.http=li(Ug)}getRoute(I){let b=new Ng().set("profile",I.profile);for(let l of I.points)b=b.append("point",`${l.y},${l.x}`);return this.http.get(this.API_URL_ROUTING,{params:b}).pipe(ed(l=>{var _e;let U=(_e=l==null?void 0:l.status)!=null?_e:"-";return Eg(()=>new Error(U))}))}};O.\u0275fac=function(b){return new(b||O)},O.\u0275prov=io({token:O,factory:O.\u0275fac,providedIn:"root"});let y=O;return y})();function Qg(y,O,G,I){let l=Ee=>Ee*Math.PI/180,U=l(G-y),_e=l(I-O),Te=Math.sin(U/2)**2+Math.cos(l(y))*Math.cos(l(G))*Math.sin(_e/2)**2;return 6371e3*2*Math.atan2(Math.sqrt(Te),Math.sqrt(1-Te))}var ey=(()=>{let O=class O{constructor(){this.injector=li(yl),this.utils=li(id),this.routing=li(Jg),this.destroyRef=li(as),this.modalCtrl=li(Zg),this._routingInProgress=mr(!1),this._currDifficultyMode=mr(_l.Hiking),this._waypoints=mr([]),this._snapped_points=mr([]),this._snapData=mr({lines:[],snappedIndices:[]}),this._snapWarningEffect=jn(()=>{this._warning.set(this._snapData().snappedIndices.length>0)}),this._paths=mr([]),this._selectedPath=mr(null),this._alternativePaths=vn(()=>{let l=this._paths(),U=this._selectedPath();return U?l.filter(_e=>_e!==U):[]}),this._pendingPathIndex=mr(null),this._loading=mr(!1),this._error=mr(null),this._warning=mr(!1),this.routingInProgress=this._routingInProgress.asReadonly(),this.currDifficultyMode=this._currDifficultyMode.asReadonly(),this.waypoints=this._waypoints.asReadonly(),this.selectedPathIndex=vn(()=>this._paths().indexOf(this._selectedPath())),this.snaplines=vn(()=>this._snapData().lines),this.snappedIndices=vn(()=>this._snapData().snappedIndices),this.selectedPath=this._selectedPath.asReadonly(),this.alternativePaths=this._alternativePaths,this.loading=this._loading.asReadonly(),this.error=this._error.asReadonly(),this.warning=this._warning.asReadonly();let I=rd(this._waypoints),b=rd(this._currDifficultyMode);zg([I,b]).pipe(Dg(200),jg(1500,void 0,{leading:!0,trailing:!0}),kg(([l,U])=>({wps:l,dm:U,valid:this.validateInputs(l)})),Bg(({valid:l})=>{l||this.validationFailedClear()}),Ag(({valid:l})=>l),Fg(({wps:l,dm:U})=>{let _e=this.buildRouteQuery(l,U);return this._loading.set(!0),this.routing.getRoute(_e).pipe(Rg(()=>this._loading.set(!1)),ed(Te=>(this._snapped_points.set([]),this._snapData.set({lines:[],snappedIndices:[]}),this._selectedPath.set(null),["400","460","461","462","502","503"].includes(Te==null?void 0:Te.message)?this._error.set(Te==null?void 0:Te.message):this._error.set("default"),Cg)))}),$p(this.destroyRef)).subscribe(l=>{if(this._error.set(null),this._paths.set(l.paths),l.paths.length>
8080){let U=this._pendingPathIndex();U!==null&&U<l.paths.length?(this._selectedPath.set(l.paths[U]),this._pendingPathIndex.set(null)):this._selectedPath.set(l.paths[0])}this._snapped_points.set(l.snapped_points),this._snapData.set(this.calculateSnapData(this._waypoints(),this._snapped_points()))})}validateInputs(I){return!(I.length<2||I.some(b=>b==null))}buildRouteQuery(I,b){let l=[];return I.forEach(U=>l.push(this.getPoint(U))),{profile:b,points:l}}getPoint(I){return I.point?{x:I.bbox[0][0],y:I.bbox[0][1]}:{x:(I.bbox[0][0]+I.bbox[1][0])/2,y:(I.bbox[0][1]+I.bbox[1][1])/2}}calculateSnapData(I,b){let U=[],_e=[];if(I.length!=b.length)return{lines:U,snappedIndices:_e};for(let Te=0;Te<I.length;Te++){let Ee=I[Te],Oe=b[Te];if(!Ee)continue;let Ve=this.getPoint(Ee);Qg(Ve.y,Ve.x,Oe.y,Oe.x)>50&&(U.push({from:Ve,to:{x:Oe.x,y:Oe.y}}),_e.push(Te+1))}return{lines:U,snappedIndices:_e}}toogleDifficultyMode(){let I=this.currDifficultyMode()==_l.Tourist?_l.Hiking:_l.Tourist;this._currDifficultyMode.set(I)}addWaypoint(I,b){let l=this._waypoints();if(b!=null&&b<l.length)this._waypoints.update(U=>{let _e=[...U];return _e.splice(b,0,I),_e});else{if(I){let U=l.indexOf(null);if(U>-1){this.updateWaypoint(U,I);return}}this._waypoints.update(U=>[...U,I])}}updateWaypoint(I,b){this._waypoints.update(l=>{if(I<0||I>=l.length)return l;let U=[...l];return U[I]=b?Me({},b):null,U})}removeWaypoint(I){let b=this._waypoints();if(!(I<0||I>=b.length)){if(b.length<=2){this.updateWaypoint(I,null);return}this._waypoints.update(l=>{let U=[...l];return U.splice(I,1),U})}}reorderWaypoints(I,b){this._waypoints.update(l=>{let U=[...l],[_e]=U.splice(I,1);return U.splice(b,0,_e),U})}reverseDirection(){this._waypoints.update(I=>[...I].reverse())}clear(){this._waypoints.set([]),this._snapped_points.set([]),this._snapData.set({lines:[],snappedIndices:[]}),this._paths.set([]),this._selectedPath.set(null),this._loading.set(!1),this._error.set(null),this._warning.set(!1)}validationFailedClear(){this._snapped_points().length&&this._snapped_points.set([]),this._paths().length&&this._paths.set([]),this._selectedPath()!==null&&this._selectedPath.set(null),this._loading()&&this._loading.set(!1),this._error()!==null&&this._error.set(null)}startPlanning(I,b,l){return ht(this,null,function*(){let{MeasureService:U}=yield import("./chunk-USKPXDTQ.js"),_e=this.injector.get(U);if(_e.isMeasuring()&&_e.close(),I)switch(b){case ga.Start:this._waypoints.set([I,null]);break;case ga.Through:this._waypoints.set([null,I,null]);break;case ga.End:this._waypoints.set([null,I]);break;default:this._waypoints.set([null,I]);break}else this._waypoints.set([null,null]);this._routingInProgress.set(!0),this.utils.isLargeScreen()?this.openDesktopRoutePlanner():yield this.openMobileRoutePlanner()})}startPlanningFromSharedRoute(I,b,l){return ht(this,null,function*(){this._pendingPathIndex.set(l),this._currDifficultyMode.set(b),this._waypoints.set(I),this._routingInProgress.set(!0),this.utils.isLargeScreen()?this.openDesktopRoutePlanner():yield this.openMobileRoutePlanner()})}endPlanning(){this._routingInProgress.set(!1),document.documentElement.style.setProperty("--side-pannel-route-planning-offset","0px"),this.clear()}selectRoute(I){this._selectedPath.set(I)}clearError(){this._error.set(null)}clearWarning(){this._warning.set(!1)}openDesktopRoutePlanner(){document.documentElement.style.setProperty("--side-pannel-route-planning-offset","var(--side-pannel-route-planning-width)")}openMobileRoutePlanner(){return ht(this,null,function*(){let I=yield this.modalCtrl.create({component:(yield import("./chunk-H4SQPCV3.js")).ModalRoutePlannerComponent,breakpoints:[0,.5,1],initialBreakpoint:.5,showBackdrop:!1,backdropDismiss:!1,backdropBreakpoint:1,handle:!1,expandToScroll:!1,cssClass:"route-planner-modal"});I.onWillDismiss().then(b=>{b.role==="cancel"||b.role==="backdrop"?this.endPlanning():b.role==="gesture"&&this.openFooterRoutePlanner()}),yield I.present()})}openFooterRoutePlanner(){return ht(this,null,function*(){let I=yield this.modalCtrl.create({component:(yield import("./chunk-LXX6VLM6.js")).FooterRoutePlannerComponent,breakpoints:[0,1],initialBreakp
808oint:1,showBackdrop:!1,backdropDismiss:!1,backdropBreakpoint:1,handle:!1,cssClass:"footer-route-planner"});I.onWillDismiss().then(b=>{b.role!=null&&this.endPlanning()}),I.present()})}};O.\u0275fac=function(b){return new(b||O)},O.\u0275prov=io({token:O,factory:O.\u0275fac,providedIn:"root"});let y=O;return y})();var wn=Gp(nd());function iy(y){return{container:y,center:[19.95,49.215],zoom:10,hash:!0,minZoom:1.5,maxZoom:18,bearing:0,maxBounds:[[-179,-60],[179,75]],pitch:0,minPitch:0,maxPitch:0,attributionControl:!1,bearingSnap:10,fadeDuration:200,renderWorldCopies:!1,aroundCenter:!1}}var Bc="v0.7.6";function ry(){return{version:8,sources:{"tatramap-source":{type:"raster",tiles:["https://tatramap.eu/slope-v0.7/{z}/{x}/{y}.jpg"],tileSize:256,attribution:'\xA9 <a href="mailto:[email protected]">TatraMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | 0.7 | <a href="/data-sources">DTM providers</a>'},"valleys-source":{type:"raster",tiles:["https://tatramap.eu/valley-v0.25/{z}/{x}/{y}.jpg"],tileSize:256,attribution:'\xA9 <a href="mailto:[email protected]">TatraMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | 0.25 | <a href="/data-sources">DTM providers</a>'},"hillshade-source":{type:"raster",tiles:["https://tiles.sharpmap.app/hillshade1/{z}/{x}/{y}.jpg"],tileSize:256,attribution:`\xA9 <a href="mailto:[email protected]">SharpMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | ${Bc} | <a href="/data-sources">DTM providers</a>`,maxzoom:17},"raster-tiles":{type:"raster",tiles:["https://tiles.sharpmap.app/slope1/{z}/{x}/{y}.jpg"],tileSize:256,attribution:`\xA9 <a href="mailto:[email protected]">SharpMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | ${Bc} | <a href="/data-sources">DTM providers</a>`},"raster-tiles-orto":{type:"raster",tiles:["https://ortophoto.sharpmap.app/orto1/{z}/{x}/{y}.jpg"],tileSize:256,attribution:`\xA9 <a href="mailto:[email protected]">SharpMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | ${Bc} | Image providers:<a target="_blank" href="https://www.maptiler.com/satellite/"><img style="height:15px;padding:0;padding:0vertical-align:middle;vertical-align: -0.4em" src="assets/img/maptiler-logo.png"></a>and <a href="/data-sources">others</a>`},"winter-source":{type:"raster",tiles:["https://tiles.sharpmap.app/winter1/{z}/{x}/{y}.jpg"],tileSize:256,attribution:`\xA9 <a href="mailto:[email protected]">SharpMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | ${Bc} | <a href="/data-sources">DTM providers</a>`,maxzoom:17},"avalanche-source":{type:"raster",tiles:["https://tiles.sharpmap.app/avalanche2/{z}/{x}/{y}.webp"],tileSize:256,attribution:`\xA9 <a href="mailto:[email protected]">SharpMap</a> | \xA9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OSM contributors</a> | ${Bc} | <a href="/data-sources">DTM providers</a>`,minzoom:9,maxzoom:17},"terrain-rgb":{type:"raster-dem",tiles:["https://tiles.sharpmap.app/terrain2/{z}/{x}/{y}.png"],tileSize:256,maxzoom:16},"terrain-analysis-source":{type:"raster",tiles:["terrain-analysis://{z}/{x}/{y}"],tileSize:256,maxzoom:16},"vector-contours":{type:"vector",url:"assets/vector/tiles-contours.json",minzoom:10,maxzoom:16},vector:{type:"vector",url:"assets/vector/tiles.json",promoteId:"full_id",maxzoom:15},"vector-premium":{type:"vector",url:"assets/vector/tiles-premium.json",promoteId:"full_id",maxzoom:15},outlines:{type:"geojson",data:"https://tiles.sharpmap.app/data/outlines.geojson"},"outlines-labels":{type:"geojson",data:"https://tiles.sharpmap.app/data/outlines_labels.geojson"},regions_label:{type:"geojson",data:"https://tiles.sharpmap.app/data/regions_label.geojson",promoteId:"full_id"},"search-result":{type:"geojson",data:{type:"FeatureCollection",features:[]}}},glyphs:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",layers:[],sky:{"fog-ground-blend":.85}}}function ny(y,O={}){var b;let G=(b=O.chipId)!=null?b:"wp-chip";return{"hillshade-tiles":{id:"hillshade-tiles",type:"raster",source:"hillshade-source",paint:{"raster-opacity":1}},"tatramap-tiles":{id:"tatramap-tiles",type:"raster",source:"tatramap-source",paint:{"raster-opacity":1}},"valleys-tiles":{id:"valleys-tiles",type:"raster",source:"valleys-source",paint:{"raster-opacity":1}},"simple-tiles":{id:"simple-tiles",type:"raster",source:"raster-tiles",paint:{"raster-opacity":1,"raster-contrast":.1}},"simple-tiles-orto":{id:"simple-tiles-orto",type:"raster",source:"raster-tiles-orto",paint:{"raster-opacity":1,"raster-brightness-min":.15}},"winter-tiles":{id:"winter-tiles",type:"raster",source:"winter-source",paint:{"raster-opacity":1}},"avalanche-tiles":{id:"avalanche-tiles",type:"raster",source:"avalanche-source",paint:{"raster-opacity":.5}},"terrain-analysis-tiles":{id:"terrain-analysis-tiles",type:"raster",source:"terrain-analysis-source",paint:{"raster-opacity":.8}},"search-result-points":{id:"search-result-points",type:"symbol",source:"search-result",filter:["==","$type","Point"],layout:{"icon-image":"search-marker","icon-size":.3,"icon-anchor":"bottom","icon-allow-overlap":!0}},"search-result-lines":{id:"search-result-lines",type:"line",source:"search-result",filter:["any",["==","$type","Polygon"],["==","$type","LineString"]],paint:{"line-color":"#f4b93f","line-width":2.5}}
808,"search-result-outline":{id:"search-result-outline",type:"line",source:"search-result",filter:["any",["==","$type","Polygon"],["==","$type","LineString"]],paint:{"line-color":"#fff","line-width":5}},"selected-route-outline":{id:"selected-route-outline",type:"line",source:"selected-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":10,"line-color":"#ffffff"}},"selected-route-line":{id:"selected-route-line",type:"line",source:"selected-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":5,"line-color":["match",["get","hike_rating"],-1,"#9E9E9E",0,"#5ad660ff",1,"#5ad660ff",2,"#136ef7ff",3,"#FFDB02",4,"#E88603",5,"#ff0000ff",6,"#000000ff","#9E9E9E"]}},"selected-route-hit":{id:"selected-route-hit",type:"line",source:"selected-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":20,"line-opacity":0}},"alternative-route-outline":{id:"alternative-route-outline",type:"line",source:"alternative-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":9,"line-color":"#5E9AE8","line-opacity":.5}},"alternative-route-line":{id:"alternative-route-line",type:"line",source:"alternative-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#E0EDFE","line-width":4.5,"line-opacity":.9}},"alternative-route-hit":{id:"alternative-route-hit",type:"line",source:"alternative-route",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":20,"line-opacity":0}},snaplines:{id:"snaplines",type:"line",source:"snaplines",layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":5,"line-color":"#1D56CF","line-dasharray":[0,3]}}}[y]||null}var xl=["parksOutlineSymbol","parksLabel","aerialwaysLabel","formationsLineLabel","residential","others","gravel","dirt","footway","paths","ferrata","passage","approximate","roadsLabel","pathsLabel","regionsLabelCurved","regionsLabel","ridgesLabel","valleysLineLabel","resorts","skitoursLabel","nordicsLabel","downhillsLabel","trailsLabel","bicycleLabel","riversLabel"],jc=["huts","buildings","points","parkings","attractions","viewpoints","caves","climbing","formationsLabel","grasslandsLabel","via_ferrata_ctr","glaciersLabel","paragliding","placesLabel","summits","passes","valleysLabel","lakesLabel","waters","watersLabel","alternative-route-line"],ay=[...jc,"alternative-route-hit","selected-route-hit"];function Ye(y,O,G){let I,b;return xl.includes(O)?(I=()=>{y.getCanvas().style.cursor=G()?"crosshair":"pointer"},b=()=>{y.getCanvas().style.cursor=G()?"crosshair":""}):(I=()=>{y.getCanvas().style.cursor="pointer"},b=()=>{y.getCanvas().style.cursor=G()?"crosshair":""}),y.on("mouseenter",O,I),y.on("mouseleave",O,b),{mouseenter:I,mouseleave:b}}var De={paint:{textHaloColor:"rgba(255, 255, 255, 0.9)",textHaloWidth:1,textHaloWidth_large:1.2,textHaloBlur:0}};var Mr={regions:{fillOpacity:["interpolate",["cubic-bezier",.6,.1,.4,.9],["zoom"],6,0,6.4,.35,7.1,.35,7.5,0],labelCurved:{textSize:["-",10,["*",["get","priority"],.5]],textColor:"#fff",textHaloColor:"#000",minzoom:1,maxzoom:6},label:{textSize:["-",13,["*",["get","priority"],.5]],textColor:"#fff",textHaloColor:"#000",minzoom:6,maxzoom:11},minzoom:6,maxzoom:8}};function oy(y,O){var I,b;let G=(b=(I=y==null?void 0:y.target)==null?void 0:I.getContainer)==null?void 0:b.call(I);if(!(G!=null&&G.classList.contains("is-measuring")))try{let l=y.features[0].properties.full_id,U=y.features[0].properties.table_id;O.navigate(["/map"],{queryParams:{id:l,type:U}})}catch{console.warn("displayDetailsOnClick(): Missing parameters!")}}function os(y,O){let G=y>=0?"N":"S",I=O>=0?"E":"W";return`${Math.abs(y).toFixed(6)}${G}, ${Math.abs(O).toFixed(6)}${I}`}function vl(y,O,G){let I=y.lngLat.lng,b=y.lngLat.lat,l={full_id:`${y.lngLat.wrap()}`,name:os(b,I),type:"0",elevation:null,bbox:[[I,b],[I,b]],distance:null,bbox_distance:0,point:!0,location:null},U=y.features;if(y.features&&(l.full_id=U[0].properties.full_id,l.name=U[0].properties.name,l.type=U[0].properties.table_id,l.type!="13"&&l.type!="20"))try{let _e=y.features[0].geometry.coordinates;l.bbox=[_e,_e]}catch{console.warn("add-waypoint.addWaypoint(): Failed to set object c
808oordinates.")}G?O.addWaypoint(l,G):O.addWaypoint(l)}function Ke(y,O,G){var I,b,l;if(G.routingInProgress()){let U=(l=(b=(I=y.features)==null?void 0:I[0])==null?void 0:b.layer)==null?void 0:l.id;if(xl.includes(U))return;vl(y,G)}else oy(y,O)}var ad={};function Vc(y,O,G,I){y.addLayer({id:"regionsLabelCurved",type:"symbol",source:"regions_label",minzoom:Mr.regions.labelCurved.minzoom,maxzoom:Mr.regions.labelCurved.maxzoom,filter:["all",[">=",["zoom"],["+",["to-number",["get","priority"],0],1]],["<=",["zoom"],["+",["to-number",["get","priority"],0],2]]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-transform":"uppercase","text-letter-spacing":["coalesce",["get","letter_spacing"],0],"text-font":["Noto Sans Bold"],"symbol-sort-key":["get","priority"],"text-size":Mr.regions.labelCurved.textSize},paint:{"text-color":Mr.regions.labelCurved.textColor,"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":Mr.regions.label.textHaloColor}});let b=Oe=>{Ke(Oe,O,G)};y.on("click","regionsLabelCurved",b);let l=Ye(y,"regionsLabelCurved",G.routingInProgress);ad.regionsLabelCurved=Me({click:b},l),y.addLayer({id:"regionsLabel",type:"symbol","source-layer":"regions_ctr",source:"vector",minzoom:Mr.regions.label.minzoom,maxzoom:Mr.regions.label.maxzoom,layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","text-max-width":7,"text-letter-spacing":.2,"text-font":["Noto Sans Bold"],"symbol-sort-key":["get","priority"],"text-size":Mr.regions.label.textSize},paint:{"text-color":Mr.regions.label.textColor,"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":Mr.regions.label.textHaloColor}});let U=Oe=>{Ke(Oe,O,G)};y.on("click","regionsLabel",U);let _e=Ye(y,"regionsLabel",G.routingInProgress);ad.regionsLabel=Me({click:U},_e);let Te={a00001:"#80b1d3",a00002:"#80b1d3",a00003:"#80b1d3",a00004:"#ffff99",a00005:"#fdbf6f",a00006:"#ffff99",a00007:"#ffff99",a00008:"#b3de69",a00009:"#b3de69",a00010:"#80b1d3",a00011:"#80b1d3",a00012:"#80b1d3",a00013:"#fdbf6f",a00014:"#b3de69",a00015:"#b3de69",a00016:"#ffff99",a00017:"#80b1d3",a00018:"#fdbf6f",a00019:"#b3de69",a00020:"#b3de69",a00021:"#fdbf6f",a00022:"#80b1d3",a00023:"#b3de69",a00024:"#ffff99",a00025:"#ffff99",a00026:"#ffff99",a00027:"#ffff99",a00028:"#80b1d3",a00029:"#b3de69",a00030:"#fdbf6f",a00031:"#ffff99",a00032:"#fdbf6f",a00033:"#fdbf6f",a00034:"#80b1d3",a00035:"#fdbf6f",a00036:"#fdbf6f",a00536:"#80b1d3",a00271:"#fdbf6f",a00270:"#80b1d3",a00273:"#ffff99",a00274:"#b3de69",a00233:"#80b1d3",a00261:"#b3de69",a00538:"#ffff99",a00537:"#ffff99",a00281_1:"#80b1d3",a00248_1:"#80b1d3",a00207_1:"#ffff99",a00186:"#fdbf6f",a00262:"#80b1d3",a00054:"#b3de69",a00264:"#ffff99",a00715:"#b3de69",a00222:"#ffff99",a00250:"#b3de69",a00253:"#b3de69",a00254:"#b3de69",a00269:"#80b1d3",a00272:"#80b1d3",a00716:"#ffff99",a00234:"#fdbf6f",a00237:"#80b1d3",a00238:"#ffff99",a00239:"#fdbf6f",a00242:"#fdbf6f",a00243:"#b3de69",a00053:"#fdbf6f",a00675:"#80b1d3",a00676:"#b3de69",a00677:"#80b1d3",a00678:"#b3de69",a00679:"#ffff99",a00680:"#b3de69",a00684:"#ffff99",a00685:"#fdbf6f",a00687:"#fdbf6f",a00686:"#80b1d3",a00683:"#b3de69",a00260:"#ffff99",a00259:"#ffff99",a00292:"#ffff99",a00293:"#80b1d3",a00296:"#ffff99",a00297:"#b3de69",a00183:"#b3de69",a00176:"#fdbf6f",a00179:"#fdbf6f",a00174:"#fdbf6f",a00175:"#ffff99",a00177:"#80b1d3",a00178:"#b3de69",a00181:"#ffff99",a00182:"#fdbf6f",a00220:"#ffff99",a00275:"#b3de69",a00276:"#fdbf6f",a00246:"#ffff99",a00258:"#b3de69",a00221:"#80b1d3",a00185:"#ffff99",a00219:"#ffff99",a00188:"#80b1d3",a00190:"#ffff99",a00191:"#b3de69",a00192:"#ffff99",a00193:"#fdbf6f",a00194:"#80b1d3",a00245:"#80b1d3",a00247:"#b3de69",a00227:"#80b1d3",a00228:"#fdbf6f",a00229:"#b3de69",a00230:"#fdbf6f",a00223:"#ffff99",a00076:"#fdbf6f",a00241:"#b3de69",a00256:"#b3de69",a00255:"#80b1d3",a00257:"#b3de69",a00252:"#80b1d3",a00201:"#80b1d3",a00225:"#fdbf6f",a00235:"#fdbf6f",a00195:"#b3de69",a00310:"#80b1d3",a00279:"#fdbf6f",a00280:"#fdbf6f",a00282:"#ffff99",a00283:"#ffff99",a00286:"#80b1d3",a00287:"#b3de69",a00285:"#fdbf6f",a00209:"#b3de69",a00210:"#80b1d3",a00211:"#fdbf6f",a00212:"#80b1d3",a00213:"#fdbf6f",a00214:"#80b1d3",a00215:"#ffff99",a00216:"#ffff99",a00206:"#80b1d3",a00205:"#ffff99",a00208:"#80b1d3",a00277:"#fdbf6f",a00278:"#ffff99",a00197:"#ffff99",a00198:"#80b1d3",a00202:"#fdbf6f",a00203:"#ffff99",a00265:"#80b1d3",a00052:"#b3de69",a00328:"#ffff99",a00329:"#b3de69",a00330:"#80b1d3",a00331:"#ffff99",a00527:"#80b1d3",a00528:"#fdbf6f",a00529:"#ffff99",a00530:"#fdbf6f",a00531:"#80b1d3",a00532:"#fdbf6f",a00533:"#b3de69",a00539:"#80b1d3",a00540:"#b3de69",a00541:"#80b1d3",a00542:"#80b1d3",a00543:"#ffff99",a00544:"#fdbf6f",a00545:"#ffff99",a00546:"#b3de69",a00547:"#fdbf6f",a00548:"#ffff99",a00549:"#b3de69",a00550:"#ffff99",a00551:"#80b1d3",a00552:"#80b1d3",a00553:"#fdbf6f",a00554:"#ffff99",a00555:"#ffff99",a00559:"#80b1d3",a00562:"#fdbf6f",a00563:"#80b1d3",a00631:"#80b1d3",a00632:"#ffff99",a00633:"#b3de69",a00638:"#ffff99",a00639:"#fdbf6f",a00643:"#ffff99",a00644:"#80b1d3",a00645:"#fdbf6f",a00649:"#b3de69",a00650:"#ffff99",a00651:"#80b1d3",a00652:"#fdbf6f",a00350:"#80b1d3",a00301:"#80b1d3"},Ee=["match",["get","full_id"]];for(let[Oe,Ve]of Object.entries(Te))Ee.push(Oe,Ve);
808Ee.push("#ffffff00"),y.addLayer({id:"regions",type:"fill",source:"vector","source-layer":"regions",paint:{"fill-color":Ee,"fill-opacity":Mr.regions.fillOpacity},minzoom:Mr.regions.minzoom,maxzoom:Mr.regions.maxzoom})}function Nc(y){let O=["regionsLabelCurved","regionsLabel"];for(let G of O){let I=ad[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete ad[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("regions")&&y.removeLayer("regions"),y.getLayer("megaregions")&&y.removeLayer("megaregions")}function od(y){y.getLayer("contours100")||y.addLayer({id:"contours100",type:"line","source-layer":"contours",source:"vector-contours",minzoom:10,filter:["==",["/",["get","elevation"],100],["ceil",["/",["get","elevation"],100]]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#442001","line-width":["interpolate",["linear"],["zoom"],15,.5,17,1],"line-opacity":["interpolate",["linear"],["zoom"],10,0,13,.5]}}),y.getLayer("contours50")||y.addLayer({id:"contours50",type:"line","source-layer":"contours",source:"vector-contours",filter:["==",["/",["get","elevation"],50],["ceil",["/",["get","elevation"],50]]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#442001","line-width":["interpolate",["linear"],["zoom"],15,.35,17,.7],"line-opacity":["interpolate",["linear"],["zoom"],12,0,14,.8]},minzoom:12}),y.getLayer("contoursLabel50")||y.addLayer({id:"contoursLabel50",type:"symbol","source-layer":"contours",source:"vector-contours",filter:["==",["/",["get","elevation"],50],["ceil",["/",["get","elevation"],50]]],layout:{"text-field":["get","elevation"],"symbol-placement":"line","icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-max-angle":60,"text-size":9,"symbol-spacing":["interpolate",["linear"],["zoom"],13,100,16,200]},paint:{"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":"rgba(255, 255, 255, 0.9)"},minzoom:13}),y.getLayer("contours10")||y.addLayer({id:"contours10",type:"line","source-layer":"contours",source:"vector-contours",filter:["==",["/",["get","elevation"],10],["ceil",["/",["get","elevation"],10]]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#442001","line-width":["interpolate",["linear"],["zoom"],15,.25,17,.5],"line-opacity":["interpolate",["linear"],["zoom"],13,0,15,1]},minzoom:13}),y.getLayer("contoursLabel10")||y.addLayer({id:"contoursLabel10",type:"symbol","source-layer":"contours",source:"vector-contours",filter:["!=",["%",["to-number",["get","elevation"]],50],0],layout:{"text-field":["get","elevation"],"symbol-placement":"line","icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-max-angle":60,"text-size":8,"symbol-spacing":500},paint:{"text-halo-blur":0,"text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"},minzoom:15})}function sd(y){y.getLayer("contours100")&&y.removeLayer("contours100"),y.getLayer("contours50")&&y.removeLayer("contours50"),y.getLayer("contoursLabel50")&&y.removeLayer("contoursLabel50"),y.getLayer("contours10")&&y.removeLayer("contours10"),y.getLayer("contoursLabel10")&&y.removeLayer("contoursLabel10")}var ui={passes:{textSize:["-",12,["*",["get","priority"],.5]],iconSize:["-",.6,["*",["get","priority"],.02]],minzoom:9,label:{textSize:10,minzoom:8}},ridges:{minzoom:10,label:{textColor:"#553a2e",maxAngle:70,letterSpacing:2,symbolSpacing:500,textSize:["-",10,["*",["get","priority"],.5]]}},valleys_line:{label:{textColor:"#000",maxAngle:70,letterSpacing:3.5,symbolSpacing:600,textSize:["-",11,["*",["get","priority"],.5]]},minzoom:7,maxzoom:16},valleys_ctr:{label:{textColor:"#000",textMaxWidth:5,textSize:["-",11,["*",["get","priority"],.5]]},minzoom:7,maxzoom:16}};var ss={};function sy(y){return ht(this,null,function*(){if(!y.hasImage("summit-marker")){let O=yield y.loadImage("assets/map-icons/peak.png");y.addImage("summit-marker",O.data)}if(!y.hasImage("pass-marker")){let O=yield y.loadImage("assets/map-icons/pass.png");y.addImage("pass-marker",O.data)}})}function Uc(y,O,G,I){y.addLayer({id:"summits",type:"symbol","source-layer":"peaks",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],8]],layout:{"text-field":["case",["has","elevation"],["format",["coalesce",["get",["concat","name_",I]],["get","name"]],{"font-scale":1},` 809`,{},"(",{"font-scale":.8},["get","elevation"],{"font-scale":.8},")",{"font-scale":.8}],["coalesce",["get",["concat","name_",I]],["get","name"]]],"text-variable-anchor":["top-left","left","right","top","bottom","top-right","bottom-left","bottom-right"],"text-pitch-alignment":"viewport","text-radial-offset":.5,"text-font":["Open Sans Semibold"],"text-justify":"auto","icon-allow-overlap":!1,"text-allow-overlap":!1,"text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":"summit-marker","symbol-sort-key":["to-number",["get","priority"]],"text-size":["-",14,["*",["to-number",["get","priority"]],.5]],"icon-size":["-",.6,["*",["get","priority"],.05]]},paint:{"text-halo-width":1.4,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor}});
809let b=ce=>{Ke(ce,O,G)};y.on("click","summits",b);let l=Ye(y,"summits",G.routingInProgress);ss.summits=Me({click:b},l),y.addLayer({id:"passes",type:"symbol","source-layer":"passes",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],9]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-pitch-alignment":"viewport","text-radial-offset":.6,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":"pass-marker","text-size":ui.passes.textSize,"icon-size":ui.passes.iconSize},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:ui.passes.minzoom});let U=ce=>{Ke(ce,O,G)};y.on("click","passes",U);let _e=Ye(y,"passes",G.routingInProgress);ss.passes=Me({click:U},_e),y.addLayer({id:"ridgesLabel",type:"symbol","source-layer":"ridges",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":ui.ridges.label.maxAngle,"text-letter-spacing":ui.ridges.label.letterSpacing,"symbol-spacing":ui.ridges.label.symbolSpacing,"text-font":["Open Sans Semibold"],"text-overlap":"never","text-size":ui.ridges.label.textSize,"symbol-sort-key":["get","priority"]},paint:{"text-color":ui.ridges.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor},minzoom:ui.ridges.minzoom});let Te=ce=>{Ke(ce,O,G)};y.on("click","ridgesLabel",Te);let Ee=Ye(y,"ridgesLabel",G.routingInProgress);ss.ridgesLabel=Me({click:Te},Ee),y.addLayer({id:"valleysLineLabel",type:"symbol","source-layer":"valleys_line",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":ui.valleys_line.label.maxAngle,"text-letter-spacing":ui.valleys_line.label.letterSpacing,"symbol-spacing":ui.valleys_line.label.symbolSpacing,"text-transform":"uppercase","text-font":["Open Sans Semibold"],"text-overlap":"never","text-size":ui.valleys_line.label.textSize,"symbol-sort-key":["get","priority"]},paint:{"text-color":ui.valleys_line.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor},minzoom:ui.valleys_line.minzoom,maxzoom:ui.valleys_line.maxzoom});let Oe=ce=>{Ke(ce,O,G)};y.on("click","valleysLineLabel",Oe);let Ve=Ye(y,"valleysLineLabel",G.routingInProgress);ss.valleysLineLabel=Me({click:Oe},Ve),y.addLayer({id:"valleysLabel",type:"symbol","source-layer":"valleys_ctr",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-size":ui.valleys_ctr.label.textSize,"text-max-width":ui.valleys_ctr.label.textMaxWidth,"text-transform":"uppercase","text-font":["Open Sans Semibold"],"text-overlap":"never","symbol-sort-key":["get","priority"]},paint:{"text-color":ui.valleys_ctr.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor},minzoom:ui.valleys_ctr.minzoom,maxzoom:ui.valleys_ctr.maxzoom});let ke=ce=>{Ke(ce,O,G)};y.on("click","valleysLabel",ke);let Ge=Ye(y,"valleysLabel",G.routingInProgress);ss.valleysLabel=Me({click:ke},Ge)}function Gc(y){let O=["summits","passes","ridgesLabel","valleysLineLabel","valleysLabel"];for(let G of O){let I=ss[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete ss[G]),y.getLayer(G)&&y.removeLayer(G)}}var bl={formationsLabel:{minzoom:13},formationsLineLabel:{maxAngle:70,letterSpacing:1,symbolSpacing:500,minzoom:12},grasslandsLabel:{minzoom:11}};var Zc={};function qc(y,O,G,I){if(!y.getLayer("formationsLabel")){y.addLayer({id:"formationsLabel",type:"symbol","source-layer":"formations",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],13]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","text-anchor":"center","text-justify":"center","text-pitch-alignment":"viewport","text-size":10,"text-max-width":5},paint:{"text-halo-blur":0,"text-halo-width":1.2,"text-color":"#28
809160f","text-halo-color":"rgba(255, 255, 255, 0.9)"},minzoom:bl.formationsLabel.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","formationsLabel",b);let l=Ye(y,"formationsLabel",G.routingInProgress);Zc.formationsLabel=Me({click:b},l)}if(!y.getLayer("formationsLineLabel")){y.addLayer({id:"formationsLineLabel",type:"symbol","source-layer":"formations_line",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],12]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":bl.formationsLineLabel.maxAngle,"text-letter-spacing":bl.formationsLineLabel.letterSpacing,"symbol-spacing":bl.formationsLineLabel.symbolSpacing,"text-font":["Open Sans Semibold"],"text-overlap":"never","text-size":9,"symbol-sort-key":["get","priority"]},paint:{"text-color":"#28160f","text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor}});let b=U=>{Ke(U,O,G)};y.on("click","formationsLineLabel",b);let l=Ye(y,"formationsLineLabel",G.routingInProgress);Zc.formationsLineLabel=Me({click:b},l)}if(!y.getLayer("grasslandsLabel")){y.addLayer({id:"grasslandsLabel",type:"symbol","source-layer":"grasslands_ctr",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],11]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","text-anchor":"center","text-justify":"center","text-pitch-alignment":"viewport","text-size":10,"text-max-width":5},paint:{"text-halo-blur":0,"text-halo-width":1.2,"text-color":"#27410a","text-halo-color":"rgba(255, 255, 255, 0.9)"},minzoom:bl.grasslandsLabel.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","grasslandsLabel",b);let l=Ye(y,"grasslandsLabel",G.routingInProgress);Zc.grasslandsLabel=Me({click:b},l)}}function $c(y){let O=["formationsLabel","formationsLineLabel","grasslandsLabel"];for(let G of O){let I=Zc[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete Zc[G]),y.getLayer(G)&&y.removeLayer(G)}}var Wc={trails:{paint:{lineColor:["case",["==",["get","colour"],"red"],"#dc0909",["==",["get","colour"],"blue"],"#244eb8",["==",["get","colour"],"green"],"#138a13",["==",["get","colour"],"yellow"],"#ffde02",["==",["get","colour"],"black"],"#000000","#dc0909"]}}};var Yp={};function Hc(y,O,G){if(y.getLayer("trails")||y.addLayer({id:"trails",type:"line","source-layer":"trails",source:"vector",layout:{"line-join":"round","line-cap":"round","line-round-limit":10},paint:{"line-color":Wc.trails.paint.lineColor,"line-width":["interpolate",["linear"],["zoom"],11,0,13,2.8],"line-offset":["step",["zoom"],0,14,3],"line-opacity":["interpolate",["linear"],["zoom"],11,0,11.4,1]},minzoom:11}),!y.getLayer("trailsLabel")){y.addLayer({id:"trailsLabel",type:"symbol","source-layer":"trails",source:"vector",layout:{"text-field":["get","refname"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":15,"text-size":9,"symbol-spacing":1e3,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,1]},paint:{"text-halo-width":De.paint.textHaloWidth,"text-halo-blur":De.paint.textHaloBlur,"text-color":"#620404","text-halo-color":"rgba(255, 255, 255, 0.7)"},minzoom:14});let I=l=>{Ke(l,O,G)};y.on("click","trailsLabel",I);let b=Ye(y,"trailsLabel",G.routingInProgress);Yp.trailsLabel=Me({click:I},b)}}function Xc(y){let O=["trailsLabel"];for(let G of O){let I=Yp[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete Yp[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("trails")&&y.removeLayer("trails")}var Kp={};function Yc(y,O,G){if(y.getLayer("bicycle")||y.addLayer({id:"bicycle",type:"line","source-layer":"bicycles",source:"vector",filter:["==",["get","type"],"bicycle"],layout:{"line-join":"round","line-cap":"round","line-round-limit":10},paint:{"line-color":"#b45bf3","line-width":1.5,"line-offset":["step",["zoom"],0,13,-3],"line-opacity":["interpolate",["linear"],["zoom"],11,0,11.4,1]},minzoom:11}),y.getLayer("mtb")||y.addLayer({id:"mtb",type:"line","source-layer":"bicycles",source:"vector",filter:["==",["get","type"],"mtb"],layout:{"line-join":"round","line-cap":"round","line-round-limit":10},paint:{"line-color":"#b45bf3","line-dasharray":[2,2],"line-width":1.5,"line-offset":["step",["zoom"],0,13,-3],"line-opacity":["interpolate",["linear"],["zoom"],12,0,12.4,1]},minzoom:12}),!y.getLayer("bicycleLabel")){y.addLayer({id:"bicycleLabel",type:"symbol","source-layer":"bicycles",source:"vector",layout:{"text-field":["get","refn
809ame"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":15,"text-size":9,"symbol-spacing":1e3,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,.6]},paint:{"text-color":"#450264","text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":"rgba(255, 255, 255, 0.7)"},minzoom:14});let I=l=>{Ke(l,O,G)};y.on("click","bicycleLabel",I);let b=Ye(y,"bicycleLabel",G.routingInProgress);Kp.bicycleLabel=Me({click:I},b)}y.getLayer("cycleway")||y.addLayer({id:"cycleway",type:"line","source-layer":"roads",source:"vector",filter:["==",["get","custom"],"cycleway"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#c551fb","line-width":2,"line-opacity":["interpolate",["linear"],["zoom"],14,0,14.4,1]},minzoom:14})}function Kc(y){let O=["bicycleLabel"];for(let G of O){let I=Kp[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete Kp[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("bicycle")&&y.removeLayer("bicycle"),y.getLayer("mtb")&&y.removeLayer("mtb"),y.getLayer("cycleway")&&y.removeLayer("cycleway")}var Xe={states:{lineColor:"#4d0573",lineWidth:["interpolate",["linear"],["zoom"],4,.3,11,2],lineOpacity:["interpolate",["linear"],["zoom"],2,0,7,.8]},parks:{fillColorNational:"#006600",fillColorOther:"rgba(0,102,0,0.4)",fillOpacity:["interpolate",["cubic-bezier",.25,.1,.25,1],["zoom"],7,0,9,.25,11,0],minzoom:7,maxzoom:10,outline:{lineColor:"#008000",lineWidth:["interpolate",["linear"],["zoom"],8,0,12,1.5],lineOpacity:["interpolate",["linear"],["zoom"],8,0,10,.5],lineDasharray:[10,10],minzoom:8},outlineNational:{lineColor:"#008000",lineWidth:["interpolate",["linear"],["zoom"],8,0,12,1.5],lineOpacity:["interpolate",["linear"],["zoom"],8,0,10,.7],minzoom:8},outlineSymbol:{textSize:11,symbolSpacing:500,textMaxWidth:5,textColor:"#004d00",minzoom:10},label:{textSize:11,textMaxWidth:5,textColor:"#004d00",textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:9,maxzoom:10}},huts:{textSize:10,iconSize:.5,textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:12},buildings:{textSize:11,iconSize:.3,textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:12},points:{textSize:7,iconSize:.25,textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:13},aerialways:{lineColor:"black",lineWidth:2,minzoom:11,aerialwaysSymbol:{iconSize:.4,symbolSpacing:15,minzoom:11},aerialwaysGoods:{lineColor:"black",lineWidth:.8,minzoom:13,aerialwaysGoodsSymbol:{iconSize:.4,symbolSpacing:15,minzoom:13}},label:{textSize:12}},powerlines:{lineColor:"#e78008",minzoom:13,powerlinesSymbol:{iconSize:.4,symbolSpacing:15,minzoom:13}},parkings:{iconSize:.25,minzoom:14},buses:{iconSize:.25,minzoom:15}};var ya={places:{textSize:["-",13,["*",["get","priority"],.5]],textLineHeight:.9,textMaxWidth:5,textVariableAnchor:["step",["zoom"],["literal",["top-left","top-right","top","bottom","bottom-right","bottom-left","left","right"]],13,["literal",["center"]]],textRadialOffset:["step",["zoom"],.48,13,0],iconImage:["step",["zoom"],["case",["==",["get","type"],"city"],"city-marker",["==",["get","type"],"town"],"town-marker",["==",["get","type"],"village"],"village-marker",""],13,""],iconSize:.4,minzoom:6}};var Jp={};function ly(y){return ht(this,null,function*(){if(!y.hasImage("city-marker")){let O=yield y.loadImage("assets/map-icons/city.png");y.addImage("city-marker",O.data)}if(!y.hasImage("town-marker")){let O=yield y.loadImage("assets/map-icons/town.png");y.addImage("town-marker",O.data)}if(!y.hasImage("village-marker")){let O=yield y.loadImage("assets/map-icons/village.png");y.addImage("village-marker",O.data)}})}function cy(y,O,G,I){y.addLayer({id:"placesLabel",type:"symbol","source-layer":"places",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":ya.places.textVariableAnchor,"text-radial-offset":ya.places.textRadialOffset,"icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-size":ya.places.textSize,"text-line-height":ya.places.textLineHeight,"text-transform":"uppercase","symbol-sort-key":["get","priority"],"text-max-width":ya.places.textMaxWidth,"text-font":["Open Sans Semibold"],"text-overlap":"never","icon-overlap":"cooperative","icon-image":ya.places.iconImage,"icon-size":ya.places.iconSize},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor,"text-color":"#000"},minzoom:ya.places.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","placesLabel",b);let l=Ye(y,"placesLabel",G.routingInProgress);Jp.placesLabel=Me({click:b},l)}function hy(y){let O=["placesLabel"];for(let G of O){let I=Jp[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete Jp[G]),y.getLayer(G)&&y.removeLayer(G)}}var _a={};function uy(y){return ht(this,null,function*(){if(!y.hasImage("refuge-marker")){let O=yield y.loadImage("assets/map-icons/refuge.png");y.addImage("refuge-marker",O.data)}if(!y.hasImage("hut-marker")){let O=yield y.loadImage("assets/map-icons/hut.png");y.addImage("hut-marker",O.data)}if(!y.hasImage("camping-marker")){let O=yield y.loadImage("assets/map-icons/camping.png");y.addImage("camping-marker",O.data)}if(!y.hasImage("building-marker")){let O=yield y.loadImage("assets/map-icons/buildings.png");y.addImage("building-marker",O.data)}if(!y.hasImage("tower-marker")){let O=yield y.loadImage("assets/map-icons/tower.png");y.addImage("tower-marker",O.data)}if(!y.hasImage("shelter-marker")){let O=yield y.loadImage("assets/map-icons/shelter.png");y.addImage("shelter-marker",O.data)}if(!y.hasImage("cable-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/cable.png");y.addImage("cable-marker",O.data)}if(!y.hasImage("gondola-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/gondola.png");y.addImage("gondola-marker",O.data)}if(!y.hasImage("chair-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/chair.png");y.addImage("chair-marker",O.data)}if(!y.hasImage("drag-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/drag.png");y.addImage("drag-marker",O.data)}if(!y.hasImage("goods-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/goods.png");y.addImage("goods-marker",O.data)}if(!y.hasImage("parkings-marker")){let O=yield y.loadImage("assets/map-icons/parkings.png");y.addImage("parkings-marker",O.data)}if(!y.hasImage("buses-marker")){let O=yield y.loadImage("assets/map-icons/buses.png");y.addImage("buses-marker",O.data)}if(!y.hasImage("point-marker")){let O=yield y.loadImage("assets/map-icons/point.png");y.addImage("point-marker",O.data)}if(!y.hasImage("cross-marker")){let O=yield y.loadImage("assets/map-icons/cross.png");y.addImage("cross-marker",O.data)}if(!y.hasImage("adit-marker")){let O=yield y.loadImage("assets/map-icons/adit.png");y.addImage("adit-marker",O.data)}if(!y.hasImage("guidepost-marker")){let O=yield y.loadImage("assets/map-icons/guidepost.png");y.addImage("guidepost-marker",O.data)}if(!y.hasImage("picnic-marker")){let O=yield y.loadImage("assets/map-icons/picnic.png");y.addImage("picnic-marker",O.data)}})}function Jc(y,O,G,I){if(y.getLayer("states")||y.addLayer({id:"states",type:"line",source:"vector","source-layer":"states_outline",paint:{"line-color":Xe.states.lineColor,"line-width":Xe.states.lineWidth,"line-opacity":Xe.states.lineOpacity}}),y.getLayer("states_areas")||y.addLayer({id:"states_areas",type:"line",source:"vector","source-layer":"states_outline",paint:{"line-color":Xe.states.lineColor,"line-width":10,"line-opacity":["interpolate",["linear"],["zoom"],11,0,14,.2]}}),y.getLayer("parks")||y.addLayer({id:"parks",type:"fill",source:"vector","source-layer":"parks",paint:{"fill-color":["case",["==",["get","national"],!0],Xe.parks.fillColorNational,["==",["get","national"],!1],Xe.parks.fillColorOther,"rgba(0,0,0,0)"],"fill-opacity":Xe.parks.fillOpacity},minzoom:Xe.parks.minzoom,maxzoom:Xe.parks.maxzoom}),y.getLayer("parksOutlineNational")||y.addLayer({id:"parksOutlineNational",type:"line",source:"vector","source-layer":"parks_outline",filter:["==",["get","national"],!0],paint:{"line-color":Xe.parks.outlineNational.lineColor,"line-width":Xe.parks.outlineNational.lineWidth,"line-opacity":Xe.parks.outlineNational.lineOpacity},minzoom:Xe.parks.outlineNational.minzoom}),y.getLayer("parksOutline")||y.addLayer({id:"parksOutline",type:"line",source:"vector","source-layer":"parks_outline",filter:["==",["get","national"],!1],paint:{"line-color":Xe.parks.outline.lineColor,"line-dasharray":Xe.parks.outline.lineDasharray,"line-width":Xe.parks.outline.lineWidth,"line-opacity":Xe.parks.outline.lineOpacity},minzoom:Xe.parks.outline.minzoom}),!y.getLayer("parksOutlineSymbol")){y.addLayer({id:"parksOutlineSymbol",type:"symbol",source:"vector","source-layer":"parks_outline",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","symbol-spacing":Xe.parks.outlineSymbol.symbolSpacing,"icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-size":Xe.parks.outlineSymbol.textSize,"text-max-width":Xe.parks.outlineSymbol.textMaxWidth,"text-font":["Open Sans Semibold"]},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor,"text-color":Xe.parks.outlineSymbol.textColor},minzoom:Xe.parks.outlineSymbol.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","parksOutlineSymbol",b);let l=Ye(y,"parksOutlineSymbol",G.routingInProgress);_a.parksOutlineSymbol=Me({click:b},l)}if(!y.getLayer("parksLabel")){y.addLayer({id:"parksLabel",type:"symbol","source-layer":"parks_ctr",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-size":Xe.parks.label.textSize,"text-max-width":Xe.parks.label.textMaxWidth,"text-font":["Open Sans Semibold"]},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-color":Xe.parks.label.textColor,"text-halo-color":Xe.parks.label.textHaloColor},minzoom:Xe.parks.label.minzoom,maxzoom:Xe.parks.label.maxzoom});let b=U=>{Ke(U,O,G)};y.on("click","parksLabel",b);let l=Ye(y,"parksLabel",G.routingInProgress);_a.parksLabel=Me({click:b},l)}if(!y.getLayer("huts")){y.addLayer({id:"huts",type:"symbol","source-layer":"huts",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-size":Xe.huts.textSize,"text-allow-overlap":!1,"text-overlap":"never","text-max-width":5,"text-line-height":1,"icon-image":["case",["==",["get","type"],"refuge"],"refuge-marker",["
809==",["get","type"],"hut"],"hut-marker",["==",["get","type"],"shelter"],"shelter-marker",["==",["get","type"],"camping"],"camping-marker",""],"icon-overlap":"cooperative","icon-size":Xe.huts.iconSize,"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":Xe.huts.textHaloColor},minzoom:Xe.huts.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","huts",b);let l=Ye(y,"huts",G.routingInProgress);_a.huts=Me({click:b},l)}if(!y.getLayer("buildings")){y.addLayer({id:"buildings",type:"symbol","source-layer":"buildings",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-size":Xe.buildings.textSize,"text-allow-overlap":!1,"text-overlap":"never","text-max-width":5,"text-line-height":1,"icon-image":["case",["==",["get","type"],"shelter"],"shelter-marker",["==",["get","type"],"observation_tower"],"tower-marker","building-marker"],"icon-overlap":"cooperative","icon-size":Xe.buildings.iconSize,"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":Xe.buildings.textHaloColor},minzoom:Xe.buildings.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","buildings",b);let l=Ye(y,"buildings",G.routingInProgress);_a.buildings=Me({click:b},l)}if(!y.getLayer("points")){y.addLayer({id:"points",type:"symbol","source-layer":"points",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],12]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-size":Xe.points.textSize,"text-allow-overlap":!1,"text-overlap":"never","text-max-width":5,"text-line-height":1,"icon-image":["case",["==",["get","type"],"cross"],"cross-marker",["==",["get","type"],"adit"],"adit-marker",["==",["get","type"],"guidepost"],"guidepost-marker",["==",["get","type"],"intersection"],"guidepost-marker",["==",["get","type"],"picnic_site"],"picnic-marker",["==",["get","type"],"picnic_table"],"picnic-marker","point-marker"],"icon-overlap":"cooperative","icon-size":Xe.points.iconSize,"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":Xe.points.textHaloColor},minzoom:Xe.points.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","points",b);let l=Ye(y,"points",G.routingInProgress);_a.points=Me({click:b},l)}if(y.getLayer("aerialways")||y.addLayer({id:"aerialways",type:"line","source-layer":"aerialways",source:"vector",filter:["all",["!=",["get","type"],"goods"],["!=",["get","type"],"zip_line"],["!=",["get","type"],"magic_carpet"]],layout:{"line-join":"round","line-cap":"butt"},paint:{"line-color":Xe.aerialways.lineColor,"line-width":Xe.aerialways.lineWidth},minzoom:Xe.aerialways.minzoom}),y.getLayer("aerialwaysSymbol")||y.addLayer({id:"aerialwaysSymbol",type:"symbol","source-layer":"aerialways",source:"vector",filter:["all",["!=",["get","type"],"goods"],["!=",["get","type"],"zip_line"],["!=",["get","type"],"magic_carpet"]],layout:{"symbol-placement":"line","symbol-spacing":Xe.aerialways.aerialwaysSymbol.symbolSpacing,"icon-image":["case",["==",["get","type"],"cable_car"],"cable-marker",["==",["get","type"],"gondola"],"gondola-marker",["==",["get","type"],"chair_lift"],"chair-marker",["==",["get","type"],"mixed_lift"],"chair-marker",["==",["get","type"],"drag_lift"],"drag-marker",["==",["get","type"],"t-bar"],"drag-marker",["==",["get","type"],"j-bar"],"drag-marker",["==",["get","type"],"platter"],"drag-marker",["==",["get","type"],"rope_tow"],"drag-marker",["
809==",["get","type"],"funicular"],"gondola-marker",""],"icon-overlap":"always","icon-size":Xe.aerialways.aerialwaysSymbol.iconSize},minzoom:Xe.aerialways.aerialwaysSymbol.minzoom}),y.getLayer("aerialway_goods")||y.addLayer({id:"aerialway_goods",type:"line","source-layer":"aerialways",source:"vector",filter:["==",["get","type"],"goods"],layout:{"line-join":"round","line-cap":"butt"},paint:{"line-color":Xe.aerialways.aerialwaysGoods.lineColor,"line-width":Xe.aerialways.aerialwaysGoods.lineWidth},minzoom:Xe.aerialways.aerialwaysGoods.minzoom}),y.getLayer("aerialways_goodsSymbol")||y.addLayer({id:"aerialways_goodsSymbol",type:"symbol","source-layer":"aerialways",source:"vector",filter:["==",["get","type"],"goods"],layout:{"symbol-placement":"line","symbol-spacing":Xe.aerialways.aerialwaysGoods.aerialwaysGoodsSymbol.symbolSpacing,"icon-overlap":"always","icon-image":"goods-marker","icon-size":Xe.aerialways.aerialwaysGoods.aerialwaysGoodsSymbol.iconSize},minzoom:Xe.aerialways.aerialwaysGoods.aerialwaysGoodsSymbol.minzoom}),!y.getLayer("aerialwaysLabel")){y.addLayer({id:"aerialwaysLabel",type:"symbol","source-layer":"aerialways",source:"vector",layout:{"text-field":["get","refname"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-size":Xe.aerialways.label.textSize,"text-font":["Open Sans Semibold"],"text-overlap":"never","text-offset":[0,.7]},paint:{"text-color":"black","text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-color":De.paint.textHaloColor},minzoom:13});let b=U=>{Ke(U,O,G)};y.on("click","aerialwaysLabel",b);let l=Ye(y,"aerialwaysLabel",G.routingInProgress);_a.aerialwaysLabel=Me({click:b},l)}if(!y.getLayer("parkings")){y.addLayer({id:"parkings",type:"symbol","source-layer":"parkings",source:"vector",layout:{"icon-image":"parkings-marker","icon-overlap":"cooperative","icon-size":Xe.parkings.iconSize,"symbol-placement":"point","icon-keep-upright":!1},minzoom:Xe.parkings.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","parkings",b);let l=Ye(y,"parkings",G.routingInProgress);_a.parkings=Me({click:b},l)}y.getLayer("buses")||y.addLayer({id:"buses",type:"symbol","source-layer":"buses",source:"vector",layout:{"icon-image":"buses-marker","icon-overlap":"cooperative","icon-size":Xe.buses.iconSize,"symbol-placement":"point","icon-keep-upright":!1},minzoom:Xe.buses.minzoom}),cy(y,O,G,I)}function Qc(y){let O=["parksOutlineSymbol","parksLabel","huts","buildings","points","aerialwaysLabel","parkings"];for(let I of O){let b=_a[I];b&&(y.off("click",I,b.click),y.off("mouseenter",I,b.mouseenter),y.off("mouseleave",I,b.mouseleave),delete _a[I]),y.getLayer(I)&&y.removeLayer(I)}["states","states_areas","parks","parksOutlineNational","parksOutline","aerialways","aerialwaysSymbol","aerialway_goods","aerialways_goodsSymbol","buses"].forEach(I=>{y.getLayer(I)&&y.removeLayer(I)}),hy(y)}var xa={attractions:{textSize:12,iconSize:.6,textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:10},viewpoints:{textSize:8,iconSize:.3,textHaloColor:"rgba(255, 255, 255, 0.7)",minzoom:15}};var ld={};function dy(y){return ht(this,null,function*(){if(!y.hasImage("attraction-marker")){let O=yield y.loadImage("assets/map-icons/attractions.png");y.addImage("attraction-marker",O.data)}if(!y.hasImage("viewpoints-marker")){let O=yield y.loadImage("assets/map-icons/viewpoint.png");y.addImage("viewpoints-marker",O.data)}if(!y.hasImage("cross-marker")){let O=yield y.loadImage("assets/map-icons/cross.png");y.addImage("cross-marker",O.data)}})}function eh(y,O,G,I){if(!y.getLayer("attractions")){y.addLayer({id:"attractions",type:"symbol","source-layer":"attractions",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],10]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-size":["-",xa.attractions.textSize,["*",["to-number",["get","priority"]],.75]],"text-allow-overlap":!1,"text-overlap":"never","text-max-width":5,"text-line-height":1,"icon-image":["case",["==",["get","type"],"wayside_cross"],"cross-marker","attraction-marker"],"icon-overlap":"cooperative","icon-size":["-",xa.attractions.iconSize,["*",["get","priority"],.06]],"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":xa.attractions.textHaloColor},minzoom:xa.attractions.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","attractions",b);let l=Ye(y,"attractions",G.routingInProgress);ld.attractions=Me({click:b},l)}if(!y.getLayer("viewpoints")){y.addLayer({id:"viewpoints",type:"symbol","source-layer":"viewpoints",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-size":xa.viewpoints.textSize,"text-allow-overlap":!1,"text-overlap":"never","text-max-width":5,"text-line-height":1,"icon-image":"viewpoints-marker","icon-overlap":"cooperative","icon-size":xa.viewpoints.iconSize,"symbol-placement":"point","icon-keep-upright":!1,"text-pitch-alignment":"viewport"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":xa.viewpoints.textHaloColor},minzoom:xa.viewpoints.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","viewpoints",b);let l=Ye(y,"viewpoints",G.routingInProgress);ld.viewpoints=Me({click:b},l)}}function th(y){let O=["attractions","viewpoints"];for(let G of O){let I=ld[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete ld[G]),y.getLayer(G)&&y.removeLayer(G)}}function Jt(y){y.getLayer("forests")&&y.moveLayer("forests"),y.getLayer("forests-outline")&&y.moveLayer("forests-outline"),y.getLayer("scrubs")&&y.moveLayer("scrubs"),y.getLayer("commercials")&&y.moveLayer("commercials"),y.getLayer("industrials")&&y.moveLayer("industrials"),y.getLayer("residentials")&&y.moveLayer("residentials"),y.getLayer("parks")&&y.moveLayer("parks"),y.getLayer("glaciers")&&y.moveLayer("glaciers"),y.getLayer("lakes")&&y.moveLayer("lakes"),y.getLayer("avalanche-tiles")&&y.moveLayer("avalanche-tiles"),y.getLayer("terrain-analysis-tiles")&&y.moveLayer("terrain-analysis-tiles"),y.getLayer("contours100")&&y.moveLayer("contours100"),y.getLayer("contours50")&&y.moveLayer("contours50"),y.getLayer("contours10")&&y.moveLayer("contours10"),y.getLayer("regions")&&y.moveLayer("regions"),y.getLayer("rivers")&&y.moveLayer("rivers"),y.getLayer("riversIntermittent")&&y.moveLayer("riversIntermittent"),y.getLayer("waters")&&y.moveLayer("waters"),y.getLayer("states_areas")&&y.moveLayer("states_areas"),y.getLayer("states")&&y.moveLayer("states"),y.getLayer("downhill_areas")&&y.moveLayer("downhill_areas"),y.getLayer("downhill_area_custom")&&y.moveLayer("downhill_area_custom"),y.getLayer("winter_trails_area")&&y.moveLayer("winter_trails_area"),y.getLayer("skitours_area")&&y.moveLayer("skitours_area"),y.getLayer("railways")&&y.moveLayer("railways"),y.getLayer("ferrata")&&y.moveLayer("ferrata"),y.getLayer("pedestrian")&&y.moveLayer("pedestrian"),y.getLayer("footway")&&y.moveLayer("footway"),y.getLayer("approximate")&&y.moveLayer("approximate"),y.getLayer("passage")&&y.moveLayer("passage"),y.getLayer("paths")&&y.moveLayer("paths"),y.getLayer("dirt")&&y.moveLayer("dirt"),y.getLayer("gravel")&&y.moveLayer("gravel"),y.getLayer("unclassified")&&y.moveLayer("unclassified"),y.getLayer("others")&&y.moveLayer("others"),y.getLayer("residential")&&y.moveLayer("residential"),y.getLayer("tertiary")&&y.moveLayer("tertiary"),y.getLayer("secondary")&&y.moveLayer("secondary"),y.getLayer("primary")&&y.moveLayer("primary"),y.getLayer("motorway_link")&&y.moveLayer("motorway_link"),y.getLayer("motorway")&&y.moveLayer("motorway"),y.getLayer("downhills")&&y.moveLayer("downhills"),y.getLayer("downhills_custom")&&y.moveLayer("downhills_custom"),y.getLayer("bicycle")&&y.moveLayer("bicycle"),y.getLayer("mtb")&&y.moveLayer("mtb"),y.getLayer("nordics")&&y.moveLayer("nordics"),y.getLayer("skitours")&&y.moveLayer("skitours"),y.getLayer("skitours_custom")&&y.moveLayer("skitours_custom"),y.getLayer("skitours_arrows")&&y.moveLayer("skitours_arrows"),y.getLayer("winter_trails")&&y.moveLayer("winter_trails"),y.getLayer("trails")&&y.moveLayer("trails"),y.getLayer("buses")&&y.moveLayer("buses"),y.getLayer("parkings")&&y.moveLayer("parkings"),y.getLayer("points")&&y.moveLayer("points"),y.getLayer("powerlines")&&y.moveLayer("powerlines"),y.getLayer("powerlinesSymbol")&&y.moveLayer("powerlinesSymbol"),y.getLayer("aerialway_goods")&&y.moveLayer("aerialway_goods"),y.getLayer("aerialways")&&y.moveLayer("aerialways"),y.getLayer("aerialways_goodsSymbol")&&y.moveLayer("aerialways_goodsSymbol"),y.getLayer("aerialwaysSymbol")&&y.moveLayer("aerialwaysSymbol"),y.getLayer("contoursLabel10")&&y.moveLayer("contoursLabel10"),y.getLayer("contoursLabel50")&&y.moveLayer("contoursLabel50"),y.getLayer("search-result-outline")&&y.moveLayer("search-result-outline"),y.getLayer("search-result-lines")&&y.moveLayer("search-result-lines"),y.getLayer("snaplines")&&y.moveLayer("snaplines"),y.getLayer("alternative-route-outline")&&y.moveLayer("alternative-route-outline"),y.getLayer("alternative-route-line")&&y.moveLayer("alternative-route-line"),y.getLayer("alternative-route-hit")&&y.moveLayer("alternative-route-hit"),y.getLayer("selected-route-outline")&&y.moveLayer("selected-route-outline"),y.getLayer("selected-route-line")&&y.moveLayer("selected-route-line"),y.getLayer("selected-route-hit")&&y.moveLayer("selected-route-hit"),y.getLayer("huts")&&y.moveLayer("huts"),y.getLayer("buildings")&&y.moveLayer("buildings"),y.getLayer("viewpoints")&&y.moveLayer("viewpoints"),y.getLayer("attractions")&&y.moveLayer("attractions"),y.getLayer("watersLabel")&&y.moveLayer("watersLabel"),y.getLayer("lakesLabel")&&y.moveLayer("lakesLabel"),y.getLayer("riversLabel")&&y.moveLayer("riversLabel"),y.getLayer("grasslandsLabel")&&y.moveLayer("grasslandsLabel"),y.getLayer("formationsLineLabel")&&y.moveLayer("formationsLineLabel"),y.getLayer("formationsLabel")&&y.moveLayer("formationsLabel"),y.getLayer("placesLabel")&&y.moveLayer("placesLabel"),y.getLayer("highwaysLabel")&&y.moveLayer("highwaysLabel"),y.getLayer("roadsLabel")&&y.moveLayer("roadsLabel"),y.getLayer("pathsLabel")&&y.moveLayer("pathsLabel"),y.getLayer("glaciersLabel")&&y.moveLayer("glaciersLabel"),y.getLayer("via_ferrata_ctr")&&y.moveLayer("via_ferrata_ctr"),y.getLayer("climbing_routes_line")&&y.moveLayer("climbing_routes_line"),y.getLayer("abseils_line")&&y.moveLayer("abseils_line"),y.getLayer("abseils_line_dots")&&y.moveLayer("abseils_line_dots"),y.getLayer("caves")&&y.moveLayer("caves"),y.getLayer("climbing")&&y.moveLayer("climbing"),y.getLayer("climbing_routes")&&y.moveLayer("climbing_routes"),y.getLayer("abseils")&&y.moveLayer("abseils"),y.getLayer("paragliding")&&y.moveLayer("paragliding"),y.getLayer("parksLabel")&&y.moveLayer("parksLabel"),y.getLayer("ridgesLabel")&&y.moveLayer("ridgesLabel"),y.getLayer("passes")&&y.moveLayer("passes"),y.getLayer("summits")&&y.moveLayer("summits"),y.getLayer("outline-inner")&&y.moveLayer("outline-inner"),y.getLayer("outline")&&y.moveLayer("outline"),y.getLayer("parksOutlineSymbol")&&y.moveLayer("parksOutlineSymbol"),y.getLayer("aerialwaysLabel")&&y.moveLayer("aerialwaysLabel"),y.getLayer("nordicsLabel")&&y.moveLayer("nordicsLabel"),y.getLayer("downhillsLabel")&&y.moveLayer("downhillsLabel"),y.getLayer("skitoursLabel")&&y.moveLayer("skitoursLabel"),y.getLayer("bicycleLabel")&&y.moveLayer("bicycleLabel"),y.getLayer("trailsLabel")&&y.moveLayer("trailsLabel"),y.getLayer("resorts")&&y.moveLayer("resorts"),y.getLayer("valleysLabel")&&y.moveLayer("valleysLabel"),y.getLayer("valleysLineLabel")&&y.moveLayer("valleysLineLabel"),y.getLayer("regionsLabel")&&y.moveLayer("regionsLabel"),y.getLayer("regionsLabelCurved")&&y.moveLayer("regionsLabelCurved"),y.getLayer("label")&&y.moveLayer("label"),y.getLayer("search-result-points")&&y.moveLayer("search-result-points"),y.getLayer("measure-line-lyr")&&y.moveLayer("measure-line-lyr"),y.getLayer("measure-pts-lyr")&&y.moveLayer("measure-pts-lyr"),y.getLayer("measure-mid-lyr")&&y.moveLayer("measure-mid-lyr"),y.getLayer("measure-mid-hit-lyr")&&y.moveLayer("measure-mid-hit-lyr"),y.getLayer("measure-pts-hit-lyr")&&y.moveLayer("measure-pts-hit-lyr")}var ni={lakes:{fillColor:"#5298c7",minzoom:6,label:{textSize:10,textMaxWidth:5,textColor:"#32709a",minzoom:8}},rivers:{lineColor:"#5298c7",lineWidth:["interpolate",["linear"],["zoom"],5,["-",.5,["*",["get","priority"],.25]],17,["-",3.5,["*",["get","priority"],.25]]],label:{textColor:"#32709a",maxAngle:70,letterSpacing:.3,symbolSpacing:1e3,textSize:["-",12,["*",["get","priority"],.5]]}}
809,waters:{circleRadius:3,circleColor:"#32709a",minzoom:11,label:{textColor:"#32709a",maxAngle:70,letterSpacing:.3,symbolSpacing:1e3,textSize:["-",11,["*",["get","priority"],.5]],minzoom:9}}};var wl={};function ih(y,O,G,I){if(y.getLayer("lakes")||y.addLayer({id:"lakes",type:"fill","source-layer":"lakes",source:"vector",paint:{"fill-color":ni.lakes.fillColor},minzoom:ni.lakes.minzoom}),!y.getLayer("lakesLabel")){y.addLayer({id:"lakesLabel",type:"symbol","source-layer":"lakes_ctr",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],8]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"point","text-anchor":"center","text-justify":"center","text-pitch-alignment":"viewport","text-size":ni.lakes.label.textSize,"symbol-sort-key":["get","priority"],"text-max-width":ni.lakes.label.textMaxWidth,"text-font":["Open Sans Semibold"]},paint:{"text-color":ni.lakes.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor},minzoom:ni.lakes.label.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","lakesLabel",b);let l=Ye(y,"lakesLabel",G.routingInProgress);wl.lakesLabel=Me({click:b},l)}if(!y.getLayer("riversLabel")){y.addLayer({id:"riversLabel",type:"symbol","source-layer":"rivers",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":ni.rivers.label.maxAngle,"text-letter-spacing":ni.rivers.label.letterSpacing,"symbol-spacing":ni.rivers.label.symbolSpacing,"text-font":["Open Sans Semibold"],"text-overlap":"never","text-size":ni.rivers.label.textSize,"symbol-sort-key":["get","priority"]},paint:{"text-color":ni.rivers.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor}});let b=U=>{Ke(U,O,G)};y.on("click","riversLabel",b);let l=Ye(y,"riversLabel",G.routingInProgress);wl.riversLabel=Me({click:b},l)}if(y.getLayer("rivers")||y.addLayer({id:"rivers",type:"line","source-layer":"rivers",source:"vector",filter:["!=",["get","intermittent"],!0],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":ni.rivers.lineColor,"line-width":ni.rivers.lineWidth}}),y.getLayer("riversIntermittent")||y.addLayer({id:"riversIntermittent",type:"line","source-layer":"rivers",source:"vector",filter:["==",["get","intermittent"],!0],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":ni.rivers.lineColor,"line-width":ni.rivers.lineWidth,"line-dasharray":[3,4]}}),!y.getLayer("waters")){y.addLayer({id:"waters",type:"circle","source-layer":"waters",source:"vector",paint:{"circle-radius":ni.waters.circleRadius,"circle-color":ni.waters.circleColor},minzoom:ni.waters.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","waters",b);let l=Ye(y,"waters",G.routingInProgress);wl.waters=Me({click:b},l)}if(!y.getLayer("watersLabel")){y.addLayer({id:"watersLabel",type:"symbol","source-layer":"waters",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.5,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","text-max-width":5,"text-line-height":1,"symbol-sort-key":["get","priority"],"text-size":ni.waters.label.textSize},paint:{"text-color":ni.waters.label.textColor,"text-halo-width":De.paint.textHaloWidth_large,"text-halo-blur":De.paint.textHaloBlur,"text-halo-color":De.paint.textHaloColor},minzoom:ni.waters.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","watersLabel",b);let l=Ye(y,"watersLabel",G.routingInProgress);wl.watersLabel=Me({click:b},l)}}function rh(y){let O=["lakesLabel","riversLabel","waters","watersLabel"];for(let G of O){let I=wl[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete wl[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("lakes")&&y.removeLayer("lakes"),y.getLayer("rivers")&&y.removeLayer("rivers"),y.getLayer("riversIntermittent")&&y.removeLayer("riversIntermittent")}function Qp(y){y.getLayer("lakes")||y.addLayer({id:"lakes",type:"fill","source-layer":"lakes",source:"vector",paint:{"fill-color":ni.lakes.fillColor},minzoom:ni.lakes.minzoom})}function cd(y){y.getLayer("lakes")&&y.removeLayer("lakes")}var ef={};function ro(y,O,G){if(y.getLayer("glaciers")||y.addLayer({id:"glaciers",type:"fill","source-layer":"glaciers",source:"vector",minzoom:8,paint:{"fill-color":"#5fd7ff","fill-opacity":.2}}),y.getLayer("glaciers-outline")||y.addLayer({id:"glaciers-outline",type:"line",source:"vector","source-layer":"glaciers",paint:{"line-color":"#5fd7ff","line-width":.1,"line-opacity":1},minzoom:8}),!y.getLayer("glaciersLabel")){y.addLayer({id:"glaciersLabel",type:"symbol","source-layer":"glaciers_ctr",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],11]],layout:{"text-field":["get","name"],"symbol-placement":"point","text-anchor":"center","text-justify":"center","icon-keep-upright":!1,"text-pitch-alignment":"viewport","text-size":10,"text-max-width":5},paint:{"text-halo-blur":0,"text-halo-width":1.2,"text-color":"#4296b2","text-halo-color":"rgba(255, 255, 255, 0.9)"},minzoom:13});let I=l=>{Ke(l,O,G)};y.on("click","glaciersLabel",I);let b=Ye(y,"glaciersLabel",G.routingInProgress);ef.glaciersLabel=Me({click:I},b)}y.getLayer("forests")||y.addLayer({id:"forests",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"forest"],paint:{"fill-color":"#2d5a1e","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}}),y.getLayer("forests-outline")||y.addLayer({id:"forests-outline",type:"line",source:"vector","source-layer":"landcover",filter:["==",["get","type"],"forest"],minzoom:11,paint:{"line-color":"#076b1b","line-width":.1,"line-opacity":["interpolate",["linear"],["zoom"],11,0,12,.3]}}),y.getLayer("scrubs")||y.addLayer({id:"scrubs",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"scrub"],paint:{"fill-color":"#7d8c1a","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}}),y.getLayer("residentials")||y.addLayer({id:"residentials",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"residential"],paint:{"fill-color":"#99822d","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}}),y.getLayer("commercials")||y.addLayer({id:"commercials",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"commercial"],paint:{"fill-color":"#f07cc5","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}}),y.getLayer("industrials")||y.addLayer({id:"industrials",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"industrial"],paint:{"fill-color":"#8b68c8","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}})}function ls(y){let O=["glaciersLabel"];for(let G of O){let I=ef[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete ef[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("forests")&&y.removeLayer("forests"),y.getLayer("forests-outline")&&y.removeLayer("forests-outline"),y.getLayer("scrubs")&&y.removeLayer("scrubs"),y.getLayer("residentials")&&y.removeLayer("residentials"),y.getLayer("commercials")&&y.removeLayer("commercials"),y.getLayer("industrials")&&y.removeLayer("industrials"),y.getLayer("glaciers")&&y.removeLayer("glaciers"),y.getLayer("glaciers-outline")&&y.removeLayer("glaciers-outline")}function tf(y){y.getLayer("scrubs")||y.addLayer({id:"scrubs",type:"fill","source-layer":"landcover",source:"vector",minzoom:11,filter:["==",["get","type"],"scrub"],paint:{"fill-color":"#6aa80e","fill-opacity":["interpolate",["linear"],["zoom"],11,0,12,.2]}})}function rf(y){y.getLayer("scrubs")&&y.removeLayer("scrubs")}var gr={resorts:{textSize:["-",11,["*",["get","priority"],.5]],textColor:"#183594",iconSize:["-",.4,["*",["get","priority"],.05]],textVariableAnchor:["step",["zoom"],["literal",["top","bottom","bottom-right","bottom-left","top-left","top-right","left","right"]],11,["literal",["center"]]],textRadialOffset:["step",["zoom"],.8,11,0],iconImage:["step",["zoom"],"resort-marker",11,""],minzoom:9,maxzoom:16},downhillsLabel:{textSize:11},skitoursLabel:{textColor:"#003366",textSize:9,symbolSpacing:800,minzoom:14}};var nh={};function py(y){return ht(this,null,function*(){if(!y.hasImage("resort-marker")){let O=yield y.loadImage("assets/map-icons/resort.png");y.addImage("resort-marker",O.data)}})}function ah(y,O,G,I){y.addLayer({id:"resorts",type:"symbol","source-layer":"resorts_ctr",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":gr.resorts.textVariableAnchor,"text-radial-offset":gr.resorts.textRadialOffset,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":gr.resorts.iconImage,"text-size":gr.resorts.textSize,"icon-size":gr.resorts.iconSize},paint:{"text-color":gr.resorts.textColor,"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:gr.resorts.minzoom,maxzoom:gr.resorts.maxzoom});let b=U=>{Ke(U,O,G)};y.on("click","resorts",b);let l=Ye(y,"resorts",G.routingInProgress);if(nh.resorts=Me({click:b},l),y.getLayer("nordics")||y.addLayer({id:"nordics",type:"line","source-layer":"nordics",source:"vector",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#15bbd1","line-width":["interpolate",["linear"],["zoom"],12,0,15,2],"line-opacity":["interpolate",["linear"],["zoom"],12,0,12.4,1],"line-offset":["step",["zoom"],0,14,-2.5]},minzoom:12}),!y.getLayer("nordicsLabel")){y.addLayer({id:"nordicsLabel",type:"symbol","source-layer":"nordics",source:"vector",layout:{"text-field":"nordic","symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":40,"text-size":9,"symbol-spacing":500,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,.8]},paint:{"text-color":"#12686d","text-halo-blur":0,"text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 0.7)"},minzoom:14});let U=Te=>{Ke(Te,O,G)};y.on("click","nordicsLabel",U);let _e=Ye(y,"nordicsLabel",G.routingInProgress);nh.nordicsLabel=Me({click:U},_e)}if(y.getLayer("downhill_areas")||y.addLayer({id:"downhill_areas",type:"fill","source-layer":"downhill_area",source:"vector",paint:{"fill-color":["case",["==",["get","difficulty"],"novice"],"green",["==",["get","difficulty"],"easy"],"blue",["==",["get","difficulty"],"intermediate"],"red",["==",["get","difficulty"],"advanced"],"black",["==",["get","difficulty"],"expert"],"orange",["==",["get","difficulty"],"freeride"],"yellow","rgba(0,0,0,0)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,0,13,.2]},minzoom:12}),y.getLayer("downhills")||y.addLayer({id:"downhills",type:"line","source-layer":"downhills",source:"vector",filter:["!",["in",["get","full_id"],["literal",["w241575951","w770572902","w241576922","w770572901","w1034894809","w770572898","w770572895","w1034894812","w263222827","w1034894813","w1034894811","w602226940","w1046827669","w1034894815","w1034894810","w972650489"]]]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":["case",["==",["get","difficulty"],"novice"],"green",["==",["get","difficulty"],"easy"],"blue",["==",["get","difficulty"],"intermediate"],"red",["==",["get","difficulty"],"advanced"],"black",["==",["get","difficulty"],"expert"],"orange",["==",["get","difficulty"],"freeride"],"yellow","rgba(0,0,0,0)"],"line-dasharray":[4,0],"line-width":["interpolate",["linear"],["zoom"],11,.7,18,4],"line-opacity":["interpolate",["linear"],["zoom"],11,0,12,1]},minzoom:11}),y.getLayer("downhills_custom")||y.addLayer({id:"downhills_custom",type:"line","source-layer":"downhills_custom",source:"vector-premium",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":["case",["==",["get","difficulty"],"novice"],"green",["==",["get","difficulty"],"easy"],"blue",["==",["get","difficulty"],"intermediate"],"red",["==",["get","difficulty"],"advanced"],"black",["==",["get","difficulty"],"expert"],"orange",["==",["get","difficulty"],"freeride"],"yellow","rgba(0,0,0,0)"],"line-dasharray":[4,0],"line-width":["interpolate",["linear"],["zoom"],11,.7,18,4],"line-opacity":["interpolate",["linear"],["zoom"],11,0,12,1]},minzoom:11}),y.getLayer("downhill_area_custom")||y.addLayer({id:"downhill_area_custom",type:"fill","source-layer":"downhills_area_custom",source:"vector-premium",paint:{"fill-color":["case",["==",["get","difficulty"],"novice"],"green",["==",["get","difficulty"],"easy"],"blue",["==",["get","difficulty"],"intermediate"],"red",["==",["get","difficulty"],"advanced"],"black",["==",["get","difficulty"],"expert"],"orange",["==",["get","difficulty"],"freeride"],"yellow","rgba(0,0,0,0)"],"fill-opacity":["interpolate",["linear"],["zoom"],12,0,13,.2]},minzoom:12}),!y.getLayer("downhillsLabel")){y.addLayer({id:"downhillsLabel",type:"symbol","source-layer":"downhills",source:"vector",filter:["!",["in",["get","full_id"],["literal",["w770572898"]]]],layout:{"text-field":["get","refn
809ame"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":30,"text-size":gr.downhillsLabel.textSize,"symbol-spacing":200,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,.8]},paint:{"text-color":["case",["==",["get","difficulty"],"novice"],"green",["==",["get","difficulty"],"easy"],"blue",["==",["get","difficulty"],"intermediate"],"red",["==",["get","difficulty"],"advanced"],"black",["==",["get","difficulty"],"expert"],"orange",["==",["get","difficulty"],"freeride"]," #b3b300","rgba(0,0,0,0)"],"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:13});let U=Te=>{Ke(Te,O,G)};y.on("click","downhillsLabel",U);let _e=Ye(y,"downhillsLabel",G.routingInProgress);nh.downhillsLabel=Me({click:U},_e)}}function oh(y){let O=["resorts","nordicsLabel","downhillsLabel"];for(let G of O){let I=nh[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete nh[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("nordics")&&y.removeLayer("nordics"),y.getLayer("downhills")&&y.removeLayer("downhills"),y.getLayer("downhills_custom")&&y.removeLayer("downhills_custom"),y.getLayer("downhill_areas")&&y.removeLayer("downhill_areas"),y.getLayer("downhill_area_custom")&&y.removeLayer("downhill_area_custom")}var tt={railways:{lineWidthMain:2,lineWidth:1,minzoom:10},motorway:{lineWidth:["interpolate",["linear"],["zoom"],8,2,9,4],minzoom:9},motorway_link:{lineWidth:3,minzoom:9},primary:{lineWidth:3.5,minzoom:9},secondary:{lineWidth:3,minzoom:11},tertiary:{lineWidth:3,minzoom:12},residential:{lineWidth:3,minzoom:12},unclassified:{lineWidth:3,minzoom:13},pedestrian:{lineWidth:4,minzoom:15},others:{lineWidth:3.5,minzoom:13},gravel:{lineWidth:3.5,minzoom:13},dirt:{lineWidth:3,minzoom:13},paths:{lineWidth:4.8,minzoom:13},passage:{symbolSpacing:5},approximate:{symbolSpacing:15},ferrata:{symbolSpacing:8},ferrata_ctr:{textSize:8,iconSize:1,minzoom:12},highway_label:{textSize:9,minzoom:14},road_label:{textSize:9,minzoom:14},path_ferrata_label:{textSize:9,minzoom:14},tunnelOpacity:.35};var er={};function fy(y){return ht(this,null,function*(){if(!y.hasImage("railways-pattern")){let O=yield y.loadImage("assets/map-icons/highways/railway2.png");y.addImage("railways-pattern",O.data)}if(!y.hasImage("motorway-pattern")){let O=yield y.loadImage("assets/map-icons/highways/motorway.png");y.addImage("motorway-pattern",O.data)}if(!y.hasImage("primary-pattern")){let O=yield y.loadImage("assets/map-icons/highways/primary2.png");y.addImage("primary-pattern",O.data)}if(!y.hasImage("tertiary-pattern")){let O=yield y.loadImage("assets/map-icons/highways/tertiary.png");y.addImage("tertiary-pattern",O.data)}if(!y.hasImage("path-pattern")){let O=yield y.loadImage("assets/map-icons/highways/path.png");y.addImage("path-pattern",O.data)}if(!y.hasImage("winter-path-pattern")){let O=yield y.loadImage("assets/map-icons/highways/winter_path.png");y.addImage("winter-path-pattern",O.data)}if(!y.hasImage("tertiary-pattern")){let O=yield y.loadImage("assets/map-icons/highways/tertiary.png");y.addImage("tertiary-pattern",O.data)}if(!y.hasImage("gravel-pattern")){let O=yield y.loadImage("assets/map-icons/highways/gravel.png");y.addImage("gravel-pattern",O.data)}if(!y.hasImage("dirt-pattern")){let O=yield y.loadImage("assets/map-icons/highways/dirt.png");y.addImage("dirt-pattern",O.data)}if(!y.hasImage("ferrata-pattern")){let O=yield y.loadImage("assets/map-icons/highways/ferrata.png");y.addImage("ferrata-pattern",O.data,{pixelRatio:3})}if(!y.hasImage("winter-technical-pattern")){let O=yield y.loadImage("assets/map-icons/highways/winter_technical.png");y.addImage("winter-technical-pattern",O.data,{pixelRatio:3})}if(!y.hasImage("passage-pattern")){let O=yield y.loadImage("assets/map-icons/highways/passage3.png");y.addImage("passage-pattern",O.data,{pixelRatio:3})}if(!y.hasImage("winter-passage-pattern")){let O=yield y.loadImage("assets/map-icons/highways/winter_passage.png");y.addImage("winter-passage-pattern",O.data,{pixelRatio:3})}if(!y.hasImage("ferrata-marker")){let O=yield y.loadImage("assets/map-icons/ferrata.png");y.addImage("ferrata-marker",O.data,{pixelRatio:3})}})}function sh(y,O,G,I){if(y.getLayer("railways")||y.addLayer({id:"railways",type:"line",source:"vector","source-layer":"railways",paint:{"line-pattern":"railways-pattern","line-width":["case",["==",["get","type"],"rail"],tt.railways.lineWidthMain,tt.railways.lineWidth],"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.railways.minzoom}),y.getLayer("motorway")||y.addLayer({id:"motorway",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"motorway"],["==",["get","type"],"trunk"]],layout:{"line-join":"round"},paint:{"line-pattern":"motorway-pattern","line-width":tt.motorway.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.motorway.minzoom}),y.getLayer("motorway_link")||y.addLayer({id:"motorway_link",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"motorway_link"],["==",["get","type"],"trunk_link"]],layout:{"line-join":"round"},paint:{"line-pattern":"motorway-pattern","line-width":tt.motorway_link.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.motorway_link.minzoom}),y.getLayer("primary")||y.addLayer({id:"primary",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"primary"]],layout:{"line-join":"round"},paint:{"line-pattern":"primary-pattern","line-width":tt.primary.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.primary.minzoom}),y.getLayer("secondary")||y.addLayer({id:"secondary",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"secondary"],["==",["get","type"],"primary_link"]],layout:{"line-join":"round"},paint:{"line-pattern":"primary-pattern","line-width":tt.secondary.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.secondary.minzoom}),y.getLayer("tertiary")||y.addLayer({id:"tertiary",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"tertiary"],["==",["get","type"],"secondary_link"]],layout:{"line-join":"round"},paint:{"line-pattern":"tertiary-pattern","line-width":tt.tertiary.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.tertiary.minzoom}),!y.getLayer("residential")){y.addLayer({id:"residential",type:"line",source:"vector","source-layer":"highways",filter:["==",["get","type"],"residential"],layout:{"line-join":"round"},paint:{"line-pattern":"tertiary-pattern","line-width":tt.residential.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.residential.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","residential",b);let l=Ye(y,"residential",G.routingInProgress);er.residential=Me({click:b},l)}if(y.getLayer("unclassified")||y.addLayer({id:"unclassified",type:"line",source:"vector","source-layer":"highways",filter:["any",["==",["get","type"],"unclassified"],["==",["get","type"],"road"],["==",["get","type"],"living_street"],["==",["get","type"],"tertiary_link"]],layout:{"line-join":"round"},paint:{"line-pattern":"tertiary-pattern","line-width":tt.unclassified.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.unclassified.minzoom}),y.getLayer("highwaysLabel")||y.addLayer({id:"highwaysLabel",type:"symbol","source-layer":"highways",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":40,"text-size":tt.highway_label.textSize,"symbol-spacing":400,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,.8]},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:tt.highway_label.minzoom}),!y.getLayer("roadsLabel")){y.addLayer({id:"roadsLabel",type:"symbol","source-layer":"roads",source:"vector",layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":40,"text-size":tt.road_label.textSize,"symbol-spacing":400,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,.8]},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:tt.road_label.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","roadsLabel",b);let l=Ye(y,"roadsLabel",G.routingInProgress);er.roadsLabel=Me({click:b},l)}}function lh(y){let O=["residential","others","gravel","dirt","roadsLabel"];for(let G of O){let I=er[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete er[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("motorway")&&y.removeLayer("motorway"),y.getLayer("motorway_link")&&y.removeLayer("motorway_link"),y.getLayer("primary")&&y.removeLayer("primary"),y.getLayer("secondary")&&y.removeLayer("secondary"),y.getLayer("tertiary")&&y.removeLayer("tertiary"),y.getLayer("unclassified")&&y.removeLayer("unclassified"),y.getLayer("railways")&&y.removeLayer("railways"),y.getLayer("highwaysLabel")&&y.removeLayer("highwaysLabel")}function ch(y,O,G){if(y.getLayer("pedestrian")||y.addLayer({id:"pedestrian",type:"line","source-layer":"highways",source:"vector",filter:["==",["get","type"],"pedestrian"],layout:{"line-join":"round"},paint:{"line-pattern":"path-pattern","line-width":tt.pedestrian.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.pedestrian.minzoom}),!y.getLayer("others")){y.addLayer({id:"others",type:"line",source:"vector","source-layer":"roads",filter:["any",["==",["get","type"],"service"],["==",["get","type"],"others"]],layout:{"line-join":"round"},paint:{"line-pattern":"tertiary-pattern","line-width":tt.others.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.others.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","others",I);let b=Ye(y,"others",G.routingInProgress);er.others=Me({click:I},b)}if(!y.getLayer("gravel")){y.addLayer({id:"gravel",type:"line",source:"vector","source-layer":"roads",filter:["any",["==",["get","type"],"gravel"],["==",["get","type"],"narrow_gravel"]],layout:{"line-join":"round"},paint:{"line-pattern":"gravel-pattern","line-width":tt.gravel.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.gravel.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","gravel",I);let b=Ye(y,"gravel",G.routingInProgress);er.gravel=Me({click:I},b)}if(!y.getLayer("dirt")){y.addLayer({id:"dirt",type:"line",source:"vector","source-layer":"roads",filter:["any",["==",["get","type"],"dirt"],["==",["get","type"],"narrow_dirt"],["==",["get","type"],"unmaintained"]],layout:{"line-join":"round"},paint:{"line-pattern":"dirt-pattern","line-width":tt.dirt.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.dirt.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","dirt",I);let b=Ye(y,"dirt",G.routingInProgress);er.dirt=Me({click:I},b)}if(!y.getLayer("footway")){y.addLayer({id:"footway",type:"line","source-layer":"paths",source:"vector",filter:["all",["any",["==",["get","type"],"footway"],["==",["get","type"],"steps"]],[">=",["zoom"],["+",["to-number",["get","priority"]],12]]],layout:{"line-join":"round"},paint:{"line-pattern":"path-pattern","line-width":tt.paths.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.paths.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","footway",I);let b=Ye(y,"footway",G.routingInProgress);er.footway=Me({click:I},b)}if(!y.getLayer("paths")){y.addLayer({id:"paths",type:"line","source-layer":"paths",source:"vector",filter:["all",["any",["==",["get","type"],"solid_path"],["==",["get","type"],"path"],["==",["get","type"],"dirt_path"]],[">=",["zoom"],["+",["to-number",["get","priority"]],12]]],layout:{"line-join":"round"},paint:{"line-pattern":["image",["match",["get","type"],"winter_path","winter-path-pattern","path-pattern"]],"line-width":tt.paths.lineWidth,"line-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.paths.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","paths",I);let b=Ye(y,"paths",G.routingInProgress);er.paths=Me({click:I},b)}if(!y.getLayer("ferrata")){y.addLayer({id:"ferrata",type:"symbol",source:"vector","source-layer":"paths",filter:["all",["any",["==",["get","type"],"via_ferrata"],["==",["get","type"],"technical"],["==",["get","type"],"winter_technical"]],[">=",["zoom"],["+",["to-number",["get","priority"]],12]]],layout:{"symbol-placement":"line","icon-image":["image",["match",["get","type"],"winter_technical","winter-technical-pattern","ferrata-pattern"]],"icon-size":["interpolate",["linear"],["zoom"],13,1,17,1.7],"symbol-spacing":tt.ferrata.symbolSpacing,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-pitch-alignment":"viewport","icon-rotation-alignment":"map"},paint:{"icon-opacity":["case",["==",["get","tunnel"],!0],tt.tunnelOpacity,1]},minzoom:tt.paths.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","ferrata",I);let b=Ye(y,"ferrata",G.routingInProgress);er.ferrata=Me({click:I},b)}if(!y.getLayer("passage")){y.addLayer({id:"passage",type:"symbol",source:"vector","source-layer":"paths",filter:["all",["any",["==",["get","type"],"passage"]],[">=",["zoom"],["+",["to-number",["get","priority"]],12]]],layout:{"symbol-placement":"line","icon-image":["image",["match",["get","type"],"winter_passage","winter-passage-pattern","passage-pattern"]],"icon-size":["interpolate",["linear"],["zoom"],8,.8,14,1.2],"symbol-spacing":tt.passage.symbolSpacing,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-pitch-alignment":"viewport","icon-rotation-alignment":"map"},minzoom:tt.paths.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","passage",I);let b=Ye(y,"passage",G.routingInProgress);er.passage=Me({click:I},b)}if(!y.getLayer("approximate")){y.addLayer({id:"approximate",type:"symbol",source:"vector","source-layer":"paths",filter:["all",["==",["get","type"],"approximate"],[">=",["zoom"],["+",["to-number",["get","priority"]],12]]],layout:{"symbol-placement":"line","icon-image":"passage-pattern","icon-size":["interpolate",["linear"],["zoom"],8,.6,14,1],"symbol-spacing":tt.approximate.symbolSpacing,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-pitch-alignment":"viewport","icon-rotation-alignment":"map"},minzoom:tt.paths.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","approximate",I);let b=Ye(y,"approximate",G.routingInProgress);er.approximate=Me({click:I},b)}if(!y.getLayer("pathsLabel")){y.addLayer({id:"pathsLabel",type:"symbol","source-layer":"paths",source:"vector",filter:["all",["!=",["coalesce",["get","name"],""],""],[">=",["zoom"],["+",["to-number",["get","priority"],10],12]]],layout:{"text-field":["get","name"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":40,"text-size":tt.path_ferrata_label.textSize,"symbol-spacing":400,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,-.6]},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:tt.path_ferrata_label.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","pathsLabel",I);let b=Ye(y,"pathsLabel",G.routingInProgress);er.pathsLabel=Me({click:I},b)}if(!y.getLayer("via_ferrata_ctr")){y.addLayer({id:"via_ferrata_ctr",type:"symbol","source-layer":"via_ferrata_ctr",source:"vector",layout:{"text-field":["case",["has","via_ferrata"],["get","via_ferrata"],""],"text-variable-anchor":["top-left"],"text-radial-offset":.1,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":"ferrata-marker","text-size":tt.ferrata_ctr.textSize,"icon-size":tt.ferrata_ctr.iconSize},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:tt.ferrata_ctr.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","via_ferrata_ctr",I);let b=Ye(y,"via_ferrata_ctr",G.routingInProgress);er.via_ferrata_ctr=Me({click:I},b)}}function hh(y){let O=["footway","paths","ferrata","passage","approximate","pathsLabel","via_ferrata_ctr"];for(let G of O){let I=er[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete er[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("pedestrian")&&y.removeLayer("pedestrian")}function my(y,O,G){y.getLayer("outline")||y.addLayer({id:"outline",type:"line",source:"outlines",maxzoom:8,paint:{"line-color":"black","line-width":1.5}}),y.getLayer("outline-inner")||y.addLayer({id:"outline-inner",type:"line",source:"outlines",maxzoom:8,layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":2,"line-offset":2,"line-color":"#a6a6a6"}}),y.getLayer("label")||y.addLayer({id:"label",type:"symbol",source:"outlines-labels",layout:{"text-field":["case",["==",O,"en"],"DETAILED MAP",["==",O,"pl"],"SZCZEG\xD3\u0141OWA MAPA",["==",O,"sk"],"PODROBN\xC1 MAPA",["==",O,"cz"],"PODROBN\xC1 MAPA",["==",O,"fr"],"CARTE D\xC9TAILL\xC9E",["==",O,"de"],"DETAILKARTE",["==",O,"it"],"MAPPA DETTAGLIATA",["==",O,"sl"],"PODROBEN ZEMLJEVID","DETAILED MAP"],"text-size":11,"text-font":["Noto Sans Bold"],"text-max-width":5,"text-overlap":"cooperative"},minzoom:4,maxzoom:6,paint:{"text-color":"#222","text-opacity":.65,"text-halo-blur":0,"text-halo-width":2,"text-halo-color":"white"}}),Ye(y,"label",G.routingInProgress),y.on("click","label",I=>{var Oe,Ve;let b=(Ve=(Oe=I.features)==null?void 0:Oe[0])==null?void 0:Ve.properties.bbox;if(!b)return;let l=JSON.parse(b.trim()),[U,_e,Te,Ee]=l.map(ke=>+ke);y.fitBounds([[U,_e],[Te,Ee]],{padding:60,duration:800})}),y.setPaintProperty("outline","line-opacity",["interpolate",["linear"],["zoom"],7,.5,8,0]),y.setPaintProperty("outline-inner","line-opacity",["interpolate",["linear"],["zoom"],7,.7,8,0])}var Sl={baseLayer:"simple-tiles",season:null,avalanche:!1,avalancheOpacity:50,regions:!1,contours:!1,ridges:!1,antropo:!1,waters:!1,hiking:!1,cycling:!1,landcover:!1,ski:!1,climbing:!1,skitours:!1,winterHiking:!1,highways:!1,paths:!1,outlines:!0,attractions:!1,paragliding:!1,terrainAnalysis:!1},Tl={summer:{season:"summer",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!0,cycling:!0,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!1},summerHiking:{season:"summerHiking",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!0,cycling:!1,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!1},cycling:{season:"cycling",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!0,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!1},winter:{season:"winter",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!1,ski:!0,skitours:!0,winterHiking:!0,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!1},skitour:{season:"skitour",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!1,ski:!1,skitours:!0,winterHiking:!1,climbing:!1,highways:!0,paths:!1,attractions:!1,paragliding:!1},winterHiking:{season:"winterHiking",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!1,ski:!1,skitours:!1,winterHiking:!0,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!1},climbing:{season:"climbing",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!1,ski:!1,skitours:!1,winterHiking:!1,climbing:!0,highways:!0,paths:!0,attractions:!1,paragliding:!1},attractions:{season:"attractions",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!0,cycling:!1,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!0,paths:!0,attractions:!0,paragliding:!1},paragliding:{season:"paragliding",regions:!0,ridges:!0,antropo:!0,waters:!0,hiking:!1,cycling:!1,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!0,paths:!0,attractions:!1,paragliding:!0},none:{season:"none",regions:!1,ridges:!1,antropo:!1,waters:!1,hiking:!1,cycling:!1,ski:!1,skitours:!1,winterHiking:!1,climbing:!1,highways:!1,paths:!1,attractions:!1,paragliding:!1}};var nf={paragliding:{textSize:9,iconSize:.35,minzoom:12}};var af={};function gy(y){return ht(this,null,function*(){if(!y.hasImage("paragliding-marker")){let O=yield y.loadImage("assets/map-icons/paragliding.png");y.addImage("paragliding-marker",O.data)}if(!y.hasImage("powerlines-marker")){let O=yield y.loadImage("assets/map-icons/aerialways/powerlines.png");y.addImage("powerlines-marker",O.data)}})}function uh(y,O,G){if(y.getLayer("powerlines")||y.addLayer({id:"powerlines",type:"line","source-layer":"aerialways",source:"vector",filter:["==",["get","type"],"power"],layout:{"line-join":"round","line-cap":"butt"},paint:{"line-color":Xe.powerlines.lineColor,"line-width":1},minzoom:Xe.powerlines.minzoom}),y.getLayer("powerlinesSymbol")||y.addLayer({id:"powerlinesSymbol",type:"symbol","source-layer":"aerialways",source:"vector",filter:["==",["get","type"],"power"],layout:{"symbol-placement":"line","symbol-spacing":Xe.powerlines.powerlinesSymbol.symbolSpacing,"icon-overlap":"always","icon-image":"powerlines-marker","icon-size":Xe.powerlines.powerlinesSymbol.iconSize},minzoom:Xe.powerlines.powerlinesSymbol.minzoom}),!y.getLayer("paragliding")){y.addLayer({id:"paragliding",type:"symbol","source-layer":"paragliding",source:"vector",layout:{"icon-overlap":"cooperative","icon-image":"paragliding-marker","icon-size":nf.paragliding.iconSize},minzoom:nf.paragliding.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","paragliding",I);let b=Ye(y,"paragliding",G.routingInProgress);af.paragliding=Me({click:I},b)}}function dh(y){y.getLayer("powerlines")&&y.removeLayer("powerlines"),y.getLayer("powerlinesSymbol")&&y.removeLayer("powerlinesSymbol");let O=["paragliding"];for(let G of O){let I=af[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete af[G]),y.getLayer(G)&&y.removeLayer(G)}}var hd={climbing:{textSize:9,iconSize:.35,minzoom:13}};var of={};function yy(y){return ht(this,null,function*(){if(!y.hasImage("climbing-marker")){let O=yield y.loadImage("assets/map-icons/climbing.png");y.addImage("climbing-marker",O.data)}if(!y.hasImage("route-marker")){let O=yield y.loadImage("assets/map-icons/climbing/route.png");y.addImage("route-marker",O.data)}if(!y.hasImage("line-pattern")){let O=yield y.loadImage("assets/map-icons/climbing/line.png");y.addImage("line-pattern",O.data)}if(!y.hasImage("abseil-marker")){let O=yield y.loadImage("assets/map-icons/climbing/abseil.png");y.addImage("abseil-marker",O.data)}})}function ph(y,O,G){if(!y.getLayer("climbing")){y.addLayer({id:"climbing",type:"symbol","source-layer":"climbing",source:"vector",filter:["!",["in",["get","full_id"],["literal",["n13087239498","n13180068150","n5305194392","w560012110"]]]],layout:{"text-field":["get","name"],"text-variable-anchor":["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":"climbing-marker","text-size":hd.climbing.textSize,"icon-size":hd.climbing.iconSize},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:hd.climbing.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","climbing",I);let b=Ye(y,"climbing",G.routingInProgress);of.climbing=Me({click:I},b)}y.getLayer("climbing_routes")||y.addLayer({id:"climbing_routes",type:"symbol","source-layer":"climbing_routes",source:"vector-premium",layout:{"text-field":["get","name"],"text-variable-anchor":["left","right","top","bottom"],"text-radial-offset":.5,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","text-max-width":5,"text-line-height":1,"text-size":8,"icon-overlap":"cooperative","icon-image":"route-marker","icon-size":.2},filter:["!=",["get","type"],"abseil"],paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:14}),y.getLayer("climbing_routes_line")||y.addLayer({id:"climbing_routes_line",type:"line","source-layer":"climbing_routes_line",source:"vector-premium",filter:["!=",["get","type"],"abseil"],layout:{"line-join":"round"},paint:{"line-pattern":["image","line-pattern"],"line-width":3},minzoom:15}),y.getLayer("abseils")||y.addLayer({id:"abseils",type:"symbol","source-layer":"climbing_routes",source:"vector-premium",filter:["==",["get","type"],"abseil"],layout:{"text-field":["get","name"],"text-variable-anchor":["left","right","top","bottom"],"text-radial-offset":.7,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","text-max-width":5,"text-line-height":1,"text-size":8,"icon-image":"abseil-marker","icon-size":.15,"icon-overlap":"cooperative"},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:16}),y.getLayer("abseils_line")||y.addLayer({id:"abseils_line",type:"line","source-layer":"climbing_routes_line",source:"vector-premium",filter:["==",["get","type"],"abseil"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#346f8b","line-width":3},minzoom:17}),y.getLayer("abseils_line_dots")||y.addLayer({id:"abseils_line_dots",type:"circle","source-layer":"climbing_routes_line",source:"vector-premium",filter:["==",["get","type"],"abseil"],paint:{"circle-color":"#346f8b","circle-radius":3,"circle-stroke-width":0},minzoom:17})}function fh(y){let O=["climbing"];for(let I of O){let b=of[I];b&&(y.off("click",I,b.click),y.off("mouseenter",I,b.mouseenter),y.off("mouseleave",I,b.mouseleave),delete of[I]),y.getLayer(I)&&y.removeLayer(I)}let G=["climbing_routes","climbing_routes_line","abseils","abseils_line","abseils_line_dots"];for(let I of G)y.getLayer(I)&&y.removeLayer(I)}var ud={caves:{textSize:["-",11,["*",["get","priority"],.5]],iconSize:["-",.4,["*",["get","priority"],.03]],minzoom:11}};var sf={};function _y(y){return ht(this,null,function*(){if(!y.hasImage("caves-marker")){let O=yield y.loadImage("assets/map-icons/caves.png");y.addImage("caves-marker",O.data)}})}function mh(y,O,G,I){if(!y.getLayer("caves")){y.addLayer({id:"caves",type:"symbol","source-layer":"caves",source:"vector",filter:[">=",["zoom"],["+",["to-number",["get","priority"]],11]],layout:{"text-field":["coalesce",["get",["concat","name_",I]],["get","name"]],"text-variable-anchor":["right","left","top","bottom","top-left","top-right","bottom-left","bottom-right"],"text-radial-offset":.8,"text-font":["Open Sans Semibold"],"text-justify":"auto","text-overlap":"never","icon-overlap":"cooperative","text-max-width":5,"text-line-height":1,"icon-image":"caves-marker","text-size":ud.caves.textSize,"icon-size":ud.caves.iconSize},paint:{"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:ud.caves.minzoom});let b=U=>{Ke(U,O,G)};y.on("click","caves",b);let l=Ye(y,"caves",G.routingInProgress);sf.caves=Me({click:b},l)}}function gh(y){let O=["caves"];for(let G of O){let I=sf[G];
809I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete sf[G]),y.getLayer(G)&&y.removeLayer(G)}}function xy(y){return ht(this,null,function*(){if(!y.hasImage("search-marker")){let O=yield y.loadImage("assets/map-icons/app/search.png");y.addImage("search-marker",O.data)}yield Promise.all([uy(y),dy(y),fy(y),sy(y),ly(y),py(y),gy(y),yy(y),_y(y)])})}var lf={};function yh(y,O,G){if(y.getLayer("skitours")||y.addLayer({id:"skitours",type:"line","source-layer":"skitours",source:"vector",filter:["!",["in",["get","full_id"],["literal",["w95951671","w466861766","w37030773","w770572900","w249237712","w915456046","w915456047","w915456045","w915626355","w263222828","w1033469381","w13969333","w28602887","w263226218","w1046827664","w770572899","w188690855","w80377055","w263226218","w263226509","w915741113","w28602887","w1046827664","w915741109","w915741112","w915741108","w915741111","w263226509","w1034894814","w1046827663","w250583977","w915741110","w1150038402","w313189572","w1046827663","w1046827663","w770602065"]]]],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#1a8cff","line-width":2,"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],12,0,12.4,1]},minzoom:12}),y.getLayer("skitours_arrows")||y.addLayer({id:"skitours_arrows",type:"symbol","source-layer":"skitours_custom",source:"vector-premium",filter:["==",["get","oneway"],!0],layout:{"symbol-placement":"line","symbol-spacing":20,"text-field":">","text-font":["Open Sans Semibold"],"text-size":14,"text-keep-upright":!1,"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#1a8cff"},minzoom:13}),!y.getLayer("skitoursLabel")){y.addLayer({id:"skitoursLabel",type:"symbol","source-layer":"skitours",source:"vector",filter:["!",["in",["get","full_id"],["literal",["w95951671","w249237712","w770572900","w37030773","w466861766"]]]],layout:{"text-field":"skitour","symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":40,"text-size":gr.skitoursLabel.textSize,"symbol-spacing":gr.skitoursLabel.symbolSpacing,"text-font":["Open Sans Semibold"],"text-allow-overlap":!1,"text-overlap":"never","text-offset":[0,-1]},paint:{"text-color":gr.skitoursLabel.textColor,"text-halo-blur":De.paint.textHaloBlur,"text-halo-width":De.paint.textHaloWidth,"text-halo-color":De.paint.textHaloColor},minzoom:gr.skitoursLabel.minzoom});let I=l=>{Ke(l,O,G)};y.on("click","skitoursLabel",I);let b=Ye(y,"skitoursLabel",G.routingInProgress);lf.skitoursLabel=Me({click:I},b)}y.getLayer("skitours_area")||y.addLayer({id:"skitours_area",type:"fill","source-layer":"skitours_area",source:"vector-premium",paint:{"fill-color":"#1a8cff","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,.15]},minzoom:13}),y.getLayer("skitours_custom")||y.addLayer({id:"skitours_custom",type:"line","source-layer":"skitours_custom",source:"vector-premium",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#1a8cff","line-width":["interpolate",["linear"],["zoom"],12,0,13,2],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],12,0,12.4,1]},minzoom:12})}function _h(y){let O=["skitoursLabel"];for(let G of O){let I=lf[G];I&&(y.off("click",G,I.click),y.off("mouseenter",G,I.mouseenter),y.off("mouseleave",G,I.mouseleave),delete lf[G]),y.getLayer(G)&&y.removeLayer(G)}y.getLayer("skitours")&&y.removeLayer("skitours"),y.getLayer("skitours_custom")&&y.removeLayer("skitours_custom"),y.getLayer("skitours_arrows")&&y.removeLayer("skitours_arrows"),y.getLayer("skitours_area")&&y.removeLayer("skitours_area")}function xh(y){y.getLayer("winter_trails")||y.addLayer({id:"winter_trails",type:"line","source-layer":"winter_trails",source:"vector-premium",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":Wc.trails.paint.lineColor,"line-width":["interpolate",["linear"],["zoom"],11,1,18,3],"line-opacity":["interpolate",["linear"],["zoom"],11,0,12,1]},minzoom:11}),y.getLayer("winter_trails_area")||y.addLayer({id:"winter_trails_area",type:"fill","source-layer":"winter_trails_area",source:"vector-premium",paint:{"fill-color":Wc.trails.paint.lineColor,"fill-opacity":["interpolate",["linear"],["zoom"],12,0,13,.15]},minzoom:12})}function vh(y){y.getLayer("winter_trails")&&y.removeLayer("winter_trails"),y.getLayer("winter_trails_area")&&y.removeLayer("winter_trails_area")}function Px(y){y.CapacitorUtils.Synapse=new Proxy({},{get(O,G){return new Proxy({},{get(I,b){return(l,U,_e)=>{let Te=y.Capacitor.Plugins[G];if(Te===void 0){_e(new Error(`Capacitor plugin ${G} not found`));return}if(typeof Te[b]!="function"){_e(new Error(`Method ${b} not found in Capacitor plugin ${G}`));return}ht(this,null,function*(){try{let Ee=yield Te[b](l);U(Ee)}catch(Ee){_e(Ee)}})}}})}})}function Ix(y){y.CapacitorUtils.Synapse=new Proxy({},{get(O,G){return y.cordova.plugins[G]}})}function vy(y=!1){window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!y?Px(window):window.cordova!==void 0&&Ix(window)}var Vn=Wg("Geolocation",{web:()=>import("./chunk-ONS33CAL.js").then(y=>new y.GeolocationWeb)});vy();var by=(()=>{let O=class O{constructor(){this.capacitorWatchId=null,this.webWatchId=null,this.locationSubject=ne
809w Bn(null),this.location$=this.locationSubject.asObservable(),this.trackingSubject=new Bn(!1),this.isTracking$=this.trackingSubject.asObservable(),this.sessionStartSubject=new Bn(0),this.sessionStart$=this.sessionStartSubject.asObservable(),this.startInProgressLock=!1,this.watchRetryCount=0,this.MAX_WATCH_RETRIES=3,this.sessionId=0,this.activeSessionId=null,this.compassHeading=null,this.orientationActive=!1,this.START_SPEED_MPS=.45,this.STOP_SPEED_MPS=.35,this.START_DELAY_MS=4e3,this.STOP_DELAY_MS=3e3,this.isGpsMode=!1,this.movingStartMs=null,this.stillStartMs=null,this.trackHistory=[],this.TRACK_HISTORY_MS=9e3,this.MIN_HEADING_DT_MS=6e3,this.MIN_HEADING_DIST_M=2.5,this.MAX_GPS_HEADING_ACCURACY_M=10,this.GPS_HEADING_RESET_GAP_MS=7e3,this.lastCourseHeadingDeg=null,this.lastFixMs=null,this.resumeRefreshLock=!1,this.watchdogTimer=null,this.WATCHDOG_MS=15e3,this.watchRestartInProgress=!1,this.onDeviceOrientation=I=>{let b=I,l=null;if(typeof(b==null?void 0:b.webkitCompassHeading)=="number"?l=b.webkitCompassHeading:typeof I.alpha=="number"&&(l=360-I.alpha),l!=null&&Number.isFinite(l)){if(this.compassHeading=((l+180)%360+360)%360,this.isGpsMode)return;let U=this.locationSubject.getValue();U&&this.locationSubject.next(wt(Me({},U),{heading:this.compassHeading,headingSource:"compass"}))}},Oc("hybrid")?Hg.addListener("appStateChange",I=>{I.isActive&&this.onResume()}):document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.onResume()})}isTracking(){return this.trackingSubject.getValue()}startTrackingUser(){return ht(this,null,function*(){if(this.startInProgressLock||this.isTracking()){console.warn("startTrackingUser() already in progress.");return}this.startInProgressLock=!0,this.sessionId+=1,this.activeSessionId=this.sessionId;let I=this.sessionId;this.watchRetryCount=0,this.sessionStartSubject.next(Date.now());try{yield this.ensurePermissions(),this.enableCompass(),this.isHybridAndroid()?this.startWebWatch(I):yield this.startCapacitorWatch(I),this.trackingSubject.next(!0),this.forceRefreshPosition({timeoutMs:this.getDefaultFixTimeoutMs(),session:I}).catch(()=>{})}catch(b){throw yield this.stopTrackingUser().catch(()=>{}),b}finally{this.startInProgressLock=!1}})}stopTrackingUser(){return ht(this,null,function*(){this.activeSessionId=null,this.capacitorWatchId&&(yield Vn.clearWatch({id:this.capacitorWatchId}),this.capacitorWatchId=null),this.webWatchId!=null&&(navigator.geolocation.clearWatch(this.webWatchId),this.webWatchId=null),this.trackingSubject.next(!1),this.locationSubject.next(null),this.disableCompass(),this.isGpsMode=!1,this.movingStartMs=null,this.stillStartMs=null,this.trackHistory=[],this.lastCourseHeadingDeg=null,this.lastFixMs=null,this.watchRetryCount=0,this.clearWatchdog(),this.watchRestartInProgress=!1,console.log("Stopped tracking")})}getCurrentUserLocation(){return this.locationSubject.getValue()}isHybridAndroid(){return Oc("hybrid")&&Oc("android")}getDefaultFixTimeoutMs(){return this.isHybridAndroid()?4e4:2e4}ensurePermissions(){return ht(this,null,function*(){if(Oc("hybrid")){let I;if(I=yield Vn.checkPermissions(),I.location!=="granted"&&I.coarseLocation!=="granted"&&(yield Vn.requestPermissions(),I=yield Vn.checkPermissions()),I.location!=="granted"&&I.coarseLocation!=="granted"){let b=new Error("Location permission was denied! Allow application access to GPS location.");throw b.code="OS-PLUG-GLOC-0003",b}}else yield new Promise((I,b)=>{if(!navigator.geolocation){let l=new Error("Geolocation is not available in this environment.");l.code="OS-PLUG-GLOC-0002",b(l);return}navigator.geolocation.getCurrentPosition(()=>I(),l=>b(this.normalizeWebError(l)),{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})})})}startCapacitorWatch(I){return ht(this,null,function*(){let b={enableHighAccuracy:!0,maximumAge:0,timeout:this.getDefaultFixTimeoutMs(),interval:1e3,minimumUpdateInterval:1e3,enableLocationFallback:!0};this.capacitorWatchId=yield Vn.watchPosition(b,(l,U)=>{var _e;this.isSessionActive(I)&&(l&&this.handleFix(l.coords.latitude,l.coords.longitude,l.coords.accuracy,l.coords.speed,(_e=l.timestamp)!=null?_e:Date.now(),I),U&&(console.error("Capacitor watchPosition error:",U),this.isFatalError(U)?(this.trackingSubject.next(!1),this.activeSessionId=null,this.clearWatchesKeepLocation().catch(()=>{})):this.isPositionUnavailable(U)?(this.resetWatchdog(I),console.warn("Capacitor watch: positionUnavailable (transient iOS) \u2013 waiting for CLLocationManager")):(console.warn("Watch error (timeout/transient) \u2013 restarting watch with relaxed params"),this.restartWatchRelaxed(I).catch(()=>{}))))}),this.resetWatchdog(I)})}
809startWebWatch(I){if(!navigator.geolocation){let b=new Error("Geolocation is not available in this environment.");throw b.code="OS-PLUG-GLOC-0002",b}this.webWatchId=navigator.geolocation.watchPosition(b=>{var U;if(!this.isSessionActive(I))return;let l=b.coords;this.handleFix(l.latitude,l.longitude,l.accuracy,l.speed,(U=b.timestamp)!=null?U:Date.now(),I)},b=>{if(!this.isSessionActive(I))return;let l=this.normalizeWebError(b);console.error("Web watchPosition error:",l),this.isFatalError(l)?(this.trackingSubject.next(!1),this.activeSessionId=null,this.clearWatchesKeepLocation().catch(()=>{})):(console.warn("Web watch error (timeout/transient) \u2013 restarting watch with relaxed params"),this.restartWatchRelaxed(I).catch(()=>{}))},{enableHighAccuracy:!0,maximumAge:0,timeout:this.getDefaultFixTimeoutMs()}),this.resetWatchdog(I)}isSessionActive(I){return this.activeSessionId===I}clearWatchesKeepLocation(){return ht(this,null,function*(){this.capacitorWatchId&&(yield Vn.clearWatch({id:this.capacitorWatchId}),this.capacitorWatchId=null),this.webWatchId!=null&&(navigator.geolocation.clearWatch(this.webWatchId),this.webWatchId=null),this.clearWatchdog(),this.disableCompass(),this.isGpsMode=!1,this.movingStartMs=null,this.stillStartMs=null})}onResume(){return ht(this,null,function*(){if(!this.isTracking()||this.resumeRefreshLock)return;this.resumeRefreshLock=!0;let I=this.activeSessionId;if(!I){this.resumeRefreshLock=!1;return}let b=this.locationSubject.getValue();b&&this.locationSubject.next(Me({},b));let l=Date.now();if(this.isGpsMode&&this.lastFixMs!=null&&l-this.lastFixMs>this.GPS_HEADING_RESET_GAP_MS){this.exitGpsHeadingImmediately();let U=this.locationSubject.getValue();U&&this.locationSubject.next(wt(Me({},U),{heading:void 0,headingSource:void 0}))}try{this.clearWatchdog(),yield this.restartWatch(I),this.forceRefreshPosition({timeoutMs:this.getDefaultFixTimeoutMs(),session:I}).catch(()=>{})}finally{this.resumeRefreshLock=!1}})}restartWatch(I){return ht(this,null,function*(){this.isSessionActive(I)&&(this.watchRetryCount=0,yield this.clearWatchesKeepLocation(),this.isHybridAndroid()?this.startWebWatch(I):yield this.startCapacitorWatch(I),this.trackingSubject.next(!0))})}restartWatchRelaxed(I){return ht(this,null,function*(){if(this.isSessionActive(I)&&!this.watchRestartInProgress){this.watchRestartInProgress=!0;try{if(this.watchRetryCount++,this.watchRetryCount>this.MAX_WATCH_RETRIES){console.error(`Watch retry limit (${this.MAX_WATCH_RETRIES}) exceeded \u2013 killing tracking`),this.trackingSubject.next(!1),this.activeSessionId=null,yield this.clearWatchesKeepLocation();return}console.log(`Restarting watch with relaxed params (retry ${this.watchRetryCount}/${this.MAX_WATCH_RETRIES})`),yield this.clearWatchesKeepLocation(),this.enableCompass(),this.isHybridAndroid()?this.startWebWatch(I):yield this.startCapacitorWatchRelaxed(I),this.forceRefreshPositionRelaxed({timeoutMs:3e4,session:I}).catch(()=>{})}finally{this.watchRestartInProgress=!1}}})}startCapacitorWatchRelaxed(I){return ht(this,null,function*(){let b={enableHighAccuracy:!0,maximumAge:3e4,timeout:45e3,interval:2e3,minimumUpdateInterval:2e3,enableLocationFallback:!0};this.capacitorWatchId=yield Vn.watchPosition(b,(l,U)=>{var _e;this.isSessionActive(I)&&(l&&this.handleFix(l.coords.latitude,l.coords.longitude,l.coords.accuracy,l.coords.speed,(_e=l.timestamp)!=null?_e:Date.now(),I),U&&(console.error("Capacitor relaxed watchPosition error:",U),this.isFatalError(U)?(this.trackingSubject.next(!1),this.activeSessionId=null,this.clearWatchesKeepLocation().catch(()=>{})):this.isPositionUnavailable(U)?(this.resetWatchdog(I),console.warn("Capacitor relaxed watch: positionUnavailable (transient iOS) \u2013 waiting")):(console.warn("Relaxed watch also errored \u2013 retrying"),this.restartWatchRelaxed(I).catch(()=>{}))))}),this.resetWatchdog(I)})}forceRefreshPositionRelaxed(I){return ht(this,null,function*(){let b=Math.max(1e3,I.timeoutMs),l=yield new Promise((U,_e)=>{let Te=window.setTimeout(()=>{let Oe=new Error("Relaxed getCurrentPosition timeout");Oe.code="OS-PLUG-GLOC-0010",_e(Oe)},b+250),Ee=()=>window.clearTimeout(Te);this.isHybridAndroid()?navigator.geolocation.getCurrentPosition(Oe=>{var ke,Ge;Ee();let Ve=Oe.coords;U({lat:Ve.latitude,lng:Ve.longitude,acc:Ve.accuracy,speed:(ke=Ve.speed)!=null?ke:void 0,ts:(Ge=Oe.timestamp)!=null?Ge:Date.now()})},Oe=>{Ee(),_e(this.normalizeWebError(Oe))},{enableHighAccuracy:!0,maximumAge:6e4,timeout:b}):ht(this,null,function*(){var Oe,Ve;try{let ke=yield Vn.getCurrentPosition({enableHighAccuracy:!0,maximumAge:6e4,timeout:b,enableLocationFallback:!0});Ee(),U({lat:ke.coords.latitude,lng:ke.coords.longitude,acc:ke.coords.accuracy,speed:(Oe=ke.coords.speed)!=null?Oe:void 0,ts:(Ve=ke.timestamp)!=null?Ve:D
809ate.now()})}catch(ke){Ee(),_e(ke)}})});this.isSessionActive(I.session)&&this.handleFix(l.lat,l.lng,l.acc,l.speed,l.ts,I.session)})}forceRefreshPosition(I){return ht(this,null,function*(){let b=Math.max(1e3,I.timeoutMs),l=yield new Promise((U,_e)=>{let Te=window.setTimeout(()=>{let Oe=new Error("Could not obtain location in time. Try with a higher timeout.");Oe.code="OS-PLUG-GLOC-0010",_e(Oe)},b+250),Ee=()=>window.clearTimeout(Te);this.isHybridAndroid()?navigator.geolocation.getCurrentPosition(Oe=>{var ke,Ge;Ee();let Ve=Oe.coords;U({lat:Ve.latitude,lng:Ve.longitude,acc:Ve.accuracy,speed:(ke=Ve.speed)!=null?ke:void 0,ts:(Ge=Oe.timestamp)!=null?Ge:Date.now()})},Oe=>{Ee(),_e(this.normalizeWebError(Oe))},{enableHighAccuracy:!0,maximumAge:0,timeout:b}):ht(this,null,function*(){var Oe,Ve;try{let ke=yield Vn.getCurrentPosition({enableHighAccuracy:!0,maximumAge:0,timeout:b,enableLocationFallback:!0});Ee(),U({lat:ke.coords.latitude,lng:ke.coords.longitude,acc:ke.coords.accuracy,speed:(Oe=ke.coords.speed)!=null?Oe:void 0,ts:(Ve=ke.timestamp)!=null?Ve:Date.now()})}catch(ke){Ee(),_e(ke)}})});this.isSessionActive(I.session)&&this.handleFix(l.lat,l.lng,l.acc,l.speed,l.ts,I.session)})}enableCompass(){var I;if(!this.orientationActive)try{let b=window;typeof((I=b==null?void 0:b.DeviceOrientationEvent)==null?void 0:I.requestPermission)=="function"?b.DeviceOrientationEvent.requestPermission().then(l=>{l==="granted"&&(window.addEventListener("deviceorientation",this.onDeviceOrientation,!0),this.orientationActive=!0)}).catch(()=>{}):"DeviceOrientationEvent"in window&&(window.addEventListener("deviceorientation",this.onDeviceOrientation,!0),this.orientationActive=!0)}catch{}}disableCompass(){this.orientationActive&&(window.removeEventListener("deviceorientation",this.onDeviceOrientation,!0),this.orientationActive=!1,this.compassHeading=null)}pushTrackPoint(I,b,l){this.trackHistory.unshift({lat:I,lng:b,ts:l});let U=l-this.TRACK_HISTORY_MS;for(;this.trackHistory.length>0&&this.trackHistory[this.trackHistory.length-1].ts<U;)this.trackHistory.pop()}getCourseHeadingDeg(){if(this.trackHistory.length<2)return null;let I=this.trackHistory[0],b=null;for(let U=0;U<this.trackHistory.length-1;U++){let _e=this.trackHistory[U];if(I.ts-_e.ts>=this.MIN_HEADING_DT_MS){b=_e;break}}return!b||this.haversineDistance(b.lat,b.lng,I.lat,I.lng)<this.MIN_HEADING_DIST_M?null:this.computeBearing(b.lat,b.lng,I.lat,I.lng)}haversineDistance(I,b,l,U){let Te=I*Math.PI/180,Ee=l*Math.PI/180,Oe=(l-I)*Math.PI/180,Ve=(U-b)*Math.PI/180,ke=Math.sin(Oe/2)*Math.sin(Oe/2)+Math.cos(Te)*Math.cos(Ee)*Math.sin(Ve/2)*Math.sin(Ve/2);return 6371e3*(2*Math.atan2(Math.sqrt(ke),Math.sqrt(1-ke)))}computeBearing(I,b,l,U){let _e=I*Math.PI/180,Te=l*Math.PI/180,Ee=(U-b)*Math.PI/180,Oe=Math.sin(Ee)*Math.cos(Te),Ve=Math.cos(_e)*Math.sin(Te)-Math.sin(_e)*Math.cos(Te)*Math.cos(Ee);return(Math.atan2(Oe,Ve)*180/Math.PI%360+360)%360}resetWatchdog(I){this.clearWatchdog(),this.watchdogTimer=setTimeout(()=>ht(this,null,function*(){if(this.isSessionActive(I)){if(this.watchRestartInProgress){this.resetWatchdog(I);return}console.warn("GeolocationService watchdog: brak fixa przez 15s \u2013 restart watch"),yield this.restartWatch(I).catch(()=>{})}}),this.WATCHDOG_MS)}clearWatchdog(){this.watchdogTimer!=null&&(clearTimeout(this.watchdogTimer),this.watchdogTimer=null)}exitGpsHeadingImmediately(){this.isGpsMode=!1,this.movingStartMs=null,this.stillStartMs=null,this.lastCourseHeadingDeg=null,this.trackHistory=[]}handleFix(I,b,l,U,_e,Te){if(!this.isSessionActive(Te))return;this.watchRetryCount=0,this.resetWatchdog(Te);let Ee=_e!=null?_e:Date.now(),Oe=this.lastFixMs;this.isGpsMode&&Oe!=null&&Ee-Oe>this.GPS_HEADING_RESET_GAP_MS&&this.exitGpsHeadingImmediately(),this.lastFixMs=Ee,this.pushTrackPoint(I,b,Ee);let Ve=typeof U=="number"&&Number.isFinite(U)?U:0,Ge=(typeof l=="number"&&Number.isFinite(l)?l:Number.POSITIVE_INFINITY)>this.MAX_GPS_HEADING_ACCURACY_M,ce=Ge?null:this.getCourseHeadingDeg();ce!==null&&(this.lastCourseHeadingDeg=ce);let Dt=Ve>=this.START_SPEED_MPS,gt=Ve<=this.STOP_SPEED_MPS;this.isGpsMode?gt||Ge||this.lastCourseHeadingDeg===null?(this.stillStartMs===null&&(this.stillStartMs=Ee),Ee-this.stillStartMs>=this.STOP_DELAY_MS&&(this.isGpsMode=!1,this.movingStartMs=null)):this.stillStartMs=null:Dt&&ce!==null?(this.movingStartMs===null&&(this.movingStartMs=Ee),Ee-this.movingStartMs>=this.START_DELAY_MS&&(this.isGpsMode=!0,this.stillStartMs=null)):this.movingStartMs=null;let ft=wi=>(wi%360+360)%360,Ot,di;this.isGpsMode&&this.lastCourseHeadingDeg!==null?(Ot=ft(this.lastCourseHeadingDeg),di="gps"):this.compassHeading!=null?(Ot=this.compassHeading,di="compass"):(Ot=void 0,di=void 0),this.locationSubject.next({latitude:I,longitude:b,accuracy:l,timestamp:_e,speed:Ve,heading:Ot,headingSource:di})}isPositionUnavailable(I){return(I==null?void 0:I.code)==="OS-PLUG-GLOC-0002"}isFatalError(I){if(!I)return!1;let b=I==null?void 0:I.code;return b==="OS-PLUG-GLOC-0003"||b===1||b==="OS-PLUG-GLOC-0007"}normalizeWebError(I){let b=typeof(I==null?void 0:I.code)=="number"?I.code:void 0,l=typeof(I==null?void 0:I.message)=="str
809ing"?I.message:"Geolocation error";if(b===1){let Te=new Error("Location permission was denied! Allow application access to GPS location.");return Te.code="OS-PLUG-GLOC-0003",Te}if(b===3){let Te=new Error("Could not obtain location in time. Try with a higher timeout.");return Te.code="OS-PLUG-GLOC-0010",Te}let U=l.toLowerCase();if(U.includes("disabled")||U.includes("provider")||U.includes("location off")||U.includes("not enabled")){let Te=new Error("Location services are not enabled.");return Te.code="OS-PLUG-GLOC-0007",Te}let _e=new Error(l);return _e.code="OS-PLUG-GLOC-0002",_e}};O.\u0275fac=function(b){return new(b||O)},O.\u0275prov=io({token:O,factory:O.\u0275fac,providedIn:"root"});let y=O;return y})();function wy(y,O){["parksOutlineSymbol","parksLabel","huts","caves","highwaysLabel","roadsLabel","pathsLabel","trailsLabel","placesLabel","regionsLabelCurved","regionsLabel","passes","summits","resorts","ridgesLabel","valleysLabel","valleysLineLabel","lakesLabel","riversLabel","glaciersLabel","climbing","watersLabel","points","buildings","attractions","grasslandsLabel","formationsLineLabel","formationsLabel"].forEach(l=>{let U=y.getLayer(l);U&&y.setLayoutProperty(U.id,"text-field",["coalesce",["get",["concat","name_",O]],["get","name"]])});let I=y.getLayer("label");I&&y.setLayoutProperty(I.id,"text-field",["case",["==",O,"en"],"DETAILED MAP",["==",O,"pl"],"SZCZEG\xD3\u0141OWA MAPA",["==",O,"sk"],"PODROBN\xC1 MAPA",["==",O,"cz"],"PODROBN\xC1 MAPA",["==",O,"fr"],"CARTE D\xC9TAILL\xC9E",["==",O,"de"],"DETAILKARTE",["==",O,"it"],"MAPPA DETTAGLIATA",["==",O,"sl"],"PODROBEN ZEMLJEVID","DETAILED MAP"]);let b=y.getLayer("summits");b&&y.setLayoutProperty(b.id,"text-field",["case",["has","elevation"],["format",["coalesce",["get",["concat","name_",O]],["get","name"]],{"font-scale":1},` 810`,{},"(",{"font-scale":.8},["get","elevation"],{"font-scale":.8},")",{"font-scale":.8}],["coalesce",["get",["concat","name_",O]],["get","name"]]])}function pd(y,O,G,I,b){let l=!1;switch(y){case"hillshade-tiles":{I.landcover||ro(O,G,b),l=!0,O.getLayer("background")&&O.setPaintProperty("background","background-color","#e9e4db"),cf(O,!1),Qp(O),tf(O),dd(O,!0);break}case"simple-tiles":{I.landcover||ro(O,G,b),l=!0,O.getLayer("background")&&O.setPaintProperty("background","background-color","#C7C7C7"),cf(O,!1),Qp(O),tf(O),dd(O,!1);break}case"winter-tiles":{I.landcover||ro(O,G,b),l=!0,O.getLayer("background")&&O.setPaintProperty("background","background-color","#d5d6db"),cf(O,!0),cd(O),rf(O),dd(O,!0);break}case"simple-tiles-orto":{I.landcover&&ls(O),l=!1,O.getLayer("background")&&O.setPaintProperty("background","background-color","#C7C7C7"),cd(O),dd(O,!1);break}case"tatramap-tiles":case"valleys-tiles":{I.landcover&&ls(O),l=!1,cd(O),rf(O);break}}return{landcoverState:l}}function dd(y,O){let G=O?.2:.8,I=O?.4:.8,b=O?.5:1;y.getLayer("contours100")&&y.setPaintProperty("contours100","line-opacity",["interpolate",["linear"],["zoom"],10,0,13,G]),y.getLayer("contours50")&&y.setPaintProperty("contours50","line-opacity",["interpolate",["linear"],["zoom"],12,0,14,I]),y.getLayer("contours10")&&y.setPaintProperty("contours10","line-opacity",["interpolate",["linear"],["zoom"],13,0,15,b])}function cf(y,O){let G=O?"#496850":"#076b1b";y.getLayer("forests")&&y.setPaintProperty("forests","fill-color",G)}function fd(y){return[y.x,y.y]}function Sy(y){if(!y)return{type:"FeatureCollection",features:[]};let O=[];return y.segments.forEach((G,I)=>{let b=G.points,l=b[0].hike_rating,U=[fd(b[0])];for(let _e=0;_e<b.length-1;_e++){let Te=b[_e],Ee=b[_e+1],Oe=Te.hike_rating;Oe!==l&&(O.push({type:"Feature",properties:{hike_rating:l,segment_index:I},geometry:{type:"LineString",coordinates:U}}),U=[fd(Te)],l=Oe),U.push(fd(Ee))}O.push({type:"Feature",properties:{hike_rating:l,segment_index:I},geometry:{type:"LineString",coordinates:U}})}),{type:"FeatureCollection",features:O}}function Mx(y,O){return y[0]===O[0]&&y[1]===O[1]}function Ty(y){return{type:"FeatureCollection",features:y.map((G,I)=>{let b=[];for(let l of G.segments){let U=l.points;for(let _e=0;_e<U.length;_e++){let Te=fd(U[_e]);(b.length===0||!Mx(b[b.length-1],Te))&&b.push(Te)}}return{type:"Feature",properties:{alt_idx:I},geometry:{type:"LineString",coordinates:b}}})}}function Py(y){return{type:"FeatureCollection",features:y.map(G=>({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[G.from.x,G.from.y],[G.to.x,G.to.y]]}}))}}function Iy(y,O,G,I=0){var l;console.log("onClickMap()");let b=(l=y.originalEvent)==null?void 0:l.target;if(b!=null&&b.closest(".maplibregl-marker")){console.log("onClickMap(): ignoring click on marker element");return}
810if(Date.now()-I<150){console.log("onClickMap(): ignoring click shortly after marker drag");return}if(G.routingInProgress()){let U=ay.filter(Te=>O.getLayer(Te)),_e=O.queryRenderedFeatures(y.point,{layers:U});if(_e.length){console.log(`onClickMap(): layers hit: ${_e} -> layer will add waypoint OR altRoute`);return}vl(y,G)}}function My(y,O){var _e,Te;let G=(_e=y.features)==null?void 0:_e[0];if(!G)return;let I=(Te=G.properties)==null?void 0:Te.alt_idx,b=typeof I=="number"?I:Number(I);if(!Number.isFinite(b))return;let U=O.alternativePaths()[b];U&&O.selectRoute(U)}function Ly(y,O,G,I){let b=y.lngLat.lng,l=y.lngLat.lat,U={full_id:`${y.lngLat.wrap()}`,name:os(l,b),type:"0",elevation:null,bbox:[[b,l],[b,l]],distance:null,bbox_distance:0,point:!0,location:null},_e=jc.filter(Ee=>O.getLayer(Ee)),Te=O.queryRenderedFeatures(y.point,{layers:_e});if(Te.length>0){let Ee=Te[0];if(U.full_id=Ee.properties.full_id,U.name=Ee.properties.name,U.type=Ee.properties.table_id,U.type!="13"&&U.type!="20")try{let Oe=Ee.geometry;if(Oe.type==="Point"){let Ve=Oe.coordinates;U.bbox=[Ve,Ve]}}catch{console.warn("update-waypoint-on-drag: Failed to set object coordinates.")}}else{let Ee=xl.filter(Ve=>O.getLayer(Ve)),Oe=O.queryRenderedFeatures(y.point,{layers:Ee});if(Oe.length>0){let Ve=Oe[0];U.full_id=Ve.properties.full_id,U.name=Ve.properties.name,U.type=Ve.properties.table_id}}G.updateWaypoint(I,U)}var Cy="#1D56CF",Ey="#ffffff";function hf(y){let O=document.createElement("div");O.style.cssText="position: relative; width: 0; height: 0; cursor: move;";let G=document.createElement("div");G.style.cssText=` 811 position: absolute; 812 width: ${6*2+4}px; 813 height: ${6*2+4}px; 814 background-color: ${Ey}; 815 border-radius: 50%; 816 transform: translate(-50%, -50%); 817 `,O.appendChild(G);let I=document.createElement("div");I.style.cssText=` 818 position: absolute; 819 width: 28px; 820 height: 28px; 821 background-color: ${Ey}; 822 border-radius: 6px; 823 transform: translate(-93%, -93%); 824 `,O.appendChild(I);let b=document.createElement("div");b.style.cssText=` 825 position: absolute; 826 width: ${6*2}px; 827 height: ${6*2}px; 828 background-color: ${Cy}; 829 border-radius: 50%; 830 transform: translate(-50%, -50%); 831 `,O.appendChild(b);let l=document.createElement("div");return l.style.cssText=` 832 position: absolute; 833 width: 24px; 834 height: 24px; 835 background-color: ${Cy}; 836 border-radius: 6px; 837 transform: translate(-100%, -100%); 838 display: flex; 839 align-items: center; 840 justify-content: center; 841 color: white; 842 font-size: 14px; 843 font-weight: bold; 844 font-family: 'Noto Sans', sans-serif; 845 `,l.textContent=String(y),O.appendChild(l),O}var md=Gp(nd());var Nn=null;function ky(y,O,G,I,b){if(console.log("onMapContextmenu()"),y.preventDefault(),G.routingInProgress())return;let l=Lx(y,O),U=os(y.lngLat.lat,y.lngLat.lng),_e=new md.LngLat(l.bbox[0][0],l.bbox[0][1]);Nn==null||Nn.remove();let Te=I.instant("mapContextMenu.goFrom"),Ee=I.instant("mapContextMenu.goThrough"),Oe=I.instant("mapContextMenu.goTo"),Ve=I.instant("mapContextMenu.details"),ke=I.instant("mapContextMenu.reportBug"),Ge=document.createElement("div");Ge.className="map-context-menu",Ge.innerHTML=` 846 <button class="context-menu-option" data-placement="start"> 847 <img src="assets/icon/route_planning/plan_route_from.svg" alt="" class="option-icon" /> 848 <span>${Te}</span> 849 </button> 850 <button class="context-menu-option" data-placement="through"> 851 <img src="assets/icon/route_planning/plan_route_through.svg" alt="" class="option-icon" /> 852 <span>${Ee}</span> 853 </button> 854 <button class="context-menu-option" data-placement="end"> 855 <img src="assets/icon/route_planning/plan_route_to.svg" alt="" class="option-icon" /> 856 <span>${Oe}</span> 857 </button> 858 <hr class="context-menu-divider" /> 859 <button class="context-menu-action" data-action="details"> 860 <img src="assets/icon/contextmenu/details.svg" alt="" class="option-icon" />
861 <span>${Ve}</span> 862 </button> 863 <button class="context-menu-action" data-action="report-bug"> 864 <img src="assets/icon/contextmenu/bug.svg" alt="" class="option-icon" /> 865 <span>${ke}</span> 866 </button> 867 `,Ge.querySelectorAll(".context-menu-option").forEach(ce=>{ce.addEventListener("click",()=>{let Dt=ce.dataset.placement,gt=Dt==="start"?ga.Start:Dt==="through"?ga.Through:ga.End;G.startPlanning(l,gt),Nn==null||Nn.remove()})}),Ge.querySelectorAll(".context-menu-action").forEach(ce=>{ce.addEventListener("click",()=>{let Dt=ce.dataset.action;Dt==="details"?Cx(l,b):Dt==="report-bug"&&Ex(l,U),Nn==null||Nn.remove()})}),Nn=new md.Popup({closeButton:!1,closeOnClick:!0,className:"map-context-menu-popup"}).setLngLat(_e).setDOMContent(Ge).addTo(O)}function Lx(y,O){let G=y.lngLat.lng,I=y.lngLat.lat,l={full_id:`${y.lngLat.lat},${y.lngLat.lng}`,name:os(I,G),type:"0",elevation:null,bbox:[[G,I],[G,I]],distance:null,bbox_distance:0,point:!0,location:null},U=jc.filter(Te=>O.getLayer(Te)),_e=O.queryRenderedFeatures(y.point,{layers:U});if(_e.length){console.log(_e);let Te=_e[0];if(Te&&(console.log(Te),l.full_id=Te.properties.full_id,l.name=Te.properties.name,l.type=Te.properties.table_id,l.type!="13"&&l.type!="20"))try{let Ee=Te.geometry;if(Ee.type==="Point"){let Oe=Ee.coordinates;l.bbox=[Oe,Oe]}}catch{console.warn("add-waypoint.addWaypoint(): Failed to set object coordinates.")}}return l}function Cx(y,O){O.navigate(["/map"],{queryParams:{id:y.full_id,type:y.type}})}function Ex(y,O){var b;let G="https://docs.google.com/forms/d/e/1FAIpQLScjsGvie5Tp4DQg6L2JE5qlMZVkcW5zSMeJNW-Jw-XXTcLULA/viewform",I=new URLSearchParams({"entry.2066637371":(b=y.name)!=null?b:"","entry.1300416623":O});window.open(`${G}?${I.toString()}`,"_blank")}var yd=Gp(nd());var zy={minElevation:1500,maxElevation:5e3,minSlope:25,maxSlope:60,aspects:[!0,!0,!1,!1,!1,!1,!1,!0],color:[255,0,0,160]},ao=256,uf=ao*ao,wh=wt(Me({},zy),{aspects:[...zy.aspects]});function Ay(){return wh}function df(y){wh=Me(Me({},wh),y),y.aspects&&(wh.aspects=[...y.aspects])}var Pl=null;function gd(){return Pl||(Pl=ht(this,null,function*(){let y=new OffscreenCanvas(ao,ao);return y.getContext("2d"),(yield y.convertToBlob({type:"image/png"})).arrayBuffer()})),Pl}var va=new Map,Dy=128;function kx(y,O,G){return`${y}/${O}/${G}`}function zx(y,O){va.delete(y),va.set(y,O),va.size>Dy&&va.delete(va.keys().next().value)}function bh(y,O,G,I,b){return ht(this,null,function*(){let l=(1<<y)-1;if(G<0||G>l)return null;O=(O%(l+1)+l+1)%(l+1);let U=kx(y,O,G),_e=va.get(U);if(_e)return va.delete(U),va.set(U,_e),_e;let Te=`https://tiles.sharpmap.app/terrain2/${y}/${O}/${G}.png`,Ee=I();Ee&&(Te+=`?s=${Ee}`);try{let Oe=yield fetch(Te,{signal:b});if(!Oe.ok)return null;let Ve=yield Oe.blob(),ke=yield createImageBitmap(Ve,{colorSpaceConversion:"none",premultiplyAlpha:"none"}),ce=new OffscreenCanvas(ao,ao).getContext("2d");if(!ce)return ke.close(),null;ce.drawImage(ke,0,0),ke.close();let Dt=ce.getImageData(0,0,ao,ao).data,gt=new Float32Array(uf);for(let ft=0;ft<uf;ft++){let Ot=ft*4;gt[ft]=-1e4+(Dt[Ot]*65536+Dt[Ot+1]*256+Dt[Ot+2])*.1}return zx(U,gt),gt}catch{return null}})}var Il=0,Ry=8,cs=[];function Ax(y){return y.aborted?Promise.resolve(!1):Il<Ry?(Il++,Promise.resolve(!0)):new Promise(O=>{let G={resolve:O,signal:y};cs.push(G),y.addEventListener("abort",()=>{let I=cs.indexOf(G);I>=0&&(cs.splice(I,1),O(!1))},{once:!0})})}function Dx(){for(Il>0&&Il--;cs.length>0;){let y=cs.shift();if(!y.signal.aborted){Il++,y.resolve(!0);return}y.resolve(!1)}}var Rx=` 868var TILE_SIZE = 256; 869var LAST = TILE_SIZE - 1; 870var PIXEL_COUNT = TILE_SIZE * TILE_SIZE; 871var DEG = 180 / Math.PI; 872var EARTH_CIRCUMFERENCE = 40075016.686; 873var K = [1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1]; 874var K_R = 5; 875var K_SUM = 1024; 876var PAD = K_R + 1; 877var PSIZE = TILE_SIZE + 2 * PAD; 878 879function buildPadded(main, north, south, west, east) { 880 var padded = new Float32Array(PSIZE * PSIZE); 881 for (var row = 0; row < TILE_SIZE; row++) 882 for (var col = 0; col < TILE_SIZE; col++) 883 padded[(row + PAD) * PSIZE + (col + PAD)] = main[row * TILE_SIZE + col]; 884 for (var row = 0; row < PAD; row++) 885 for (var col = 0; col < TILE_SIZE; col++) 886 padded[row * PSIZE + (col + PAD)] = north 887 ? north[(TILE_SIZE - PAD + row) * TILE_SIZE + col] 888 : main[col]; 889 for (var row = 0; row < PAD; row++) 890 for (var col = 0; col < TILE_SIZE; col++) 891 padded[(TILE_SIZE + PAD + row) * PSIZE + (col + PAD)] = south 892 ? south[row * TILE_SIZE + col] 893 : main[LAST * TILE_SIZE + col]; 894 for (var row = 0; row < TILE_SIZE; row++) 895 for (var col = 0; col < PAD; col++) 896 padded[(row + PAD) * PSIZE + col] = west 897 ? west[row * TILE_SIZE + (TILE_SIZE - PAD + col)] 898 : main[row * TILE_SIZE]; 899 for (var row = 0; row < TILE_SIZE; row++) 900 for (var col = 0; col < PAD; col++) 901 padded[(row + PAD) * PSIZE + (TILE_SIZE + PAD + col)] = east 902 ? east[row * TILE_SIZE + col]
903 : main[row * TILE_SIZE + LAST]; 904 for (var row = 0; row < PAD; row++) 905 for (var col = 0; col < PAD; col++) { 906 padded[row * PSIZE + col] = padded[row * PSIZE + PAD]; 907 padded[row * PSIZE + (TILE_SIZE + PAD + col)] = padded[row * PSIZE + (TILE_SIZE + PAD - 1)]; 908 padded[(TILE_SIZE + PAD + row) * PSIZE + col] = padded[(TILE_SIZE + PAD + row) * PSIZE + PAD]; 909 padded[(TILE_SIZE + PAD + row) * PSIZE + (TILE_SIZE + PAD + col)] = padded[(TILE_SIZE + PAD + row) * PSIZE + (TILE_SIZE + PAD - 1)]; 910 } 911 return padded; 912} 913 914self.onmessage = function(e) { 915 var d = e.data; 916 var id = d.id; 917 var mainElev = d.main; 918 var north = d.north; 919 var south = d.south; 920 var west = d.west; 921 var east = d.east; 922 var c = d.criteria; 923 var z = d.z; 924 var y = d.y; 925 926 var padded = buildPadded(mainElev, north, south, west, east); 927 928 var SSIZE = TILE_SIZE + 2; 929 var ptmp = new Float32Array(PSIZE * PSIZE); 930 for (var row = 0; row < PSIZE; row++) { 931 for (var col = PAD - 1; col <= PSIZE - PAD; col++) { 932 var sum = 0; 933 for (var dd = -K_R; dd <= K_R; dd++) 934 sum += padded[row * PSIZE + (col + dd)] * K[dd + K_R]; 935 ptmp[row * PSIZE + col] = sum / K_SUM; 936 } 937 } 938 var smooth = new Float32Array(SSIZE * SSIZE); 939 for (var row = -1; row <= TILE_SIZE; row++) { 940 for (var col = -1; col <= TILE_SIZE; col++) { 941 var sum = 0; 942 for (var dd = -K_R; dd <= K_R; dd++) 943 sum += ptmp[(row + PAD + dd) * PSIZE + (col + PAD)] * K[dd + K_R]; 944 smooth[(row + 1) * SSIZE + (col + 1)] = sum / K_SUM; 945 } 946 } 947 948 var latRad = Math.atan(Math.sinh(Math.PI * (1 - 2 * (y + 0.5) / (1 << z)))); 949 var cellSize = EARTH_CIRCUMFERENCE * Math.cos(latRad) / (TILE_SIZE * (1 << z)); 950 var inv8cell = 1 / (8 * cellSize); 951 var checkSlope = c.minSlope > 0 || c.maxSlope < 90; 952 var allAspects = c.aspects[0] && c.aspects[1] && c.aspects[2] && c.aspects[3] && 953 c.aspects[4] && c.aspects[5] && c.aspects[6] && c.aspects[7]; 954 955 var pass = new Uint8Array(PIXEL_COUNT); 956 for (var row = 0; row < TILE_SIZE; row++) { 957 for (var col = 0; col < TILE_SIZE; col++) { 958 var idx = row * TILE_SIZE + col; 959 if (mainElev[idx] < c.minElevation || mainElev[idx] > c.maxElevation) continue; 960 var si = (row + 1) * SSIZE + (col + 1); 961 var nw = smooth[si - SSIZE - 1]; 962 var n = smooth[si - SSIZE]; 963 var ne = smooth[si - SSIZE + 1]; 964 var w = smooth[si - 1]; 965 var e = smooth[si + 1]; 966 var sw = smooth[si + SSIZE - 1]; 967 var s = smooth[si + SSIZE]; 968 var se = smooth[si + SSIZE + 1]; 969 var dzdx = ((ne + 2 * e + se) - (nw + 2 * w + sw)) * inv8cell; 970 var dzdy = ((sw + 2 * s + se) - (nw + 2 * n + ne)) * inv8cell; 971 if (checkSlope) { 972 var slopeDeg = Math.atan(Math.sqrt(dzdx * dzdx + dzdy * dzdy)) * DEG; 973 if (slopeDeg < c.minSlope || slopeDeg > c.maxSlope) continue; 974 } 975 if (!allAspects) { 976 var aspect = Math.atan2(dzdy, -dzdx) * DEG; 977 aspect = 90 - aspect; 978 if (aspect > 180) aspect -= 360; 979 if (aspect < -180) aspect += 360; 980 var a = aspect; 981 if (a < 0) a += 360; 982 if (!c.aspects[Math.floor(((a + 22.5) % 360) / 45)]) continue; 983 } 984 pass[idx] = 1; 985 } 986 } 987 988 var out = new Uint8ClampedArray(PIXEL_COUNT * 4); 989 var cR = c.color[0], cG = c.color[1], cB = c.color[2], cA = c.color[3]; 990 var anyPixelSet = false; 991 for (var row = 0; row < TILE_SIZE; row++) { 992 var rn = Math.max(0, row - 1), rs = Math.min(LAST, row + 1); 993 for (var col = 0; col < TILE_SIZE; col++) { 994 var colL = Math.max(0, col - 1), colR = Math.min(LAST, col + 1); 995 var count = 996 pass[rn * TILE_SIZE + colL] + pass[rn * TILE_SIZE + col] + pass[rn * TILE_SIZE + colR] + 997 pass[row * TILE_SIZE + colL] + pass[row * TILE_SIZE + col] + pass[row * TILE_SIZE + colR] + 998 pass[rs * TILE_SIZE + colL] + pass[rs * TILE_SIZE + col] + pass[rs * TILE_SIZE + colR]; 999 if (count >= 5) { 1000 var oi = (row * TILE_SIZE + col) * 4; 1001 out[oi] = cR; out[oi + 1] = cG; out[oi + 2] = cB; out[oi + 3] = cA; 1002 anyPixelSet = true; 1003 } 1004 } 1005 } 1006 1007 if (!anyPixelSet) { 1008 self.postMessage({ id: id, empty: true }); 1009 return; 1010 } 1011 1012 // New canvas per tile \u2014 convertToBlob is async, shared canvas could be over
1012written 1013 var canvas = new OffscreenCanvas(TILE_SIZE, TILE_SIZE); 1014 var ctx = canvas.getContext("2d"); 1015 if (!ctx) { self.postMessage({ id: id, empty: true }); return; } 1016 ctx.putImageData(new ImageData(out, TILE_SIZE, TILE_SIZE), 0, 0); 1017 canvas.convertToBlob({ type: "image/png" }).then(function(blob) { 1018 return blob.arrayBuffer(); 1019 }).then(function(buf) { 1020 self.postMessage({ id: id, data: buf }, [buf]); 1021 }).catch(function() { 1022 self.postMessage({ id: id, empty: true }); 1023 }); 1024}; 1025`,Hr=null,no=null,Fx=0,ba=new Map;function Ox(){if(!Hr){let y=new Blob([Rx],{type:"application/javascript"});no=URL.createObjectURL(y),Hr=new Worker(no),Hr.onmessage=O=>{let{id:G,data:I,empty:b}=O.data,l=ba.get(G);l&&(ba.delete(G),b?gd().then(l):l(I))},Hr.onerror=()=>{console.error("[terrain-analysis] Worker crashed \u2014 resolving pending tiles as empty");let O=Pl;if(O)for(let G of ba.values())O.then(I=>G(I));ba.clear(),Hr==null||Hr.terminate(),Hr=null,no&&(URL.revokeObjectURL(no),no=null)}}return Hr}function Fy(y,O=8,G=128){Ry=O,Dy=G,gd(),yd.addProtocol("terrain-analysis",(I,b)=>ht(this,null,function*(){let l=wh,U=yield gd();if(!l.aspects[0]&&!l.aspects[1]&&!l.aspects[2]&&!l.aspects[3]&&!l.aspects[4]&&!l.aspects[5]&&!l.aspects[6]&&!l.aspects[7])return{data:U};let _e=I.url.replace("terrain-analysis://","").split("?")[0],[Te,Ee,Oe]=_e.split("/"),Ve=+Te,ke=+Ee,Ge=+Oe,ce=b.signal;if(!(yield Ax(ce)))return{data:U};try{let[gt,ft,Ot,di,wi]=yield Promise.all([bh(Ve,ke,Ge,y,ce),bh(Ve,ke,Ge-1,y,ce),bh(Ve,ke,Ge+1,y,ce),bh(Ve,ke-1,Ge,y,ce),bh(Ve,ke+1,Ge,y,ce)]);if(!gt)return{data:U};let gi=!1;for(let Li=0;Li<uf;Li++)if(gt[Li]>=l.minElevation&>[Li]<=l.maxElevation){gi=!0;break}if(!gi)return{data:U};let Xr=Fx++;return{data:yield new Promise(Li=>{ba.set(Xr,Li);let Yr=()=>{ba.delete(Xr)&&gd().then(Or=>Li(Or))};ce.addEventListener("abort",Yr,{once:!0}),Ox().postMessage({id:Xr,z:Ve,y:Ge,main:gt,north:ft,south:Ot,west:di,east:wi,criteria:{minElevation:l.minElevation,maxElevation:l.maxElevation,minSlope:l.minSlope,maxSlope:l.maxSlope,aspects:l.aspects,color:l.color}})})}}finally{Dx()}}))}function Oy(){for(yd.removeProtocol("terrain-analysis");cs.length>0;)cs.shift().resolve(!1);if(Il=0,ba.size>0){let y=Pl;if(y)for(let O of ba.values())y.then(G=>O(G))}ba.clear(),Hr&&(Hr.terminate(),Hr=null),no&&(URL.revokeObjectURL(no),no=null),va.clear(),Pl=null}var H2=(()=>{let O=class O{constructor(){var I;this.failedSources=new Set,this.bearingSubject=new Bn(0),this.bearing$=this.bearingSubject.asObservable(),this.router=li(Gg),this.geolocationService=li(by),this.errorLoggingservice=li(Yg),this.utils=li(id),this.translate=li(qg),this.ngZone=li(Vg),this.storage=li(Kg),this.tileSession=li($g),this.userMarker=null,this.horizonCheckHandler=null,this.isCenteredOnUserSubject=new Bn(!0),this.isCenteredOnUser$=this.isCenteredOnUserSubject.asObservable(),this.is3DSubject=new Bn(!1),this.is3D$=this.is3DSubject.asObservable(),this.mapLayerStateSubject=new Bn(Sl),this.mapLayersState$=this.mapLayerStateSubject.asObservable(),this.tilesUnavailable$=new Bn(!1),this.layersInitialized=!1,this.lastPosition=null,this.lastAccuracyLat=null,this.lastAccuracyMeters=null,this.lastArrowDeg=null,this.gpsHeadingStickyUntil=null,this.lastWaypointDragEndTime=0,this.routePlanningService=li(ey),this.injector=li(yl),this.routeFC=vn(()=>Sy(this.routePlanningService.selectedPath())),this.alternativeRoutesFC=vn(()=>Ty(this.routePlanningService.alternativePaths())),this.snaplinesFC=vn(()=>Py(this.routePlanningService.snaplines())),this.routingInProgress=this.routePlanningService.routingInProgress,this.waypointMarkers=[],this.currentLodLevel=(I=this.storage.get(bn.LOD_LEVEL))!=null?I:2,this.pendingLayerState=null,this.mapContainer=null,this._rotationLocked=localStorage.getItem(O.ROTATION_LOCK_KEY)==="true",this.moveStartHandler=null,this.moveEndHandler=null,this.STALE_POSITION_MS=15e3,this.UNCERTAIN_ACCURACY_M=25,this.cachedMarkerEl=null,this.draggingMain=!1,this.dragMoved=!1,this.draggedSegmentIndex=null,this.dragStartPoint=null,this.dragMarker=null,this.DRAG_THRESHOLD_PX=6,this.onMainMouseDown=b=>{var Ee,Oe,Ve,ke,Ge,ce,Dt;let l=(Ee=b.originalEvent)==null?void 0:Ee.target;if(l!=null&&l.closest(".maplibregl-marker")){(Ve=(Oe=b.originalEvent)==null?void 0:Oe.stopPropagation)==null||Ve.call(Oe),(Ge=(ke=b.originalEvent)==null?void 0:ke.preventDefault)==null||Ge.call(ke);return}b.originalEvent.stopPropagation();let U=(ce=b.features)==null?void 0:ce[0];if(!U)return;let _e=(Dt=U.properties)==null?void 0:Dt.segment_index,Te=typeof _e=="number"?_e:Number(_e);Number.isFinite(Te)&&(this.draggingMain=!0,this.dragMoved=!1,this.draggedSegmentIndex=Te,this.dragStartPoint=b.point,this.map.dragPan.disable(),this.dragMarker=new wn.Marker({element:hf("+"),draggable:!1}).setLngLat(b.lngLat).addTo(this.map))},this.onMapMouseMove=b=>{if(this.draggingMain){if(this.dragStartPoint){let l=b.point.x-this.dragStartPoint.x,U=b.point.y-this.dragStartPoint.y;!this.dragMoved&&l*l+U*U>=this.DRAG_THRESHOLD_PX*this.DRAG_THRESHOLD_PX&&(this.dragMoved=!0)}this.dragMarker&&this.dragMarker.setLngLat(b.lngLat)}},this.onMapMouseUp=b=>{if(!this.draggingMain)return;let l=this.draggedSegmentIndex,U=this.dragMoved;if(this.draggingMain=!1,this.dragMoved=!1,this.draggedSegmentIndex=null,this.dragStartPoint=null,this.map.dragPan.enable(),this.dragMarker&&(this.dragMarker.remove(),this.dragMarker=null),!U||l===null)return;let _e=l+1;this.ngZone.run(()=>vl(b,this.routePlanningService,_e))},this.geolocationService.location$.subscribe(b=>
1025this.updateUserMarker(b)),this.mapLayerStateSubject.subscribe(b=>{if(this.layersInitialized&&!this.isCleanBase(b.baseLayer)){let l=b,{contours:U}=l,_e=Ig(l,["contours"]);this.storage.set(bn.MAP_LAYERS_STATE,_e)}}),document.addEventListener("visibilitychange",()=>{if(!(document.visibilityState!=="visible"||!this.map)){this.tileSession.checkOnWake(),this.tileSession.waitForSession().then(()=>this.onSessionReady());try{this.map.resize()}catch{}this.map.style||(console.warn("Map style was null after tab resume \u2014 recreating map"),this.recreateMap())}}),jn(()=>{var l;let b=this.routeFC();this.map&&((l=this.map.getSource("selected-route"))==null||l.setData(b))},{injector:this.injector}),jn(()=>{var l;let b=this.alternativeRoutesFC();this.map&&((l=this.map.getSource("alternative-route"))==null||l.setData(b))},{injector:this.injector}),jn(()=>{var l;let b=this.snaplinesFC();this.map&&((l=this.map.getSource("snaplines"))==null||l.setData(b))},{injector:this.injector}),jn(()=>{let b=this.routePlanningService.waypoints();this.map&&this.syncWaypointMarkers(b)},{injector:this.injector}),jn(()=>{let b=this.routingInProgress();this.map&&(this.map.getCanvas().style.cursor=b?"crosshair":"")},{injector:this.injector})}initMap(I){if(this.map){this.mapContainer!==I?(this.mapContainer=I,this.recreateMap()):this.map.resize();return}this.mapContainer=I,this.ngZone.runOutsideAngular(()=>{let b=iy(I);b=wt(Me({},b),{style:ry()});let U=this.router.parseUrl(this.router.url).queryParams;if(U.bboxA&&U.bboxB&&U.bboxC&&U.bboxD){let ke=[[Number(U.bboxA),Number(U.bboxB)],[Number(U.bboxC),Number(U.bboxD)]];if(U.point==="true")b=wt(Me({},b),{center:ke[0],zoom:14});else{let ce=[(ke[0][0]+ke[1][0])/2,(ke[0][1]+ke[1][1])/2];b=wt(Me({},b),{center:ce})}}else{let ke=this.storage.get(bn.MAP_POSITION);ke&&(b=wt(Me({},b),{center:ke.center,zoom:ke.zoom}))}let _e=this.storage.get(bn.TERRAIN_ANALYSIS_CRITERIA);_e&&df(_e),Fy(()=>this.tileSession.getSessionToken(),this.utils.isMobileApp()?4:8,this.utils.isMobileApp()?32:128),this.map=new wn.Map(Me(wt(Me({},b),{transformRequest:ke=>{if((ke.includes("sharpmap.eu")||ke.includes("sharpmap.app"))&&!ke.includes("localhost")){let Ge=this.tileSession.getSessionToken();return{url:Ge?`${ke}${ke.includes("?")?"&":"?"}s=${Ge}`:ke}}return{url:ke}}}),window.innerWidth<768?{maxTileCacheSize:50,maxTileCacheZoomLevels:3}:{}));let Te=null;this.map.on("error",ke=>{var Ge,ce;if((Ge=ke.source)!=null&&Ge.id&&this.failedSources.add(ke.source.id),((ce=ke.error)==null?void 0:ce.status)===401){this.tilesUnavailable$.next(!0),this.tileSession.invalidateAndRefresh().then(()=>{this.tilesUnavailable$.next(!1),this.onSessionReady()});return}Te||(Te=setTimeout(()=>{Te=null,this.onSessionReady()},2e3))});let Ee=this.map.getLayer.bind(this.map);this.map.getLayer=ke=>this.map.style?Ee(ke):void 0,this.map.setPixelRatio(window.devicePixelRatio),this.map.addControl(new wn.ScaleControl({maxWidth:200,unit:"metric"}),"bottom-left"),window.innerWidth>=768?this.map.addControl(new wn.AttributionControl({compact:!0}),"bottom-left"):this.map.addControl(new wn.AttributionControl({compact:!0}),"bottom-right"),this.map.on("style.load",()=>{console.log("Map style has loaded, now adding initial layers."),this.map.getLayer("background")||this.map.addLayer({id:"background",type:"background",paint:{"background-color":"#C7C7C7"}});let ke=this.storage.get(bn.MAP_LAYERS_STATE),Ge=(ke==null?void 0:ke.baseLayer)||"simple-tiles";this.addLayer(Ge),this.addLayer("search-result-outline"),this.addLayer("search-result-lines"),this.addLayer("search-result-points"),this.map.setTerrain(null),this.map.setPitch(0),this.map.setMaxPitch(0),this.map.setPixelRatio(window.devicePixelRatio),my(this.map,this.translate.currentLang,this.routePlanningService),this.loadIconFreeLayers(),xy(this.map).then(ce=>this.loadIconDependentLayers()).catch(ce=>{console.error("preloadLayersData failed:",ce),this.loadIconDependentLayers()}),this.map.addSource("selected-route",{type:"geojson",data:this.routeFC()}),this.map.addSource("alternative-route",{type:"geojson",data:this.alternativeRoutesFC()}),this.map.addSource("snaplines",{type:"geojson",data:this.snaplinesFC()}),this.addLayer("selected-route-outline"),this.addLayer("selected-route-line"),this.addLayer("selected-route-hit"),this.addLayer("alternative-route-outline"),this.addLayer("alternative-route-line"),this.addLayer("alternative-route-hit"),this.addLayer("snaplines"),this.map.on("mousedown","selected-route-hit",this.onMainMouseDown),this.map.on("mousemove",this.onMapMouseMove),this.map.on("mouseup",this.onMapMouseUp),this.map.on("mouseenter","selected-route-hit",()=>{this.map.getCanvas().style.cursor="move"}),this.map.on("mouseleave","selected-route-hit",()=>{this.map.getCanvas().style.cursor="crosshair"}),this.map.on("click","alternative-route-hit",ce=>{this.ngZone.run(()=>My(ce,this.routePlanningService))}),this.map.on("mouseenter","alternative-route-hit",()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave","alternative-route-hit",()=>{this.map.getCanvas().style.cursor="crosshair"}),this.applyRotationLock()}),this.map.on("rotate",()=>{let ke=this.map.getBearing();this.ngZone.run(()=>this.bearingSubject.next(ke))}),this.map.on("dragend",()=>{this.geolocationService.isTracking()&&this.ngZone.run(()=>this.isCenteredOnUserSubject.next(!1))});let Oe=null;this.map.on("moveend",()=>{Oe&&clearTimeout(Oe),Oe=setTimeout(()=>{let ke=this.map.getCenter();this.storage.set(bn.MAP_POSITION,{center:[ke.lng,ke.lat],zoom:this.map.getZoom()})},1e3)}),this.map.on("zoom",()=>{this.updateAccuracyRingForCurrentZoom()}),this.map.on("click",ke=>{this.ngZone.run(()=>Iy(ke,this.map,this.routePlanningService,this.lastWaypointDragEndTime))}),this.addContextMenu(),this.map.on("error",ke=>this.errorLoggingservice.logError(ke));let Ve=this.map.getCanvas();Ve.addEventListener("webglcontextlost",ke=>{console.warn("WebGL context lost \u2014 preventing default to allow recovery"),ke.preventDefault(),setTimeout(()=>{this.map&&(this.map.style||(console.warn("WebGL context not restored after 2s \u2014 recreating map"),this.recreateMap())
1025)},2e3)}),Ve.addEventListener("webglcontextrestored",()=>{console.warn("WebGL context restored"),setTimeout(()=>{this.map&&(this.map.style?this.map.triggerRepaint():this.recreateMap())},0)})})}onSessionReady(){if(!this.map||this.failedSources.size===0||!this.map.style)return;let I=this.map.getStyle();for(let b of this.failedSources){let l=I.sources[b],U=this.map.getSource(b);!U||!l||("setTiles"in U&&l.tiles?U.setTiles(l.tiles):"setUrl"in U&&l.url&&U.setUrl(l.url))}this.failedSources.clear()}recreateMap(){var I;if(this.mapContainer){this.userMarker=null,this.cachedMarkerEl=null,this.lastArrowDeg=null,this.lastPosition=null,this.gpsHeadingStickyUntil=null,this.lastAccuracyLat=null,this.lastAccuracyMeters=null,this.waypointMarkers=[],this.moveStartHandler=null,this.moveEndHandler=null,Oy();try{(I=this.map)==null||I.remove()}catch{}this.map=void 0,this.is3DSubject.next(!1),setTimeout(()=>this.mapContainer&&this.initMap(this.mapContainer),500)}}get isMapInitialized(){var I;return!!((I=this.map)!=null&&I.style)}getMap(){return this.map}updateLanguageLabels(I){this.isMapInitialized&&wy(this.map,I)}getMapCenter(){return this.isMapInitialized?this.map.getCenter():null}addLayer(I){if(!this.map)return;let b=ny(I);b&&(this.map.getLayer(I)||this.map.addLayer(b))}removeLayer(I){this.map&&this.map.getLayer(I)&&this.map.removeLayer(I)}updateSearchResultSource(I){if(!this.isMapInitialized)return;let b=this.map.getSource("search-result");b&&b.setData(I)}clearSearchResultSource(){this.updateSearchResultSource({type:"FeatureCollection",features:[]})}zoomIn(){this.isMapInitialized&&this.map.zoomIn()}zoomOut(){this.isMapInitialized&&this.map.zoomOut()}get rotationLocked(){return this._rotationLocked}get is3D(){return this.is3DSubject.value}getBearing(){return this.bearingSubject.value}rotateNorth(){this.isMapInitialized&&this.map.rotateTo(0,{duration:500})}lockRotation(){this._rotationLocked=!0,localStorage.setItem(O.ROTATION_LOCK_KEY,"true"),this.isMapInitialized&&this.disableRotationControls()}unlockRotation(){this._rotationLocked=!1,localStorage.setItem(O.ROTATION_LOCK_KEY,"false"),this.isMapInitialized&&this.enableRotationControls()}disableRotationControls(){this.map.dragRotate.disable(),this.map.touchZoomRotate.disableRotation(),this.map.keyboard.disableRotation()}enableRotationControls(){this.map.dragRotate.enable(),this.map.touchZoomRotate.enableRotation(),this.map.keyboard.enableRotation()}applyRotationLock(I=0){this._rotationLocked&&(this.map.rotateTo(0,{duration:I}),this.disableRotationControls())}toggle3D(){if(!this.isMapInitialized)return;let I=this.is3DSubject.value;I?(this.map.setTerrain(null),this.map.setPitch(0),this.map.setMaxPitch(0),this.map.setPixelRatio(window.devicePixelRatio),this.map.style.fadeDuration=200,this.remove3DSymbolHiding(),this.toggleContours(!0)):(this.toggleContours(!1),this.enableRotationControls(),this.map.getTerrain()||(this.map.setTerrain({source:"terrain-rgb",exaggeration:1}),this.map.setMaxPitch(80),this.map.getZoom()>15&&this.map.setZoom(15),this.map.setPitch(45),this.map.style.fadeDuration=0,this.setLodLevel(this.currentLodLevel),this.setup3DSymbolHiding())),this.is3DSubject.next(!I),I&&this.applyRotationLock(500)}setup3DSymbolHiding(){this.moveStartHandler=()=>{this.map.style&&this.map.getStyle().layers.forEach(I=>{I.type==="symbol"&&I.id!=="search-result-points"&&this.map.setLayoutProperty(I.id,"visibility","none")})},this.moveEndHandler=()=>{this.map.style&&this.map.getStyle().layers.forEach(I=>{I.type==="symbol"&&this.map.setLayoutProperty(I.id,"visibility","visible")})},this.map.on("movestart",this.moveStartHandler),this.map.on("moveend",this.moveEndHandler)}remove3DSymbolHiding(){this.moveStartHandler&&(this.map.off("movestart",this.moveStartHandler),this.moveStartHandler=null),this.moveEndHandler&&(this.map.off("moveend",this.moveEndHandler),this.moveEndHandler=null)}toggleTracking(){return ht(this,null,function*(){this.geolocationService.isTracking()&&this.isCenteredOnUserSubject.getValue()?(yield this.geolocationService.stopTrackingUser(),this.isCenteredOnUserSubject.next(!0)):this.geolocationService.isTracking()&&!this.isCenteredOnUserSubject.getValue()?this.recenterMapOnUser():(this.isCenteredOnUserSubject.next(!0),yield this.geolocationService.startTrackingUser())})}metersPerPixelAtLat(I,b){return Math.cos(I*Math.PI/180)*40075016686e-3/(512*Math.pow(2,b))}
1025getOrCreateUserMarkerElement(){if(!this.cachedMarkerEl){let I=document.createElement("div");I.className="user-marker-wrapper";let b=document.createElement("div");b.className="accuracy-ring";let l=document.createElement("div");l.className="compass-arrow";let U=document.createElement("div");U.className="gps-arrow";let _e=document.createElementNS("http://www.w3.org/2000/svg","svg");_e.setAttribute("viewBox","0 0 24 24"),_e.setAttribute("class","gps-arrow-shape");let Te=document.createElementNS("http://www.w3.org/2000/svg","path");Te.setAttribute("d","M12 2 L19 22 L12 18 L5 22 Z"),_e.appendChild(Te),U.appendChild(_e);let Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("width","16"),Ee.setAttribute("height","16"),Ee.setAttribute("viewBox","0 0 16 16"),Ee.setAttribute("class","custom-user-location-marker");let Oe=document.createElementNS("http://www.w3.org/2000/svg","circle");Oe.setAttribute("cx","8"),Oe.setAttribute("cy","8"),Oe.setAttribute("r","7"),Oe.setAttribute("fill","#007aff"),Oe.setAttribute("stroke","#ffffff"),Oe.setAttribute("stroke-width","2"),Ee.appendChild(Oe),I.appendChild(b),I.appendChild(l),I.appendChild(U),I.appendChild(Ee),this.cachedMarkerEl={wrapper:I,ring:b,compass:l,gps:U,dot:Ee}}return this.cachedMarkerEl}updateUserMarker(I){var l;if(!this.isMapInitialized)return;let b=!!I&&typeof I.timestamp=="number"&&Date.now()-I.timestamp>this.STALE_POSITION_MS;if(I){let U=this.getOrCreateUserMarkerElement();this.userMarker?this.userMarker.setLngLat([I.longitude,I.latitude]):this.userMarker=new wn.Marker({element:U.wrapper,opacityWhenCovered:"1"}).setLngLat([I.longitude,I.latitude]).addTo(this.map),this.horizonCheckHandler||(this.horizonCheckHandler=()=>{if(!this.userMarker||!this.cachedMarkerEl)return;let ft=this.cachedMarkerEl.wrapper;if(this.map.getTerrain()){let Ot=this.map.project(this.userMarker.getLngLat()),di=this.map.transform,wi=(90-this.map.getPitch())*Math.PI/180,gi=di.cameraToCenterDistance*Math.tan(wi)*.85;ft.style.display=Ot.y>di.height/2-gi?"":"none"}else ft.style.display=""},this.map.on("move",this.horizonCheckHandler));let _e=U.ring,Te=U.compass,Ee=U.gps,Oe=U.dot,Ve=!!I.heading&&Number.isFinite(I.heading),ke=Ve&&I.headingSource==="gps",Ge=Ve&&I.headingSource==="compass",ce=typeof I.timestamp=="number"?I.timestamp:Date.now();ke&&(this.gpsHeadingStickyUntil=ce+2e3);let Dt=!b&&(ke||this.gpsHeadingStickyUntil!==null&&Date.now()<this.gpsHeadingStickyUntil);if(_e)if(typeof I.accuracy=="number"&&Number.isFinite(I.accuracy)&&I.accuracy>0&&!Dt){let Ot=this.metersPerPixelAtLat(I.latitude,this.map.getZoom()),wi=I.accuracy/Ot*2;_e.style.width=`${wi}px`,_e.style.height=`${wi}px`,_e.style.opacity="1",this.lastAccuracyLat=I.latitude,this.lastAccuracyMeters=I.accuracy}else _e.style.opacity="0",this.lastAccuracyLat=null,this.lastAccuracyMeters=null;if(Oe&&(Oe.style.opacity=Dt?"0":"1",b?Oe.classList.add("user-location-stale"):Oe.classList.remove("user-location-stale")),Ve){let ft=((I.heading-this.map.getBearing())%360+360)%360,Ot=(l=this.lastArrowDeg)!=null?l:ft,di=(ft-Ot+540)%360-180,wi=Ot+di;this.lastArrowDeg=wi%360,Ee&&(Dt?(Ee.style.transform=`translate(-50%, -50%) rotate(${wi}deg)`,Ee.style.opacity="1"):Ee.style.opacity="0"),Te&&(Te.style.opacity="0")}else Ee&&(Ee.style.opacity="0"),Te&&(Te.style.opacity="0"),this.lastArrowDeg=null;(!this.lastPosition||Math.abs(this.lastPosition.lat-I.latitude)>1e-6||Math.abs(this.lastPosition.lng-I.longitude)>1e-6)&&(this.lastPosition={lat:I.latitude,lng:I.longitude},this.isCenteredOnUserSubject.getValue()&&this.recenterMapOnUser())}else this.userMarker&&(this.userMarker.remove(),this.userMarker=null,this.horizonCheckHandler&&(this.map.off("move",this.horizonCheckHandler),this.horizonCheckHandler=null),this.cachedMarkerEl=null,this.lastArrowDeg=null,this.lastPosition=null,this.gpsHeadingStickyUntil=null)}updateAccuracyRingForCurrentZoom(){if(!this.userMarker||!this.cachedMarkerEl||this.lastAccuracyLat===null||this.lastAccuracyMeters===null)return;let I=this.cachedMarkerEl.ring;if(!I)return;let b=this.metersPerPixelAtLat(this.lastAccuracyLat,this.map.getZoom()),U=this.lastAccuracyMeters/b*2;I.style.width=`${U}px`,I.style.height=`${U}px`}recenterMapOnUser(){if(this.userMarker){let I=this.userMarker.getLngLat(),b=this.map.getZoom(),l={center:I,essential:!0};b<12&&(l.zoom=14),this.map.flyTo(l),this.isCenteredOnUserSubject.next(!0)}}get layerState(){return this.mapLayerStateSubject.value}isCleanBase(I){return I==="tatramap-tiles"||I==="valleys-tiles"}toggleBaseLayer(I){if(this.layerState.baseLayer===I)return;let b=this.isCleanBase(this.layerState.baseLayer),l=this.isCleanBase(I);if(this.removeLayer(this.layerState.baseLayer),this.addLayer(I),l&&!b)this.unLoadAllSilent(),Jt(this.map),this.mapLayerStateSubject.next(wt(Me(Me({},this.layerState),Tl.none),{baseLayer:I,contours:!1,landcover:!1,avalanche:!1,terrainAnalysis:!1,outlines:!1}));else if(!l&&b){let U=this.storage.get(bn.MAP_LAYERS_STATE),_e=U?Me(Me({},Sl),U):Me(Me({},Sl),Tl.summer),{landcoverState:Te}=pd(I,this.map,this.router,{landcover:!1},this.routePlanningService);this.restoreLayers(_e),Jt(this.map),this.mapLayerStateSubject.next(wt(Me({},_e),{baseLayer:I,contours:!0,landcover:Te}))}else{let{landcoverState:U}=pd(I,this.map,this.router,this.layerState,this.routePlanningService);Jt(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{baseLayer:I,landcover:U}))}}unLoadAllSilent(){this.layerState.attractions&&th(this.map),this.layerState.paragliding&&dh(this.map),this.layerState.climbing&&fh(this.map),this.layerState.skitours&&_h(this.map),this.layerState.winterHiking&&vh(this.map),this.layerState.regi
1025ons&&Nc(this.map),this.layerState.contours&&sd(this.map),this.layerState.ridges&&(Gc(this.map),$c(this.map),gh(this.map)),this.layerState.antropo&&Qc(this.map),this.layerState.waters&&rh(this.map),this.layerState.hiking&&Xc(this.map),this.layerState.cycling&&Kc(this.map),this.layerState.landcover&&ls(this.map),this.layerState.ski&&oh(this.map),this.layerState.highways&&lh(this.map),this.layerState.paths&&hh(this.map),this.layerState.avalanche&&this.removeLayer("avalanche-tiles"),this.layerState.terrainAnalysis&&this.removeLayer("terrain-analysis-tiles")}restoreLayers(I){var l;let b=this.translate.currentLang;if(od(this.map),I.landcover&&ro(this.map,this.router,this.routePlanningService),I.waters&&ih(this.map,this.router,this.routePlanningService,b),I.hiking&&Hc(this.map,this.router,this.routePlanningService),I.cycling&&Yc(this.map,this.router,this.routePlanningService),I.skitours&&yh(this.map,this.router,this.routePlanningService),I.winterHiking&&xh(this.map),I.regions&&Vc(this.map,this.router,this.routePlanningService,b),I.ridges&&(Uc(this.map,this.router,this.routePlanningService,b),qc(this.map,this.router,this.routePlanningService,b),mh(this.map,this.router,this.routePlanningService,b)),I.antropo&&Jc(this.map,this.router,this.routePlanningService,b),I.highways&&sh(this.map,this.router,this.routePlanningService,b),I.paths&&ch(this.map,this.router,this.routePlanningService),I.attractions&&eh(this.map,this.router,this.routePlanningService,b),I.paragliding&&uh(this.map,this.router,this.routePlanningService),I.climbing&&ph(this.map,this.router,this.routePlanningService),I.ski&&ah(this.map,this.router,this.routePlanningService,b),I.avalanche){this.addLayer("avalanche-tiles");let U=((l=I.avalancheOpacity)!=null?l:50)/100;this.map.setPaintProperty("avalanche-tiles","raster-opacity",U)}I.terrainAnalysis&&(this.addLayer("terrain-analysis-tiles"),this.map.setPaintProperty("terrain-analysis-tiles","raster-opacity",.8))}loadIconFreeLayers(){let I=this.storage.get(bn.MAP_LAYERS_STATE),b=I?Me(Me({},Sl),I):Me(Me({},Sl),Tl.summer);b.contours=!0,od(this.map),b.landcover&&ro(this.map,this.router,this.routePlanningService),b.waters&&ih(this.map,this.router,this.routePlanningService,this.translate.currentLang),b.hiking&&Hc(this.map,this.router,this.routePlanningService),b.cycling&&Yc(this.map,this.router,this.routePlanningService),b.skitours&&yh(this.map,this.router,this.routePlanningService),b.winterHiking&&xh(this.map),b.regions&&Vc(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map),this.pendingLayerState=b}loadIconDependentLayers(){var b;let I=this.pendingLayerState;if(I){if(this.pendingLayerState=null,I.ridges&&(Uc(this.map,this.router,this.routePlanningService,this.translate.currentLang),qc(this.map,this.router,this.routePlanningService,this.translate.currentLang),mh(this.map,this.router,this.routePlanningService,this.translate.currentLang)),I.antropo&&Jc(this.map,this.router,this.routePlanningService,this.translate.currentLang),I.highways&&sh(this.map,this.router,this.routePlanningService,this.translate.currentLang),I.paths&&ch(this.map,this.router,this.routePlanningService),I.attractions&&eh(this.map,this.router,this.routePlanningService,this.translate.currentLang),I.paragliding&&uh(this.map,this.router,this.routePlanningService),I.climbing&&ph(this.map,this.router,this.routePlanningService),I.ski&&ah(this.map,this.router,this.routePlanningService,this.translate.currentLang),I.avalanche){this.addLayer("avalanche-tiles");let l=((b=I.avalancheOpacity)!=null?b:50)/100;this.map.setPaintProperty("avalanche-tiles","raster-opacity",l)}I.terrainAnalysis&&(this.addLayer("terrain-analysis-tiles"),this.map.setPaintProperty("terrain-analysis-tiles","raster-opacity",.8)),pd(I.baseLayer,this.map,this.router,I,this.routePlanningService),Jt(this.map),this.layersInitialized=!0,this.mapLayerStateSubject.next(I)}}applyPreset(I){if(!this.isMapInitialized)return;let b=Tl[I],l=this.layerState,U=this.translate.currentLang;b.regions&&!l.regions&&Vc(this.map,this.router,this.routePlanningService,U),!b.regions&&l.regions&&Nc(this.map),b.ridges&&!l.ridges&&(Uc(this.map,this.router,this.routePlanningService,U),q
1025c(this.map,this.router,this.routePlanningService,U),mh(this.map,this.router,this.routePlanningService,U)),!b.ridges&&l.ridges&&(Gc(this.map),$c(this.map),gh(this.map)),b.antropo&&!l.antropo&&Jc(this.map,this.router,this.routePlanningService,U),!b.antropo&&l.antropo&&Qc(this.map),b.waters&&!l.waters&&ih(this.map,this.router,this.routePlanningService,U),!b.waters&&l.waters&&rh(this.map),b.hiking&&!l.hiking&&Hc(this.map,this.router,this.routePlanningService),!b.hiking&&l.hiking&&Xc(this.map),b.cycling&&!l.cycling&&Yc(this.map,this.router,this.routePlanningService),!b.cycling&&l.cycling&&Kc(this.map),b.ski&&!l.ski&&ah(this.map,this.router,this.routePlanningService,U),!b.ski&&l.ski&&oh(this.map),b.climbing&&!l.climbing&&ph(this.map,this.router,this.routePlanningService),!b.climbing&&l.climbing&&fh(this.map),b.skitours&&!l.skitours&&yh(this.map,this.router,this.routePlanningService),!b.skitours&&l.skitours&&_h(this.map),b.winterHiking&&!l.winterHiking&&xh(this.map),!b.winterHiking&&l.winterHiking&&vh(this.map),b.highways&&!l.highways&&sh(this.map,this.router,this.routePlanningService,U),!b.highways&&l.highways&&lh(this.map),b.paths&&!l.paths&&ch(this.map,this.router,this.routePlanningService),!b.paths&&l.paths&&hh(this.map),b.attractions&&!l.attractions&&eh(this.map,this.router,this.routePlanningService,U),!b.attractions&&l.attractions&&th(this.map),b.paragliding&&!l.paragliding&&uh(this.map,this.router,this.routePlanningService),!b.paragliding&&l.paragliding&&dh(this.map),Jt(this.map),this.mapLayerStateSubject.next(Me(Me({},l),b))}toggleAvalanche(){var b;if(!this.isMapInitialized)return;let I=!this.layerState.avalanche;if(I){this.addLayer("avalanche-tiles");let l=((b=this.layerState.avalancheOpacity)!=null?b:50)/100;this.map.setPaintProperty("avalanche-tiles","raster-opacity",l),Jt(this.map)}else this.removeLayer("avalanche-tiles");this.mapLayerStateSubject.next(wt(Me({},this.layerState),{avalanche:I,season:null}))}setAvalancheOpacity(I){if(!Number.isFinite(I))return;let b=Math.max(0,Math.min(100,Math.round(I))),l=b/100;this.isMapInitialized&&this.map.getLayer("avalanche-tiles")&&this.map.setPaintProperty("avalanche-tiles","raster-opacity",l),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{avalancheOpacity:b}))}toggleTerrainAnalysis(){if(!this.isMapInitialized)return;let I=!this.layerState.terrainAnalysis;I?(this.addLayer("terrain-analysis-tiles"),this.map.setPaintProperty("terrain-analysis-tiles","raster-opacity",.8),Jt(this.map)):this.removeLayer("terrain-analysis-tiles"),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{terrainAnalysis:I,season:null}))}updateTerrainAnalysisCriteria(I){df(I),this.storage.set(bn.TERRAIN_ANALYSIS_CRITERIA,Ay()),this.reloadTerrainAnalysisTiles()}reloadTerrainAnalysisTiles(){this.isMapInitialized&&this.map.style._reloadSource("terrain-analysis-source")}setLodLevel(I){var Ve;if(this.currentLodLevel=I,!this.isMapInitialized)return;let b={1:[12,1,16,1,Math.min(window.devicePixelRatio,1.25)],2:[8,2.5,12,3,Math.min(window.devicePixelRatio,1.75)],3:[7,3.5,9,4,Math.min(window.devicePixelRatio,2.5)]},[l,U,_e,Te,Ee]=(Ve=b[I])!=null?Ve:b[2];this.map.setSourceTileLodParams(l,U),this.map.setSourceTileLodParams(_e,Te,"vector"),this.map.setSourceTileLodParams(12,1,"avalanche-source");let Oe=I>=3?2.5:I>=2?1.5:1;this.map.setSourceTileLodParams(12,Oe,"terrain-analysis-source"),this.applyTerrainDeltaZoom(I>=3?0:1),this.map.setPixelRatio(Ee),this.storage.set(bn.LOD_LEVEL,I)}getLodLevel(){return this.currentLodLevel}applyTerrainDeltaZoom(I){try{let b=this.map.terrain;b!=null&&b.tileManager&&(b.tileManager.deltaZoom=I)}catch{}}toggleRegions(){if(!this.isMapInitialized)return;let I=!this.layerState.regions;I?(Vc(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):Nc(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{regions:I,season:null}))}toggleContours(I){if(!this.isMapInitialized)return;let b=I===void 0?!this.layerState.contours:I;b?(od(this.map),Jt(this.map)):sd(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{contours:b}))}toggleRidges(){if(!this.isMapInitialized)return;let I=!this.layerState.ridges;I?(Uc(this.map,this.router,this.routePlanningService,this.translate.currentLang),qc(this.map,this.router,this.routePlanningService,this.translate.currentLang),mh(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):(Gc(this.map),$c(this.map),gh(this.map)),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{ridges:I,season:null}))}toggleAntropo(){if(!this.isMapInitialized)return;let I=!this.layerState.antropo;I?(Jc(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):Qc(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{antropo:I,season:null}))}toggleWaters(){if(!this.isMapInitialized)return;let I=!this.layerState.waters;I?(ih(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):rh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{waters:I,season:null}))}toggleHiking(){if(!this.isMapInitialized)return;let I=!this.layerState.hiking;I?(Hc(this.map,this.router,this.routePlanningService),Jt(this.map)):Xc(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{hiking:I,season:null}))}toggleCycling(){if(!this.isMapInitialized)return;let I=!this.layerState.cycling;I?(Yc(this.map,this.router,this.routePlanningService),Jt(this.map)):Kc(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{cycling:I,season:null}))}toggleLandcover(){if(!this.isMapInitialized)return;let I=!this.layerState.landcover;I?(ro(this.map,this.router,this.routePlanningService),Jt(this.map)):ls(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{landcover:I}))}toggleSki(){if(!this.isMapInitialized)return;let I=!this.layerState.ski;I?(ah(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):oh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{ski:I,season:null}))}toggleClimbing(){if(!this.isMapInitialized)return;let I=!this.layerState.climbing;I?(ph(this.map,this.router,this.routePlanningService),Jt(this.map)):fh(this.map),this.mapLayerStateSubject.next(wt(Me({}
1025,this.layerState),{climbing:I,season:null}))}toggleSkitours(){if(!this.isMapInitialized)return;let I=!this.layerState.skitours;I?(yh(this.map,this.router,this.routePlanningService),Jt(this.map)):_h(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{skitours:I,season:null}))}toggleWinterHiking(){if(!this.isMapInitialized)return;let I=!this.layerState.winterHiking;I?(xh(this.map),Jt(this.map)):vh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{winterHiking:I,season:null}))}toggleHighways(){if(!this.isMapInitialized)return;let I=!this.layerState.highways;I?(sh(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):lh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{highways:I,season:null}))}togglePaths(){if(!this.isMapInitialized)return;let I=!this.layerState.paths;I?(ch(this.map,this.router,this.routePlanningService),Jt(this.map)):hh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{paths:I,season:null}))}toggleAttractions(){if(!this.isMapInitialized)return;let I=!this.layerState.attractions;I?(eh(this.map,this.router,this.routePlanningService,this.translate.currentLang),Jt(this.map)):th(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{attractions:I,season:null}))}toggleParagliding(){if(!this.isMapInitialized)return;let I=!this.layerState.paragliding;I?(uh(this.map,this.router,this.routePlanningService),Jt(this.map)):dh(this.map),this.mapLayerStateSubject.next(wt(Me({},this.layerState),{paragliding:I,season:null}))}mapOnPosition(I,b,l){let U=()=>{this.map.once("idle",()=>{this.map.resize(),b?this.map.flyTo({center:I[0],zoom:14,speed:1.8}):this.map.fitBounds(I,{padding:l!=null?l:50,maxZoom:15})})};if(this.isMapInitialized)U();else{let _e=0,Te=setInterval(()=>{this.isMapInitialized?(clearInterval(Te),U()):++_e>=100&&clearInterval(Te)},100)}}unLoadAll(){this.layerState.attractions&&th(this.map),this.layerState.paragliding&&dh(this.map),this.layerState.climbing&&fh(this.map),this.layerState.skitours&&_h(this.map),this.layerState.winterHiking&&vh(this.map),this.layerState.regions&&Nc(this.map),this.layerState.contours&&sd(this.map),this.layerState.ridges&&(Gc(this.map),$c(this.map),gh(this.map)),this.layerState.antropo&&Qc(this.map),this.layerState.waters&&rh(this.map),this.layerState.hiking&&Xc(this.map),this.layerState.cycling&&Kc(this.map),this.layerState.landcover&&ls(this.map),this.layerState.ski&&oh(this.map),this.layerState.highways&&lh(this.map),this.layerState.paths&&hh(this.map),this.mapLayerStateSubject.next(Me(Me({},this.layerState),Tl.none))}syncWaypointMarkers(I){this.waypointMarkers.forEach(b=>b.remove()),this.waypointMarkers=[],I.forEach((b,l)=>{if(!b)return;let[[U,_e],[Te,Ee]]=b.bbox,Oe=(U+Te)/2,Ve=(_e+Ee)/2,ke=new wn.Marker({element:hf(l+1),draggable:!0}).setLngLat([Oe,Ve]).addTo(this.map);ke.on("dragend",()=>{this.lastWaypointDragEndTime=Date.now();let Ge=ke.getLngLat();this.ngZone.run(()=>this.onWaypointDragEnd(l,Ge))}),ke.getElement().addEventListener("click",Ge=>{Ge.stopPropagation(),this.ngZone.run(()=>this.routePlanningService.removeWaypoint(l))}),this.waypointMarkers.push(ke)})}onWaypointDragEnd(I,b){let l=this.map.project(b);Ly({lngLat:b,point:l},this.map,this.routePlanningService,I)}addContextMenu(){let I=0,b=500,l=U=>{let _e=Date.now();_e-I<b||(I=_e,this.ngZone.run(()=>ky(U,this.map,this.routePlanningService,this.translate,this.router)))};if(this.map.on("contextmenu",l),this.utils.isTouchable()){let U=null,_e=null,Te=()=>{U&&(clearTimeout(U),U=null),_e=null};this.map.on("touchstart",Ee=>{if(Ee.originalEvent.touches.length!==1){Te();return}_e=Ee,U=setTimeout(()=>{U=null,_e&&(_e.originalEvent.preventDefault(),l(_e))},500)}),this.map.on("touchmove",()=>Te()),this.map.on("touchend",()=>Te())}}};O.ROTATION_LOCK_KEY="rotationLocked",O.\u0275fac=function(b){return new(b||O)},O.\u0275prov=io({token:O,factory:O.\u0275fac,providedIn:"root"});let y=O;return y})();export{$p as a,rd as b,cx as c,os as d,by as e,ga as f,_l as g,ey as h,zy as i,Ay as j,H2 as k};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.