osmgl 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/osmgl.js CHANGED
@@ -1,11 +1,11 @@
1
- import Un from'earcut';import bl from'pbf';var H=Map,Q=Set;var Ve=class{constructor(){this.listeners=new H;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new Q),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var Ye=i=>i*Math.PI/180,bn=i=>i*180/Math.PI;function et(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var oo=i=>1-Math.pow(1-i,3);function le(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var ro=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new H;this._stencilTest=false;this.gl=e,this.caps=el(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){this._framebuffer!==e&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this._framebuffer=e);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function el(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var Ke=512,no=40075016686e-3,yn=85.051129;function q(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Be=i=>512*Math.pow(2,i),io=i=>Math.max(-yn,Math.min(yn,i));function ee(i){return (180+i)/360}function te(i){let e=io(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return no*Math.cos(i*Math.PI/180)}function Go(i,e){return i/Le(e)}function tu(i,e){return i*Le(e)}function ou(i,e){return Go(1,i)*Be(e)}function ru(i,e){return Le(i)/Be(e)}function gn(i,e){let t=Math.pow(2,i);return Le(Ce((e+.5)/t))/t}function No(i){return no/Math.pow(2,i)}function vn(i,e,t){let o=No(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var _t=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=q(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=q(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:ee(this.west),maxX:ee(this.east),minY:te(this.north),maxY:te(this.south)}}};function Uo(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,wn),r=Math.max(e.height-t.top-t.bottom,wn),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,h=(n.minY+n.maxY)/2,u=0,d=0;for(let[v,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let S=(v-f)*s-(w-h)*c,_=(v-f)*c+(w-h)*s;u=Math.max(u,Math.abs(S)*2),d=Math.max(d,Math.abs(_)*2);}let m=Math.min(o/Math.max(u,1e-12),r/Math.max(d,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Be(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(h-(-b*c+g*s))},zoom:y,bearing:a}}var wn=32;function G(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Re(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],h=e[8],u=e[9],d=e[10],m=e[11],y=e[12],p=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let w=t[v*4],S=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+S*l+_*h+M*y,i[v*4+1]=w*r+S*s+_*u+M*p,i[v*4+2]=w*n+S*c+_*d+M*b,i[v*4+3]=w*a+S*f+_*m+M*g;}return i}function Ee(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Ie(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function Xo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],h=e[10],u=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+h*o,i[7]=s*r+u*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=h*r-l*o,i[11]=u*r-s*o,i}function Yo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],h=e[6],u=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+h*o,i[3]=s*r+u*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=h*r-l*o,i[7]=u*r-s*o,i}function _n(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function Cn(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function Fe(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],h=e[9],u=e[10],d=e[11],m=e[12],y=e[13],p=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,w=t*c-n*a,S=o*s-r*l,_=o*c-n*l,M=r*c-n*s,x=f*y-h*m,C=f*p-u*m,T=f*b-d*m,E=h*p-u*y,k=h*b-d*y,F=u*b-d*p,L=g*F-v*k+w*E+S*T-_*C+M*x;return L?(L=1/L,i[0]=(l*F-s*k+c*E)*L,i[1]=(r*k-o*F-n*E)*L,i[2]=(y*M-p*_+b*S)*L,i[3]=(u*_-h*M-d*S)*L,i[4]=(s*T-a*F-c*C)*L,i[5]=(t*F-r*T+n*C)*L,i[6]=(p*w-m*M-b*v)*L,i[7]=(f*M-u*w+d*v)*L,i[8]=(a*k-l*T+c*x)*L,i[9]=(o*T-t*k-n*x)*L,i[10]=(m*_-y*w+b*g)*L,i[11]=(h*w-f*_-d*g)*L,i[12]=(l*C-a*E-s*x)*L,i[13]=(t*E-o*C+r*x)*L,i[14]=(y*v-m*S-p*g)*L,i[15]=(f*S-h*v+u*g)*L,i):null}function ie(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function He(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function ao(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function xn(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function tl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function jo(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Sn(i,e,t,o){let r=ao(tl(t,e)),n=ao(xn(r,o)),a=xn(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-jo(n,e),i[13]=-jo(a,e),i[14]=jo(r,e),i[15]=1,i}var Ct=60,lo=4.5,$e=6,so=i=>i/(2*Math.PI);function co(i){if(i<=lo)return 0;if(i>=$e)return 1;let e=(i-lo)/($e-lo);return e*e*(3-2*e)}function fo(i,e){let t=i*Math.PI/180,o=io(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Ko(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function ol(i,e){return fo(Se(i),Ce(e))}function $o(i,e){let t=i*Math.PI/180,o=io(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function Mn(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function rl(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function Tn(i,e,t,o,r,n,a,l){let s=Mn(ol(i,e),r,a);if(l<=0)return s;let c=rl(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function qo(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var An=1e3,nl=2,kn=84,il=.42,St=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=Ye(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=G();this._viewProjPx=G();this._viewMatrix=G();this._pixelMatrix=G();this._pixelMatrixInverse=G();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=G();this._localView=G();this._localProj=G();this._localPixel=G();this._localPixelInverse=G();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=G();this._shadowView=G();this._shadowProj=G();this._shadowVP=G();this._shadowVPm=G();this._shadowTile=G();this._shadowObject=G();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=il*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=et(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<$e?Math.min(this.maxPitch,Ct):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return bn(this._fov)}set fov(e){let t=Ye(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[ee(e.lng)*this._worldSize,te(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ie(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return ie(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ie(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ie(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=et(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-kn,kn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ee(e.lng)*this._worldSize,y:te(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Ee(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),He(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ee(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ie(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ee(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),He(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ye(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ye(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<$e}get globeFlatMix(){return this._ensure(),co(this._zoom)}get globeRadiusPx(){return this._ensure(),so(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=G();if(!Fe(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];ie(a,this._localPixelInverse,[r,n,0,1]),ie(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,h=l[1]/c-a[1]/s,u=l[2]/c-a[2]/s,d=Math.hypot(f,h,u)||1;return [f/d,h/d,u/d]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),He(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Tn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,co(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ie(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ie(t,this._localPixelInverse,[e.x,e.y,0,1]),ie(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],h=qo(l,f,a);if(!h)return null;let u=this._globeBasis,d=[h[0]/a,h[1]/a,h[2]/a],m=[d[0]*u.east[0]+d[1]*u.south[0]+d[2]*u.up[0],d[0]*u.east[1]+d[1]*u.south[1]+d[2]*u.up[1],d[0]*u.east[2]+d[1]*u.south[2]+d[2]*u.up[2]];return Ko(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=fo(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*nl,r=G();if(!Fe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let S of [-1,1])for(let _ of [-1,1])for(let M of [-1,1]){if(ie(l,r,[S,_,M,1]),l[3]===0)continue;let x=l[0]/l[3],C=l[1]/l[3],T=x-n[0],E=C-n[1],k=Math.hypot(T,E);if(k>o){let F=o/k;x=n[0]+T*F,C=n[1]+E*F;}a.push({x,y:C,z:0});}if(!a.length)return;let s=ao(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Sn(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let h=Math.min(t*this._pixelsPerMeter,o),u=1/0,d=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let S of a)for(let _ of [0,h])ie(g,f,[S.x,S.y,_,1]),g[0]<u&&(u=g[0]),g[0]>y&&(y=g[0]),g[1]<d&&(d=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=h+1,w=this._shadowProj;Cn(w,u,y,d,p,-b-v,-m+v),xe(this._shadowVP,w,f),Ie(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Ee(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),He(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ee(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),He(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=An*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,h=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*h+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-An*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=Be(this._zoom);this._worldSize=e,this._pixelsPerMeter=Go(1,this._center.lat)*e,this._centerX=ee(this._center.lng)*e,this._centerY=te(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ye(this._pitch),n=-Ye(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,h=Math.min(f*1.01,a*30),u=o/50;if(this.projection==="globe"&&this._zoom<$e){let g=so(e);u=Math.max(a-g*1.6,a*.02),h=a+g*2.4;}let d=this._viewMatrix;Ie(d,G(),1,-1,1),Ee(d,d,0,0,-a),Xo(d,d,r),Yo(d,d,n),Ee(d,d,-this._centerX,-this._centerY,0);let m=G();_n(m,this._fov,t/o,u,h),xe(this._viewProjPx,m,d);let y=G();Ie(y,d,1,1,this._pixelsPerMeter),xe(this._projMatrix,m,y);let p=this._localView;Ie(p,G(),1,-1,1),Ee(p,p,0,0,-a),Xo(p,p,r),Yo(p,p,n),xe(this._localProj,m,p),this._globeBasis=$o(this._center.lng,this._center.lat);let b=G();Ie(b,G(),t/2,-o/2,1),Ee(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),Fe(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),Fe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Fe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=G();if(!Fe(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];ie(f,e,[c,s,l,1]);let h=f[3]||1e-9;t.push([f[0]/h,f[1]/h,f[2]/h]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],h=t[s],u=t[c],d=h[0]-f[0],m=h[1]-f[1],y=h[2]-f[2],p=u[0]-f[0],b=u[1]-f[1],g=u[2]-f[2],v=m*g-y*b,w=y*p-d*g,S=d*b-m*p,_=Math.hypot(v,w,S)||1;v/=_,w/=_,S/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=S,M[3]=-(v*f[0]+w*f[1]+S*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var al={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Ln=2,ll=100,sl=.5,cl=.1,fl=25,In=i=>Math.abs(i.y)>Math.abs(i.x);function Fn(i,e,t){let o=Math.hypot(i.x,i.y)>=Ln,r=Math.hypot(e.x,e.y)>=Ln;return !o&&!r?void 0:!o||!r?t<ll?void 0:false:i.y>0==e.y>0&&In(i)&&In(e)}function En(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var ul=160,Zo=4,uo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new H;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...al,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?Fn(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*sl,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=cl&&(e.zoomActive=true),e.zoomActive)){let h=Math.log2(r/f);h!==0&&(this.tr.zoom=this.tr.zoom+h,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let h=fl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(En(n,e.startAngle))>=h&&(e.rotateActive=true),e.rotateActive){let u=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=En(n,u);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>ul;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>Zo&&(r=r/a*Zo,n=n/a*Zo);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let h=Math.exp(-25e-4*f*10);if(r*=h,n*=h,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let u={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,u),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var be=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},se=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},ae=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var hl=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],ce=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new H;this.attribs=new H;let a=e.gl,l=ml(n),s=Rn(a,a.VERTEX_SHADER,zn(o,l),`${t}.vert`),c=Rn(a,a.FRAGMENT_SHADER,zn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),hl.forEach((h,u)=>a.bindAttribLocation(f,u,h)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let h=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${h}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function ml(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
2
- `)}function zn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
1
+ import Yn from'earcut';import Sl from'pbf';import*as Qn from'polygon-clipping';var O=Map,J=Set;var Ve=class{constructor(){this.listeners=new O;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new J),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var Ke=i=>i*Math.PI/180,vn=i=>i*180/Math.PI;function tt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var ro=i=>1-Math.pow(1-i,3);function fe(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var no=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new O;this._stencilTest=false;this.gl=e,this.caps=sl(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){this._framebuffer!==e&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this._framebuffer=e);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function sl(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var $e=512,io=40075016686e-3,wn=85.051129;function Z(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var De=i=>512*Math.pow(2,i),ao=i=>Math.max(-wn,Math.min(wn,i));function te(i){return (180+i)/360}function oe(i){let e=ao(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Ae(i){return io*Math.cos(i*Math.PI/180)}function No(i,e){return i/Ae(e)}function uu(i,e){return i*Ae(e)}function hu(i,e){return No(1,i)*De(e)}function du(i,e){return Ae(i)/De(e)}function xn(i,e){let t=Math.pow(2,i);return Ae(Ce((e+.5)/t))/t}function Uo(i){return io/Math.pow(2,i)}function _n(i,e,t){let o=Uo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Ct=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=Z(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=Z(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:te(this.west),maxX:te(this.east),minY:oe(this.north),maxY:oe(this.south)}}};function jo(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,Cn),r=Math.max(e.height-t.top-t.bottom,Cn),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,h=(n.minY+n.maxY)/2,u=0,d=0;for(let[v,_]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let S=(v-f)*s-(_-h)*c,C=(v-f)*c+(_-h)*s;u=Math.max(u,Math.abs(S)*2),d=Math.max(d,Math.abs(C)*2);}let m=Math.min(o/Math.max(u,1e-12),r/Math.max(d,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=De(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(h-(-b*c+g*s))},zoom:y,bearing:a}}var Cn=32;function G(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function ze(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],h=e[8],u=e[9],d=e[10],m=e[11],y=e[12],p=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let _=t[v*4],S=t[v*4+1],C=t[v*4+2],M=t[v*4+3];i[v*4]=_*o+S*l+C*h+M*y,i[v*4+1]=_*r+S*s+C*u+M*p,i[v*4+2]=_*n+S*c+C*d+M*b,i[v*4+3]=_*a+S*f+C*m+M*g;}return i}function Ie(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Le(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function Yo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],h=e[10],u=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+h*o,i[7]=s*r+u*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=h*r-l*o,i[11]=u*r-s*o,i}function Ko(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],h=e[6],u=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+h*o,i[3]=s*r+u*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=h*r-l*o,i[7]=u*r-s*o,i}function Mn(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function Tn(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function Fe(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],h=e[9],u=e[10],d=e[11],m=e[12],y=e[13],p=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,_=t*c-n*a,S=o*s-r*l,C=o*c-n*l,M=r*c-n*s,w=f*y-h*m,x=f*p-u*m,T=f*b-d*m,k=h*p-u*y,L=h*b-d*y,P=u*b-d*p,A=g*P-v*L+_*k+S*T-C*x+M*w;return A?(A=1/A,i[0]=(l*P-s*L+c*k)*A,i[1]=(r*L-o*P-n*k)*A,i[2]=(y*M-p*C+b*S)*A,i[3]=(u*C-h*M-d*S)*A,i[4]=(s*T-a*P-c*x)*A,i[5]=(t*P-r*T+n*x)*A,i[6]=(p*_-m*M-b*v)*A,i[7]=(f*M-u*_+d*v)*A,i[8]=(a*L-l*T+c*w)*A,i[9]=(o*T-t*L-n*w)*A,i[10]=(m*C-y*_+b*g)*A,i[11]=(h*_-f*C-d*g)*A,i[12]=(l*x-a*k-s*w)*A,i[13]=(t*k-o*x+r*w)*A,i[14]=(y*v-m*S-p*g)*A,i[15]=(f*S-h*v+u*g)*A,i):null}function ae(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function Pe(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function lo(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Sn(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function cl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function Xo(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function En(i,e,t,o){let r=lo(cl(t,e)),n=lo(Sn(r,o)),a=Sn(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-Xo(n,e),i[13]=-Xo(a,e),i[14]=Xo(r,e),i[15]=1,i}var St=60,so=4.5,qe=6,co=i=>i/(2*Math.PI);function fo(i){if(i<=so)return 0;if(i>=qe)return 1;let e=(i-so)/(qe-so);return e*e*(3-2*e)}function uo(i,e){let t=i*Math.PI/180,o=ao(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function $o(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function fl(i,e){return uo(Se(i),Ce(e))}function qo(i,e){let t=i*Math.PI/180,o=ao(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function kn(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function ul(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function An(i,e,t,o,r,n,a,l){let s=kn(fl(i,e),r,a);if(l<=0)return s;let c=ul(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function Zo(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var Ln=1e3,hl=2,In=84,dl=.42,Mt=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=Ke(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=G();this._viewProjPx=G();this._viewMatrix=G();this._pixelMatrix=G();this._pixelMatrixInverse=G();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=G();this._localView=G();this._localProj=G();this._localPixel=G();this._localPixelInverse=G();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=G();this._shadowView=G();this._shadowProj=G();this._shadowVP=G();this._shadowVPm=G();this._shadowTile=G();this._shadowObject=G();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=dl*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=tt(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<qe?Math.min(this.maxPitch,St):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return vn(this._fov)}set fov(e){let t=Ke(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[te(e.lng)*this._worldSize,oe(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ae(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return ae(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ae(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ae(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=tt(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-In,In);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:te(e.lng)*this._worldSize,y:oe(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Ie(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),Pe(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ie(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Le(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ie(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),Pe(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ke(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ke(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<qe}get globeFlatMix(){return this._ensure(),fo(this._zoom)}get globeRadiusPx(){return this._ensure(),co(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=G();if(!Fe(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];ae(a,this._localPixelInverse,[r,n,0,1]),ae(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,h=l[1]/c-a[1]/s,u=l[2]/c-a[2]/s,d=Math.hypot(f,h,u)||1;return [f/d,h/d,u/d]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),Pe(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),An(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,fo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ae(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ae(t,this._localPixelInverse,[e.x,e.y,0,1]),ae(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],h=Zo(l,f,a);if(!h)return null;let u=this._globeBasis,d=[h[0]/a,h[1]/a,h[2]/a],m=[d[0]*u.east[0]+d[1]*u.south[0]+d[2]*u.up[0],d[0]*u.east[1]+d[1]*u.south[1]+d[2]*u.up[1],d[0]*u.east[2]+d[1]*u.south[2]+d[2]*u.up[2]];return $o(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=uo(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*hl,r=G();if(!Fe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let S of [-1,1])for(let C of [-1,1])for(let M of [-1,1]){if(ae(l,r,[S,C,M,1]),l[3]===0)continue;let w=l[0]/l[3],x=l[1]/l[3],T=w-n[0],k=x-n[1],L=Math.hypot(T,k);if(L>o){let P=o/L;w=n[0]+T*P,x=n[1]+k*P;}a.push({x:w,y:x,z:0});}if(!a.length)return;let s=lo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;En(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let h=Math.min(t*this._pixelsPerMeter,o),u=1/0,d=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let S of a)for(let C of [0,h])ae(g,f,[S.x,S.y,C,1]),g[0]<u&&(u=g[0]),g[0]>y&&(y=g[0]),g[1]<d&&(d=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=h+1,_=this._shadowProj;Tn(_,u,y,d,p,-b-v,-m+v),xe(this._shadowVP,_,f),Le(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Ie(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),Pe(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ie(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),Pe(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=Ln*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,h=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*h+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-Ln*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=De(this._zoom);this._worldSize=e,this._pixelsPerMeter=No(1,this._center.lat)*e,this._centerX=te(this._center.lng)*e,this._centerY=oe(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ke(this._pitch),n=-Ke(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,h=Math.min(f*1.01,a*30),u=o/50;if(this.projection==="globe"&&this._zoom<qe){let g=co(e);u=Math.max(a-g*1.6,a*.02),h=a+g*2.4;}let d=this._viewMatrix;Le(d,G(),1,-1,1),Ie(d,d,0,0,-a),Yo(d,d,r),Ko(d,d,n),Ie(d,d,-this._centerX,-this._centerY,0);let m=G();Mn(m,this._fov,t/o,u,h),xe(this._viewProjPx,m,d);let y=G();Le(y,d,1,1,this._pixelsPerMeter),xe(this._projMatrix,m,y);let p=this._localView;Le(p,G(),1,-1,1),Ie(p,p,0,0,-a),Yo(p,p,r),Ko(p,p,n),xe(this._localProj,m,p),this._globeBasis=qo(this._center.lng,this._center.lat);let b=G();Le(b,G(),t/2,-o/2,1),Ie(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),Fe(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),Fe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Fe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=G();if(!Fe(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];ae(f,e,[c,s,l,1]);let h=f[3]||1e-9;t.push([f[0]/h,f[1]/h,f[2]/h]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],h=t[s],u=t[c],d=h[0]-f[0],m=h[1]-f[1],y=h[2]-f[2],p=u[0]-f[0],b=u[1]-f[1],g=u[2]-f[2],v=m*g-y*b,_=y*p-d*g,S=d*b-m*p,C=Math.hypot(v,_,S)||1;v/=C,_/=C,S/=C;let M=new Float64Array(4);return M[0]=v,M[1]=_,M[2]=S,M[3]=-(v*f[0]+_*f[1]+S*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var ml={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Fn=2,pl=100,bl=.5,yl=.1,gl=25,Rn=i=>Math.abs(i.y)>Math.abs(i.x);function Pn(i,e,t){let o=Math.hypot(i.x,i.y)>=Fn,r=Math.hypot(e.x,e.y)>=Fn;return !o&&!r?void 0:!o||!r?t<pl?void 0:false:i.y>0==e.y>0&&Rn(i)&&Rn(e)}function zn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var vl=160,Qo=4,ho=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new O;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...ml,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?Pn(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*bl,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=yl&&(e.zoomActive=true),e.zoomActive)){let h=Math.log2(r/f);h!==0&&(this.tr.zoom=this.tr.zoom+h,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let h=gl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(zn(n,e.startAngle))>=h&&(e.rotateActive=true),e.rotateActive){let u=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=zn(n,u);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>vl;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>Qo&&(r=r/a*Qo,n=n/a*Qo);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let h=Math.exp(-25e-4*f*10);if(r*=h,n*=h,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let u={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,u),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var ye=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},ue=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},le=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var xl=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],he=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new O;this.attribs=new O;let a=e.gl,l=_l(n),s=On(a,a.VERTEX_SHADER,Hn(o,l),`${t}.vert`),c=On(a,a.FRAGMENT_SHADER,Hn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),xl.forEach((h,u)=>a.bindAttribLocation(f,u,h)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let h=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${h}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function _l(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
2
+ `)}function Hn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
3
3
  `+i.slice(t[0].length):`${e}
4
- ${i}`}function Rn(i,e,t,o){let r=i.createShader(e);if(!r)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0435\u0439\u0434\u0435\u0440 ${o}`);if(i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){let n=i.getShaderInfoLog(r)??"";throw i.deleteShader(r),new Error(`[osmgl] \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u044F ${o} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430:
4
+ ${i}`}function On(i,e,t,o){let r=i.createShader(e);if(!r)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0435\u0439\u0434\u0435\u0440 ${o}`);if(i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){let n=i.getShaderInfoLog(r)??"";throw i.deleteShader(r),new Error(`[osmgl] \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u044F ${o} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430:
5
5
  ${n}
6
- ${pl(t)}`)}return r}function pl(i){return i.split(`
6
+ ${Cl(t)}`)}return r}function Cl(i){return i.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
- `)}var Tt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Tt||{}),ho=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(yl,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function yl(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?gl(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function gl(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var mo=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(vl,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return ho.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function vl(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(wl(t)));}function wl(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var Mt=class{constructor(e){this.layers={};new bl(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=mo.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function qe(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=xl(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function xl(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function V(i,e,t){return i===void 0?t:typeof i=="number"?i:Hn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function ke(i,e,t){return i===void 0?t:typeof i=="string"?le(i):Hn(i.stops,e,(o,r,n)=>{let a=le(o),l=le(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Hn(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,h=f===0?0:(e-s)/f;return t(c,l,h)}return o}function de(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>de(o,e));case "any":return i.slice(1).some(o=>de(o,e));case "!":return !de(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var _l=Math.PI/8,Cl=.35,Sl=32,Pn=.25,On=.07;function ze(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Cl,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+o-1)%o*2],u=i[(s+o-1)%o*2+1],d=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-h,p=f-u,b=d-c,g=m-f,v=Math.hypot(y,p),w=Math.hypot(b,g);if(v<1e-6||w<1e-6){l.push(c,f);continue}let S=y/v,_=p/v,M=b/w,x=g/w;if(e.keep?.[s]){l.push(c,f);continue}let C=S*M+_*x;if(C>.985){l.push(c,f);continue}if(a!==void 0&&(Qo(c,f,a)||Qo(h,u,a)||Qo(d,m,a))){l.push(c,f);continue}let T=Math.min(t,v*.4,w*.4);if(T<t*n){l.push(c,f);continue}let E=c-S*T,k=f-_*T,F=c+M*T,L=f+x*T,I=Math.acos(Math.max(-1,Math.min(1,C))),A=Math.min(_l,Math.PI/2/r),R=Math.ceil(I/A-1e-6),P=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(I/2)*I/e.maxChord):0,z=Math.max(1,Math.min(Sl,Math.max(Math.min(r,R),P)));l.push(E,k);for(let O=1;O<z;O++){let N=O/z,W=1-N;l.push(W*W*E+2*W*N*c+N*N*F,W*W*k+2*W*N*f+N*N*L);}l.push(F,L);}return l.length<6?i:(l.push(l[0],l[1]),l)}var Qo=(i,e,t)=>i<=0||e<=0||i>=t||e>=t;function tt(i,e){let t=Wn(i.outer,e);if(!t)return null;let o=[];for(let r of i.holes){let n=Wn(r,e);n&&o.push(n);}return {outer:t,holes:o}}function Wn(i,e){let t=[];for(let o=0;o<i.length-2;o+=2)t.push(i[o],i[o+1]);if(t.length<6)return null;for(let o=0;o<4;o++){let r=t;t=[];let n=r.length/2;if(n===0)return null;for(let a=0;a<n;a++){let l=r[a*2],s=r[a*2+1],c=r[(a+n-1)%n*2],f=r[(a+n-1)%n*2+1],h=Vn(l,s,o,e),u=Vn(c,f,o,e);if(h!==u){let d=Ml(c,f,l,s,o,e);t.push(c+(l-c)*d,f+(s-f)*d);}h&&t.push(l,s);}}return t.length<6?null:(t.push(t[0],t[1]),t)}function Vn(i,e,t,o){return t===0?i>=0:t===1?i<=o:t===2?e>=0:e<=o}function Ml(i,e,t,o,r,n){return r===0?(0-i)/(t-i):r===1?(n-i)/(t-i):r===2?(0-e)/(o-e):(n-e)/(o-e)}function po(i,e,t,o,r){return i===0&&t===0||i===r&&t===r||e===0&&o===0||e===r&&o===r}function Bn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,nt=4,jn=65535/nt,Tl=9,Al=1,kl=0,Ll=1,Il=2;var Dn=0,El=1,Gn=2,Fl=3,zl=.47;function tr(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:zl,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=u=>s(u);let s=u=>{if(l.vertexCount+u<=n)return;n=Math.max(n*2,l.vertexCount+u);let d=new ArrayBuffer(n*Me);new Uint8Array(d).set(l.vertsU8.subarray(0,l.vertOffset)),a=d,l.verts=new DataView(d),l.vertsU8=new Uint8Array(d);};for(let u of i.features()){if(u.type!==3||!de(t,u.properties))continue;let d=es(u.properties),m=ts(u.properties,d);if(d<=m)continue;let y=rs(u.properties)??Number(u.id??0),p=Jl(y>>>0),b=Ql(p,u.properties),g=Zl(u.properties,d),v=qe(u.loadGeometry());for(let w of v){let S=tt(w,e);if(!S)continue;let _=Bn(S.outer,e),M=(o.cornerRadius??0)/r,x={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0},C=M>0?{outer:ze(S.outer,x),holes:S.holes.map(I=>ze(I,x))}:S,T=C.outer.length/2+C.holes.reduce((I,A)=>I+A.length/2,0);s(T*5+32);let E=C.holes.length||_?null:Ol(C.outer),k=E?Nl(u.properties,E,d,p,r):null,F=null,L=[];if(k&&E){let I=Xn(Xl(C.outer,r),E,k.shape);L=Yl(I,C.outer);let A=Kl(I,L);if(A>1e-6){let R=Math.min(Math.max(A*r*Bl,Gl),Dl);F=$l(I,R/A,d);}}Nn(l,C.outer,m,d,y,b,g,r,e,F);for(let I of C.holes)Nn(l,I,m,d,y,b,g,r,e,null);F?ql(l,L,F,d,y,b,g,r):Pl(l,C.outer,C.holes,d,y,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var or=(i,e)=>i|e<<2,Jo=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,jn)*nt)));function ot(i,e,t,o,r,n,a,l,s,c,f=0,h=0,u=0){let d=i.vertOffset;return i.verts.setInt16(d,Math.round(e),true),i.verts.setInt16(d+2,Math.round(t),true),i.verts.setUint16(d+4,Math.round(Math.min(o,jn)*nt),true),i.vertsU8[d+6]=s,i.vertsU8[d+7]=l,i.verts.setInt8(d+8,er(Math.round(r*127))),i.verts.setInt8(d+9,er(Math.round(n*127))),i.verts.setInt8(d+10,er(Math.round(a*127))),i.vertsU8[d+11]=c,i.verts.setUint16(d+12,Jo(f),true),i.verts.setUint16(d+14,Jo(h),true),i.verts.setUint16(d+16,Jo(u),true),i.vertOffset+=Me,i.vertexCount++}function Nn(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let h=or(kl,a),u=Hl(e,l),d=o-t,m=new Float64Array(f*2),y=new Uint8Array(f);{let p=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],w=Math.hypot(g,v)||1;p[b*2]=v/w,p[b*2+1]=-g/w;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=p[g*2]*p[b*2]+p[g*2+1]*p[b*2+1],w=p[g*2]+p[b*2],S=p[g*2+1]+p[b*2+1],_=Math.hypot(w,S);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=S/_,y[b]=1);}}for(let p=0;p<f-1;p++){let b=e[p*2],g=e[p*2+1],v=e[p*2+2],w=e[p*2+3];if(b===v&&g===w||po(b,g,v,w,s))continue;let S=v-b,_=w-g,M=Math.hypot(S,_)||1,x=_/M,C=-S/M,T=u.offset[p],E=u.width[p],k=[0,1];if(c){for(let L=0;L<c.length;L++)for(let I=L+1;I<c.length;I++){let A=Ze(c[L],b,g)-Ze(c[I],b,g),R=Ze(c[L],v,w)-Ze(c[I],v,w);if(A===R)continue;let P=A/(A-R);P>1e-4&&P<1-1e-4&&k.push(P);}k.sort((L,I)=>L-I);}let F=(L,I)=>{if(!c)return o;let A=1/0;for(let R of c)A=Math.min(A,Ze(R,L,I));return Math.max(o,A)};for(let L=0;L+1<k.length;L++){let I=k[L],A=k[L+1];if(A-I<1e-6)continue;let R=b+S*I,P=g+_*I,z=b+S*A,O=g+_*A,N=T+M*I*l,W=T+M*A*l,B=(p+1)%(f-1),D=y[p]?m[p*2]:x,K=y[p]?m[p*2+1]:C,$=y[B]?m[B*2]:x,oe=y[B]?m[B*2+1]:C,ye=x+(D-x)*(1-I),J=C+(K-C)*(1-I),X=x+($-x)*A,me=C+(oe-C)*A,pe=Math.hypot(ye,J)||1,Z=Math.hypot(X,me)||1,U=ye/pe,j=J/pe,fe=X/Z,ne=me/Z;i.ensure(4);let ue=ot(i,R,P,t,U,j,0,0,n,h,N,E,d),re=ot(i,z,O,t,fe,ne,0,0,n,h,W,E,d),ge=ot(i,R,P,F(R,P),U,j,0,255,n,h,N,E,d),Ae=ot(i,z,O,F(z,O),fe,ne,0,255,n,h,W,E,d);i.indices.push(ue,Ae,re,ue,ge,Ae),i.featureIds.push(r,r);}}}var Rl=.9976;function Hl(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],h=Math.hypot(c,f);o.push(h>0?{x:c/h,y:f/h,len:h*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Rl,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],h=o[c].len,u=s+1;for(;u<t;){let m=(n+u)%t;if(!r((n+u-1)%t,m))break;f.push(m),h+=o[m].len,u++;}let d=0;for(let m of f)a[m]=d,l[m]=h,d+=o[m].len;s=u;}return {offset:a,width:l}}function Pl(i,e,t,o,r,n,a){let l=[],s=[];for(let u=0;u<e.length;u++)l.push(e[u]);for(let u of t){s.push(l.length/2);for(let d=0;d<u.length;d++)l.push(u[d]);}let c=Un(l,s.length?s:void 0,2);if(!c.length)return;let f=or(Ll,a),h=i.vertexCount;for(let u=0;u<l.length;u+=2)ot(i,l[u],l[u+1],o,0,0,1,255,n,f);for(let u=0;u<c.length;u+=3)i.indices.push(h+c[u],h+c[u+2],h+c[u+1]),i.featureIds.push(r);}function Ol(i){let e=Wl(i);if(e.length<3)return null;let t=Math.abs(Vl(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,h=-1/0,u=1/0,d=-1/0;for(let w of e){let S=w.x*l+w.y*s,_=-w.x*s+w.y*l;S<f&&(f=S),S>h&&(h=S),_<u&&(u=_),_>d&&(d=_);}let m=h-f,y=d-u,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+h)/2,g=(u+d)/2,v=m>=y;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?m:y)/2,halfShort:(v?y:m)/2,fill:t/p};}return o}function Wl(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function Vl(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var Bl=Math.tan(30*Math.PI/180),Dl=3.5,Gl=.9;function Nl(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=Ul(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Ul(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ze=(i,e,t)=>i.a*e+i.b*t+i.c;function jl(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,h]=a((l+r-1)%r),u=e*s+t*c+o,d=e*f+t*h+o;if(u<=0!=d<=0){let m=d/(d-u);n.push(f+(s-f)*m,h+(c-h)*m);}u<=0&&n.push(s,c);}return n}function Xl(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],h=c-l,u=f-s,d=Math.hypot(h,u),m=d>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*u-(i[y*2+1]-s)*h)/d>=t){m=false;break}}m||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function Xn(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+1)%l*2],u=i[(s+1)%l*2+1],d=h-c,m=u-f,y=Math.hypot(d,m);if(y<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/y)<.86)continue;let p=-m/y,b=d/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?Xn(i,e,"hipped"):a}function Yl(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=jl(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function Kl(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Ze(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function $l(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function ql(i,e,t,o,r,n,a,l){let s=or(Il,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let h=Un(f,void 0,2);if(!h.length)continue;let u=-t[c].a/l,d=-t[c].b/l,m=Math.hypot(u,d,1),y={x:u/m,y:d/m,z:1/m};i.ensure(f.length/2);let p=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Ze(t[c],f[b],f[b+1]));ot(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<h.length;b+=3)i.indices.push(p+h[b],p+h[b+2],p+h[b+1]),i.featureIds.push(r);}}function Zl(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Fl:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Gn:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Dn:e>=40?Gn:El}function Ql(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function Jl(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function es(i){let e=rt(i.render_height)??rt(i.height)??os(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Al):Tl}function ts(i,e){let t=rt(i.render_min_height)??rt(i.min_height)??rt(i.base)??0;return t>0&&t<e?t:0}function os(i){let e=rt(i);return e&&e>0?e*3:null}function rt(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var er=i=>i>127?127:i<-127?-127:i;function rs(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}var it=16,Qn=64,is=0,as=1,Yn=2,ls=3,At=1;function ar(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),h=new ArrayBuffer(f*it),u={view:new DataView(h),bytes:new Uint8Array(h),offset:0,count:0,indices:[],extent:e,ensure(w){if(u.count+w<=f)return;f=Math.max(f*2,u.count+w);let S=new ArrayBuffer(f*it);new Uint8Array(S).set(u.bytes.subarray(0,u.offset)),h=S,u.view=new DataView(S),u.bytes=new Uint8Array(S);}},d=[],m=new Map;for(let w of i.features()){if(w.type!==3||!de(t,w.properties))continue;let S=o.liftBy?.(w.properties)??0;for(let _ of qe(w.loadGeometry())){let M=tt(_,e);if(M){d.push(S?{...M,lift:S}:M),Kn(M.outer,m);for(let x of M.holes)Kn(x,m);}}}o.onShapes?.(d);let y=new Set;for(let[w,S]of m)S>1&&y.add(w);let p=[],b={radius:c,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:Pn/r};for(let w of d){let S=c>0?{outer:ze(w.outer,{...b,keep:$n(w.outer,y)}),holes:w.holes.map(F=>ze(F,{...b,keep:$n(F,y)}))}:w,_=l>0?Zn(S.outer,l,e,y):S.outer,M=S.holes.map(F=>l>0?Zn(F,-l,e,y):F),x=w.lift??0,C=n+x,T=a+x;qn(u,_??S.outer,M.map((F,L)=>F??S.holes[L]),C);let E=C,k=C-s;_&&l>0&&s>0&&rr(u,_,S.outer,E,k,as,e,y),k!==T&&rr(u,S.outer,S.outer,k,T,Yn,e,y);for(let F of S.holes)if(k!==T&&rr(u,F,F,k,T,Yn,e,y),C<T){let L=u.indices.length;qn(u,F,[],T,ls);for(let I=L;I<u.indices.length;I++)p.push(u.indices[I]);u.indices.length=L;}}if(!u.indices.length&&!p.length)return null;let g=u.indices.length,v=new Uint32Array(g+p.length);return v.set(u.indices,0),v.set(p,g),{vertices:h.slice(0,u.offset),indices:v.buffer,vertexCount:u.count,indexCount:v.length,extent:e,capIndexOffset:g}}function at(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function Kn(i,e){for(let t=0;t+3<i.length;t+=2){let o=at(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function $n(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=at(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=at(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function kt(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,ss(Math.round(o*Qn)),true),i.view.setInt8(s+10,ir(Math.round(r*127))),i.view.setInt8(s+11,ir(Math.round(n*127))),i.view.setInt8(s+12,ir(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-At:e>=i.extent?At:0),i.view.setInt8(s+15,t<=0?-At:t>=i.extent?At:0),i.offset+=it,i.count++}function qn(i,e,t,o,r=is){let n=[],a=[];for(let c=0;c<e.length;c++)n.push(e[c]);for(let c of t){a.push(n.length/2);for(let f=0;f<c.length;f++)n.push(c[f]);}let l=Un(n,a.length?a:void 0,2);if(!l.length)return;i.ensure(n.length/2);let s=i.count;for(let c=0;c<n.length;c+=2)kt(i,n[c],n[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)i.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function rr(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],h=t[c*2+1],u=t[c*2+2],d=t[c*2+3];if(f===u&&h===d||po(f,h,u,d,a)||l.has(at(f,h,u,d)))continue;let m=u-f,y=d-h,p=Math.hypot(m,y)||1,b=y/p,g=-m/p,v=o-r,w=Math.hypot(e[c*2]-f,e[c*2+1]-h)||0,S=0;if(w>1e-6&&v!==0){let T=1/Math.hypot(1,v/w);S=w/Math.hypot(w,v)*Math.sign(v),b*=T,g*=T;}let _=kt(i,e[c*2],e[c*2+1],o,b,g,S,n),M=kt(i,e[c*2+2],e[c*2+3],o,b,g,S,n),x=kt(i,f,h,r,b,g,S,n),C=kt(i,u,d,r,b,g,S,n);i.indices.push(x,M,C,x,_,M);}}}function Zn(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let s=0;s<r;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+r-1)%r*2],u=i[(s+r-1)%r*2+1],d=i[(s+1)%r*2],m=i[(s+1)%r*2+1],y=Math.hypot(c-h,f-u)||1,p=Math.hypot(d-c,m-f)||1,b=(f-u)/y,g=-(c-h)/y,v=(m-f)/p,w=-(d-c)/p,S=b+v,_=g+w,M=Math.hypot(S,_);if(M<1e-6){n.push(c,f);continue}S/=M,_/=M;let x=Math.min(1/Math.max(S*b+_*g,.35),3),C=c-S*e*x,T=f-_*e*x,E=at(h,u,c,f),k=at(c,f,d,m);if(o.has(E)||o.has(k)){n.push(c,f);continue}(c<=0||c>=t)&&(C=c),(f<=0||f>=t)&&(T=f),n.push(C,T);}n.push(n[0],n[1]);let a=Math.abs(nr(i)),l=nr(n);if(Math.sign(l)!==Math.sign(nr(i))||Math.abs(l)<a*.25)return null;for(let s=0;s<n.length;s+=2)n[s]=Math.max(0,Math.min(t,n[s])),n[s+1]=Math.max(0,Math.min(t,n[s+1]));return n}function nr(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var ir=i=>i>127?127:i<-127?-127:i,ss=i=>i>32767?32767:i<-32768?-32768:i;var De=4;function fs(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,h)=>{let u=i.length/2;return i.push((l(f)+l(h))/2,(s(f)+s(h))/2),u};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let h=0;for(;a.length&&!(++h>2e4);){let[u,d,m]=a.pop(),y=(l(u)-l(d))**2+(s(u)-s(d))**2,p=(l(d)-l(m))**2+(s(d)-s(m))**2,b=(l(m)-l(u))**2+(s(m)-s(u))**2,g=Math.max(y,p,b);if(g<=n){r.push(u,d,m);continue}if(g===y){let v=c(u,d);a.push([u,v,m],[v,d,m]);}else if(g===p){let v=c(d,m);a.push([d,v,u],[v,m,u]);}else {let v=c(m,u);a.push([m,v,d],[v,u,d]);}}}}function lr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let d of i.features()){if(d.type!==3||!de(e,d.properties))continue;let m=d.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(d.id??0);for(let b of qe(d.loadGeometry())){let g=r?tt(b,n):b;if(!g)continue;let v=[],w=[],S=o?ze(g.outer,o):g.outer;for(let x=0;x<S.length;x++)v.push(S[x]);for(let x of g.holes){let C=o?ze(x,o):x;w.push(v.length/2);for(let T=0;T<C.length;T++)v.push(C[T]);}let _=Un(v,w.length?w:void 0,2);if(!_.length)continue;let M=a.length/2;for(let x=0;x<v.length;x++)a.push(v[x]);if(t>0){let x=[];fs(a,_,M,t,x);for(let C=0;C<x.length;C+=3)l.push(x[C],x[C+2],x[C+1]),s.push(p);continue}for(let x=0;x<_.length;x+=3)l.push(M+_[x],M+_[x+2],M+_[x+1]),s.push(p);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),h=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:h.buffer,vertexCount:c,indexCount:h.length}}var us=100;function sr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function cr(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function ds(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=lt(Math.floor(o.minX/e)),n=lt(Math.floor(o.maxX/e)),a=lt(Math.floor(o.minY/e)),l=lt(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var ei=i=>i.shapes.length===0;function bo(i,e,t){!i.cells.length&&i.shapes.length&&ds(i);let o=i.extent/32,r=i.cells[lt(Math.floor(t/o))*32+lt(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!Jn(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Jn(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function fr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=bo(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],h=e[l+3],u=bo(i,f,h);if(u!==a&&n>0){let d=Math.hypot(f-s,h-c),m=Math.min(Math.ceil(d/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(h-c)*b,w=bo(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,h),o.push(u),a=u;}return {pts:t,levels:o}}var lt=i=>i<0?0:i>31?31:i;function Jn(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var Ge=20;function ur(i,e,t=0,o){let r=Math.max(256,i.length*24),n=new ArrayBuffer(r*Ge),a=new DataView(n),l=0,s=[],c=d=>{if(l+d<=r)return;r=Math.max(r*2,l+d);let m=new ArrayBuffer(r*Ge);new Uint8Array(m).set(new Uint8Array(n,0,l*Ge)),n=m,a=new DataView(m);},f=(d,m,y,p,b,g,v,w=0,S=0)=>{let _=l*Ge;return a.setInt16(_,d,true),a.setInt16(_+2,m,true),a.setInt16(_+4,y,true),a.setInt16(_+6,p,true),a.setInt8(_+8,b),a.setInt8(_+9,g),a.setInt8(_+10,w),a.setInt8(_+11,S),a.setFloat32(_+12,v,true),a.setFloat32(_+16,h,true),l++},h=0;for(let d of i.features()){if(d.type!==2&&d.type!==3||!de(e,d.properties))continue;let m=d.properties.width;h=typeof m=="number"&&m>.5&&m<100?m:0;let y=d.type===3;for(let p of d.loadGeometry()){let b=t>0?hs(ti(p),t):ti(p);if(b.length<4)continue;let g=o&&!ei(o)?fr(o,b):null,v=g?g.pts:b,w=g?.levels,S=v.length/2;if(S<2)continue;c((S-1)*4);let _=0;for(let M=0;M<S-1;M++){let x=v[M*2],C=v[M*2+1],T=v[M*2+2],E=v[M*2+3],k=Math.hypot(T-x,E-C);if(y&&ps(x,C,T,E,i.extent)){_+=k;continue}let F=ms(x,C,T,E,i.extent);if(!F){_+=k;continue}let[L,I,A,R]=F,P=Math.hypot(L-x,I-C),z=Math.hypot(A-L,R-I),O=Math.hypot(T-A,E-R),N=_+P,W=w?w[M]:0,B=w?w[M+1]:0,D=f(L,I,A,R,0,-1,N,W,B),K=f(L,I,A,R,0,1,N,W,B),$=f(L,I,A,R,1,1,N,W,B),oe=f(L,I,A,R,1,-1,N,W,B);_+=P+z+O,s.push(D,K,$,D,$,oe);}}}if(!s.length)return null;let u=new Uint32Array(s);return {vertices:n.slice(0,l*Ge),indices:u.buffer,vertexCount:l,indexCount:u.length}}function hs(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function ti(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function ms(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,h]of c){if(f===0){if(h<0)return null;continue}let u=h/f;if(f<0){if(u>s)return null;u>l&&(l=u);}else {if(u<l)return null;u<s&&(s=u);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function ps(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var dr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},hr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var oi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ri={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ni={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ii={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ai={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:"#22262f"},"road-casing-minor":{color:"#1e222a"},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:"#2f343d"},"road-secondary":{color:"#3c424d"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var li={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:"#d2d2d2"},"road-casing-minor":{color:"#d8d8d8"},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:"#f7f7f7"},"road-secondary":{color:"#fbfbfb"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var si={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:"#eceae2"},"road-casing-minor":{color:"#efedE6"},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:"#fdfcfa"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var ci={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#f0ecea",light:{ambientColor:"#f8f8f8",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#f4f2f1"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#e0dddc"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:"#9da7be"},"road-casing-minor":{color:"#9da7be"},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:"#bbc1d3"},"road-secondary":{color:"#bbc1d3"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ede7de",roofColor:"#ede7de",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var fi={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:"#5a6faf"},"road-casing-minor":{color:"#5a6faf"},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var ui={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:"#6a1b6a"},"road-casing-minor":{color:"#6a1b6a"},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:"#12e2e2"},"road-secondary":{color:"#12e2e2"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var di={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:"#a6afc9"},"road-casing-minor":{color:"#a6afc9"},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:"#c3c9df"},"road-secondary":{color:"#c3c9df"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var hi={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:"#7078a4"},"road-casing-minor":{color:"#7078a4"},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:"#8f94b7"},"road-secondary":{color:"#8f94b7"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var mi={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:"#a79376"},"road-casing-minor":{color:"#a79376"},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:"#c6bba9"},"road-secondary":{color:"#c6bba9"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var pi={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:"#185662"},"road-casing-minor":{color:"#185662"},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:"#22b6c3"},"road-secondary":{color:"#22b6c3"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var bi={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:"#d5cdb8"},"road-casing-minor":{color:"#cad1d8"},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#fbf6ea"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var yi={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:"#bdcfdb"},"road-casing-minor":{color:"#bdcfdb"},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:"#d6e2eb"},"road-secondary":{color:"#d6e2eb"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var gi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:"#383838"},"road-casing-minor":{color:"#383838"},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:"#525252"},"road-secondary":{color:"#525252"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var vi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:"#80a1c6"},"road-casing-minor":{color:"#80a1c6"},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:"#b0c5dd"},"road-secondary":{color:"#b0c5dd"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var wi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:"#7fbd7f"},"road-casing-minor":{color:"#7fbd7f"},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:"#afd4af"},"road-secondary":{color:"#afd4af"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var xi={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:"#848b9a"},"road-casing-minor":{color:"#848b9a"},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:"#acb0b9"},"road-secondary":{color:"#acb0b9"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var _i={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:"#abb0ba"},"road-casing-minor":{color:"#abb0ba"},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:"#c7cad1"},"road-secondary":{color:"#c7cad1"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Ci={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:"#b8b8b8"},"road-casing-minor":{color:"#b8b8b8"},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:"#d1d1d1"},"road-secondary":{color:"#d1d1d1"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Si={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:"#8ab2c7"},"road-casing-minor":{color:"#8ab2c7"},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:"#b8d3e0"},"road-secondary":{color:"#b8d3e0"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Mi={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:"#423b2e"},"road-casing-minor":{color:"#423b2e"},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:"#5e5645"},"road-secondary":{color:"#5e5645"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Ti={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:"#766b60"},"road-casing-minor":{color:"#766b60"},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:"#9c948b"},"road-secondary":{color:"#9c948b"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Ai={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:"#3a2060"},"road-casing-minor":{color:"#3a2060"},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:"#6b35b6"},"road-secondary":{color:"#6b35b6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var ki={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:"#712b14"},"road-casing-minor":{color:"#712b14"},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:"#e65e19"},"road-secondary":{color:"#e65e19"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Li={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:"#a3adc2"},"road-casing-minor":{color:"#a3adc2"},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:"#bfc6d9"},"road-secondary":{color:"#bfc6d9"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Ii={"3d":ci,cartoon:fi,cyberpunk:ui,dawn:di,dusk:hi,earth:mi,future:pi,"glass-refined":bi,glass:yi,"harmony-black":gi,"harmony-blue":vi,"harmony-green":wi,lunar:xi,matte:_i,minimal:Ci,ocean:Si,premium:Mi,realistic:Ti,space:Ai,volcano:ki,white:Li};function yo(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var Y="base",Ei="\u241F",st=(i,e)=>i+"\u241F"+String(e);var ct=class{constructor(e=mr){this.splitValues={};this.spec=e,this.light={...hr,...e.light??{}},this.sky={...dr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return le(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let r=e.paint;return ke(r?.color,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=Y){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??Y)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??Y))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:st(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},mr=oi,Us=ri,js=ni,Xs=ii,ft={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:ai,mono:li,pale:si,...Ii};function go(i,e=mr){if(typeof i!="string")return yo(e,i);if(i==="day")return e;let t=ft[i];return t?yo(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(ft).join(", ")}`),e)}var Lt=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),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_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function Fi(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var It=`
8
+ `)}var Et=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Et||{}),mo=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(Ml,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function Ml(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?Tl(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function Tl(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var po=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(El,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return mo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function El(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(kl(t)));}function kl(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var Tt=class{constructor(e){this.layers={};new Sl(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=po.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Ze(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=Al(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function Al(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function B(i,e,t){return i===void 0?t:typeof i=="number"?i:Wn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function ke(i,e,t){return i===void 0?t:typeof i=="string"?fe(i):Wn(i.stops,e,(o,r,n)=>{let a=fe(o),l=fe(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Wn(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,h=f===0?0:(e-s)/f;return t(c,l,h)}return o}function pe(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>pe(o,e));case "any":return i.slice(1).some(o=>pe(o,e));case "!":return !pe(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var Ll=Math.PI/8,Il=.35,Fl=32,Bn=.25,Vn=.07;function Re(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Il,0),a=e.extent,l=e.margin??0,s=[];for(let c=0;c<o;c++){let f=i[c*2],h=i[c*2+1],u=i[(c+o-1)%o*2],d=i[(c+o-1)%o*2+1],m=i[(c+1)%o*2],y=i[(c+1)%o*2+1],p=f-u,b=h-d,g=m-f,v=y-h,_=Math.hypot(p,b),S=Math.hypot(g,v);if(_<1e-6||S<1e-6){s.push(f,h);continue}let C=p/_,M=b/_,w=g/S,x=v/S;if(e.keep?.[c]){s.push(f,h);continue}let T=C*w+M*x;if(T>.985){s.push(f,h);continue}if(a!==void 0&&(Jo(f,h,a,l)||Jo(u,d,a,l)||Jo(m,y,a,l))){s.push(f,h);continue}let k=Math.min(t,_*.4,S*.4);if(k<t*n){s.push(f,h);continue}let L=f-C*k,P=h-M*k,A=f+w*k,I=h+x*k,E=Math.acos(Math.max(-1,Math.min(1,T))),F=Math.min(Ll,Math.PI/2/r),z=Math.ceil(E/F-1e-6),R=e.maxChord&&e.maxChord>0?Math.ceil(k/Math.tan(E/2)*E/e.maxChord):0,H=Math.max(1,Math.min(Fl,Math.max(Math.min(r,z),R)));s.push(L,P);for(let N=1;N<H;N++){let V=N/H,W=1-V;s.push(W*W*L+2*W*V*f+V*V*A,W*W*P+2*W*V*h+V*V*I);}s.push(A,I);}return s.length<6?i:(s.push(s[0],s[1]),s)}var Jo=(i,e,t,o)=>i<=-o||e<=-o||i>=t+o||e>=t+o;var He=i=>i/64;function ot(i,e,t=0){let o=Dn(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=Dn(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Dn(i,e,t){let o=[];for(let r=0;r<i.length-2;r+=2)o.push(i[r],i[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let n=o;o=[];let a=n.length/2;if(a===0)return null;for(let l=0;l<a;l++){let s=n[l*2],c=n[l*2+1],f=n[(l+a-1)%a*2],h=n[(l+a-1)%a*2+1],u=Gn(s,c,r,e,t),d=Gn(f,h,r,e,t);if(u!==d){let m=Rl(f,h,s,c,r,e,t);o.push(f+(s-f)*m,h+(c-h)*m);}u&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Gn(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Rl(i,e,t,o,r,n,a){return r===0?(-a-i)/(t-i):r===1?(n+a-i)/(t-i):r===2?(-a-e)/(o-e):(n+a-e)/(o-e)}function bo(i,e,t,o,r,n=0){let a=-n,l=r+n;return i===a&&t===a||i===l&&t===l||e===a&&o===a||e===l&&o===l}function Nn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,it=4,Kn=65535/it,zl=9,Pl=1,Hl=0,Ol=1,Wl=2;var Un=0,Bl=1,jn=2,Vl=3,Dl=.47;function or(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Dl,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=u=>s(u);let s=u=>{if(l.vertexCount+u<=n)return;n=Math.max(n*2,l.vertexCount+u);let d=new ArrayBuffer(n*Me);new Uint8Array(d).set(l.vertsU8.subarray(0,l.vertOffset)),a=d,l.verts=new DataView(d),l.vertsU8=new Uint8Array(d);};for(let u of i.features()){if(u.type!==3||!pe(t,u.properties))continue;let d=ss(u.properties),m=cs(u.properties,d);if(d<=m)continue;let y=us(u.properties)??Number(u.id??0),p=ls(y>>>0),b=as(p,u.properties),g=is(u.properties,d),v=Ze(u.loadGeometry());for(let _ of v){let S=ot(_,e);if(!S)continue;let C=Nn(S.outer,e),M=(o.cornerRadius??0)/r,w={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0},x=M>0?{outer:Re(S.outer,w),holes:S.holes.map(I=>Re(I,w))}:S,T=x.outer.length/2+x.holes.reduce((I,E)=>I+E.length/2,0);s(T*5+32);let k=x.holes.length||C?null:jl(x.outer),L=k?Zl(u.properties,k,d,p,r):null,P=null,A=[];if(L&&k){let I=$n(es(x.outer,r),k,L.shape);A=ts(I,x.outer);let E=os(I,A);if(E>1e-6){let F=Math.min(Math.max(E*r*Kl,ql),$l);P=rs(I,F/E,d);}}Xn(l,x.outer,m,d,y,b,g,r,e,P);for(let I of x.holes)Xn(l,I,m,d,y,b,g,r,e,null);P?ns(l,A,P,d,y,b,g,r):Ul(l,x.outer,x.holes,d,y,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var rr=(i,e)=>i|e<<2,er=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,Kn)*it)));function rt(i,e,t,o,r,n,a,l,s,c,f=0,h=0,u=0){let d=i.vertOffset;return i.verts.setInt16(d,Math.round(e),true),i.verts.setInt16(d+2,Math.round(t),true),i.verts.setUint16(d+4,Math.round(Math.min(o,Kn)*it),true),i.vertsU8[d+6]=s,i.vertsU8[d+7]=l,i.verts.setInt8(d+8,tr(Math.round(r*127))),i.verts.setInt8(d+9,tr(Math.round(n*127))),i.verts.setInt8(d+10,tr(Math.round(a*127))),i.vertsU8[d+11]=c,i.verts.setUint16(d+12,er(f),true),i.verts.setUint16(d+14,er(h),true),i.verts.setUint16(d+16,er(u),true),i.vertOffset+=Me,i.vertexCount++}function Xn(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let h=rr(Hl,a),u=Nl(e,l),d=o-t,m=new Float64Array(f*2),y=new Uint8Array(f);{let p=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],_=Math.hypot(g,v)||1;p[b*2]=v/_,p[b*2+1]=-g/_;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=p[g*2]*p[b*2]+p[g*2+1]*p[b*2+1],_=p[g*2]+p[b*2],S=p[g*2+1]+p[b*2+1],C=Math.hypot(_,S);v>.5&&C>1e-6&&(m[b*2]=_/C,m[b*2+1]=S/C,y[b]=1);}}for(let p=0;p<f-1;p++){let b=e[p*2],g=e[p*2+1],v=e[p*2+2],_=e[p*2+3];if(b===v&&g===_||bo(b,g,v,_,s))continue;let S=v-b,C=_-g,M=Math.hypot(S,C)||1,w=C/M,x=-S/M,T=u.offset[p],k=u.width[p],L=[0,1];if(c){for(let A=0;A<c.length;A++)for(let I=A+1;I<c.length;I++){let E=Qe(c[A],b,g)-Qe(c[I],b,g),F=Qe(c[A],v,_)-Qe(c[I],v,_);if(E===F)continue;let z=E/(E-F);z>1e-4&&z<1-1e-4&&L.push(z);}L.sort((A,I)=>A-I);}let P=(A,I)=>{if(!c)return o;let E=1/0;for(let F of c)E=Math.min(E,Qe(F,A,I));return Math.max(o,E)};for(let A=0;A+1<L.length;A++){let I=L[A],E=L[A+1];if(E-I<1e-6)continue;let F=b+S*I,z=g+C*I,R=b+S*E,H=g+C*E,N=T+M*I*l,V=T+M*E*l,W=(p+1)%(f-1),D=y[p]?m[p*2]:w,Y=y[p]?m[p*2+1]:x,$=y[W]?m[W*2]:w,ee=y[W]?m[W*2+1]:x,se=w+(D-w)*(1-I),Q=x+(Y-x)*(1-I),U=w+($-w)*E,ce=x+(ee-x)*E,ne=Math.hypot(se,Q)||1,q=Math.hypot(U,ce)||1,j=se/ne,X=Q/ne,de=U/q,ie=ce/q;i.ensure(4);let me=rt(i,F,z,t,j,X,0,0,n,h,N,k,d),re=rt(i,R,H,t,de,ie,0,0,n,h,V,k,d),ge=rt(i,F,z,P(F,z),j,X,0,255,n,h,N,k,d),Ee=rt(i,R,H,P(R,H),de,ie,0,255,n,h,V,k,d);i.indices.push(me,Ee,re,me,ge,Ee),i.featureIds.push(r,r);}}}var Gl=.9976;function Nl(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],h=Math.hypot(c,f);o.push(h>0?{x:c/h,y:f/h,len:h*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Gl,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],h=o[c].len,u=s+1;for(;u<t;){let m=(n+u)%t;if(!r((n+u-1)%t,m))break;f.push(m),h+=o[m].len,u++;}let d=0;for(let m of f)a[m]=d,l[m]=h,d+=o[m].len;s=u;}return {offset:a,width:l}}function Ul(i,e,t,o,r,n,a){let l=[],s=[];for(let u=0;u<e.length;u++)l.push(e[u]);for(let u of t){s.push(l.length/2);for(let d=0;d<u.length;d++)l.push(u[d]);}let c=Yn(l,s.length?s:void 0,2);if(!c.length)return;let f=rr(Ol,a),h=i.vertexCount;for(let u=0;u<l.length;u+=2)rt(i,l[u],l[u+1],o,0,0,1,255,n,f);for(let u=0;u<c.length;u+=3)i.indices.push(h+c[u],h+c[u+2],h+c[u+1]),i.featureIds.push(r);}function jl(i){let e=Xl(i);if(e.length<3)return null;let t=Math.abs(Yl(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,h=-1/0,u=1/0,d=-1/0;for(let _ of e){let S=_.x*l+_.y*s,C=-_.x*s+_.y*l;S<f&&(f=S),S>h&&(h=S),C<u&&(u=C),C>d&&(d=C);}let m=h-f,y=d-u,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+h)/2,g=(u+d)/2,v=m>=y;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?m:y)/2,halfShort:(v?y:m)/2,fill:t/p};}return o}function Xl(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function Yl(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var Kl=Math.tan(30*Math.PI/180),$l=3.5,ql=.9;function Zl(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=Ql(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Ql(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Qe=(i,e,t)=>i.a*e+i.b*t+i.c;function Jl(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,h]=a((l+r-1)%r),u=e*s+t*c+o,d=e*f+t*h+o;if(u<=0!=d<=0){let m=d/(d-u);n.push(f+(s-f)*m,h+(c-h)*m);}u<=0&&n.push(s,c);}return n}function es(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],h=c-l,u=f-s,d=Math.hypot(h,u),m=d>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*u-(i[y*2+1]-s)*h)/d>=t){m=false;break}}m||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function $n(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+1)%l*2],u=i[(s+1)%l*2+1],d=h-c,m=u-f,y=Math.hypot(d,m);if(y<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/y)<.86)continue;let p=-m/y,b=d/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?$n(i,e,"hipped"):a}function ts(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=Jl(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function os(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Qe(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function rs(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function ns(i,e,t,o,r,n,a,l){let s=rr(Wl,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let h=Yn(f,void 0,2);if(!h.length)continue;let u=-t[c].a/l,d=-t[c].b/l,m=Math.hypot(u,d,1),y={x:u/m,y:d/m,z:1/m};i.ensure(f.length/2);let p=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Qe(t[c],f[b],f[b+1]));rt(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<h.length;b+=3)i.indices.push(p+h[b],p+h[b+2],p+h[b+1]),i.featureIds.push(r);}}function is(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Vl:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?jn:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Un:e>=40?jn:Bl}function as(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function ls(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function ss(i){let e=nt(i.render_height)??nt(i.height)??fs(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Pl):zl}function cs(i,e){let t=nt(i.render_min_height)??nt(i.min_height)??nt(i.base)??0;return t>0&&t<e?t:0}function fs(i){let e=nt(i);return e&&e>0?e*3:null}function nt(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var tr=i=>i>127?127:i<-127?-127:i;function us(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}function qn(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Zn(i){let e=[];for(let o of i)e.push(o[0],o[1]);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function Jn(i,e,t=0){if(i.length<2)return i;let o=new Map;for(let n of i){let a=n.lift??0,l=o.get(a);l?l.push(n):o.set(a,[n]);}let r=[];for(let[n,a]of o){if(a.length<2){r.push(...a);continue}let s=(t>0&&e?a.map(h=>({outer:e(h.outer,-t)??h.outer,holes:h.holes.map(u=>e(u,t)??u)})):a).map(h=>[qn(h.outer),...h.holes.map(qn)]),c;try{c=Qn.union(s[0],...s.slice(1));}catch{r.push(...a);continue}let f=c;if(!Array.isArray(f)||f.length===0){r.push(...a);continue}for(let h of f){if(!h.length)continue;let u=Zn(h[0]);if(u.length<8)continue;let d=[];for(let m=1;m<h.length;m++){let y=Zn(h[m]);y.length>=8&&d.push(y);}r.push(n?{outer:u,holes:d,lift:n}:{outer:u,holes:d});}}return r}var at=16,ii=64,ds=0,ms=1,ei=2,ps=3,kt=1,bs=.6;function sr(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),h=new ArrayBuffer(f*at),u={view:new DataView(h),bytes:new Uint8Array(h),offset:0,count:0,indices:[],extent:e,ensure(w){if(u.count+w<=f)return;f=Math.max(f*2,u.count+w);let x=new ArrayBuffer(f*at);new Uint8Array(x).set(u.bytes.subarray(0,u.offset)),h=x,u.view=new DataView(x),u.bytes=new Uint8Array(x);}},d=[],m=new Map;for(let w of i.features()){if(w.type!==3||!pe(t,w.properties))continue;let x=o.liftBy?.(w.properties)??0;for(let T of Ze(w.loadGeometry())){let k=ot(T,e,He(e));k&&d.push(x?{...k,lift:x}:k);}}let y=new Set,p=Math.max(o.weld??bs,0),b=Jn(d,(w,x)=>ir(w,x,e,y),p/r),g=p>0?b.map(w=>({...w,outer:ni(w.outer,p/r,e),holes:w.holes.map(x=>ni(x,p/r,e))})):b;for(let w of g){ti(w.outer,m);for(let x of w.holes)ti(x,m);}o.onShapes?.(g);let v=new Set;for(let[w,x]of m)x>1&&v.add(w);let _=[],S={radius:c,segments:o.cornerSegments,extent:e,margin:He(e),minCutRatio:0,maxChord:Bn/r};for(let w of g){let x=c>0?{outer:Re(w.outer,{...S,keep:oi(w.outer,v)}),holes:w.holes.map(F=>Re(F,{...S,keep:oi(F,v)}))}:w,T=l>0?ir(x.outer,l,e,v):x.outer,k=x.holes.map(F=>l>0?ir(F,-l,e,v):F),L=w.lift??0,P=n+L,A=a+L;ri(u,T??x.outer,k.map((F,z)=>F??x.holes[z]),P);let I=P,E=P-s;T&&l>0&&s>0&&nr(u,T,x.outer,I,E,ms,e,v),E!==A&&nr(u,x.outer,x.outer,E,A,ei,e,v);for(let F of x.holes)if(E!==A&&nr(u,F,F,E,A,ei,e,v),P<A){let z=u.indices.length;ri(u,F,[],A,ps);for(let R=z;R<u.indices.length;R++)_.push(u.indices[R]);u.indices.length=z;}}if(!u.indices.length&&!_.length)return null;let C=u.indices.length,M=new Uint32Array(C+_.length);return M.set(u.indices,0),M.set(_,C),{vertices:h.slice(0,u.offset),indices:M.buffer,vertexCount:u.count,indexCount:M.length,extent:e,capIndexOffset:C}}function lt(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function ti(i,e){for(let t=0;t+3<i.length;t+=2){let o=lt(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function oi(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=lt(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=lt(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function At(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,ys(Math.round(o*ii)),true),i.view.setInt8(s+10,lr(Math.round(r*127))),i.view.setInt8(s+11,lr(Math.round(n*127))),i.view.setInt8(s+12,lr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-kt:e>=i.extent?kt:0),i.view.setInt8(s+15,t<=0?-kt:t>=i.extent?kt:0),i.offset+=at,i.count++}function ri(i,e,t,o,r=ds){let n=[],a=[];for(let c=0;c<e.length;c++)n.push(e[c]);for(let c of t){a.push(n.length/2);for(let f=0;f<c.length;f++)n.push(c[f]);}let l=Yn(n,a.length?a:void 0,2);if(!l.length)return;i.ensure(n.length/2);let s=i.count;for(let c=0;c<n.length;c+=2)At(i,n[c],n[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)i.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function nr(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],h=t[c*2+1],u=t[c*2+2],d=t[c*2+3];if(f===u&&h===d||bo(f,h,u,d,a,He(a))||l.has(lt(f,h,u,d)))continue;let m=u-f,y=d-h,p=Math.hypot(m,y)||1,b=y/p,g=-m/p,v=o-r,_=Math.hypot(e[c*2]-f,e[c*2+1]-h)||0,S=0;if(_>1e-6&&v!==0){let T=1/Math.hypot(1,v/_);S=_/Math.hypot(_,v)*Math.sign(v),b*=T,g*=T;}let C=At(i,e[c*2],e[c*2+1],o,b,g,S,n),M=At(i,e[c*2+2],e[c*2+3],o,b,g,S,n),w=At(i,f,h,r,b,g,S,n),x=At(i,u,d,r,b,g,S,n);i.indices.push(w,M,x,w,C,M);}}}function ir(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let f=0;f<r;f++){let h=i[f*2],u=i[f*2+1],d=i[(f+r-1)%r*2],m=i[(f+r-1)%r*2+1],y=i[(f+1)%r*2],p=i[(f+1)%r*2+1],b=Math.hypot(h-d,u-m)||1,g=Math.hypot(y-h,p-u)||1,v=(u-m)/b,_=-(h-d)/b,S=(p-u)/g,C=-(y-h)/g,M=v+S,w=_+C,x=Math.hypot(M,w);if(x<1e-6){n.push(h,u);continue}M/=x,w/=x;let T=Math.min(1/Math.max(M*v+w*_,.35),3),k=h-M*e*T,L=u-w*e*T,P=lt(d,m,h,u),A=lt(h,u,y,p);if(o.has(P)||o.has(A)){n.push(h,u);continue}let I=-He(t),E=t+He(t),F=(z,R)=>z<=I||z>=E||R<=I||R>=E;(F(h,u)||F(d,m)||F(y,p))&&(k=h,L=u),n.push(k,L);}n.push(n[0],n[1]);let a=Math.abs(ar(i)),l=ar(n);if(Math.sign(l)!==Math.sign(ar(i))||Math.abs(l)<a*.25)return null;let s=-He(t),c=t+He(t);for(let f=0;f<n.length;f+=2)n[f]=Math.max(s,Math.min(c,n[f])),n[f+1]=Math.max(s,Math.min(c,n[f+1]));return n}function ar(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var lr=i=>i>127?127:i<-127?-127:i,ys=i=>i>32767?32767:i<-32768?-32768:i;function ni(i,e,t){if(!(e>0))return i;let o=He(t),r=-o,n=t+o,a=i;for(let l=0;l<3;l++){let s=a.length/2-1;if(s<6)break;let c=new Array(s).fill(true),f=s;for(let u=0;u<s&&!(f<=5);u++){let d=a[u*2],m=a[u*2+1];if(d<=r||d>=n||m<=r||m>=n)continue;let y=(u+s-1)%s;for(;!c[y]&&y!==u;)y=(y+s-1)%s;let p=(u+1)%s;for(;!c[p]&&p!==u;)p=(p+1)%s;if(y===u||p===u)break;let b=a[y*2],g=a[y*2+1],v=a[p*2]-b,_=a[p*2+1]-g,S=Math.hypot(v,_);S<1e-6||Math.abs((d-b)*_-(m-g)*v)/S<e&&(c[u]=false,f--);}if(f===s)break;let h=[];for(let u=0;u<s;u++)c[u]&&h.push(a[u*2],a[u*2+1]);h.push(h[0],h[1]),a=h;}return a}var Ge=4;function vs(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,h)=>{let u=i.length/2;return i.push((l(f)+l(h))/2,(s(f)+s(h))/2),u};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let h=0;for(;a.length&&!(++h>2e4);){let[u,d,m]=a.pop(),y=(l(u)-l(d))**2+(s(u)-s(d))**2,p=(l(d)-l(m))**2+(s(d)-s(m))**2,b=(l(m)-l(u))**2+(s(m)-s(u))**2,g=Math.max(y,p,b);if(g<=n){r.push(u,d,m);continue}if(g===y){let v=c(u,d);a.push([u,v,m],[v,d,m]);}else if(g===p){let v=c(d,m);a.push([d,v,u],[v,m,u]);}else {let v=c(m,u);a.push([m,v,d],[v,u,d]);}}}}function cr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let d of i.features()){if(d.type!==3||!pe(e,d.properties))continue;let m=d.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(d.id??0);for(let b of Ze(d.loadGeometry())){let g=r?ot(b,n):b;if(!g)continue;let v=[],_=[],S=o?Re(g.outer,o):g.outer;for(let w=0;w<S.length;w++)v.push(S[w]);for(let w of g.holes){let x=o?Re(w,o):w;_.push(v.length/2);for(let T=0;T<x.length;T++)v.push(x[T]);}let C=Yn(v,_.length?_:void 0,2);if(!C.length)continue;let M=a.length/2;for(let w=0;w<v.length;w++)a.push(v[w]);if(t>0){let w=[];vs(a,C,M,t,w);for(let x=0;x<w.length;x+=3)l.push(w[x],w[x+2],w[x+1]),s.push(p);continue}for(let w=0;w<C.length;w+=3)l.push(M+C[w],M+C[w+2],M+C[w+1]),s.push(p);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),h=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:h.buffer,vertexCount:c,indexCount:h.length}}var ws=100;function fr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function ur(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function xs(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=st(Math.floor(o.minX/e)),n=st(Math.floor(o.maxX/e)),a=st(Math.floor(o.minY/e)),l=st(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var li=i=>i.shapes.length===0;function yo(i,e,t){!i.cells.length&&i.shapes.length&&xs(i);let o=i.extent/32,r=i.cells[st(Math.floor(t/o))*32+st(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!ai(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(ai(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function hr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=yo(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],h=e[l+3],u=yo(i,f,h);if(u!==a&&n>0){let d=Math.hypot(f-s,h-c),m=Math.min(Math.ceil(d/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(h-c)*b,_=yo(i,g,v);_!==y&&(t.push(g,v),o.push(_),y=_);}}t.push(f,h),o.push(u),a=u;}return {pts:t,levels:o}}var st=i=>i<0?0:i>31?31:i;function ai(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var Ne=20;function mr(i,e,t=0,o,r=0){let n=Math.max(256,i.length*24),a=new ArrayBuffer(n*Ne),l=new DataView(a),s=0,c=[],f=p=>{if(s+p<=n)return;n=Math.max(n*2,s+p);let b=new ArrayBuffer(n*Ne);new Uint8Array(b).set(new Uint8Array(a,0,s*Ne)),a=b,l=new DataView(b);},h=(p,b,g,v,_,S,C,M=0,w=0,x=0)=>{let T=s*Ne;return l.setInt16(T,p,true),l.setInt16(T+2,b,true),l.setInt16(T+4,g,true),l.setInt16(T+6,v,true),l.setInt8(T+8,_),l.setInt8(T+9,S),l.setInt8(T+10,M),l.setInt8(T+11,w),l.setFloat32(T+12,C,true),l.setFloat32(T+16,x,true),s++},u=0,d=r>0?12/r:0,m=d>0?Ms(i):null;for(let p of i.features()){if(p.type!==2&&p.type!==3||!pe(e,p.properties))continue;let b=p.properties.width;u=typeof b=="number"&&b>.5&&b<100?b:0;let g=p.type===3;for(let v of p.loadGeometry()){let _=t>0?_s(si(v),t):si(v);if(_.length<4)continue;let S=o&&!li(o)?hr(o,_):null,C=S?S.pts:_,M=S?.levels,w=C.length/2;if(w<2)continue;let x=null;if(m&&u>0&&!g){let k=0;for(let F=0;F<w-1;F++)k+=Math.hypot(C[F*2+2]-C[F*2],C[F*2+3]-C[F*2+1]);let L=m.get(dr(Math.round(C[0]),Math.round(C[1])))??0,P=m.get(dr(Math.round(C[w*2-2]),Math.round(C[w*2-1])))??0,A=L-u,I=P-u,E=Math.min(d,k/2);E>0&&(A>0||I>0)&&(x=F=>{let z=0;return A>0&&F<E&&(z=A*(1-F/E)),I>0&&k-F<E&&(z=Math.max(z,I*(1-(k-F)/E))),u+z});}f((w-1)*4);let T=0;for(let k=0;k<w-1;k++){let L=C[k*2],P=C[k*2+1],A=C[k*2+2],I=C[k*2+3],E=Math.hypot(A-L,I-P);if(g&&Ss(L,P,A,I,i.extent)){T+=E;continue}let F=Cs(L,P,A,I,i.extent);if(!F){T+=E;continue}let[z,R,H,N]=F,V=Math.hypot(z-L,R-P),W=Math.hypot(H-z,N-R),D=Math.hypot(A-H,I-N),Y=T+V,$=M?M[k]:0,ee=M?M[k+1]:0,se=x?x(Y):u,Q=x?x(Y+W):u,U=h(z,R,H,N,0,-1,Y,$,ee,se),ce=h(z,R,H,N,0,1,Y,$,ee,se),ne=h(z,R,H,N,1,1,Y,$,ee,Q),q=h(z,R,H,N,1,-1,Y,$,ee,Q);T+=V+W+D,c.push(U,ce,ne,U,ne,q);}}}if(!c.length)return null;let y=new Uint32Array(c);return {vertices:a.slice(0,s*Ne),indices:y.buffer,vertexCount:s,indexCount:y.length}}function _s(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function si(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function Cs(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,h]of c){if(f===0){if(h<0)return null;continue}let u=h/f;if(f<0){if(u>s)return null;u>l&&(l=u);}else {if(u<l)return null;u<s&&(s=u);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function Ss(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var ci=new WeakMap,dr=(i,e)=>(i+512)*65536+(e+512);function Ms(i){let e=ci.get(i);if(e)return e;let t=new Map,o=(r,n,a)=>{let l=dr(Math.round(r),Math.round(n)),s=t.get(l);(s===void 0||a>s)&&t.set(l,a);};for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width;if(!(typeof n!="number"||!(n>.5)||!(n<100)))for(let a of r.loadGeometry())a.length<4||(o(a[0],a[1],n),o(a[a.length-2],a[a.length-1],n));}return ci.set(i,t),t}var pr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},br={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var fi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var ui={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var hi={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-ramp",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var di={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var mi={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:"#22262f"},"road-casing-minor":{color:"#1e222a"},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:"#2f343d"},"road-secondary":{color:"#3c424d"},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var pi={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:"#d2d2d2"},"road-casing-minor":{color:"#d8d8d8"},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:"#f7f7f7"},"road-secondary":{color:"#fbfbfb"},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var bi={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:"#eceae2"},"road-casing-minor":{color:"#efedE6"},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:"#fdfcfa"},"road-secondary":{color:"#ffffff"},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var yi={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#f0ecea",light:{ambientColor:"#f8f8f8",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#f4f2f1"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#e0dddc"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:"#9da7be"},"road-casing-minor":{color:"#9da7be"},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:"#bbc1d3"},"road-secondary":{color:"#bbc1d3"},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ede7de",roofColor:"#ede7de",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var gi={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:"#5a6faf"},"road-casing-minor":{color:"#5a6faf"},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffffff"},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var vi={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:"#6a1b6a"},"road-casing-minor":{color:"#6a1b6a"},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:"#12e2e2"},"road-secondary":{color:"#12e2e2"},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var wi={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:"#a6afc9"},"road-casing-minor":{color:"#a6afc9"},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:"#c3c9df"},"road-secondary":{color:"#c3c9df"},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var xi={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:"#7078a4"},"road-casing-minor":{color:"#7078a4"},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:"#8f94b7"},"road-secondary":{color:"#8f94b7"},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var _i={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:"#a79376"},"road-casing-minor":{color:"#a79376"},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:"#c6bba9"},"road-secondary":{color:"#c6bba9"},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Ci={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:"#185662"},"road-casing-minor":{color:"#185662"},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:"#22b6c3"},"road-secondary":{color:"#22b6c3"},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var Si={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:"#d5cdb8"},"road-casing-minor":{color:"#cad1d8"},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#fbf6ea"},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Mi={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:"#bdcfdb"},"road-casing-minor":{color:"#bdcfdb"},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:"#d6e2eb"},"road-secondary":{color:"#d6e2eb"},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ti={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:"#383838"},"road-casing-minor":{color:"#383838"},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:"#525252"},"road-secondary":{color:"#525252"},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var Ei={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:"#80a1c6"},"road-casing-minor":{color:"#80a1c6"},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:"#b0c5dd"},"road-secondary":{color:"#b0c5dd"},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var ki={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:"#7fbd7f"},"road-casing-minor":{color:"#7fbd7f"},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:"#afd4af"},"road-secondary":{color:"#afd4af"},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Ai={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:"#848b9a"},"road-casing-minor":{color:"#848b9a"},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:"#acb0b9"},"road-secondary":{color:"#acb0b9"},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Li={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:"#abb0ba"},"road-casing-minor":{color:"#abb0ba"},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:"#c7cad1"},"road-secondary":{color:"#c7cad1"},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Ii={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:"#b8b8b8"},"road-casing-minor":{color:"#b8b8b8"},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:"#d1d1d1"},"road-secondary":{color:"#d1d1d1"},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Fi={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:"#8ab2c7"},"road-casing-minor":{color:"#8ab2c7"},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:"#b8d3e0"},"road-secondary":{color:"#b8d3e0"},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Ri={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:"#423b2e"},"road-casing-minor":{color:"#423b2e"},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:"#5e5645"},"road-secondary":{color:"#5e5645"},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var zi={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:"#766b60"},"road-casing-minor":{color:"#766b60"},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:"#9c948b"},"road-secondary":{color:"#9c948b"},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Pi={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:"#3a2060"},"road-casing-minor":{color:"#3a2060"},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:"#6b35b6"},"road-secondary":{color:"#6b35b6"},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Hi={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:"#712b14"},"road-casing-minor":{color:"#712b14"},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:"#e65e19"},"road-secondary":{color:"#e65e19"},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Oi={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:"#a3adc2"},"road-casing-minor":{color:"#a3adc2"},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:"#bfc6d9"},"road-secondary":{color:"#bfc6d9"},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Wi={"3d":yi,cartoon:gi,cyberpunk:vi,dawn:wi,dusk:xi,earth:_i,future:Ci,"glass-refined":Si,glass:Mi,"harmony-black":Ti,"harmony-blue":Ei,"harmony-green":ki,lunar:Ai,matte:Li,minimal:Ii,ocean:Fi,premium:Ri,realistic:zi,space:Pi,volcano:Hi,white:Oi};function go(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var K="base",Bi="\u241F",ct=(i,e)=>i+"\u241F"+String(e);var ft=class{constructor(e=yr){this.splitValues={};this.spec=e,this.light={...br,...e.light??{}},this.sky={...pr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return fe(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let r=e.paint;return ke(r?.color,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=K){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??K)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??K))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:ct(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},yr=fi,ec=ui,tc=hi,oc=di,ut={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:mi,mono:pi,pale:bi,...Wi};function vo(i,e=yr){if(typeof i!="string")return go(e,i);if(i==="day")return e;let t=ut[i];return t?go(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(ut).join(", ")}`),e)}var Lt=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),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_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function Vi(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var It=`
9
9
  uniform vec3 u_ambient_color;
10
10
  uniform float u_ambient_intensity;
11
11
  uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u0441\u0432\u0435\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430
@@ -68,7 +68,7 @@ vec3 applyLightWithFactor(vec3 albedo, vec3 normal, float keyFactor) {
68
68
  vec3 applyLight(vec3 albedo, vec3 normal) {
69
69
  return applyLightWithFactor(albedo, normal, max(dot(normal, -u_key_dir), 0.0));
70
70
  }
71
- `,vo=`
71
+ `,wo=`
72
72
  // \u0423 \u0441\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u0441\u044D\u043C\u043F\u043B\u0435\u0440\u0430 \u0432 GLSL ES 3.00 \u041D\u0415\u0422 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E (\u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435
73
73
  // \u043E\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E sampler2D \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435) \u2014 \u0431\u0435\u0437 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438 \u0448\u0435\u0439\u0434\u0435\u0440 \u043D\u0435 \u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u0442\u0441\u044F.
74
74
  precision highp sampler2DShadow;
@@ -129,7 +129,7 @@ float shadowOcclusion(float ndotl) {
129
129
 
130
130
  return (1.0 - lit * 0.25) * u_shadow_params.x;
131
131
  }
132
- `,pr=`
132
+ `,gr=`
133
133
  uniform int u_material; // 0 \u2014 \u043D\u0435\u0442, 1 \u0432\u043E\u0434\u0430, 2 \u0437\u0435\u043B\u0435\u043D\u044C, 3 \u043F\u0435\u0441\u043E\u043A, 4 \u0430\u0441\u0444\u0430\u043B\u044C\u0442
134
134
  uniform vec4 u_material_params; // x: \u0441\u0438\u043B\u0430, y: \u043C\u0430\u0441\u0448\u0442\u0430\u0431 (\u043C), z: \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C, w: \u0432\u0440\u0435\u043C\u044F (\u0441)
135
135
 
@@ -238,7 +238,7 @@ vec3 applyMaterial(vec3 color, vec2 world) {
238
238
 
239
239
  return mix(color, shaded, strength);
240
240
  }
241
- `,zi=`
241
+ `,Di=`
242
242
  uniform vec4 u_globe; // x: \u0432\u043A\u043B, y: \u0434\u043E\u043B\u044F \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B, z: \u0440\u0430\u0434\u0438\u0443\u0441, w: worldSize
243
243
  uniform vec2 u_globe_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0440\u0442\u044B \u0432 \u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u043C \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0435
244
244
  uniform vec4 u_globe_cam; // xyz: \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0443 \u043E\u0442 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430, w: \u043A\u043E\u0441\u0438\u043D\u0443\u0441 \u0443\u0433\u043B\u0430 \u0434\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430
@@ -291,7 +291,7 @@ vec3 globeLocal(vec2 tilePos) {
291
291
 
292
292
  return mix(sphere, flat_pos, u_globe.y);
293
293
  }
294
- `,Ri=`#version 300 es
294
+ `,Gi=`#version 300 es
295
295
  precision highp float;
296
296
 
297
297
  in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
@@ -315,7 +315,7 @@ void main() {
315
315
  vec3 n = u_globe_basis * unit;
316
316
  v_rim = 1.0 - clamp(n.z, 0.0, 1.0);
317
317
  }
318
- `,Hi=`#version 300 es
318
+ `,Ni=`#version 300 es
319
319
  precision highp float;
320
320
 
321
321
  in float v_rim;
@@ -331,17 +331,17 @@ void main() {
331
331
  float rim = pow(v_rim, 6.0) * u_atmo_strength;
332
332
  fragColor = vec4(mix(u_body_color, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
333
333
  }
334
- `,Pi=`#version 300 es
334
+ `,Ui=`#version 300 es
335
335
  precision highp float;
336
336
  in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
337
337
  uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
338
338
  void main() {
339
339
  gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
340
340
  }
341
- `,Oi=`#version 300 es
341
+ `,ji=`#version 300 es
342
342
  precision highp float;
343
343
  void main() {}
344
- `,Wi=`#version 300 es
344
+ `,Xi=`#version 300 es
345
345
  precision highp float;
346
346
  in vec2 a_pos;
347
347
  in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 4, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439
@@ -350,10 +350,10 @@ uniform float u_height_scale;
350
350
  void main() {
351
351
  gl_Position = u_matrix * vec4(a_pos, (a_height / 4.0) * u_height_scale, 1.0);
352
352
  }
353
- `,br=`#version 300 es
353
+ `,vr=`#version 300 es
354
354
  precision highp float;
355
355
  void main() {}
356
- `,Ne=`
356
+ `,Ue=`
357
357
  uniform vec3 u_fog_color;
358
358
  uniform vec3 u_fog_range; // x: \u043D\u0430\u0447\u0430\u043B\u043E, y: \u043A\u043E\u043D\u0435\u0446 (\u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438), z: \u043F\u0440\u0435\u0434\u0435\u043B \u0441\u0438\u043B\u044B
359
359
 
@@ -376,7 +376,7 @@ vec4 applyFogPremultiplied(vec4 color) {
376
376
  vec3 applyFog(vec3 color) {
377
377
  return mix(color, u_fog_color, fogAmount());
378
378
  }
379
- `,Vi=`#version 300 es
379
+ `,Yi=`#version 300 es
380
380
  precision highp float;
381
381
 
382
382
  in vec3 a_pos;
@@ -449,7 +449,7 @@ void main() {
449
449
  // \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0436\u0435 \u0433\u043E\u0434\u0438\u0442\u0441\u044F \u0438 \u0434\u043B\u044F \u0432\u0435\u043A\u0442\u043E\u0440\u0430 \u0432\u0437\u0433\u043B\u044F\u0434\u0430.
450
450
  v_view = u_normal_matrix * (u_camera_model - a_pos);
451
451
  }
452
- `,Bi=`#version 300 es
452
+ `,Ki=`#version 300 es
453
453
  precision highp float;
454
454
 
455
455
  in vec3 a_pos;
@@ -513,12 +513,12 @@ void main() {
513
513
  v_nmodel = a_normal;
514
514
  v_view = n * (u_camera_model - a_pos);
515
515
  }
516
- `,yr=`#version 300 es
516
+ `,wr=`#version 300 es
517
517
  precision highp float;
518
518
 
519
519
  ${It}
520
- ${vo}
521
- ${Ne}
520
+ ${wo}
521
+ ${Ue}
522
522
 
523
523
  in vec3 v_normal;
524
524
  in vec2 v_tex;
@@ -797,14 +797,14 @@ void main() {
797
797
  float alpha = albedo.a * u_opacity;
798
798
  fragColor = vec4(applyFog(color) * alpha, alpha);
799
799
  }
800
- `,Di=`#version 300 es
800
+ `,$i=`#version 300 es
801
801
  precision highp float;
802
802
  in vec3 a_pos;
803
803
  uniform mat4 u_matrix;
804
804
  void main() {
805
805
  gl_Position = u_matrix * vec4(a_pos, 1.0);
806
806
  }
807
- `,Gi=`#version 300 es
807
+ `,qi=`#version 300 es
808
808
  precision highp float;
809
809
  in vec2 a_pos; // 0..1, \u0442\u043E\u0442 \u0436\u0435 \u043A\u0432\u0430\u0434\u0440\u0430\u0442, \u0447\u0442\u043E \u0443 \u0442\u0435\u043D\u0438 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435
810
810
 
@@ -823,7 +823,7 @@ void main() {
823
823
  v_ray = mix(mix(u_ray_bl, u_ray_br, a_pos.x), mix(u_ray_tl, u_ray_tr, a_pos.x), a_pos.y);
824
824
  gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
825
825
  }
826
- `,Ni=`#version 300 es
826
+ `,Zi=`#version 300 es
827
827
  precision highp float;
828
828
 
829
829
  in vec2 v_uv;
@@ -912,7 +912,7 @@ void main() {
912
912
 
913
913
  fragColor = vec4(sky * alpha, alpha);
914
914
  }
915
- `,Ui=`#version 300 es
915
+ `,Qi=`#version 300 es
916
916
  precision highp float;
917
917
 
918
918
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
@@ -930,10 +930,10 @@ void main() {
930
930
  v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
931
931
  gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
932
932
  }
933
- `,ji=`#version 300 es
933
+ `,Ji=`#version 300 es
934
934
  precision highp float;
935
935
 
936
- ${Ne}
936
+ ${Ue}
937
937
 
938
938
  in vec2 v_uv;
939
939
 
@@ -948,7 +948,7 @@ void main() {
948
948
  // \u043A\u0430\u043C\u0435\u0440\u0435 \u0434\u0430\u043B\u0451\u043A\u0438\u0439 \u0440\u0430\u0441\u0442\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0451\u0442\u043A\u0438\u043C \u0442\u0430\u043C, \u0433\u0434\u0435 \u0432\u0441\u0451 \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u0443\u0436\u0435 \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E.
949
949
  fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
950
950
  }
951
- `,Xi=`#version 300 es
951
+ `,ea=`#version 300 es
952
952
  precision highp float;
953
953
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
954
954
  uniform mat4 u_matrix;
@@ -959,11 +959,11 @@ void main() {
959
959
  gl_Position = u_matrix * local;
960
960
  v_shadow = u_shadow_matrix * local;
961
961
  }
962
- `,Yi=`#version 300 es
962
+ `,ta=`#version 300 es
963
963
  precision highp float;
964
964
 
965
- ${vo}
966
- ${Ne}
965
+ ${wo}
966
+ ${Ue}
967
967
 
968
968
  uniform vec3 u_shadow_ground; // \u0432\u043E \u0447\u0442\u043E \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u0439 \u0446\u0432\u0435\u0442 \u0432 \u0442\u0435\u043D\u0438
969
969
  uniform float u_ground_ndotl; // \u0441\u0438\u043D\u0443\u0441 \u0432\u044B\u0441\u043E\u0442\u044B \u0441\u043E\u043B\u043D\u0446\u0430: \u0437\u0435\u043C\u043B\u044F \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430
@@ -975,10 +975,10 @@ void main() {
975
975
  float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
976
976
  fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
977
977
  }
978
- `,Ki=`#version 300 es
978
+ `,oa=`#version 300 es
979
979
  precision highp float;
980
980
 
981
- ${zi}
981
+ ${Di}
982
982
 
983
983
  in vec2 a_pos;
984
984
  uniform mat4 u_matrix;
@@ -1000,12 +1000,12 @@ void main() {
1000
1000
  // \u043D\u0435 \u043F\u043E\u043F\u0430\u0434\u0430\u043B \u2014 \u0443 \u043B\u0438\u043D\u0438\u0439 \u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u043D\u043E, \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0437\u0430\u0431\u044B\u043B\u043E\u0441\u044C.
1001
1001
  v_world = u_world_origin + a_pos * u_meters_per_unit;
1002
1002
  }
1003
- `,$i=`#version 300 es
1003
+ `,ra=`#version 300 es
1004
1004
  precision highp float;
1005
1005
 
1006
- ${Ne}
1006
+ ${Ue}
1007
1007
  ${It}
1008
- ${pr}
1008
+ ${gr}
1009
1009
 
1010
1010
  in vec2 v_world;
1011
1011
 
@@ -1022,10 +1022,10 @@ void main() {
1022
1022
  if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
1023
1023
  fragColor = applyFogPremultiplied(c);
1024
1024
  }
1025
- `,qi=`#version 300 es
1025
+ `,na=`#version 300 es
1026
1026
  precision highp float;
1027
1027
 
1028
- ${zi}
1028
+ ${Di}
1029
1029
 
1030
1030
  in vec2 a_p0; // \u043D\u0430\u0447\u0430\u043B\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 (\u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0443 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043D \u043A\u0430\u043F\u0441\u0443\u043B\u044B)
1031
1031
  in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
@@ -1143,12 +1143,12 @@ void main() {
1143
1143
  v_dist0 = a_dist * u_tile_to_px;
1144
1144
  v_seg_len = len * u_tile_to_px;
1145
1145
  }
1146
- `,Zi=`#version 300 es
1146
+ `,ia=`#version 300 es
1147
1147
  precision highp float;
1148
1148
 
1149
- ${Ne}
1149
+ ${Ue}
1150
1150
  ${It}
1151
- ${pr}
1151
+ ${gr}
1152
1152
 
1153
1153
  in vec2 v_pos;
1154
1154
  in vec2 v_p0;
@@ -1399,7 +1399,7 @@ void main() {
1399
1399
  if (alpha <= 0.003) discard;
1400
1400
  fragColor = applyFogPremultiplied(color) * alpha;
1401
1401
  }
1402
- `,Qi=`#version 300 es
1402
+ `,aa=`#version 300 es
1403
1403
  precision highp float;
1404
1404
 
1405
1405
  in vec2 a_pos; // \u0442\u043E\u0447\u043A\u0430 \u043E\u0441\u0438, \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440
@@ -1433,10 +1433,10 @@ void main() {
1433
1433
  v_half = u_half_width;
1434
1434
  v_dist = a_dist * u_units_to_px;
1435
1435
  }
1436
- `,Ji=`#version 300 es
1436
+ `,la=`#version 300 es
1437
1437
  precision highp float;
1438
1438
 
1439
- ${Ne}
1439
+ ${Ue}
1440
1440
 
1441
1441
  in float v_side;
1442
1442
  in float v_outset;
@@ -1482,7 +1482,7 @@ void main() {
1482
1482
  if (alpha <= 0.003) discard;
1483
1483
  fragColor = applyFogPremultiplied(color) * alpha;
1484
1484
  }
1485
- `,ea=`#version 300 es
1485
+ `,sa=`#version 300 es
1486
1486
  precision highp float;
1487
1487
 
1488
1488
  in vec2 a_pos;
@@ -1524,7 +1524,7 @@ void main() {
1524
1524
  v_up = h;
1525
1525
  v_wall = a_wall / 4.0;
1526
1526
  }
1527
- `,Ys=`
1527
+ `,rc=`
1528
1528
  uniform float u_facade_detail; // 0 \u2014 \u0433\u043B\u0430\u0434\u043A\u0438\u0435 \u0441\u0442\u0435\u043D\u044B, 1 \u2014 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0438\u0441\u0443\u043D\u043E\u043A
1529
1529
  uniform vec3 u_window_color;
1530
1530
  uniform vec3 u_window_frame;
@@ -1689,13 +1689,13 @@ vec3 roofHue(vec3 base, float seed) {
1689
1689
  float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
1690
1690
  return hue * (baseLum / hueLum);
1691
1691
  }
1692
- `,ta=`#version 300 es
1692
+ `,ca=`#version 300 es
1693
1693
  precision highp float;
1694
1694
 
1695
1695
  ${It}
1696
- ${vo}
1697
- ${Ne}
1698
- ${Ys}
1696
+ ${wo}
1697
+ ${Ue}
1698
+ ${rc}
1699
1699
 
1700
1700
  in vec3 v_normal;
1701
1701
  in float v_ao;
@@ -1774,7 +1774,7 @@ void main() {
1774
1774
  float alpha = u_opacity * u_wall_color.a;
1775
1775
  fragColor = vec4(applyFog(color) * alpha, alpha);
1776
1776
  }
1777
- `,oa=`#version 300 es
1777
+ `,fa=`#version 300 es
1778
1778
  precision highp float;
1779
1779
 
1780
1780
  in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430, \u0414\u0420\u041E\u0411\u041D\u042B\u0415 (\u0441\u043C. generators/surface.ts)
@@ -1814,13 +1814,13 @@ void main() {
1814
1814
  v_world = u_world_origin + pos * u_meters_per_unit;
1815
1815
  v_shadow = u_shadow_matrix * local;
1816
1816
  }
1817
- `,ra=`#version 300 es
1817
+ `,ua=`#version 300 es
1818
1818
  precision highp float;
1819
1819
 
1820
1820
  ${It}
1821
- ${vo}
1822
- ${Ne}
1823
- ${pr}
1821
+ ${wo}
1822
+ ${Ue}
1823
+ ${gr}
1824
1824
 
1825
1825
  in vec3 v_normal;
1826
1826
  in float v_kind; // 0 \u0432\u0435\u0440\u0445, 1 \u0431\u043E\u0440\u0442, 2 \u044E\u0431\u043A\u0430, 3 \u043A\u0440\u044B\u0448\u043A\u0430 \u043E\u0441\u0442\u0440\u043E\u0432\u0430
@@ -1869,7 +1869,7 @@ void main() {
1869
1869
 
1870
1870
  fragColor = vec4(applyFog(color) * alpha, alpha);
1871
1871
  }
1872
- `,na=`#version 300 es
1872
+ `,ha=`#version 300 es
1873
1873
  precision highp float;
1874
1874
 
1875
1875
  in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
@@ -1899,7 +1899,7 @@ void main() {
1899
1899
  v_scale = a_scale;
1900
1900
  v_fade = a_fade;
1901
1901
  }
1902
- `,ia=`#version 300 es
1902
+ `,da=`#version 300 es
1903
1903
  precision highp float;
1904
1904
 
1905
1905
  in vec2 v_tex;
@@ -1949,6 +1949,6 @@ void main() {
1949
1949
  if (color.a <= 0.001) discard;
1950
1950
  fragColor = color;
1951
1951
  }
1952
- `;var wo=i=>i.kind==="symbol",aa=i=>i.kind==="placement";function Pe(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],h=r[n+5];if(Ks(e,t,a,l,s,c,f,h)||o>0&&(gr(e,t,a,l,s,c)<=o||gr(e,t,s,c,f,h)<=o||gr(e,t,f,h,a,l)<=o))return true}return false}function Ks(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}function gr(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function vr(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*De;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function wr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var qs={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Zs=40,Qs=10.5,la=2.5,Js=16,ec=4,tc=7,Et=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(w=>w.type==="symbol"&&w.layout?.placement==="map"&&r.layerVisibleAt(w,c));if(!f.length)return;let h=t.center,u=ee(h.lng),d=te(h.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let S=o.get(w.source??Y);if(!S)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let x=m*1.5,T=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,E=V(w.layout?.arrowLength,c,Zs)*T,k=V(w.layout?.arrowWidth,c,Qs)*T,F=V(w.layout?.arrowOutline,c,la)*T,L=V(w.layout?.arrowGap,c,Js)*T,I=V(w.layout?.arrowDotRadius,c,ec)*T,A=V(w.layout?.arrowDotGap,c,tc)*T,R=_r(E,k,I,L-A),P=F>0?_r(E,k,I,L-A,F).outline:null,z={layer:w,verts:[],shape:R};for(let O of S.visibleTiles){let W=S.getTile(O)?.data?.buckets?.[_];if(!W||!wo(W))continue;let B=new Int16Array(W.anchors),D=W.rotations?new Int16Array(W.rotations):null,K=O.bounds(),$=(K.maxX-K.minX)/W.extent,oe=K.minX,ye=K.minY;for(let J=0;J<B.length/2;J++){let X=oe+B[J*2]*$,me=ye+B[J*2+1]*$;if(M&&!Pe(this.highlightFootprint,X,me,x))continue;let pe=(D?D[J]:0)*Math.PI/180,Z=Math.sin(pe),U=-Math.cos(pe),j=X-u-Z*L,fe=me-d-U*L;P&&Cr(z,P,j,fe,Z,U),Cr(z,R.outline,j,fe,Z,U),this.count++;}}z.verts.length&&y.push(z);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let S=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:S,count:w.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,p,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(u,d,0)),n.setMat4("u_matrix",t.objectMatrix(u,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let w of v){let S=w.layer.paint,_=V(S.opacity,c,1),M=ke(S.color,c,[.18,.45,.76,1]),x=ke(S.haloColor,c,[1,1,1,1]),C=V(w.layer.layout?.arrowOutline,c,la)>0;oc(e,n,w,x,M,_,C,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new be(e,new Uint8Array(this.capacity*n*8),qs,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new se(e,a),this.vao=new ae(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function oc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)sa(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)sa(i,t.first+c,l);}function sa(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var ca=4,xr=12;function _r(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,h=[],u=(b,g)=>h.push(b,g);u(0,0),u(-n,a),u(-n+l,c),u(f,s);for(let b=1;b<ca;b++){let g=b/ca*Math.PI;u(f-Math.sin(g)*s,Math.cos(g)*s);}u(f,-s),u(-n+l,-c),u(-n,-a);let d=r>0?rc(h,r):h,m=Un(h,void 0,2);if(t<=0)return {outline:d,indices:m};let y=d.length/2,p=t+r;for(let b=0;b<xr;b++){let g=b/xr*Math.PI*2;d.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<xr-1;b++)m.push(y,y+b,y+b+1);return {outline:d,indices:m}}function rc(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],h=i[(a+1)%t*2],u=i[(a+1)%t*2+1],d=Math.hypot(c-l,f-s)||1,m=Math.hypot(h-c,u-f)||1,y=r*(f-s)/d,p=-r*(c-l)/d,b=r*(u-f)/m,g=-r*(h-c)/m,v=y+b,w=p+g,S=Math.hypot(v,w);if(S<1e-9){n.push(c,f);continue}v/=S,w/=S;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function Cr(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function nc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Cr(s,_r(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var ic=5;function fa(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var xo=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let h=a.get(f.source);if(!h)continue;let u=V(f.paint?.opacity,l,1);if(!(u<=.001)){r.setFloat("u_opacity",u),o.bind();for(let d of h.visibleTiles){let m=this.patchFor(e,h,d);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=ic&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:fa(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var ac="indoor-",Ft=class{constructor(){this.parts=null;this.stamp="";this.cache=new H;this.box=null;this.hidden=new Q;this.collected=new Q;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let u of t.layers){if(!u.id.startsWith(ac)||u.type!=="fill"||!t.layerVisibleAt(u,o))continue;let d=t.bucketKeyFor(u);d&&(r.push(d),n??(n=e.get(u.source??Y)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(u=>u.dataKey+(n.getTile(u)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,h=-1/0;for(let u of n.visibleTiles){let d=n.getTile(u)?.data?.buckets;if(d)for(let m of r){let y=d[m];if(!y||y.kind!=="fill")continue;let p=vr(y,u);l.push(p);for(let b=0;b<p.length;b+=2)p[b]<s&&(s=p[b]),p[b]>f&&(f=p[b]),p[b+1]<c&&(c=p[b+1]),p[b+1]>h&&(h=p[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,h]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new H;for(let h=0;h*3<r.length;h++){let u=n[h];if(this.hidden.has(u))continue;let d=f.get(u);d||f.set(u,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[h*3+m]*Me,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<d[0]&&(d[0]=p),b<d[1]&&(d[1]=b),p>d[2]&&(d[2]=p),b>d[3]&&(d[3]=b);}}for(let[h,u]of f){let d=l.minX+(u[0]+u[2])/2*s,m=l.minY+(u[1]+u[3])/2*s;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||Pe(o,d,m,0)&&this.hidden.add(h);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),h=new Float64Array(s.featureIds),u=[];for(let d=0;d*3<f.length;d++)this.hidden.has(h[d])||u.push(f[d*3],f[d*3+1],f[d*3+2]);if(u.length<f.length){let d=new se(e,new Uint32Array(u));c={vao:new ae(e,[{buffer:n,locations:a}],d),ibo:d,count:u.length};}}return this.cache.set(r.dataKey,c),c}};var ua=35,lc=70,sc=.35,cc=.5,fc=1.1;function ut(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-ua)/(lc-ua),0,1),n=t.fogRange[0]*(1-sc*r)*o,a=t.fogRange[1]*(1-cc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*fc:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Sr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f),u=h&&da(h,t);if(!u||!Fe(l,i.tileMatrix64(f,u.extent))||(ie(s,l,[r,n,-1,1]),ie(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-d,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=dc(u,d,m,y,p,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function Mr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f);if(h)for(let u of t){let d=h.data?.buckets?.[u];if(!d||d.kind!=="fill"||!d.featureIds||!Fe(l,i.tileMatrix64(f,d.extent))||(ie(s,l,[r,n,-1,1]),ie(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],y=s[1]/s[3],p=s[2]/s[3],b=c[2]/c[3]-p;if(Math.abs(b)<1e-9)continue;let g=-p/b;if(g<0||g>1)continue;let v=m+(c[0]/c[3]-m)*g,w=y+(c[1]/c[3]-y)*g,S=uc(d,v,w);S!==null&&(!a||g<a.distance)&&(a={featureId:S,tile:f,layerId:u,distance:g});}}return a}function uc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*De,true),l=s=>o.getInt16(s*De+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],h=r[s*3+2],u=a(c),d=l(c),m=a(f),y=l(f),p=a(h),b=l(h),g=(e-m)*(d-y)-(u-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),w=(e-u)*(b-d)-(p-u)*(t-d),S=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(S&&_))return n[s]}return null}function da(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function dc(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=y=>l.getInt16(y*Me,true),h=y=>l.getInt16(y*Me+2,true),u=y=>l.getUint16(y*Me+4,true)/nt,d=1/0,m=-1;for(let y=0;y+2<s.length;y+=3){let p=s[y],b=s[y+1],g=s[y+2],v=f(p),w=h(p),S=u(p),_=f(b)-v,M=h(b)-w,x=u(b)-S,C=f(g)-v,T=h(g)-w,E=u(g)-S,k=n*E-a*T,F=a*C-r*E,L=r*T-n*C,I=_*k+M*F+x*L;if(I>-1e-9&&I<1e-9)continue;let A=1/I,R=e-v,P=t-w,z=o-S,O=(R*k+P*F+z*L)*A;if(O<0||O>1)continue;let N=P*x-z*M,W=z*_-R*x,B=R*M-P*_,D=(r*N+n*W+a*B)*A;if(D<0||O+D>1)continue;let K=(C*N+T*W+E*B)*A;K<0||K>1||K>=d||(d=K,m=c[y/3]??0);}return m>=0?{featureId:m,t:d}:null}function _o(i,e,t){let o=da(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var dt=24,Tr=8,mc=2,pc=12,Co=8,So=8;function zt(i){let e=0;for(let d of i)e+=d.length/2;if(e<2)return null;let t=(Co+2)*2,o=e*t+i.length*(So+2)*2+8,r=e*(Co+2)*6+i.length*So*6+24,n=new ArrayBuffer(o*dt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(d,m,y,p,b,g)=>{let v=s*dt;return a.setFloat32(v,d,true),a.setFloat32(v+4,m,true),a.setFloat32(v+8,y,true),a.setFloat32(v+12,p,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},h=(d,m,y,p)=>{l[c++]=d,l[c++]=m,l[c++]=p,l[c++]=d,l[c++]=p,l[c++]=y;},u=(d,m,y,p,b,g,v)=>{let w=f(d,m,0,0,0,v),S=f(d,m,y,p,1,v);for(let _=1;_<=So;_++){let M=Math.PI*_/So,x=y*Math.cos(M)+b*Math.sin(M),C=p*Math.cos(M)+g*Math.sin(M),T=f(d,m,x,C,1,v);l[c++]=w,l[c++]=S,l[c++]=T,S=T;}};for(let d of i){let m=bc(d),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let _=0;_<y-1;_++){let M=m[_*2+2]-m[_*2],x=m[_*2+3]-m[_*2+1],C=Math.hypot(M,x)||1;p[_]=M/C,b[_]=x/C;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let M=m[_*2],x=m[_*2+1];_>0&&(g+=Math.hypot(M-m[_*2-2],x-m[_*2-1]));let C=_>0?_-1:0,T=_<y-1?_:y-2,E=-b[C],k=p[C],F=-b[T],L=p[T],I=E+F,A=k+L,R=Math.hypot(I,A);R>1e-9?(I/=R,A/=R):(I=E,A=k);let P=I*F+A*L,z=P>1e-6?1/P:1/0,O=Math.acos(Math.min(1,Math.max(-1,p[C]*p[T]+b[C]*b[T])));if(!(O>pc*Math.PI/180)&&z<=mc){let W=f(M,x,I*z,A*z,1,g),B=f(M,x,-I*z,-A*z,-1,g);v>=0&&h(v,w,W,B),v=W,w=B;}else {let W=Math.max(1,Math.min(Co,Math.ceil(O/(Math.PI/Co)))),D=p[C]*b[T]-b[C]*p[T]>=0?1:-1,K=f(M,x,E,k,1,g),$=f(M,x,-E,-k,-1,g);v>=0&&h(v,w,K,$);for(let oe=1;oe<=W;oe++){let ye=D*O*(oe/W),J=Math.cos(ye),X=Math.sin(ye),me=E*J-k*X,pe=E*X+k*J,Z=f(M,x,me,pe,1,g),U=f(M,x,-me,-pe,-1,g);h(K,$,Z,U),K=Z,$=U;}v=K,w=$;}}let S=y-2;u(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),u(m[(y-1)*2],m[(y-1)*2+1],-b[S],p[S],p[S],b[S],g);}return c?{vertices:n.slice(0,s*dt),indices:l.slice(0,c),vertexCount:s}:null}function Ar(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=Un(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function bc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Rt=5126,yc={stride:Tr,attribs:[{name:"a_pos",size:2,type:Rt,offset:0}]},Lr={stride:dt,attribs:[{name:"a_pos",size:2,type:Rt,offset:0},{name:"a_extrude",size:2,type:Rt,offset:8},{name:"a_side",size:1,type:Rt,offset:16},{name:"a_dist",size:1,type:Rt,offset:20}]},kr=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},gc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Ht=class{constructor(){this.objects=[];this.markers=[];this.gpu=new H;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,y)=>m.zIndex-y.zIndex);let f=e.gl.drawingBufferWidth,h=t.width>0?f/t.width:1,u=t.worldSize*h,d=null;for(let m of this.objects){if(!m.visible)continue;let y=m.ghostOpacity;if(c&&y<=0)continue;let p=this.gpuFor(e,m,r,a);if(!p)continue;let b=s?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,g=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:v,vao:w,ibo:S}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?gc(v.color,y):v.color;if(v.kind==="fill")d!==o&&(o.use(),l?.(o),d=o),o.setVec4v("u_color",_e(_)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {d!==n&&(n.use(),l?.(n),d=n);let M=v.width/2*h,x=u>1e-9?1/u:1;if(n.setVec4v("u_color",_e(_)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*h),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",x),n.setFloat("u_units_to_px",u),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[C,T]=v.dashArray;n.setVec2("u_dash",C*h,(C+T)*h);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let C=(v.arrowSize??5)*h;n.setVec3("u_arrow",(v.arrowPeriod??46)*h,Math.max(C*.4,1),Math.min(C,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,S.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(ee(a)*r,te(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=q(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?yc:Lr,f=s.kind==="fill"?o:r,h=new be(e,new Uint8Array(s.mesh.vertices),c),u=new se(e,s.mesh.indices),d=new ae(e,[{buffer:h,locations:f}],u);a.push({part:s,vao:d,vbo:h,ibo:u});}let l=new kr(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var Mo=32,vc=1179937895,wc=1313821514,xc=5130562,_c={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Cc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Ir(i){let{json:e,bin:t}=ha(i),o=await Mc(e,t);return pa(e,t,o)}function Sc(i){let{json:e,bin:t}=ha(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return pa(e,t,null)}function ha(i){let e=new DataView(i);if(e.getUint32(0,true)!==vc)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===wc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===xc&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Mc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function ma(i){let e=G();if(i.matrix){for(let x=0;x<16;x++)e[x]=i.matrix[x];return e}Re(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,h]=i.scale??[1,1,1],u=n+n,d=a+a,m=l+l,y=n*u,p=n*d,b=n*m,g=a*d,v=a*m,w=l*m,S=s*u,_=s*d,M=s*m;return e[0]=(1-(g+w))*c,e[1]=(p+M)*c,e[2]=(b-_)*c,e[4]=(p-M)*f,e[5]=(1-(y+w))*f,e[6]=(v+S)*f,e[8]=(b+_)*h,e[9]=(v-S)*h,e[10]=(1-(y+g))*h,e[12]=t,e[13]=o,e[14]=r,e}var Tc={5120:127,5121:255,5122:32767,5123:65535};function Ac(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let h=1/f;return [(n*c-a*s)*h,(a*l-r*c)*h,(r*s-n*l)*h,(o*s-t*c)*h,(e*c-o*l)*h,(t*l-e*s)*h,(t*a-o*n)*h,(o*r-e*a)*h,(e*n-t*r)*h]}function pa(i,e,t){let o=x=>{let C=t?.get(x);if(C)return C;let T=i.bufferViews?.[x];if(!T)return null;let E=T.byteOffset??0;return e.subarray(E,E+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],h=x=>{if(x===void 0)return null;let C=i.accessors?.[x];if(!C)return null;let T=Cc[C.type]??1,E=new Float64Array(C.count*T),k=C.bufferView!==void 0?i.bufferViews?.[C.bufferView]:void 0;if(!k||C.bufferView===void 0)return {data:E,components:T};let F=o(C.bufferView);if(!F)return {data:E,components:T};let L=_c[C.componentType]??4,I=k.extensions?.EXT_meshopt_compression,A=I?I.byteStride:k.byteStride,R=A&&A>0?A:L*T,P=C.byteOffset??0,z=new DataView(F.buffer,F.byteOffset,F.byteLength),O=C.normalized?Tc[C.componentType]??1:1;for(let N=0;N<C.count;N++)for(let W=0;W<T;W++){let B=P+N*R+W*L,D;switch(C.componentType){case 5120:D=z.getInt8(B);break;case 5121:D=z.getUint8(B);break;case 5122:D=z.getInt16(B,true);break;case 5123:D=z.getUint16(B,true);break;case 5125:D=z.getUint32(B,true);break;default:D=z.getFloat32(B,true);}E[N*T+W]=O===1?D:Math.max(D/O,-1);}return {data:E,components:T}},u=(x,C,T=-1)=>{if(x.mode!==void 0&&x.mode!==4)return;let E=h(x.attributes.POSITION);if(!E)return;let k=h(x.attributes.NORMAL),F=h(x.attributes.TEXCOORD_0),L=h(x.indices),I=r.length/3,A=E.data.length/3,R=Ac(C),z=(x.material!==void 0?i.materials?.[x.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,O=z?{ox:z.offset?.[0]??0,oy:z.offset?.[1]??0,sx:z.scale?.[0]??1,sy:z.scale?.[1]??1,rot:z.rotation??0}:null;for(let X=0;X<A;X++){let me=E.data[X*3],pe=E.data[X*3+1],Z=E.data[X*3+2],U=C[0]*me+C[4]*pe+C[8]*Z+C[12],j=C[1]*me+C[5]*pe+C[9]*Z+C[13],fe=C[2]*me+C[6]*pe+C[10]*Z+C[14];if(r.push(U,j,fe),U<c[0]&&(c[0]=U),j<c[1]&&(c[1]=j),fe<c[2]&&(c[2]=fe),U>f[0]&&(f[0]=U),j>f[1]&&(f[1]=j),fe>f[2]&&(f[2]=fe),k){let re=k.data[X*3],ge=k.data[X*3+1],Ae=k.data[X*3+2],ve=R[0]*re+R[3]*ge+R[6]*Ae,Jt=R[1]*re+R[4]*ge+R[7]*Ae,eo=R[2]*re+R[5]*ge+R[8]*Ae,to=Math.hypot(ve,Jt,eo);to>1e-12?(ve/=to,Jt/=to,eo/=to):(ve=0,Jt=1,eo=0),n.push(ve,Jt,eo);}else n.push(0,1,0);let ne=F?F.data[X*2]:0,ue=F?F.data[X*2+1]:0;if(O){if(O.rot!==0){let re=Math.cos(O.rot),ge=Math.sin(O.rot),Ae=re*ne+ge*ue,ve=-ge*ne+re*ue;ne=Ae,ue=ve;}ne=ne*O.sx+O.ox,ue=ue*O.sy+O.oy;}a.push(ne,ue);}let N=l.length;if(L)for(let X=0;X<L.data.length;X++)l.push(I+L.data[X]);else for(let X=0;X<A;X++)l.push(I+X);let W=x.material!==void 0?i.materials?.[x.material]:void 0,B=W?.pbrMetallicRoughness,D=B?.metallicFactor!==void 0||B?.roughnessFactor!==void 0,K=B?.baseColorFactor??[1,1,1,1],$=B?.baseColorTexture?.index,oe=$!==void 0?i.textures?.[$]?.source:void 0,ye=W?.emissiveFactor??[0,0,0],J=W?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[K[0],K[1],K[2],K[3]??1],metallic:D?B?.metallicFactor??1:0,roughness:D?B?.roughnessFactor??1:1,emissive:[ye[0]*J,ye[1]*J,ye[2]*J],texture:oe??-1,doubleSided:W?.doubleSided===true,blend:W?.alphaMode==="BLEND",alphaCutoff:W?.alphaMode==="MASK"?W.alphaCutoff??.5:.02,node:T});},d=i.skins?.length?null:kc(i,h),m=d?d.nodes:null,y=(x,C,T,E)=>{let k=i.nodes?.[x];if(!k)return;let F=ma(k),L=G();xe(L,C,F);let I=G(),A=E,R=m?.get(x);if(R?(R.parentNode=E,R.parent=T.slice(),Re(I),A=x):xe(I,T,F),k.mesh!==void 0)for(let z of i.meshes?.[k.mesh]?.primitives??[])u(z,I,A);let P=k.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let z=i.extensions?.KHR_lights_punctual?.lights?.[P],O=z?.type;if(z&&(O==="point"||O==="spot"||O==="directional")){let N=-L[8],W=-L[9],B=-L[10],D=Math.hypot(N,W,B)||1,K=z.spot?.innerConeAngle??0,$=z.spot?.outerConeAngle??Math.PI/4;p.push({type:O,color:[z.color?.[0]??1,z.color?.[1]??1,z.color?.[2]??1],intensity:z.intensity??1,range:z.range??0,position:[L[12],L[13],L[14]],direction:[N/D,W/D,B/D],cosInner:Math.cos(K),cosOuter:Math.cos($)});}}for(let z of k.children??[])y(z,L,I,A);},p=[],b=G();Re(b);let g=G();Re(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((x,C)=>C)??[];for(let x of v)y(x,b,g,-1);let w=[];for(let x of i.images??[]){if(x.bufferView===void 0){w.push(new Uint8Array(0));continue}let C=o(x.bufferView);w.push(C?C.slice():new Uint8Array(0));}let S=r.length/3,_=new ArrayBuffer(S*Mo),M=new Float32Array(_);for(let x=0;x<S;x++){let C=x*8;M[C]=r[x*3],M[C+1]=r[x*3+1],M[C+2]=r[x*3+2],M[C+3]=n[x*3],M[C+4]=n[x*3+1],M[C+5]=n[x*3+2],M[C+6]=a[x*2],M[C+7]=a[x*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:_,indices:new Uint32Array(l),primitives:s,images:w,min:c,max:f,animation:d,lights:p}}function kc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let h=l==="rotation"?4:3,u=s.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*h);for(let p=0;p<d;p++){let b=u?(p*3+1)*h:p*h;for(let g=0;g<h;g++)m[p*h+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:Re(G()),base:Lc(i.nodes?.[a]),channels:[]};y.channels.push({path:l,times:Float32Array.from(c.data),values:m,step:s.interpolation==="STEP"}),o.set(a,y),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Lc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function Er(i,e,t,o){let r=i.nodes.get(e);if(!r)return Re(o);let n=G();Ic(r,t,n);let a=G();if(xe(a,r.parent,n),r.parentNode<0)return ba(o,a);let l=G();return Er(i,r.parentNode,t,l),xe(o,l,a)}var ba=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Ic(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),h=a.times[f]-a.times[c],u=a.step||h<=0?0:Math.min(Math.max((e-a.times[c])/h,0),1),d=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[d+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[d+g]*(1-u)+a.values[m+g]*p*u,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let y=a.path==="translation"?o:n;for(let p=0;p<3;p++)y[p]=a.values[d+p]*(1-u)+a.values[m+p]*u;}}return ba(t,ma({translation:o,rotation:r,scale:n}))}var Te=5126,Ec=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ya={stride:Mo,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},zr=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Fr=256,To=41,ga={stride:To*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Pt=2,ht=16,Ue=class{constructor(){this.models=[];this.gpu=new H;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Fr*To);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Pt);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let h=c.fade<1;o.setFloat("u_opacity",c.fade);let u=c.matrixFor(t);o.setMat4("u_matrix",u),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let y of [false,true])if(!(h&&!y))for(let p of c.mesh.primitives){if(!h&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):u),d&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):d);let b=p.texture>=0?f.textures[p.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),b&&e.bindTexture(Pt,b),o.setVec4v("u_base_color",p.baseColor),o.setVec3("u_emissive",p.emissive[0],p.emissive[1],p.emissive[2]),o.setFloat("u_metallic",p.metallic),o.setFloat("u_roughness",p.roughness),e.setCull(p.doubleSided?"none":"back"),e.setBlend(y?"premultiplied":"none"),e.setDepthMask(!y),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new H;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(h=>h.blend||h.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new be(e,this.instScratch,ga,true)),f.instVao||(f.instVao=new ae(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Pt),o.setFloat("u_opacity",1),s=true);let h=c[0].mesh;for(let u=0;u<c.length;u+=Fr){let d=Math.min(Fr,c.length-u);for(let m=0;m<d;m++){let y=c[u+m],p=m*To;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):Ec;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,d*To)),e.bindVAO(f.instVao.vao);for(let m of h.primitives){let y=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",y?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),y&&e.bindTexture(Pt,y),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,d);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=ht?r:[...r].sort((f,h)=>h.intensity-f.intensity).slice(0,ht),a=new Float32Array(ht*4),l=new Float32Array(ht*4),s=new Float32Array(ht*4),c=new Float32Array(ht*4);n.forEach((f,h)=>{let u=h*4;a[u]=f.position[0],a[u+1]=f.position[1],a[u+2]=f.position[2],a[u+3]=f.range,l[u]=f.color[0]*f.intensity,l[u+1]=f.color[1]*f.intensity,l[u+2]=f.color[2]*f.intensity,l[u+3]=f.type==="spot"?1:0,s[u]=f.direction[0],s[u+1]=f.direction[1],s[u+2]=f.direction[2],c[u]=f.cosInner,c[u+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new be(e,new Uint8Array(t.mesh.vertices),ya),l=new se(e,t.mesh.indices),s=new ae(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(h=>{if(!h)return null;let u=n.createTexture();return u?(e.bindTexture(Pt,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,h),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),u):null}),f=new zr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return ya}static get instanceLayout(){return ga}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Rr=4,va=new Q;function Fc(i){va.has(i)||(va.add(i),console.warn(`[osmgl] ${i}`));}var zc=.5,Rc=.01,Hc=300,Hr=127,Pr=128,Ot=5120,Lo=5121,Wt=5122,wa=5123,Vt=5126,Pc={stride:8,attribs:[{name:"a_pos",size:2,type:Vt,offset:0}]},Or={stride:De,attribs:[{name:"a_pos",size:2,type:Wt,offset:0}]},xa={stride:Ge,attribs:[{name:"a_p0",size:2,type:Wt,offset:0},{name:"a_p1",size:2,type:Wt,offset:4},{name:"a_corner",size:2,type:Ot,offset:8},{name:"a_ground",size:2,type:Ot,offset:10},{name:"a_dist",size:1,type:Vt,offset:12},{name:"a_width",size:1,type:Vt,offset:16}]},Ao={stride:Me,attribs:[{name:"a_pos",size:2,type:Wt,offset:0},{name:"a_height",size:1,type:wa,offset:4},{name:"a_tint",size:1,type:Lo,normalized:true,offset:6},{name:"a_ao",size:1,type:Lo,normalized:true,offset:7},{name:"a_normal",size:3,type:Ot,normalized:true,offset:8},{name:"a_kind",size:1,type:Lo,offset:11},{name:"a_wall",size:3,type:wa,offset:12}]},Oc={flat:0,water:1,foliage:2,sand:3,asphalt:4},Wc=[1,9,14,26,3],_a={stride:it,attribs:[{name:"a_pos",size:2,type:Vt,offset:0},{name:"a_level",size:1,type:Wt,offset:8},{name:"a_normal",size:3,type:Ot,normalized:true,offset:10},{name:"a_kind",size:1,type:Lo,offset:13},{name:"a_bleed",size:2,type:Ot,offset:14}]},Wr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Sa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Bt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new H;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new xo;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new H;this.lineLocs=new H;this.objectLine=null;this.objectLineLocs=new H;this.buildingLocs=new H;this.shadows={...Sa};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new H;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new H;this.highlightKey="";this.groundArrows=new Et;this.highlightTris=new H;this.fillHighlightGpu=new H;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Ft;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new H;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Ue;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new H;this.modelInstLocs=new H;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),h=new Float64Array(c.featureIds),u=[];for(let m=0;m*3<f.length;m++)a.has(h[m])||u.push(f[m*3],f[m*3+1],f[m*3+2]);let d=null;if(u.length<f.length){let m=new se(e,new Uint32Array(u));d={vao:new ae(e,[{buffer:n,locations:this.buildingLocs}],m),ibo:m,count:u.length,vbo:n};}return this.hiddenCut.set(l,d),d}init(e){this.symbols?.init(e),this.fill=new ce(e,"fill",Ki,$i),this.surface=new ce(e,"surface",oa,ra),this.line=new ce(e,"line",qi,Zi),this.objectLine=new ce(e,"objectLine",Qi,Ji),this.building=new ce(e,"buildings",ea,ta),this.depth=new ce(e,"depth",Wi,br),this.groundShadow=new ce(e,"groundShadow",Xi,Yi),this.sky=new ce(e,"sky",Gi,Ni),this.raster=new ce(e,"raster",Ui,ji),this.globeBody=new ce(e,"globeBody",Ri,Hi),this.globeClip=new ce(e,"globeClip",Pi,Oi),this.globeMesh=Vc(e,this.globeBody),this.model=new ce(e,"model",Vi,yr),this.modelInstanced=new ce(e,"model-instanced",Bi,yr),this.modelDepth=new ce(e,"modelDepth",Di,br);for(let n of Ue.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Ue.layout.attribs,...Ue.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=Fi(e);let t=new H([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new be(e,new Float32Array([0,0,1,0,1,1,0,1]),Pc),r=new se(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new ae(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Or.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of _a.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of xa.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Lr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Ao.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new H){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=ut(t,r),this.patternScale=no/Math.max(Le(t.center.lat),1);let c=u=>o.get(u.source??Y);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=u=>u.type==="line"&&V(u.paint.elevation,l,0)!==0;for(let u of r.layers){if(u.type==="raster"||u.type==="fill-extrusion"||u.type==="symbol"||u.overlay||f(u)||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){if(!this.flattened(d,r,u))continue;this.drawFill(e,t,d,r,u,l);continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let u of r.layers){if(u.type!=="surface"||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.flattened(d,r,u)||this.drawSurface(e,t,d,r,u,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);for(let u of r.layers){if(u.type==="raster"||!f(u)||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&this.drawLine(e,t,d,r,u,l);}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let u of r.layers){if(u.type!=="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.drawBuildings(e,t,d,r,u,l,n)&&(s=true),this.drawHighlight(e,t,d,r,u,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,u=>{this.applyShadowUniforms(u),this.applyFogUniforms(u,t,r),this.applyLight(u,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let u of r.layers){if(u.type==="raster"||!u.overlay||u.type==="symbol"||u.type==="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){this.flattened(d,r,u)?this.drawFill(e,t,d,r,u,l):this.drawSurface(e,t,d,r,u,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let h=r.layers.filter(u=>u.type==="line"&&V(u.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(u,l));if(h.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let u of h){let d=c(u);d&&this.drawLine(e,t,d,r,u,l,V(u.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Rr,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(h=>h.type==="fill-extrusion"&&!h.overlay&&r.layerVisibleAt(h,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Lt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(ko(l.keyAzimuth,l.keyAltitude),Hc),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let h of a){let u=o.get(h.source??Y);if(!u)continue;let d=r.bucketKeyFor(h);if(d===null)continue;let m=V(h.paint.heightScale,t.zoom,1);(h.source??Y)===Y&&this.indoorMask.prepare(u,d);for(let y of u.visibleTiles){if(!this.drawsTile(t,r,h,y))continue;let p=u.getTile(y),b=p&&this.bucketFor(e,p,d,Ao,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!u.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(h.source??Y)===Y,v=this.cutHidden(e,p,d,y.dataKey,b.buffer,this.hiddenFor(d,g)),w=g?v??this.indoorMask.indicesFor(e,p,d,y,b.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Rr),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Oe(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(ie(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Oe(r,"u_sky_color",o.sky.skyColor),Oe(r,"u_horizon_color",o.sky.horizonColor);let n=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*n,s=Math.max(a,1)*n,c=Math.min(s*.5,t.height*n*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Oe(r,"u_space_color",o.sky.spaceColor),Oe(r,"u_atmo_color",o.sky.atmosphereColor);let h=t.globeDisc();r.setVec4("u_globe_disc",h.dir[0],h.dir[1],h.dir[2],h.angle);let[u,d,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",u[0],u[1],u[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",y[0],y[1],y[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let n=t.globeCamera();e.setVec4("u_globe_cam",n.dir[0],n.dir[1],n.dir[2],n.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??ut(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Oe(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,V(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(zc/Math.max(t.pixelsPerMeter,1e-9),Rc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Hr);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(Y);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Hr)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Hr),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let n=o.get(Y);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let h=0;h<4;h++)s[12+h]+=l*f[8+h];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(Y);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=ko(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=le(l.ambientColor),h=le(l.keyColor),u=[0,0,0];for(let d=0;d<3;d++){let m=f[d]*l.ambientIntensity,y=h[d]*l.keyIntensity*c;u[d]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",u[0],u[1],u[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Rr),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=le(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=No(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=vn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Oc[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=V(a.materialStrength,o,1)*this.detailScale,s=V(a.materialScale,o,Wc[n]),c=V(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=V(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let h of o.visibleTiles){if(!this.drawsTile(t,r,n,h))continue;let u=o.getTile(h),d=u&&this.bucketFor(e,u,f,Or,this.fillLocs,"fill");d&&(this.clipToTile(e,h),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),this.applyTileScale(l,h,d.extent),this.applyTileMatrix(l,t,h,d.extent),d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0){let s=this.line,c=r.colorAt(n,a),f=V(n.paint.opacity,a,1)*(l||1),h=V(n.paint.width,a,1);if(f<=.001||h<=.01)return;let u=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,m=t.width>0?u/t.width:1,y=h/2*m;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t),this.applyLight(s,r),this.applyMaterial(s,n,a),s.setVec4v("u_color",_e([c[0],c[1],c[2],c[3]*f])),s.setFloat("u_center_w",t.cameraToCenterDistance);let p=V(n.paint.offset,a,0)*m;s.setFloat("u_elevation",V(n.paint.elevation,a,0)*this.reliefScale),s.setFloat("u_relief",this.reliefScale),s.setVec2("u_viewport",u,d);let b=n.paint.dashArray,g=n.paint.arrow===true,v=n.paint.arrowStyle,w=g&&(v==="head"||v==="headOnly"),S=g&&v==="dash";if(s.setInt("u_pattern",S?5:b?1:v==="headOnly"&&g?4:w?3:g?2:0),b){let[M,x]=b;s.setVec2("u_dash",M*m,(M+x)*m);}if(g){let M=ke(n.paint.arrowColor,a,[1,1,1,1]);s.setVec4v("u_arrow_color",_e(M));let x=V(n.paint.arrowPeriod,a,46)*m,C=V(n.paint.arrowSize,a,5)*m;if(S){let T=V(n.paint.arrowGap,a,24)*m,E=Math.max(x-T,1),k=Math.min(C,E),F=V(n.paint.arrowShaft,a,2)*m,L=V(n.paint.arrowHead,a,4)*m,I=V(n.paint.arrowOutline,a,0)*m;s.setVec4("u_arrow",F,k,L,E),s.setVec2("u_dash",I,x);}else w?s.setVec4("u_arrow",x,C,y,0):s.setVec4("u_arrow",x,Math.max(C*.4,1),Math.min(C,y*.72),0);}let _=r.bucketKeyFor(n);if(_!==null)for(let M of o.visibleTiles){if(!this.drawsTile(t,r,n,M))continue;let x=o.getTile(M),C=x&&this.bucketFor(e,x,_,xa,this.lineLocs,"line");if(!C)continue;let T=M.bounds(),E=(T.maxX-T.minX)*t.worldSize/C.extent*m;s.setFloat("u_tile_to_px",E);let k=E>1e-6?1/E:1;s.setFloat("u_half_width",y*k),s.setFloat("u_meters_to_units",t.pixelsPerMeter*k),s.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),s.setFloat("u_width_extra",V(n.paint.widthExtra,a,0)*k),s.setFloat("u_offset",p*k),s.setFloat("u_tile_per_px",k),this.applyTileScale(s,M,C.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(M,C.extent)),this.applyTileMatrix(s,t,M,C.extent),C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.indexCount,C.indexType,0);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=le(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",V(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let h of o.visibleTiles){let u=o.getTile(h);if(!u)continue;let d=u.data?.buckets?.[n.id];if(!d)continue;let m=h.dataKey,y=this.highlightGpu.get(m);if(y===void 0){let p=_o(u,n.id,l.featureId);if(p){let b=new be(e,new Uint8Array(p.vertices),Ao),g=new se(e,p.indices);y={vao:new ae(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:p.indices.length};}else y=null;this.highlightGpu.set(m,y);}y&&(this.applyTileScale(f,h,d.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),f.setMat4("u_matrix",t.tileMatrix(h,d.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??Y);if(!a)return;let l=new Q;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let h=_o(c,o.layerId,o.featureId);h&&this.highlightTris.set(s.dataKey,wr(h,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(u=>u.id===n.layerId),s=l?o.get(l.source??Y):void 0;if(!l||!s)return;let c=n.bucketKey,f=le(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let h=e.gl;e.setStencilTest(true),h.stencilFunc(h.NOTEQUAL,Pr,Pr),h.stencilOp(h.KEEP,h.KEEP,h.REPLACE),h.stencilMask(Pr);for(let u of s.visibleTiles){let d=s.getTile(u),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,u,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(u,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),h.stencilOp(h.KEEP,h.KEEP,h.KEEP),h.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(u=>{u?.vao.destroy(),u?.ibo.destroy(),u?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let u=0;u*3<s.length;u++)c[u]===r&&f.push(s[u*3],s[u*3+1],s[u*3+2]);let h=null;if(f.length){let u=new be(e,new Uint8Array(t.vertices),Or),d=new se(e,new Uint32Array(f));h={vao:new ae(e,[{buffer:u,locations:this.fillLocs}],d),vbo:u,ibo:d,count:f.length};}return this.fillHighlightGpu.set(a,h),h}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=V(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",V(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),h=n.paint.sideColor?ke(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",h[0],h[1],h[2]),l.setFloat("u_side_light",V(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let u=r.bucketKeyFor(n);if(u===null)return;let d=c>=1&&!n.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,u,_a,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v});}let y=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),l.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},p=m.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of p){y(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:b,bucket:g}of m)y(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,h=V(n.paint.opacity,a,1);if(h<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",h),s.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",V(n.paint.tintVariation,a,.07));let u=(w,S)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,S):S,d=u("windowColor",[.62,.71,.8,1]),m=u("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",d[0],d[1],d[2]),s.setVec3("u_window_frame",m[0],m[1],m[2]),s.setFloat("u_facade_detail",V(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",V(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",V(n.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",V(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=h>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=V(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??Y)===Y;v&&this.indoorMask.prepare(o,g);for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let S=o.getTile(w),_=S&&this.bucketFor(e,S,g,Ao,this.buildingLocs,"fill-extrusion");if(!_)continue;let M=this.growScale(_,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,w,_.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(w,_.extent)),s.setMat4("u_matrix",t.tileMatrix(w,_.extent));let C=this.cutHidden(e,S,g,w.dataKey,_.buffer,this.hiddenFor(g,v))??(S&&v?this.indoorMask.indicesFor(e,S,g,w,_.buffer,this.buildingLocs):null);C?(C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?Bc(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Oe(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=ko(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Oe(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=ko(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Oe(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return Fc(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new be(e,new Uint8Array(s.vertices),r),f=new se(e,new Uint32Array(s.indices)),h=new ae(e,[{buffer:c,locations:n}],f),u=new Wr(h,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,u),u}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Ca=new H;function Vc(i,e){let r=new Float32Array(4290),n=0;for(let u=0;u<=32;u++){let d=(u/32-.5)*Math.PI;for(let m=0;m<=64;m++)r[n++]=m/64*2*Math.PI-Math.PI,r[n++]=d;}let a=new Uint16Array(2048*6),l=0;for(let u=0;u<32;u++)for(let d=0;d<64;d++){let m=u*65+d,y=m+64+1;a[l++]=m,a[l++]=m+1,a[l++]=y,a[l++]=m+1,a[l++]=y+1,a[l++]=y;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Vt,offset:0}]},c=new H([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new be(i,r,s),h=new se(i,a);return {vao:new ae(i,[{buffer:f,locations:c}],h),vbo:f,ibo:h,count:a.length}}function Oe(i,e,t){let o=Ca.get(t);o||(o=le(t),Ca.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function ko(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function Bc(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Io=1,Dt=class{constructor(e=1024){this.entries=new H;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+Io>this.size&&(this.shelfY+=this.shelfHeight+Io,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Io>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+Io,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),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),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Vr=.75,Nt=8,he=3,We=24,mt=256,Ma=255,Gt=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new H;this.loaded=new Q;this.inflight=new H;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/mt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/mt);if(r<=Ma&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new Q;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/mt);n>Ma||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*mt}-${e*mt+mt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of Ta(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Ta(i){let e=new bl(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,h={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((u,d,m)=>{m&&(u===1?h.id=m.readVarint():u===2?h.bitmap=m.readBytes():u===3?h.width=m.readVarint():u===4?h.height=m.readVarint():u===5?h.left=m.readSVarint():u===6?h.top=m.readSVarint():u===7&&(h.advance=m.readVarint()));},null,f),t.push(h);},null,a);},null),t}var Gc=.25,pt=1e20;function Br(i,e,t){let o=e+he*2,r=t+he*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(pt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let h=i[c*e+f]/255,u=(c+he)*o+(f+he);if(h>=1)a[u]=0,l[u]=pt;else if(h>0){let d=.5-h;a[u]=d>0?d*d:0,l[u]=d<0?d*d:0;}else a[u]=pt,l[u]=0;}Aa(a,o,r),Aa(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=Nc(Math.round(255-255*(f/Nt+Gc)));}return {data:s,width:o,height:r}}function Aa(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];ka(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];ka(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function ka(i,e,t,o,r){t[0]=0,o[0]=-pt,o[1]=pt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=pt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var Nc=i=>i<0?0:i>255?255:i;var La=48,Ut=class{constructor(e={}){this.defs=e;this.sdfs=new H;this.pending=new Q;this.failed=new Q;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(La*(n>1?n:1))),l=Math.max(8,Math.round(La/(n<1?n:1))),s=await Uc(o,a,l);return this.sdfs.set(e,Br(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function Uc(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((h,u)=>{a.onload=()=>h(),a.onerror=()=>u(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let h=0;h<f.length;h++)f[h]=c[h*4+3];return f}finally{URL.revokeObjectURL(n);}}var Qe={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},jc={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(jc)){let t=Qe[e];t?Qe[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var Xc=1.2;function Dr(i,e,t=16,o=0){let r=Yc(i,t),n=[],a=[],l=0;for(let f of r){let h=0,u=0;for(let d of f){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(h+=y.advance,u++);}u>1&&(h+=o*(u-1)),a.push(h),h>l&&(l=h);}if(l===0)return null;let s=We*Xc,c=r.length*s;for(let f=0;f<r.length;f++){let h=-a[f]/2,u=-c/2+f*s+s/2;for(let d of r[f]){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(y.width>0&&y.height>0&&y.bitmap&&n.push({glyph:y,x:h,y:u}),h+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function Yc(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function Gr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=u=>u.x>=r&&u.x<=a&&u.y>=n&&u.y<=l,c=[],f=[],h=()=>{f.length>=2&&c.push(f),f=[];};for(let u=0;u+1<i.length;u++){let d=i[u],m=i[u+1],y=s(d),p=s(m);if(y&&p){f.length||f.push(d),f.push(m);continue}let b=Kc(d,m,r,n,a,l);if(!b){h();continue}f.length||f.push(b[0]),f.push(b[1]),p||h();}return h(),c}function Kc(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[h,u]of f){if(h===0){if(u<0)return null;continue}let d=u/h;if(h<0){if(d>c)return null;d>s&&(s=d);}else {if(d<s)return null;d<c&&(c=d);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var $c=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Ur(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Jc(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,h=[],u=o.spacing??250,d=u>0&&u-t<u*.25?t+u*.25:u;if(o.accept)return qc(i,r,e,t,d,c,a,f,o.accept);if(d>0&&s>=t+d){let y=Math.min(Math.floor((s-t)/d)+1,24),p=t+d*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=d){let v=b/l,w=Nr(i,r,e,t,v,c,a,f);w&&h.push({glyphs:w,path:w.map(S=>({x:S.x,y:S.y})),at:v});}if(h.length)return h}let m=(n-t)/2;for(let y of $c){let p=m+m*y,b=Nr(i,r,e,t,p,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:p}];if(m===0)break}return []}function qc(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),h=[],u=-1/0;for(let d=0;d+o<=c;d+=f){if(d-u<r)continue;let m=Nr(i,e,t,o,d,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:d};if(s(y)&&(h.push(y),u=d,h.length>=24))break}return h}function Nr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Zc(i,e,r,r+o,n,a))return null;let s=jt(i,e,r),c=jt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Ia(i,e,t,r,l);let f=e[e.length-1];return Ia([...i].reverse(),ef(e),t,f-(r+o),l)}function Zc(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),h=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),u=Math.abs((h-f)*180/Math.PI+540)%360-180,d=Math.abs(u);for(a.push({at:c,delta:d}),l+=d;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Ia(i,e,t,o,r){let n=[];for(let c of t){let f=Ea(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let h=Math.abs(Qc(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(h,Math.PI/3)/2);}l=o+t[c].offset+s;let f=Ea(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Ea(i,e,t,o){let r=jt(i,e,t+o/2);if(!r)return null;let n=jt(i,e,t),a=jt(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function Qc(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Jc(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function ef(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function jt(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var Xr=20,Fa={stride:Xr,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},tf=220,je=64,za=2,of=1.22,rf=128,nf=.7;function af(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*We;let r=V(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*nf/(t/We)}var lf=256,sf=200,jr="frame-circle",bt=class i{constructor(e,t){this.shader=null;this.locations=new H;this.atlas=new Dt(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new H;this.fading=false;this.styleOrder=new H;this.glyphs=new Gt(e,t),this.icons=new Ut(Qe);}init(e){this.shader=new ce(e,"symbol",na,ia);for(let t of Fa.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/tf;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?sf:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new H,f=new H,h=new H;l.forEach((d,m)=>h.set(d.id,m));let u=0;for(let d of s){let m=this.place(d,a,c);if(!m)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:m.box,order:h.get(d.layer.id)??0});let y=f.get(d.layer.id);y||f.set(d.layer.id,y={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),y.verts.push(...m.verts),y.texs.push(...m.texs),y.iconVerts.push(...m.iconVerts),y.iconTexs.push(...m.iconTexs),y.frameVerts.push(...m.frameVerts),y.frameTexs.push(...m.frameTexs),u+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),u&&(this.styleOrder=h,this.draw(e,t,f,u,a));}collect(e,t,o,r){let n=[],l=this.padding,s=ut(e,o).far,[c,f,h]=e.cameraPositionPx;for(let u of r){let d=(u.layout?.priority??0)*lf,m=t.get(u.source??Y);if(!m)continue;let y=u.layout?.showFor==="highlight",p=u.layout?.placement==="map",{shift:b,drop:g}=p?Oa(u,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(y&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,w=o.bucketKeyFor(u);if(w!==null)for(let S of m.visibleTiles){if(!o.layerVisibleAt(u,e.detailZoom(e.distanceToTile(S))))continue;let M=m.getTile(S)?.data?.buckets?.[w];if(!M||!wo(M))continue;let x=new Int16Array(M.anchors),C=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,E=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,F=S.bounds(),L=e.worldSize,I=(F.maxX-F.minX)*L/M.extent,A=F.minX*L,R=F.minY*L;for(let P=0;P<C.length;P++){let z=A+x[P*2]*I,O=R+x[P*2+1]*I;if(s!==1/0&&Math.hypot(z-c,O-f,h)>s||y&&!Pe(this.highlightFootprint,z/L,O/L,v))continue;let N=z,W=O;if(p&&T){let $=T[P]*Math.PI/180,oe=b;N-=Math.sin($)*oe,W+=Math.cos($)*oe;}let B=e.worldPxToPoint(N,W),D=E&&k?cf(e,E,k,P,A,R,I):void 0;if(u.layout?.textPlacement==="line"){if(!D)continue}else if(!B||B.x<l.left-64||B.y<l.top-64||B.x>e.width-l.right+64||B.y>e.height-l.bottom+64)continue;n.push({layer:u,screenX:B?B.x:D[0].x,screenY:(B?B.y:D[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:C[P]+d,rotate:Wa(u,T,P,e.bearing),mercX:z/L,mercY:O/L,line:D});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=V(r.textSize,t,13),c=V(r.iconSize,t,16),f=r.iconTextGap??5,[h,u]=r.offset??[0,0],d=r.placement==="map",m=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let Z=`icon:${e.icon}`,U=this.atlas.get(Z);if(!U){let j=this.icons.get(e.icon);j?U=this.atlas.add(Z,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}U&&(m=U);}let y=null;if(m&&r.iconFrame==="circle"){let Z=`icon:${jr}`,U=this.atlas.get(Z);if(!U){let j=this.icons.get(jr);j?U=this.atlas.add(Z,j.data,j.width,j.height)??void 0:this.pendingIcons.add(jr);}U&&(y=U);}let p=y?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=Dr(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,af(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/We,v=b?b.width*g:0,w=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,w,o,t,a):null;let S=r.iconPlacement??"top",_=S==="behind"&&!!m&&!!b,M=S==="top"&&!!m&&!!b,x=m?m.width/Math.max(m.height,1):1,C=_?w+f*2:c,T=m?C*x:0,E=Math.max(T,m?c*p:0),k=Math.max(C,m?c*p:0),F=_?Math.max(T,v+f*2):M?Math.max(E,v):E+(m&&b?f:0)+v,L=_?Math.max(C,w):M?k+f+w:Math.max(m?k:0,w),I=e.screenX+h,A=e.screenY+u,R=za+(r.collisionPadding??0),P={x1:I-F/2-R,y1:A-L/2-R,x2:I+F/2+R,y2:A+L/2+R},z=this.padding;if(P.x1<z.left||P.y1<z.top||P.x2>this.viewport.width-z.right||P.y2>this.viewport.height-z.bottom)return null;if(!r.allowOverlap){if(Ra(o,P))return null;Ha(o,P);}let O=[],N=[],W=[],B=[],D=[],K=[],$=0,oe=I-F/2,ye=M?(k+f)/2:0,J=1/0,X=1/0,me=-1/0,pe=-1/0;if(b){let Z=M||_?I:oe+(m?E+f:0)+v/2;for(let U of b.glyphs){let j=U.glyph,fe=`g:${j.id}`,ne=this.atlas.get(fe);if(!ne&&(!j.bitmap||(ne=this.atlas.add(fe,j.bitmap,j.width+he*2,j.height+he*2)??void 0,!ne)))continue;let ue=Z+(U.x+j.left-he)*g,re=A+ye+(U.y-j.top-he)*g,ge=ne.width*g,Ae=ne.height*g;Eo(O,N,ue,re,ge,Ae,ne,0,a),$++;let ve=he*g;J=Math.min(J,ue+ve),X=Math.min(X,re+ve),me=Math.max(me,ue+ge-ve),pe=Math.max(pe,re+Ae-ve);}if(M&&m&&X<1/0){let U=A-L/2+k+f-X;if(U!==0){for(let j=1;j<O.length;j+=4)O[j]+=U;X+=U,pe+=U;}}}if(m){let Z=l?of:1,U=T*Z,j=C*Z,fe=(M?I-T/2:oe+(E-T)/2)-(U-T)/2,ne=(M?A-L/2+(k-C)/2:A-C/2)-(j-C)/2;if(y){let re=c*p*Z,ge=fe+U/2-re/2,Ae=ne+j/2-re/2,ve=he/Math.max(y.height-he*2,1)*re;Eo(D,K,ge-ve,Ae-ve,re+ve*2,re+ve*2,y,0,a),$++;}if(_&&me>J){let re=f*1.6,ge=f;U=(me-J+re*2)*Z,j=(pe-X+ge*2)*Z,fe=J-re,ne=X-ge;}let ue=he/Math.max(m.height-he*2,1)*j;Eo(W,B,fe-ue,ne-ue,U+ue*2,j+ue*2,m,e.rotate,a),$++;}return $?{verts:O,texs:N,iconVerts:W,iconTexs:B,frameVerts:D,frameTexs:K,quads:$,box:P}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,h=e.layer.layout??{},u=[],d=[],m=[],y=0,p=r/2+za,b=this.padding,g=T=>{let E=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of E)if(k.x1<b.left||k.y1<b.top||k.x2>this.viewport.width-b.right||k.y2>this.viewport.height-b.bottom||!h.allowOverlap&&Ra(n,k))return false;if(!h.allowOverlap)for(let k of E)Ha(n,k);return m.push(...E),true},v=-1/0,w=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),w=Math.min(w,T.glyph.top-T.glyph.height));let S=Number.isFinite(v)?(v+w)/2*o:0,M=Gr(s,this.viewport.width,this.viewport.height,rf).flatMap(T=>Ur(T,c,f,{spacing:h.symbolSpacing,fontSize:We*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let E=0;E<t.glyphs.length;E++){let k=t.glyphs[E].glyph,F=T.glyphs[E],L=`g:${k.id}`,I=this.atlas.get(L);if(!I&&(!k.bitmap||(I=this.atlas.add(L,k.bitmap,k.width+he*2,k.height+he*2)??void 0,!I)))continue;let A=I.width*o,R=I.height*o,P=(k.height/2-k.top)*o+S,z=F.angle*Math.PI/180;Eo(u,d,F.x-A/2-Math.sin(z)*P,F.y-R/2+Math.cos(z)*P,A,R,I,F.angle,l),y++;}if(!y)return null;let x=m.map(T=>(T.x1+T.x2)/2),C=m.map(T=>(T.y1+T.y2)/2);return {verts:u,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...x)-p,y1:Math.min(...C)-p,x2:Math.max(...x)+p,y2:Math.max(...C)+p}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*Xr),h=new Float32Array(f),u=new Uint16Array(f),d=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){d.push({layer:g,role:v,first:m/4*6,count:w*6});for(let S=0;S<w*4;S++){let _=m*5;h[_]=p[S*4],h[_+1]=p[S*4+1],u[_*2+4]=b[S*2],u[_*2+5]=b[S*2+1],h[_+3]=p[S*4+2],h[_+4]=p[S*4+3],m++;}}};for(let p of this.inStyleOrder(o))y(p.frameVerts,p.frameTexs,p.layer,"frame"),y(p.iconVerts,p.iconTexs,p.layer,"icon"),y(p.verts,p.texs,p.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Vr),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let p of d){let b=p.layer.paint,g=V(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",S=(E,k,F)=>w?k??E??F:v?E??F:F,_=ke(w?b.frameColor??b.haloColor??b.color:S(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=w?b.frameHaloColor:S(b.iconHaloColor,void 0,b.haloColor),x=ke(M??(w?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(x[3]*=.35),w&&(_[3]*=V(b.frameOpacity,n,1));let C=V(w?b.frameHaloWidth??1.1:S(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=V(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",_e([x[0],x[1],x[2],x[3]*g])),a.setFloat("u_halo",C/(Nt*(T/We))),l.drawElements(l.TRIANGLES,p.count,l.UNSIGNED_INT,p.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new be(e,new Uint8Array(this.capacityQuads*4*Xr),Fa,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new se(e,o),this.vao=new ae(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Eo(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,h=Math.cos(f),u=Math.sin(f),d=t+r/2,m=o+n/2;for(let[y,p]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=y-d,g=p-m;i.push(d+b*h-g*u,m+b*u+g*h,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function cf(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let h=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!h)break;c.push(h);}return c.length>=2?c:void 0}var Pa=(i,e)=>i*4096+e;function Ra(i,e){let t=Math.floor(e.x1/je),o=Math.floor(e.y1/je),r=Math.floor(e.x2/je),n=Math.floor(e.y2/je);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(Pa(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Ha(i,e){let t=Math.floor(e.x1/je),o=Math.floor(e.y1/je),r=Math.floor(e.x2/je),n=Math.floor(e.y2/je);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=Pa(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function Oa(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=V(i.layout?.arrowLength,e,50)*r;return {shift:V(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function Wa(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var yt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new H;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var gt=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function ff(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new gt(t,s,l),f=c.bounds(),h=(f.minX+f.maxX)/2,u=(f.minY+f.maxY)/2,d=[[h,u],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of d)if(i.isOnGlobeFront(Se(p),Ce(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of d){let g=i.localToPoint(i.globeLocal(p,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){y=true;break}}if(y&&(n.push(c),n.length>=r))return n}return n}function Xt(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return ff(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],h=[];for(let d=s;d<=c;d++)h.push(new gt(0,0,0,d));let u=0;for(;h.length&&!(++u>2e4||f.length>=n);){let d=h.pop();if(!i.isTileVisible(d))continue;if(d.z>=l){d.z>=o&&f.push(d);continue}if(i.tileScreenSize(d.z,i.distanceToTile(d))<=a&&d.z>=o){f.push(d);continue}for(let y of d.children())h.push(y);}return f.sort((d,m)=>i.distanceToTile(d)-i.distanceToTile(m)),f}var Yr=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new H;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},uf=1500,Fo=class extends Ve{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new yt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Xt(t,this.opts),r=new Q;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>uf?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new Q;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new Yr(t);this.cache.set(t.dataKey,o);let r=df(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:gn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function df(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var zo=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},Yt=class extends Ve{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new yt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=Xt(t,this.opts);let o=new Q;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new zo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Va(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function Va(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var hf="osmgl-assets",vt="assets";var Ro=null;function Da(){return Ro||(Ro=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(hf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(vt)||t.createObjectStore(vt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Ro)}function mf(i){return Da().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(vt,"readonly").objectStore(vt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function pf(i){Da().then(e=>{if(e)try{e.transaction(vt,"readwrite").objectStore(vt).put(i);}catch{}});}var Ba=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function bf(i,e,t){let o=await crypto.subtle.importKey("raw",Ba(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ba(t),tagLength:128},o,i)}var Kt=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await mf(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),pf({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return bf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var yf=1,$t=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=G();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${yf++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await Ir(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=q(this.coordinates);return {x:ee(e.lng),y:te(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Le(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=$r(n(-this.rotation));this.rotationTiltX&&(a=Xe(Kr(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Xe(qr(n(this.rotationTiltZ)),a));let l=Xe(r,a),s=this.matrix;return Re(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=q(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return xe(n,r,this.localMatrix(o.lat)),He(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=q(this.coordinates),n=Le(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,h=s,u=f,d=c,m=p=>p*Math.PI/180,y=$r(m(-this.rotation));return this.rotationTiltX&&(y=Xe(Kr(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Xe(qr(m(this.rotationTiltZ)),y)),[(y[0]*h+y[1]*u+y[2]*d)/t,(y[3]*h+y[4]*u+y[5]*d)/t,(y[6]*h+y[7]*u+y[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=q(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],h=s[8],u=s[9],d=c*u-f*h;if(Math.abs(d)<1e-30)return false;let m=(n*u-a*h)/d,y=(c*a-f*n)/d,p=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*p,w=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=w}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=G();for(let h=0;h<16;h++)a[h]=e[h];let l=q(this.coordinates),s=G();xe(s,a,this.localMatrix(l.lat));let c=G();Er(n,t,n.duration>0?o%n.duration:0,c);let f=G();return xe(f,s,c),He(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=$r(e(-this.rotation));this.rotationTiltX&&(t=Xe(Kr(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Xe(qr(e(this.rotationTiltZ)),t));let o=Xe([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function Xe(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var Kr=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},$r=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},qr=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Po=class{constructor(){this.hit=new H;this.miss=new Q;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),h=new Uint32Array(a.indices),u=new Float64Array(a.featureIds),d=f.length/a.vertexCount;for(let m=0;m*3+2<h.length;m++){let y=h[m*3]*d,p=h[m*3+1]*d,b=h[m*3+2]*d;if(!Sf(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=u[m];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},gf=14,vf=2e3,wf=4e3,Ga=160,xf=50,_f=4e3,Zr=6,Oo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new H;this.loading=0;this.pending=[];this.known=new H;this.underBuilding=new Po;this.underVenue=new Po;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ga;this.replacedBuildings=new Q;this.replacedVenues=new Q;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new Kt(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??gf,f=s.loadRadius??vf,h=Math.max(s.keepRadius??wf,f),u=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((s.budget??Ga)*this.budgetScale*u));this.budget=d,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let A of [...this.entries.values()])A.model.retire(),A.model.grow<=0&&this.release(A,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let p=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let A of t.visibleTiles)g+=A.dataKey+(t.getTile(A)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let A=new Q;v=0;for(let R of t.visibleTiles){let P=t.getTile(R)?.data?.buckets?.[e.id];if(!P||!aa(P))continue;let z=new Int16Array(P.anchors),O=R.bounds(),N=O.maxX-O.minX,W=O.maxY-O.minY;for(let B=0;B<P.props.length;B++){let D=P.props[B],K=Je(D.file,NaN);if(!Number.isFinite(K))continue;let $=String(D.kind??"model"),oe=$==="rule"?`t-${D.rid}-${D.oid}`:`m-${D.mid}`;if(A.has(oe))continue;A.add(oe),$==="rule"&&v++;let ye=O.minX+z[B*2]/P.extent*N,J=O.minY+z[B*2+1]/P.extent*W,X=Cf(ye,J);this.known.set(oe,{id:oe,fileId:K,lng:X.lng,lat:X.lat,mercX:ye,mercY:J,altitude:Je(D.alt,0),scale:Je(D.scale,1),rotation:Je(D.rx,0),tiltX:Je(D.rz,0),tiltZ:Je(D.ry,0),kind:$==="rule"?"rule":"model",target:Ho($==="rule"?D.oid:D.replaces),replaces:m?$==="rule"?Ho(D.oid):String(D.anchor??"replace")==="replace"?Ho(D.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,S=new Q;for(let A of w)A.kind==="model"&&A.target!==null&&S.add(A.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),x=A=>Math.hypot((A.lng-p.lng)*_*M,(A.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedVenues.clear();let C=new Q,T=[],E=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>xf)&&(w.sort((A,R)=>x(A)-x(R)),this.sortedAt={lng:p.lng,lat:p.lat});let L=0;for(let A of w){let R=x(A);if(R>h){E++;continue}if(A.kind==="rule"&&A.target!==null&&S.has(A.target)){let N=this.entries.get(A.id);N&&N.model.retire();continue}let P=this.entries.get(A.id);if(L>=d){k++,P&&P.model.retire();continue}L++,C.add(A.id);let z=()=>{if(A.replaces===null)return;this.replacedBuildings.add(A.replaces);let N=this.underBuilding.find(A,a);N!==null&&this.replacedBuildings.add(N);let W=this.underVenue.find(A,l);W!==null&&this.replacedVenues.add(W);},O=P;if(O){z(),O.distance=R,O.leftAt=0,O.model.revive(),b<O.lod&&!O.upgrading&&this.loading<Zr&&this.upgrade(O,b,r,n);continue}if(R>f){E++;continue}if(this.loading>=Zr){T.push(A),z();continue}z(),this.spawn(A,R,b,r);}for(let A of [...this.entries.values()])if(!C.has(A.placement.id)){if(A.leftAt===0){A.leftAt=y;continue}y-A.leftAt>_f&&A.model.retire();}for(let A of [...this.entries.values()])A.model.growTarget===0&&A.model.grow<=0&&this.release(A,n);if(this.known.size>4e3)for(let[A,R]of [...this.known.entries()])x(R)>h*3&&this.known.delete(A);let I=this.stats;I.found=w.length,I.kept=C.size,I.live=this.entries.size,I.tooFar=E,I.overBudget=k,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<Zr&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new $t({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},Je=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Ho=i=>{let e=Je(i,NaN);return Number.isFinite(e)?e:null};function Cf(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Sf(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}var Mf=200,Tf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},qt=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Tf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Af),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=q(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ee(t.lng)*o,te(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Mf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Af='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var Zt=class extends qt{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var kf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],Na=new Map(kf);function Qr(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=Na.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>Na.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function en(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let h of i.features()){if(!de(e.filter,h.properties))continue;let u=h.loadGeometry(),d=Ef(h.type,u);if(!d)continue;let m=e.textField?Jr(e.textField,h.properties):"",y=m&&e.abbreviate?Qr(m):m,p=e.iconImage?Jr(e.iconImage,h.properties):"";if(!(!y&&!p)){if(l){let b=If(h.type,u);if(!b)continue;f.push({text:y,line:b});continue}t.push(d[0],d[1]),o.push(y),r.push(p),n.push(Ff(h.properties)),a.push(e.iconRotate&&Math.round(Number(h.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:h,line:u}of Lf(f)){c.push(s.length/2);for(let d of u)s.push(d);t.push(Math.round(u[0]),Math.round(u[1])),o.push(h),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Lf(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let h=e[f];if(h.line.push(...a.slice(2)),o.delete(l),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f),c!==void 0&&c!==f){let u=e[c];h.line.push(...u.line.slice(2)),u.line=[],t.delete(s),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f);}continue}if(c!==void 0){let h=e[c];h.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,h.line[0],h.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function If(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function Ef(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let h=c[f+2]-c[f],u=c[f+3]-c[f+1],d=h*h+u*u;d>a&&(a=d,l=c[f]+h/2,s=c[f+1]+u/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Ff(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Jr(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function Ua(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&de(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function zf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Xa(i,e){let t=performance.now(),o=zf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(p,b,g,v,w=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:v,parseMs:w},diag:{status:p,bytes:b,layers:g,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new Mt(a),f=Object.keys(c.layers),h={},u={},d=[],y=i.plan.some(p=>p.type==="surface"&&(p.elevation??0)>0)&&i.plan.some(p=>p.type==="line"&&p.ground)?sr(i.metersPerTile):void 0;for(let p of i.plan){if(!Hf(p,i.zoom,i.sourceMaxZoom))continue;let b=c.layers[p.sourceLayer];if(!b)continue;let g=Pf(i.zoom,b.extent);try{if(p.splitBy){let w=Of(b,p.splitBy,p.filter);if(!w.length)continue;let S=u[p.splitBy]??(u[p.splitBy]=[]);for(let _ of w){S.includes(_)||S.push(_);let M={...p,splitBy:void 0,filter:Wf(p.filter,p.splitBy,_)},x=ja(M,b,g,i.metersPerTile,y);x&&(h[st(p.id,_)]=x);}continue}let v=ja(p,b,g,i.metersPerTile,y);v&&(h[p.id]=v);}catch(v){d.push(`${p.id}: ${v instanceof Error?v.message:String(v)}`);}}return {type:"loaded",id:i.id,buckets:h,...Object.keys(u).length?{splits:u}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(h).length,...d.length?{failed:d}:{}}}}function Rf(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function Hf(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Pf(i,e){return i<=6?Math.max(64,e/24):0}function ja(i,e,t,o,r){{if(i.type==="fill"){let a=o>0?o/e.extent:0,l=i.cornerRadius&&a>0?{radius:i.cornerRadius/a,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:On/a}:void 0,s=lr(e,i.filter,t,l,i.clipToTile===true,e.extent);return s?{kind:"fill",...s,extent:e.extent}:null}if(i.type==="surface"){let a=ar(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:i.elevation??0,base:i.base,bevel:i.bevel,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:l=>cr(r,l,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Rf(i.groundBy)}:{}});return a?{kind:"surface",...a}:null}if(i.type==="line"){let a=ur(e,i.filter,t,i.ground?r:void 0);return a?{kind:"line",...a,extent:e.extent}:null}if(i.type==="model"){let a=Ua(e,i.filter);return a?{kind:"placement",...a,extent:e.extent}:null}if(i.type==="symbol"){let a=en(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return a?{kind:"symbol",...a,extent:e.extent}:null}let n=tr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return n?{kind:"fill-extrusion",vertices:n.vertices,indices:n.indices,featureIds:n.featureIds,vertexCount:n.vertexCount,indexCount:n.indexCount,extent:n.extent}:null}}function Of(i,e,t){let o=[];for(let r of i.features()){if(!de(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function Wf(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var tn='"use strict";(()=>{var se=new Set,Pe=!1;function Y(t,e,n=2){let r=e&&e.length,o=r?e[0]*n:t.length;se.size&&se.clear();let i=ft(t,0,o,n,!0),s=[];if(!i||i.next===i.prev)return s;let u=0,c=0,l=0;if(r&&(i=un(t,e,i,n)),t.length>80*n){u=t[0],c=t[1];let f=u,m=c;for(let a=n;a<o;a+=n){let h=t[a],d=t[a+1];h<u&&(u=h),d<c&&(c=d),h>f&&(f=h),d>m&&(m=d)}l=Math.max(f-u,m-c),l=l!==0?32767/l:0}return Ae(i,s,u,c,l),s}function ft(t,e,n,r,o){let i=null;if(o===wn(t,e,n,r)>0)for(let s=e;s<n;s+=r)i=lt(s/r|0,t[s],t[s+1],i);else for(let s=n-r;s>=e;s-=r)i=lt(s/r|0,t[s],t[s+1],i);return i&&ue(i,i.next)&&(le(i),i=i.next),i}function $(t,e=t){let n=e===t,r=t,o;do o=!1,r!==r.next&&(se.size===0||!se.has(r))&&(ue(r,r.next)||L(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),Pe=!0,le(r),r=r.prev,o=!0):(n||r!==e)&&(r=r.next,o=!n);while(o||r!==e);return e}function Ae(t,e,n,r,o){o&&dn(t,n,r,o);let i=t,s=!1;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(L(u,t,c)<0&&(o?rn(t,n,r,o):nn(t))){e.push(u.i,t.i,c.i),le(t),t=c,i=c;continue}if(t=c,t===i){if(Pe=!1,t=$(t),Pe){i=t;continue}if(!s){t=on(t,e),i=t,s=!0;continue}sn(t,e,n,r,o);break}}}function nn(t){let e=t.prev,n=t,r=t.next,o=e.x,i=n.x,s=r.x,u=e.y,c=n.y,l=r.y,f=Math.min(o,i,s),m=Math.min(u,c,l),a=Math.max(o,i,s),h=Math.max(u,c,l),d=r.next;for(;d!==e;){if(d.x>=f&&d.x<=a&&d.y>=m&&d.y<=h&&!(o===d.x&&u===d.y)&&ge(o,u,i,c,s,l,d.x,d.y)&&L(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function rn(t,e,n,r){let o=t.prev,i=t,s=t.next,u=o.x,c=i.x,l=s.x,f=o.y,m=i.y,a=s.y,h=Math.min(u,c,l),d=Math.min(f,m,a),g=Math.max(u,c,l),x=Math.max(f,m,a),p=Te(h,d,e,n,r),w=Te(g,x,e,n,r),b=t.prevZ;for(;b&&b.z>=p;){if(b.x>=h&&b.x<=g&&b.y>=d&&b.y<=x&&b!==s&&!(u===b.x&&f===b.y)&&ge(u,f,c,m,l,a,b.x,b.y)&&L(b.prev,b,b.next)>=0)return!1;b=b.prevZ}let y=t.nextZ;for(;y&&y.z<=w;){if(y.x>=h&&y.x<=g&&y.y>=d&&y.y<=x&&y!==s&&!(u===y.x&&f===y.y)&&ge(u,f,c,m,l,a,y.x,y.y)&&L(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function on(t,e){let n=t,r=!1;do{let o=n.prev,i=n.next.next;mt(o,n,n.next,i,!1)&&ce(o,i)&&ce(i,o)&&(e.push(o.i,n.i,i.i),le(n),le(n.next),n=t=i,r=!0),n=n.next}while(n!==t);return r?$(n):n}function sn(t,e,n,r,o){let i=t;do{let s=i.next.next;for(;s!==i.prev;){if(i.i!==s.i&&bn(i,s)){let u=dt(i,s);i=$(i,i.next),u=$(u,u.next),Ae(i,e,n,r,o),Ae(u,e,n,r,o);return}s=s.next}i=i.next}while(i!==t)}var Be=!1;function un(t,e,n,r){let o=[];for(let i=0,s=e.length;i<s;i++){let u=e[i]*r,c=i<s-1?e[i+1]*r:t.length,l=ft(t,u,c,r,!1);l===l.next&&se.add(l),o.push(pn(l))}o.sort(cn),fn(t.length/r,e.length),ht(n,n),Be=!0;for(let i=0;i<o.length;i++)n=ln(o[i],n);return Be=!1,$(n)}function cn(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function ln(t,e){let n=hn(t,e);if(!n)return e;let r=dt(n,t),o=r.next;return ht(n,o.next),$(r,r.next),$(n,n.next)}var at=16,T=new Float64Array(0),ye=0,Ie=[],Ee=[];function fn(t,e){let n=Math.ceil((t+2*e)/at)+e+2;T.length<n*4&&(T=new Float64Array(n*4)),ye=0}function ht(t,e){let n=t;do{let r=ye++;Ie[r]=n;let o=1/0,i=1/0,s=-1/0,u=-1/0,c=0;do{let f=n.next;n.z=r,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<i&&(i=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<i&&(i=f.y),f.y>u&&(u=f.y),n=f}while(++c<at&&n!==e);Ee[r]=n;let l=r*4;T[l]=o,T[l+1]=i,T[l+2]=s,T[l+3]=u}while(n!==e)}function an(t,e){let n=t.z*4;e.x<T[n]&&(T[n]=e.x),e.y<T[n+1]&&(T[n+1]=e.y),e.x>T[n+2]&&(T[n+2]=e.x),e.y>T[n+3]&&(T[n+3]=e.y)}function ut(t){let e=Ee[t];for(;e.prev.next!==e;)e=e.next;return Ee[t]=e,e}function ct(t){let e=Ie[t];for(;e.prev.next!==e;)e=e.next;return Ie[t]=e,e}function hn(t,e){let n=e,r=t.x,o=t.y,i=-1/0,s;if(ue(t,n))return n;for(let a=0,h=0;a<ye;a++,h+=4){if(o<T[h+1]||o>T[h+3]||T[h]>r||T[h+2]<=i)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n){if(ue(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let g=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=r&&g>i&&(i=g,s=n.x<n.next.x?n:n.next,g===r))return s}}n=n.next}while(n!==d)}if(!s)return null;let u=s.x,c=s.y,l=Math.min(o,c),f=Math.max(o,c),m=1/0;for(let a=0,h=0;a<ye;a++,h+=4){if(T[h+2]<u||T[h]>r||T[h+3]<l||T[h+1]>f)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n&&r>=n.x&&n.x>=u&&r!==n.x&&ge(o<c?r:i,o,u,c,o<c?i:r,o,n.x,n.y)){let g=Math.abs(o-n.y)/(r-n.x);(ce(n,t)||n.y===o&&n.next.y===o&&n.next.x>r)&&(g<m||g===m&&(n.x>s.x||n.x===s.x&&mn(s,n)))&&(s=n,m=g)}n=n.next}while(n!==d)}return s}function mn(t,e){return L(t.prev,t,e.prev)<0&&L(e.next,t,t.next)<0}var G=[],re=[],Z=new Uint32Array(0),oe=new Uint32Array(0),ie=new Uint32Array(256);function dn(t,e,n,r){let o=t,i=0;do o.z=Te(o.x,o.y,e,n,r),G[i++]=o,o=o.next;while(o!==t);xn(i);let s=null;for(let u=0;u<i;u++){let c=G[u];c.prevZ=s,s&&(s.nextZ=c),s=c}s.nextZ=null}function xn(t){if(t<=32){for(let e=1;e<t;e++){let n=G[e],r=n.z,o=e-1;for(;o>=0&&G[o].z>r;)G[o+1]=G[o],o--;G[o+1]=n}return}Z.length<t&&(Z=new Uint32Array(t),oe=new Uint32Array(t),re=new Array(t));for(let e=0;e<t;e++)Z[e]=G[e].z;pe(t,G,Z,re,oe,0),pe(t,re,oe,G,Z,8),pe(t,G,Z,re,oe,16),pe(t,re,oe,G,Z,24)}function pe(t,e,n,r,o,i){ie.fill(0);for(let u=0;u<t;u++)ie[n[u]>>>i&255]++;let s=0;for(let u=0;u<256;u++){let c=ie[u];ie[u]=s,s+=c}for(let u=0;u<t;u++){let c=n[u],l=ie[c>>>i&255]++;r[l]=e[u],o[l]=c}}function Te(t,e,n,r,o){return t=(t-n)*o|0,e=(e-r)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function pn(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function ge(t,e,n,r,o,i,s,u){return(o-s)*(e-u)>=(t-s)*(i-u)&&(t-s)*(r-u)>=(n-s)*(e-u)&&(n-s)*(i-u)>=(o-s)*(r-u)}function bn(t,e){let n=ue(t,e)&&L(t.prev,t,t.next)>0&&L(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||ce(t,e)&&ce(e,t)&&(L(t.prev,t,e.prev)!==0||L(t,e.prev,e)!==0))&&!yn(t,e)&&(n||gn(t,e))}function L(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ue(t,e){return t.x===e.x&&t.y===e.y}function mt(t,e,n,r,o=!0){let i=L(t,e,n),s=L(t,e,r),u=L(n,r,t),c=L(n,r,e);return(i>0&&s<0||i<0&&s>0)&&(u>0&&c<0||u<0&&c>0)?!0:o?!!(i===0&&be(t,n,e)||s===0&&be(t,r,e)||u===0&&be(n,t,r)||c===0&&be(n,e,r)):!1}function be(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function yn(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),o=Math.min(t.y,e.y),i=Math.max(t.y,e.y),s=t;do{let u=s.next;if(s.x>r&&u.x>r||s.x<n&&u.x<n||s.y>i&&u.y>i||s.y<o&&u.y<o){s=u;continue}if(s.i!==t.i&&u.i!==t.i&&s.i!==e.i&&u.i!==e.i&&mt(s,u,t,e))return!0;s=u}while(s!==t);return!1}function ce(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function gn(t,e){let n=t,r=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{let s=n.next;n.y>i!=s.y>i&&o<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x&&(r=!r),n=s}while(n!==t);return r}function dt(t,e){let n=Ve(t.i,t.x,t.y),r=Ve(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function lt(t,e,n,r){let o=Ve(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function le(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Be&&an(t.prev,t.next)}function Ve(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function wn(t,e,n,r){let o=0;for(let i=e,s=n-r;i<n;i+=r)o+=(t[s]-t[i])*(t[i+1]+t[s+1]),s=i;return o}var xt=23283064365386963e-26,Fn=12,pt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Le=0,we=1,fe=2,Fe=5,ae=class{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,n,r=this.length){for(;this.pos<r;){let o=this.readVarint(),i=o>>3,s=this.pos;this.type=o&7,e(i,n,this),this.pos===s&&this.skip(o)}return n}readMessage(e,n){return this.readFields(e,n,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)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;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 n=this.buf,r,o;return o=n[this.pos++],r=o&127,o<128||(o=n[this.pos++],r|=(o&127)<<7,o<128)||(o=n[this.pos++],r|=(o&127)<<14,o<128)||(o=n[this.pos++],r|=(o&127)<<21,o<128)?r:(o=n[this.pos],r|=(o&15)<<28,Mn(r,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,n=this.pos;return this.pos=e,e-n>=Fn&&pt?pt.decode(this.buf.subarray(n,e)):Cn(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===fe?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===Le)for(;this.buf[this.pos++]>127;);else if(n===fe)this.pos=this.readVarint()+this.pos;else if(n===Fe)this.pos+=4;else if(n===we)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}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,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Rn(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=_n(this.buf,e,this.pos);let r=this.pos-n;r>=128&&bt(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}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 n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let o=this.pos-r;o>=128&&bt(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o}writeMessage(e,n,r){this.writeTag(e,fe),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,kn,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Pn,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,In,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,An,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Bn,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,En,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,Tn,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Vn,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Ln,n)}writeBytesField(e,n){this.writeTag(e,fe),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,Fe),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,Fe),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,we),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,we),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,Le),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,Le),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,fe),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,Fe),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,we),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Mn(t,e,n){let r=n.buf,o,i;if(i=r[n.pos++],o=(i&112)>>4,i<128||(i=r[n.pos++],o|=(i&127)<<3,i<128)||(i=r[n.pos++],o|=(i&127)<<10,i<128)||(i=r[n.pos++],o|=(i&127)<<17,i<128)||(i=r[n.pos++],o|=(i&127)<<24,i<128)||(i=r[n.pos++],o|=(i&1)<<31,i<128))return W(t,o,e);throw new Error("Expected varint not more than 10 bytes")}function W(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Rn(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Sn(n,r,e),vn(r,e)}function Sn(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function vn(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function bt(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function kn(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Pn(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function An(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Bn(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function In(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function En(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function Tn(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Vn(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Ln(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Cn(t,e,n){let r="",o=e;for(;o<n;){let i=t[o],s=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u>n)break;let c,l,f;u===1?i<128&&(s=i):u===2?(c=t[o+1],(c&192)===128&&(s=(i&31)<<6|c&63,s<=127&&(s=null))):u===3?(c=t[o+1],l=t[o+2],(c&192)===128&&(l&192)===128&&(s=(i&15)<<12|(c&63)<<6|l&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(c=t[o+1],l=t[o+2],f=t[o+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(s=(i&15)<<18|(c&63)<<12|(l&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,r+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),r+=String.fromCharCode(s),o+=u}return r}function _n(t,e,n){for(let r=0,o,i;r<e.length;r++){if(o=e.charCodeAt(r),o>55295&&o<57344)if(i)if(o<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=o;continue}else o=i-55296<<10|o-56320|65536,i=null;else{o>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=o;continue}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);o<128?t[n++]=o:(o<2048?t[n++]=o>>6|192:(o<65536?t[n++]=o>>12|224:(t[n++]=o>>18|240,t[n++]=o>>12&63|128),t[n++]=o>>6&63|128),t[n++]=o&63|128)}return n}var Ce=class t{constructor(e,n,r,o){this.pbf=e;this.keys=n;this.values=r;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,o,i){let s=new t(e,r,o,i);return e.readFields(Dn,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,o=1,i=0,s=0,u=0,c=[],l=[];for(;e.pos<r;){if(i<=0){let f=e.readVarint();o=f&7,i=f>>3}if(i--,o===1||o===2)s+=e.readSVarint(),u+=e.readSVarint(),o===1&&(l.length&&c.push(l),l=[]),l.push(s,u);else if(o===7)l.length>=2&&l.push(l[0],l[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${o}`)}return l.length&&c.push(l),e.pos=n,c}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return[n,r,o,i]}};function Dn(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Un(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Un(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],o=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=o)}}var _e=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(On,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return Ce.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function On(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Gn(n)))}function Gn(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var Me=class{constructor(e){this.layers={};new ae(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,o,i)=>{if(r===3&&i){let s=_e.read(i,i.readVarint()+i.pos);s.length&&(this.layers[s.name]=s)}},null)}};function K(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let o=Hn(r);o!==0&&(o>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Hn(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function _(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>_(r,e));case"any":return t.slice(1).some(r=>_(r,e));case"!":return!_(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],o=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===o;case"!=":return r!==o;case">":return r>o;case">=":return r>=o;case"<":return r<o;case"<=":return r<=o;default:return!0}}}}var Nn=Math.PI/8,Xn=.35,zn=32,yt=.25,gt=.07;function X(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let o=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??Xn,0),s=e.extent,u=[];for(let c=0;c<r;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+r-1)%r*2],a=t[(c+r-1)%r*2+1],h=t[(c+1)%r*2],d=t[(c+1)%r*2+1],g=l-m,x=f-a,p=h-l,w=d-f,b=Math.hypot(g,x),y=Math.hypot(p,w);if(b<1e-6||y<1e-6){u.push(l,f);continue}let F=g/b,M=x/b,v=p/y,R=w/y;if(e.keep?.[c]){u.push(l,f);continue}let S=F*v+M*R;if(S>.985){u.push(l,f);continue}if(s!==void 0&&(De(l,f,s)||De(m,a,s)||De(h,d,s))){u.push(l,f);continue}let P=Math.min(n,b*.4,y*.4);if(P<n*i){u.push(l,f);continue}let V=l-F*P,E=f-M*P,I=l+v*P,A=f+R*P,k=Math.acos(Math.max(-1,Math.min(1,S))),B=Math.min(Nn,Math.PI/2/o),C=Math.ceil(k/B-1e-6),O=e.maxChord&&e.maxChord>0?Math.ceil(P/Math.tan(k/2)*k/e.maxChord):0,z=Math.max(1,Math.min(zn,Math.max(Math.min(o,C),O)));u.push(V,E);for(let H=1;H<z;H++){let D=H/z,U=1-D;u.push(U*U*V+2*U*D*l+D*D*I,U*U*E+2*U*D*f+D*D*A)}u.push(I,A)}return u.length<6?t:(u.push(u[0],u[1]),u)}var De=(t,e,n)=>t<=0||e<=0||t>=n||e>=n;function J(t,e){let n=wt(t.outer,e);if(!n)return null;let r=[];for(let o of t.holes){let i=wt(o,e);i&&r.push(i)}return{outer:n,holes:r}}function wt(t,e){let n=[];for(let r=0;r<t.length-2;r+=2)n.push(t[r],t[r+1]);if(n.length<6)return null;for(let r=0;r<4;r++){let o=n;n=[];let i=o.length/2;if(i===0)return null;for(let s=0;s<i;s++){let u=o[s*2],c=o[s*2+1],l=o[(s+i-1)%i*2],f=o[(s+i-1)%i*2+1],m=Ft(u,c,r,e),a=Ft(l,f,r,e);if(m!==a){let h=Yn(l,f,u,c,r,e);n.push(l+(u-l)*h,f+(c-f)*h)}m&&n.push(u,c)}}return n.length<6?null:(n.push(n[0],n[1]),n)}function Ft(t,e,n,r){return n===0?t>=0:n===1?t<=r:n===2?e>=0:e<=r}function Yn(t,e,n,r,o,i){return o===0?(0-t)/(n-t):o===1?(i-t)/(n-t):o===2?(0-e)/(r-e):(i-e)/(r-e)}function Re(t,e,n,r,o){return t===0&&n===0||t===o&&n===o||e===0&&r===0||e===o&&r===o}function Mt(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ge=18,He=4,Pt=65535/He,Zn=9,$n=1,jn=0,Wn=1,Kn=2;var Rt=0,Jn=1,St=2,Qn=3,qn=.47;function At(t,e,n,r={}){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:qn,i=Math.max(1024,t.length*48),s=new ArrayBuffer(i*Ge),u={verts:new DataView(s),vertsU8:new Uint8Array(s),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};u.ensure=a=>c(a);let c=a=>{if(u.vertexCount+a<=i)return;i=Math.max(i*2,u.vertexCount+a);let h=new ArrayBuffer(i*Ge);new Uint8Array(h).set(u.vertsU8.subarray(0,u.vertOffset)),s=h,u.verts=new DataView(h),u.vertsU8=new Uint8Array(h)};for(let a of t.features()){if(a.type!==3||!_(n,a.properties))continue;let h=wr(a.properties),d=Fr(a.properties,h);if(h<=d)continue;let g=Rr(a.properties)??Number(a.id??0),x=gr(g>>>0),p=yr(x,a.properties),w=br(a.properties,h),b=K(a.loadGeometry());for(let y of b){let F=J(y,e);if(!F)continue;let M=Mt(F.outer,e),v=(r.cornerRadius??0)/o,R={radius:v,segments:r.cornerSegments,extent:e,minCutRatio:0},S=v>0?{outer:X(F.outer,R),holes:F.holes.map(k=>X(k,R))}:F,P=S.outer.length/2+S.holes.reduce((k,B)=>k+B.length/2,0);c(P*5+32);let V=S.holes.length||M?null:rr(S.outer),E=V?lr(a.properties,V,h,x,o):null,I=null,A=[];if(E&&V){let k=Bt(hr(S.outer,o),V,E.shape);A=mr(k,S.outer);let B=dr(k,A);if(B>1e-6){let C=Math.min(Math.max(B*o*sr,cr),ur);I=xr(k,C/B,h)}}vt(u,S.outer,d,h,g,p,w,o,e,I);for(let k of S.holes)vt(u,k,d,h,g,p,w,o,e,null);I?pr(u,A,I,h,g,p,w,o):nr(u,S.outer,S.holes,h,g,p,w)}}if(!u.indices.length)return null;let l=new Uint32Array(u.indices),f=new Float64Array(u.featureIds);return{vertices:s.slice(0,u.vertOffset),indices:l.buffer,featureIds:f.buffer,vertexCount:u.vertexCount,indexCount:l.length,extent:e}}var Ne=(t,e)=>t|e<<2,Ue=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,Pt)*He)));function Q(t,e,n,r,o,i,s,u,c,l,f=0,m=0,a=0){let h=t.vertOffset;return t.verts.setInt16(h,Math.round(e),!0),t.verts.setInt16(h+2,Math.round(n),!0),t.verts.setUint16(h+4,Math.round(Math.min(r,Pt)*He),!0),t.vertsU8[h+6]=c,t.vertsU8[h+7]=u,t.verts.setInt8(h+8,Oe(Math.round(o*127))),t.verts.setInt8(h+9,Oe(Math.round(i*127))),t.verts.setInt8(h+10,Oe(Math.round(s*127))),t.vertsU8[h+11]=l,t.verts.setUint16(h+12,Ue(f),!0),t.verts.setUint16(h+14,Ue(m),!0),t.verts.setUint16(h+16,Ue(a),!0),t.vertOffset+=Ge,t.vertexCount++}function vt(t,e,n,r,o,i,s,u,c,l=null){let f=e.length/2;if(f<3)return;let m=Ne(jn,s),a=tr(e,u),h=r-n,d=new Float64Array(f*2),g=new Uint8Array(f);{let x=new Float64Array(f*2);for(let p=0;p<f-1;p++){let w=e[p*2+2]-e[p*2],b=e[p*2+3]-e[p*2+1],y=Math.hypot(w,b)||1;x[p*2]=b/y,x[p*2+1]=-w/y}for(let p=0;p<f-1;p++){let w=(p+f-2)%(f-1),b=x[w*2]*x[p*2]+x[w*2+1]*x[p*2+1],y=x[w*2]+x[p*2],F=x[w*2+1]+x[p*2+1],M=Math.hypot(y,F);b>.5&&M>1e-6&&(d[p*2]=y/M,d[p*2+1]=F/M,g[p]=1)}}for(let x=0;x<f-1;x++){let p=e[x*2],w=e[x*2+1],b=e[x*2+2],y=e[x*2+3];if(p===b&&w===y||Re(p,w,b,y,c))continue;let F=b-p,M=y-w,v=Math.hypot(F,M)||1,R=M/v,S=-F/v,P=a.offset[x],V=a.width[x],E=[0,1];if(l){for(let A=0;A<l.length;A++)for(let k=A+1;k<l.length;k++){let B=j(l[A],p,w)-j(l[k],p,w),C=j(l[A],b,y)-j(l[k],b,y);if(B===C)continue;let O=B/(B-C);O>1e-4&&O<1-1e-4&&E.push(O)}E.sort((A,k)=>A-k)}let I=(A,k)=>{if(!l)return r;let B=1/0;for(let C of l)B=Math.min(B,j(C,A,k));return Math.max(r,B)};for(let A=0;A+1<E.length;A++){let k=E[A],B=E[A+1];if(B-k<1e-6)continue;let C=p+F*k,O=w+M*k,z=p+F*B,H=w+M*B,D=P+v*k*u,U=P+v*B*u,N=(x+1)%(f-1),de=g[x]?d[x*2]:R,ve=g[x]?d[x*2+1]:S,xe=g[N]?d[N*2]:R,ke=g[N]?d[N*2+1]:S,We=R+(de-R)*(1-k),Ke=S+(ve-S)*(1-k),Je=R+(xe-R)*B,Qe=S+(ke-S)*B,qe=Math.hypot(We,Ke)||1,et=Math.hypot(Je,Qe)||1,tt=We/qe,nt=Ke/qe,rt=Je/et,ot=Qe/et;t.ensure(4);let it=Q(t,C,O,n,tt,nt,0,0,i,m,D,V,h),en=Q(t,z,H,n,rt,ot,0,0,i,m,U,V,h),tn=Q(t,C,O,I(C,O),tt,nt,0,255,i,m,D,V,h),st=Q(t,z,H,I(z,H),rt,ot,0,255,i,m,U,V,h);t.indices.push(it,st,en,it,tn,st),t.featureIds.push(o,o)}}}var er=.9976;function tr(t,e){let n=t.length/2-1,r=[];for(let c=0;c<n;c++){let l=t[c*2+2]-t[c*2],f=t[c*2+3]-t[c*2+1],m=Math.hypot(l,f);r.push(m>0?{x:l/m,y:f/m,len:m*e}:{x:0,y:0,len:0})}let o=(c,l)=>r[c].len>0&&r[l].len>0&&r[c].x*r[l].x+r[c].y*r[l].y>=er,i=0;for(;i<n&&o((i-1+n)%n,i);)i++;i>=n&&(i=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let c=0;c<n;){let l=(i+c)%n,f=[l],m=r[l].len,a=c+1;for(;a<n;){let d=(i+a)%n;if(!o((i+a-1)%n,d))break;f.push(d),m+=r[d].len,a++}let h=0;for(let d of f)s[d]=h,u[d]=m,h+=r[d].len;c=a}return{offset:s,width:u}}function nr(t,e,n,r,o,i,s){let u=[],c=[];for(let a=0;a<e.length;a++)u.push(e[a]);for(let a of n){c.push(u.length/2);for(let h=0;h<a.length;h++)u.push(a[h])}let l=Y(u,c.length?c:void 0,2);if(!l.length)return;let f=Ne(Wn,s),m=t.vertexCount;for(let a=0;a<u.length;a+=2)Q(t,u[a],u[a+1],r,0,0,1,255,i,f);for(let a=0;a<l.length;a+=3)t.indices.push(m+l[a],m+l[a+2],m+l[a+1]),t.featureIds.push(o)}function rr(t){let e=or(t);if(e.length<3)return null;let n=Math.abs(ir(t));if(n<=0)return null;let r=null,o=1/0;for(let i=0;i<e.length;i++){let s=(i+1)%e.length,u=e[s].x-e[i].x,c=e[s].y-e[i].y,l=Math.hypot(u,c);if(l<1e-6)continue;u/=l,c/=l;let f=1/0,m=-1/0,a=1/0,h=-1/0;for(let y of e){let F=y.x*u+y.y*c,M=-y.x*c+y.y*u;F<f&&(f=F),F>m&&(m=F),M<a&&(a=M),M>h&&(h=M)}let d=m-f,g=h-a,x=d*g;if(x<=0||x>=o)continue;o=x;let p=(f+m)/2,w=(a+h)/2,b=d>=g;r={cx:p*u-w*c,cy:p*c+w*u,ax:b?u:-c,ay:b?c:u,halfLong:(b?d:g)/2,halfShort:(b?g:d)/2,fill:n/x}}return r}function or(t){let e=[];for(let i=0;i<t.length-2;i+=2)e.push({x:t[i],y:t[i+1]});if(e.length<3)return e;e.sort((i,s)=>i.x===s.x?i.y-s.y:i.x-s.x);let n=(i,s,u)=>(s.x-i.x)*(u.y-i.y)-(s.y-i.y)*(u.x-i.x),r=[];for(let i of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],i)<=0;)r.pop();r.push(i)}let o=[];for(let i=e.length-1;i>=0;i--){let s=e[i];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return r.pop(),o.pop(),r.concat(o)}function ir(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var sr=Math.tan(30*Math.PI/180),ur=3.5,cr=.9;function lr(t,e,n,r,o){if(e.fill<.86)return null;let i=e.halfShort*2*o,s=e.halfLong*2*o,u=i*s,c=e.halfShort>0?e.halfLong/e.halfShort:99,l=fr(t);if(!l){if(n>15||u>600||i<3)return null;let f=r%1e3/1e3;u<30?l=f<.5?"skillion":"gabled":c<1.25?l=f<.35?"pyramidal":"hipped":l=f<.8?"gabled":"hipped"}return l==="flat"?null:{shape:l}}function fr(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var j=(t,e,n)=>t.a*e+t.b*n+t.c;function ar(t,e,n,r){let o=t.length/2;if(o<3)return[];let i=[],s=u=>[t[u*2],t[u*2+1]];for(let u=0;u<o;u++){let[c,l]=s(u),[f,m]=s((u+o-1)%o),a=e*c+n*l+r,h=e*f+n*m+r;if(a<=0!=h<=0){let d=h/(h-a);i.push(f+(c-f)*d,m+(l-m)*d)}a<=0&&i.push(c,l)}return i}function hr(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let o=[],i=0;o.push(t[0],t[1]);for(let s=1;s<r;s++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1],m=l-u,a=f-c,h=Math.hypot(m,a),d=h>1e-6;if(d){for(let g=i+1;g<s;g++)if(Math.abs((t[g*2]-u)*a-(t[g*2+1]-c)*m)/h>=n){d=!1;break}}d||(o.push(t[(s-1)*2],t[(s-1)*2+1]),i=s-1)}return o.length/2<3?t:(o.push(o[0],o[1]),o)}function Bt(t,e,n){let{ax:r,ay:o,halfLong:i}=e;if(n==="skillion"){let c=-o,l=r;return[{a:c,b:l,c:-(c*e.cx+l*e.cy)+e.halfShort}]}let s=[],u=t.length/2-1;for(let c=0;c<u;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+1)%u*2],a=t[(c+1)%u*2+1],h=m-l,d=a-f,g=Math.hypot(h,d);if(g<1e-6||n==="gabled"&&Math.abs((h*r+d*o)/g)<.86)continue;let x=-d/g,p=h/g;s.push({a:x,b:p,c:-(x*l+p*f)})}return!s.length&&i>0?Bt(t,e,"hipped"):s}function mr(t,e){let n=[];for(let o=0;o<e.length-2;o+=2)n.push(e[o],e[o+1]);if(n.length<6)return[];let r=[];for(let o=0;o<t.length;o++){let i=n;for(let s=0;s<t.length&&i.length>=6;s++)s!==o&&(i=ar(i,t[o].a-t[s].a,t[o].b-t[s].b,t[o].c-t[s].c));r.push(i.length>=6?i:[])}return r}function dr(t,e){let n=0;for(let r=0;r<e.length;r++){let o=e[r];for(let i=0;i<o.length;i+=2){let s=j(t[r],o[i],o[i+1]);s>n&&(n=s)}}return n}function xr(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function pr(t,e,n,r,o,i,s,u){let c=Ne(Kn,s);for(let l=0;l<n.length;l++){let f=e[l];if(!f||f.length<6)continue;let m=Y(f,void 0,2);if(!m.length)continue;let a=-n[l].a/u,h=-n[l].b/u,d=Math.hypot(a,h,1),g={x:a/d,y:h/d,z:1/d};t.ensure(f.length/2);let x=t.vertexCount;for(let p=0;p<f.length;p+=2){let w=Math.max(r,j(n[l],f[p],f[p+1]));Q(t,f[p],f[p+1],w,g.x,g.y,g.z,255,i,c)}for(let p=0;p<m.length;p+=3)t.indices.push(x+m[p],x+m[p+2],x+m[p+1]),t.featureIds.push(o)}}function br(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Qn:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?St:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?Rt:e>=40?St:Jn}function yr(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function gr(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function wr(t){let e=q(t.render_height)??q(t.height)??Mr(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,$n):Zn}function Fr(t,e){let n=q(t.render_min_height)??q(t.min_height)??q(t.base)??0;return n>0&&n<e?n:0}function Mr(t){let e=q(t);return e&&e>0?e*3:null}function q(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Oe=t=>t>127?127:t<-127?-127:t;function Rr(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Sr(t,e,n,r,o){let i=r*r,s=[],u=f=>t[f*2],c=f=>t[f*2+1],l=(f,m)=>{let a=t.length/2;return t.push((u(f)+u(m))/2,(c(f)+c(m))/2),a};for(let f=0;f<e.length;f+=3){s.push([n+e[f],n+e[f+1],n+e[f+2]]);let m=0;for(;s.length&&!(++m>2e4);){let[a,h,d]=s.pop(),g=(u(a)-u(h))**2+(c(a)-c(h))**2,x=(u(h)-u(d))**2+(c(h)-c(d))**2,p=(u(d)-u(a))**2+(c(d)-c(a))**2,w=Math.max(g,x,p);if(w<=i){o.push(a,h,d);continue}if(w===g){let b=l(a,h);s.push([a,b,d],[b,h,d])}else if(w===x){let b=l(h,d);s.push([h,b,a],[b,d,a])}else{let b=l(d,a);s.push([d,b,h],[b,a,h])}}}}function It(t,e,n=0,r,o=!1,i=4096){let s=[],u=[],c=[];for(let h of t.features()){if(h.type!==3||!_(e,h.properties))continue;let d=h.properties.osm_id,g=typeof d=="number"?d:typeof d=="string"?Number(d):NaN,x=Number.isFinite(g)?g:Number(h.id??0);for(let p of K(h.loadGeometry())){let w=o?J(p,i):p;if(!w)continue;let b=[],y=[],F=r?X(w.outer,r):w.outer;for(let R=0;R<F.length;R++)b.push(F[R]);for(let R of w.holes){let S=r?X(R,r):R;y.push(b.length/2);for(let P=0;P<S.length;P++)b.push(S[P])}let M=Y(b,y.length?y:void 0,2);if(!M.length)continue;let v=s.length/2;for(let R=0;R<b.length;R++)s.push(b[R]);if(n>0){let R=[];Sr(s,M,v,n,R);for(let S=0;S<R.length;S+=3)u.push(R[S],R[S+2],R[S+1]),c.push(x);continue}for(let R=0;R<M.length;R+=3)u.push(v+M[R],v+M[R+2],v+M[R+1]),c.push(x)}}if(!u.length)return null;let l=s.length/2,f=new Int16Array(s),m=new Uint32Array(u);return{featureIds:new Float64Array(c).buffer,vertices:f.buffer,indices:m.buffer,vertexCount:l,indexCount:m.length}}function Tt(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Vt(t,e,n,r){if(!(n<=0)){t.extent=r;for(let o of e){let i=o.outer;if(i.length<6)continue;let s=1/0,u=1/0,c=-1/0,l=-1/0;for(let f=0;f<i.length;f+=2)i[f]<s&&(s=i[f]),i[f]>c&&(c=i[f]),i[f+1]<u&&(u=i[f+1]),i[f+1]>l&&(l=i[f+1]);t.shapes.push({outer:i,holes:o.holes,level:n,minX:s,minY:u,maxX:c,maxY:l})}t.cells=[]}}function vr(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],o=ee(Math.floor(r.minX/e)),i=ee(Math.floor(r.maxX/e)),s=ee(Math.floor(r.minY/e)),u=ee(Math.floor(r.maxY/e));for(let c=s;c<=u;c++)for(let l=o;l<=i;l++)t.cells[c*32+l].push(n)}}var Lt=t=>t.shapes.length===0;function Xe(t,e,n){!t.cells.length&&t.shapes.length&&vr(t);let r=t.extent/32,o=t.cells[ee(Math.floor(n/r))*32+ee(Math.floor(e/r))];if(!o||!o.length)return 0;let i=0;for(let s of o){let u=t.shapes[s];if(u.level<=i||e<u.minX||e>u.maxX||n<u.minY||n>u.maxY||!Et(u.outer,e,n))continue;let c=!1;for(let l of u.holes)if(Et(l,e,n)){c=!0;break}c||(i=u.level)}return Math.min(Math.round(i*100),127)}function Ct(t,e){let n=[],r=[],o=t.extent>0?t.metersPerTile/t.extent:0,i=o>0?2/o:0,s=Xe(t,e[0],e[1]);n.push(e[0],e[1]),r.push(s);for(let u=0;u+3<e.length;u+=2){let c=e[u],l=e[u+1],f=e[u+2],m=e[u+3],a=Xe(t,f,m);if(a!==s&&i>0){let h=Math.hypot(f-c,m-l),d=Math.min(Math.ceil(h/i),64),g=s;for(let x=1;x<d;x++){let p=x/d,w=c+(f-c)*p,b=l+(m-l)*p,y=Xe(t,w,b);y!==g&&(n.push(w,b),r.push(y),g=y)}}n.push(f,m),r.push(a),s=a}return{pts:n,levels:r}}var ee=t=>t<0?0:t>31?31:t;function Et(t,e,n){let r=!1,o=t.length/2;for(let i=0,s=o-1;i<o;s=i++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1];c>n!=f>n&&e<(l-u)*(n-c)/(f-c)+u&&(r=!r)}return r}var $e=16,kr=64,Pr=0,Ar=1,_t=2,Br=3,Se=1;function Ht(t,e,n,r){let o=r.metersPerUnit>0?r.metersPerUnit:.5,i=r.elevation,s=r.base??0,u=Math.max(r.bevel??0,0)/o,c=Math.max(r.bevelDrop??0,0),l=Math.max(r.cornerRadius??0,0)/o,f=Math.max(512,t.length*24),m=new ArrayBuffer(f*$e),a={view:new DataView(m),bytes:new Uint8Array(m),offset:0,count:0,indices:[],extent:e,ensure(y){if(a.count+y<=f)return;f=Math.max(f*2,a.count+y);let F=new ArrayBuffer(f*$e);new Uint8Array(F).set(a.bytes.subarray(0,a.offset)),m=F,a.view=new DataView(F),a.bytes=new Uint8Array(F)}},h=[],d=new Map;for(let y of t.features()){if(y.type!==3||!_(n,y.properties))continue;let F=r.liftBy?.(y.properties)??0;for(let M of K(y.loadGeometry())){let v=J(M,e);if(v){h.push(F?{...v,lift:F}:v),Dt(v.outer,d);for(let R of v.holes)Dt(R,d)}}}r.onShapes?.(h);let g=new Set;for(let[y,F]of d)F>1&&g.add(y);let x=[],p={radius:l,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:yt/o};for(let y of h){let F=l>0?{outer:X(y.outer,{...p,keep:Ut(y.outer,g)}),holes:y.holes.map(I=>X(I,{...p,keep:Ut(I,g)}))}:y,M=u>0?Gt(F.outer,u,e,g):F.outer,v=F.holes.map(I=>u>0?Gt(I,-u,e,g):I),R=y.lift??0,S=i+R,P=s+R;Ot(a,M??F.outer,v.map((I,A)=>I??F.holes[A]),S);let V=S,E=S-c;M&&u>0&&c>0&&ze(a,M,F.outer,V,E,Ar,e,g),E!==P&&ze(a,F.outer,F.outer,E,P,_t,e,g);for(let I of F.holes)if(E!==P&&ze(a,I,I,E,P,_t,e,g),S<P){let A=a.indices.length;Ot(a,I,[],P,Br);for(let k=A;k<a.indices.length;k++)x.push(a.indices[k]);a.indices.length=A}}if(!a.indices.length&&!x.length)return null;let w=a.indices.length,b=new Uint32Array(w+x.length);return b.set(a.indices,0),b.set(x,w),{vertices:m.slice(0,a.offset),indices:b.buffer,vertexCount:a.count,indexCount:b.length,extent:e,capIndexOffset:w}}function te(t,e,n,r){let o=`${Math.round(t*100)},${Math.round(e*100)}`,i=`${Math.round(n*100)},${Math.round(r*100)}`;return o<i?`${o}|${i}`:`${i}|${o}`}function Dt(t,e){for(let n=0;n+3<t.length;n+=2){let r=te(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function Ut(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let o=0;o<n;o++){let i=te(t[(o+n-1)%n*2],t[(o+n-1)%n*2+1],t[o*2],t[o*2+1]),s=te(t[o*2],t[o*2+1],t[(o+1)%n*2],t[(o+1)%n*2+1]);(e.has(i)||e.has(s))&&(r[o]=!0)}return r}function he(t,e,n,r,o,i,s,u){let c=t.offset;return t.view.setFloat32(c,e,!0),t.view.setFloat32(c+4,n,!0),t.view.setInt16(c+8,Ir(Math.round(r*kr)),!0),t.view.setInt8(c+10,Ze(Math.round(o*127))),t.view.setInt8(c+11,Ze(Math.round(i*127))),t.view.setInt8(c+12,Ze(Math.round(s*127))),t.bytes[c+13]=u,t.view.setInt8(c+14,e<=0?-Se:e>=t.extent?Se:0),t.view.setInt8(c+15,n<=0?-Se:n>=t.extent?Se:0),t.offset+=$e,t.count++}function Ot(t,e,n,r,o=Pr){let i=[],s=[];for(let l=0;l<e.length;l++)i.push(e[l]);for(let l of n){s.push(i.length/2);for(let f=0;f<l.length;f++)i.push(l[f])}let u=Y(i,s.length?s:void 0,2);if(!u.length)return;t.ensure(i.length/2);let c=t.count;for(let l=0;l<i.length;l+=2)he(t,i[l],i[l+1],r,0,0,1,o);for(let l=0;l<u.length;l+=3)t.indices.push(c+u[l],c+u[l+2],c+u[l+1])}function ze(t,e,n,r,o,i,s,u){let c=Math.min(e.length,n.length)/2;if(!(c<3)){t.ensure((c-1)*4);for(let l=0;l<c-1;l++){let f=n[l*2],m=n[l*2+1],a=n[l*2+2],h=n[l*2+3];if(f===a&&m===h||Re(f,m,a,h,s)||u.has(te(f,m,a,h)))continue;let d=a-f,g=h-m,x=Math.hypot(d,g)||1,p=g/x,w=-d/x,b=r-o,y=Math.hypot(e[l*2]-f,e[l*2+1]-m)||0,F=0;if(y>1e-6&&b!==0){let P=1/Math.hypot(1,b/y);F=y/Math.hypot(y,b)*Math.sign(b),p*=P,w*=P}let M=he(t,e[l*2],e[l*2+1],r,p,w,F,i),v=he(t,e[l*2+2],e[l*2+3],r,p,w,F,i),R=he(t,f,m,o,p,w,F,i),S=he(t,a,h,o,p,w,F,i);t.indices.push(R,v,S,R,M,v)}}}function Gt(t,e,n,r){let o=t.length/2-1;if(o<3)return null;let i=[];for(let c=0;c<o;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+o-1)%o*2],a=t[(c+o-1)%o*2+1],h=t[(c+1)%o*2],d=t[(c+1)%o*2+1],g=Math.hypot(l-m,f-a)||1,x=Math.hypot(h-l,d-f)||1,p=(f-a)/g,w=-(l-m)/g,b=(d-f)/x,y=-(h-l)/x,F=p+b,M=w+y,v=Math.hypot(F,M);if(v<1e-6){i.push(l,f);continue}F/=v,M/=v;let R=Math.min(1/Math.max(F*p+M*w,.35),3),S=l-F*e*R,P=f-M*e*R,V=te(m,a,l,f),E=te(l,f,h,d);if(r.has(V)||r.has(E)){i.push(l,f);continue}(l<=0||l>=n)&&(S=l),(f<=0||f>=n)&&(P=f),i.push(S,P)}i.push(i[0],i[1]);let s=Math.abs(Ye(t)),u=Ye(i);if(Math.sign(u)!==Math.sign(Ye(t))||Math.abs(u)<s*.25)return null;for(let c=0;c<i.length;c+=2)i[c]=Math.max(0,Math.min(n,i[c])),i[c+1]=Math.max(0,Math.min(n,i[c+1]));return i}function Ye(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var Ze=t=>t>127?127:t<-127?-127:t,Ir=t=>t>32767?32767:t<-32768?-32768:t;var me=20;function Xt(t,e,n=0,r){let o=Math.max(256,t.length*24),i=new ArrayBuffer(o*me),s=new DataView(i),u=0,c=[],l=h=>{if(u+h<=o)return;o=Math.max(o*2,u+h);let d=new ArrayBuffer(o*me);new Uint8Array(d).set(new Uint8Array(i,0,u*me)),i=d,s=new DataView(d)},f=(h,d,g,x,p,w,b,y=0,F=0)=>{let M=u*me;return s.setInt16(M,h,!0),s.setInt16(M+2,d,!0),s.setInt16(M+4,g,!0),s.setInt16(M+6,x,!0),s.setInt8(M+8,p),s.setInt8(M+9,w),s.setInt8(M+10,y),s.setInt8(M+11,F),s.setFloat32(M+12,b,!0),s.setFloat32(M+16,m,!0),u++},m=0;for(let h of t.features()){if(h.type!==2&&h.type!==3||!_(e,h.properties))continue;let d=h.properties.width;m=typeof d=="number"&&d>.5&&d<100?d:0;let g=h.type===3;for(let x of h.loadGeometry()){let p=n>0?Er(Nt(x),n):Nt(x);if(p.length<4)continue;let w=r&&!Lt(r)?Ct(r,p):null,b=w?w.pts:p,y=w?.levels,F=b.length/2;if(F<2)continue;l((F-1)*4);let M=0;for(let v=0;v<F-1;v++){let R=b[v*2],S=b[v*2+1],P=b[v*2+2],V=b[v*2+3],E=Math.hypot(P-R,V-S);if(g&&Vr(R,S,P,V,t.extent)){M+=E;continue}let I=Tr(R,S,P,V,t.extent);if(!I){M+=E;continue}let[A,k,B,C]=I,O=Math.hypot(A-R,k-S),z=Math.hypot(B-A,C-k),H=Math.hypot(P-B,V-C),D=M+O,U=y?y[v]:0,N=y?y[v+1]:0,de=f(A,k,B,C,0,-1,D,U,N),ve=f(A,k,B,C,0,1,D,U,N),xe=f(A,k,B,C,1,1,D,U,N),ke=f(A,k,B,C,1,-1,D,U,N);M+=O+z+H,c.push(de,ve,xe,de,xe,ke)}}}if(!c.length)return null;let a=new Uint32Array(c);return{vertices:i.slice(0,u*me),indices:a.buffer,vertexCount:u,indexCount:a.length}}function Er(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let o=t[r],i=t[r+1],s=t[r+2],u=t[r+3];n.push(o,i);let c=Math.min(64,Math.floor(Math.hypot(s-o,u-i)/e));for(let l=1;l<c;l++){let f=l/c;n.push(o+(s-o)*f,i+(u-i)*f)}}return n.push(t[t.length-2],t[t.length-1]),n}function Nt(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1],i=e.length;i>=2&&e[i-2]===r&&e[i-1]===o||e.push(r,o)}return e}function Tr(t,e,n,r,o){let i=n-t,s=r-e,u=0,c=1,l=[[-i,t],[i,o-t],[-s,e],[s,o-e]];for(let[f,m]of l){if(f===0){if(m<0)return null;continue}let a=m/f;if(f<0){if(a>c)return null;a>u&&(u=a)}else{if(a<u)return null;a<c&&(c=a)}}return c-u<1e-6?null:[Math.round(t+i*u),Math.round(e+s*u),Math.round(t+i*c),Math.round(e+s*c)]}function Vr(t,e,n,r,o){return t===n&&(t<=0||t>=o)?!0:e===r&&(e<=0||e>=o)}var Lr=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],zt=new Map(Lr);function Yt(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(i=>{let s=zt.get(i.toLowerCase());return s?(n=!0,i[0]===i[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):i});return!n||!e.filter(i=>zt.get(i.toLowerCase())===void 0).length?t:r.join(" ")}function $t(t,e){let n=[],r=[],o=[],i=[],s=[],u=e.textPlacement==="line",c=[],l=[],f=[];for(let m of t.features()){if(!_(e.filter,m.properties))continue;let a=m.loadGeometry(),h=Dr(m.type,a);if(!h)continue;let d=e.textField?Zt(e.textField,m.properties):"",g=d&&e.abbreviate?Yt(d):d,x=e.iconImage?Zt(e.iconImage,m.properties):"";if(!(!g&&!x)){if(u){let p=_r(m.type,a);if(!p)continue;f.push({text:g,line:p});continue}n.push(h[0],h[1]),r.push(g),o.push(x),i.push(Ur(m.properties)),s.push(e.iconRotate&&Math.round(Number(m.properties[e.iconRotate]??0))||0)}}if(u){for(let{text:m,line:a}of Cr(f)){l.push(c.length/2);for(let h of a)c.push(h);n.push(Math.round(a[0]),Math.round(a[1])),r.push(m),o.push(""),i.push(128),s.push(0)}l.push(c.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:o,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(c).buffer,lineStarts:new Uint32Array(l).buffer}:{}}:null}function Cr(t){let e=[],n=new Map,r=new Map,o=(i,s,u)=>`${i}\\u241F${s}\\u241F${u}`;for(let{text:i,line:s}of t){let u=o(i,s[0],s[1]),c=o(i,s[s.length-2],s[s.length-1]),l=n.get(c),f=r.get(u);if(f!==void 0){let m=e[f];if(m.line.push(...s.slice(2)),r.delete(u),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f),l!==void 0&&l!==f){let a=e[l];m.line.push(...a.line.slice(2)),a.line=[],n.delete(c),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f)}continue}if(l!==void 0){let m=e[l];m.line.unshift(...s.slice(0,s.length-2)),n.delete(c),n.set(o(i,m.line[0],m.line[1]),l);continue}n.set(u,e.length),r.set(c,e.length),e.push({text:i,line:s})}return e.filter(i=>i.line.length>=4)}function _r(t,e){if(t!==2)return null;let n=null,r=0;for(let o of e){if(o.length<4)continue;let i=0;for(let s=0;s+3<o.length;s+=2)i+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);i>r&&(r=i,n=o)}return n}function Dr(t,e){if(!e.length)return null;if(t===1){let s=e[0];return s.length>=2?[s[0],s[1]]:null}if(t===2){let s=-1,u=0,c=0;for(let l of e)for(let f=0;f+3<l.length;f+=2){let m=l[f+2]-l[f],a=l[f+3]-l[f+1],h=m*m+a*a;h>s&&(s=h,u=l[f]+m/2,c=l[f+1]+a/2)}return s>0?[Math.round(u),Math.round(c)]:null}let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((r+i)/2)]:null}function Ur(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Zt(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let o=!0,s=r.replace(/\\{([^}]+)\\}/g,(u,c)=>{let l=e[c];return l==null||l===""?(o=!1,""):String(l)}).trim();if(o&&s)return s}return""}function jt(t,e){let n=[],r=[];for(let o=0;o<t.length;o++){let i=t.feature(o);if(i.type===1&&_(e,i.properties))for(let s of i.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),r.push(i.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Or="\\u241F",Wt=(t,e)=>t+Or+String(e);function Gr(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Jt(t,e){let n=performance.now(),r=Gr(),o=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),i=(x,p,w,b,y=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:b,parseMs:y},diag:{status:x,bytes:p,layers:w,built:0}});if(!o.ok){if(o.status===404||o.status===204)return i(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${t.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return i(o.status,0,[],u);let c=performance.now(),l=new Me(s),f=Object.keys(l.layers),m={},a={},h=[],g=t.plan.some(x=>x.type==="surface"&&(x.elevation??0)>0)&&t.plan.some(x=>x.type==="line"&&x.ground)?Tt(t.metersPerTile):void 0;for(let x of t.plan){if(!Nr(x,t.zoom,t.sourceMaxZoom))continue;let p=l.layers[x.sourceLayer];if(!p)continue;let w=Xr(t.zoom,p.extent);try{if(x.splitBy){let y=zr(p,x.splitBy,x.filter);if(!y.length)continue;let F=a[x.splitBy]??(a[x.splitBy]=[]);for(let M of y){F.includes(M)||F.push(M);let v={...x,splitBy:void 0,filter:Yr(x.filter,x.splitBy,M)},R=Kt(v,p,w,t.metersPerTile,g);R&&(m[Wt(x.id,M)]=R)}continue}let b=Kt(x,p,w,t.metersPerTile,g);b&&(m[x.id]=b)}catch(b){h.push(`${x.id}: ${b instanceof Error?b.message:String(b)}`)}}return{type:"loaded",id:t.id,buckets:m,...Object.keys(a).length?{splits:a}:{},timing:{fetchMs:u,parseMs:performance.now()-c},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(m).length,...h.length?{failed:h}:{}}}}function Hr(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let o of n.split(",")){let i=t[o];typeof i=="number"&&i>r&&(r=i)}return r}}function Nr(t,e,n){let r=e-1,o=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>o)}function Xr(t,e){return t<=6?Math.max(64,e/24):0}function Kt(t,e,n,r,o){{if(t.type==="fill"){let s=r>0?r/e.extent:0,u=t.cornerRadius&&s>0?{radius:t.cornerRadius/s,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:gt/s}:void 0,c=It(e,t.filter,n,u,t.clipToTile===!0,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(t.type==="surface"){let s=Ht(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...o?{onShapes:u=>Vt(o,u,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:Hr(t.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(t.type==="line"){let s=Xt(e,t.filter,n,t.ground?o:void 0);return s?{kind:"line",...s,extent:e.extent}:null}if(t.type==="model"){let s=jt(e,t.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(t.type==="symbol"){let s=$t(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let i=At(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return i?{kind:"fill-extrusion",vertices:i.vertices,indices:i.indices,featureIds:i.featureIds,vertexCount:i.vertexCount,indexCount:i.indexCount,extent:i.extent}:null}}function zr(t,e,n){let r=[];for(let o of t.features()){if(!_(n,o.properties))continue;let i=o.properties[e];typeof i!="string"&&typeof i!="number"||r.includes(i)||r.push(i)}return r.sort((o,i)=>typeof o=="number"&&typeof i=="number"?o-i:String(o).localeCompare(String(i))),r}function Yr(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var Zr=t=>t.kind==="symbol",$r=t=>t.kind==="placement";function Qt(t){let e=[];for(let n of Object.values(t.buckets)){if($r(n)){e.push(n.anchors);continue}if(Zr(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var qt=Map;var ne=new qt,je=self;je.onmessage=t=>{let e=t.data;if(e.type==="abort"){ne.get(e.id)?.abort(),ne.delete(e.id);return}let n=new AbortController;ne.set(e.id,n),Jt(e,n.signal).then(r=>{ne.has(e.id)&&(ne.delete(e.id),je.postMessage(r,Qt(r)))}).catch(r=>{let o=n.signal.aborted;ne.delete(e.id);let i={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:o};je.postMessage(i)})};})();\n';var Wo=class{constructor(e=on()){this.workers=[];this.blobUrl=null;this.pending=new H;this.nextId=1;this.cursor=0;this.mainThreadAborts=new H;this.destroyed=false;try{let t=new Blob([tn],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),Xa(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function on(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Ya(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function rn(i,e){let t=Ya(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function nn(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function Ka(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var $a={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},wt=i=>$a[i]??$a.high;function Vo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Bo(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function an(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function ln(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function qa(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function sn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Vf=1,Qt=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Vf++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=q(l),c=ee(s.lng),f=te(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=q(o);t.push(ee(r.lng)-this.originX,te(r.lat)-this.originY);}return t}color(e,t){let o=le(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},fn=class extends Qt{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=zt([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=zt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=le(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=dn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Za(e,n[a],n[a+1])<=r)return true;return false}},Do=class extends Qt{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Ar(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(cn(a))),n=zt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=dn(cn(this.coordinates[0]??[]),this.altitude,t);if(!hn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(hn(e,dn(cn(this.coordinates[r]),this.altitude,t)))return false;return true}},un=class extends Do{constructor(e){super({...e,coordinates:[Bf(e.center,e.radius,e.segments)]});}};function Bf(i,e,t){let o=q(i),r=e/Le(o.lat),n=ee(o.lng),a=te(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function dn(i,e,t){let o=[];for(let r of i){let n=q(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function cn(i){if(i.length<2)return i;let e=q(i[0]),t=q(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Za(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function hn(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var Qa="objects3d",xt="level",Df=32,Gf=100,mn=120,Nf=40,Uf=.35,jf=.02,Xf=150,Yf=250;function Ja(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function Kf(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var pn=class extends Ve{constructor(t){super();this.options=t;this.transform=new St;this.ctx=null;this.sources=new H;this.rasterSources=new H;this.renderer=new Bt;this.objects=new Ht;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(mn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new H;this.autoIndoorLevel=true;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Vo(Bo()):t.quality;this.qualityCeiling=r,this.quality=wt(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ct(t.theme?go(t.theme,t.style):t.style),this.background=t.background?le(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=q(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Wo(t.workerCount??Math.min(on(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new ro(t);let o=new bt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...Qe,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(Y,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Oo({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:Qa,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Kf):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:Qa,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(Pe(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(Y);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??Y)!==Y)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===xt&&t.add(o.source??Y);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??Y;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new Yt({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Fo(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===Y&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new uo(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let h of this.getPopups())h.closeOnClick&&this.removePopup(h);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=an(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=q(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=q(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?q(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+et((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?q(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+et((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Be(r.zoom),s=(ee(a.center.lng)-ee(r.center.lng))*l,c=(te(a.center.lat)-te(r.center.lat))*l,f=Math.hypot(s,c),h=Math.max(o.width,o.height),u=h*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,y,p=null;if(f<1e-6){let g=Math.log(u/h);y=Math.abs(g)/d,p=v=>({u:0,w:h*Math.exp(d*Math.sign(g)*v)});}else {let g=x=>{let C=x===0?h:u,T=x===0?u:h;return (T*T-C*C+(x===0?1:-1)*m*m*f*f)/(2*C*m*f)},v=x=>Math.log(-g(x)+Math.sqrt(g(x)*g(x)+1)),w=v(0);y=(v(1)-w)/d;let _=x=>(Math.exp(x)+Math.exp(-x))/2,M=x=>(Math.exp(2*x)-1)/(Math.exp(2*x)+1);p=x=>{let C=d*x+w;return {u:h*_(w)*M(C)/m-h*Math.sinh(w)/m,w:h*_(w)/_(C)}};}if(!Number.isFinite(y)||y<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,y/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:y,u1:f,curve:p,w0:h}},this.triggerRepaint(),this}setPadding(t){return this.padding=Ja(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new _t;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=Uo(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ja(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:oo(r),a=this.transform,l=q(o.from.center),s=q(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),h=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*h,lat:l.lat+(s.lat-l.lat)*h},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*oo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*oo(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(q(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new ct(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(go(t,this.options.style))}static get themes(){return Object.keys(ft)}static get themeList(){return Object.entries(ft).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:bt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??Y);if(!n)continue;let a=Sr(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new H,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??Y)));}if(!n||!o.length)return null;let a=Mr(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=rn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Ka("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=nn(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?Vo(Bo()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(wt(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>Gf?3:t>Df?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%mn,this.ringFilled<mn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<Nf)return;let r=this.ringSum/this.ringFilled;if(r>=Uf){let a=sn(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(wt(a),true);return}if(r>jf||this.steadyFrames<Xf)return;let n=qa(this.quality.name);!n||ln(n)>ln(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(wt(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=le(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??Y)===o&&"splitBy"in n&&n.splitBy===xt))for(let n of r.splitValues(xt)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[xt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[xt]:this._style.splitValues[xt]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof Zt)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,Ct):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let d of this.sources.values())d.update(this.transform);this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<Yf,h=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let u=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(u),this.emit("render",{frameMs:l,intervalMs:h}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},I0=pn;
1953
- export{Kt as AssetLoader,Y as BASE_SOURCE,nt as BUILDING_HEIGHT_SCALE,Me as BUILDING_VERTEX_STRIDE,Xs as CITY_STYLE,un as Circle,Qe as DEFAULT_ICONS,hr as DEFAULT_LIGHT,Sa as DEFAULT_SHADOWS,dr as DEFAULT_SKY,mr as DEFAULT_STYLE,Lt as DepthTarget,no as EARTH_CIRCUMFERENCE,De as FILL_VERTEX_STRIDE,Ct as GLOBE_MAX_PITCH,$e as GLOBE_ZOOM_MAX,lo as GLOBE_ZOOM_MIN,he as GLYPH_BORDER,We as GLYPH_SIZE,us as GROUND_SCALE,Tt as GeomType,Gt as GlyphSource,Et as GroundArrows,Ut as IconSource,Ft as IndoorMask,Ge as LINE_VERTEX_STRIDE,Bt as LayerRenderer,_t as LngLatBounds,yn as MAX_LATITUDE,Mo as MODEL_VERTEX_STRIDE,pn as Map,Qt as MapObject,qt as Marker,$t as Model,Ue as ModelLayer,Ht as ObjectManager,Do as Polygon,fn as Polyline,Zt as Popup,js as RELIEF_STYLE,Tr as RUNTIME_FILL_STRIDE,dt as RUNTIME_LINE_STRIDE,Yt as RasterSource,zo as RasterTile,Vr as SDF_EDGE,Nt as SDF_PX,Us as SOFT_STYLE,Ei as SPLIT_SEP,At as SURFACE_CUT_BLEED,Qn as SURFACE_LEVEL_SCALE,it as SURFACE_VERTEX_STRIDE,Dt as SdfAtlas,ct as Style,bt as SymbolRenderer,ft as THEMES,Ke as TILE_SIZE,gt as TileID,St as Transform,Mt as VectorTile,ho as VectorTileFeature,mo as VectorTileLayer,Qr as abbreviateStreet,cr as addGround,tu as altitudeFromMercatorZ,yo as applyTheme,Oa as arrowLabelOffset,nc as arrowVertices,Ar as buildRuntimeFill,zt as buildRuntimeLine,Uo as cameraForBounds,Le as circumferenceAtLatitude,io as clampLat,an as clampPixelRatio,Gr as clipLineToRect,Ya as coordinateDigits,Xt as coveringTiles,sr as createGround,I0 as default,Bo as deviceHints,Za as distToSegment,ke as evaluateColor,V as evaluateNumber,_o as extractFeature,vr as fillFootprint,ut as fogPlanes,wr as footprintOf,rn as formatHash,tr as generateBuildings,lr as generateFill,ur as generateLine,ar as generateSurface,en as generateSymbols,$o as globeBasis,co as globeFlatMix,so as globeRadius,Mn as globeToLocal,bo as groundAt,Wa as iconRotation,Pe as insideFootprint,Ce as latFromMercatorY,Se as lngFromMercatorX,fo as lngLatToUnit,de as matchesFilter,No as mercatorMetersPerTile,ee as mercatorX,te as mercatorY,Go as mercatorZFromAltitude,ru as metersPerPixel,gn as metersPerTile,sn as nextQualityDown,Sc as parseGlb,Ir as parseGlbAsync,Ta as parseGlyphs,nn as parseHash,fa as patchUV,Sr as pickBuilding,Mr as pickFill,Fn as pitchIntent,ou as pixelsPerMeter,Ur as placeAlongLine,hn as pointInRing,Vo as qualityFor,wt as qualityProfile,qo as raySphere,Jr as resolveTemplate,ze as roundRing,Br as sdfFromAlpha,Dr as shapeText,st as splitBucketKey,fr as splitByGround,qe as splitPolygons,go as styleWithTheme,vn as tileOriginMeters,Va as tileUrl,q as toLngLat,Ko as unitToLngLat,Be as worldSize};//# sourceMappingURL=osmgl.js.map
1952
+ `;var xo=i=>i.kind==="symbol",ma=i=>i.kind==="placement";function Oe(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],h=r[n+5];if(nc(e,t,a,l,s,c,f,h)||o>0&&(xr(e,t,a,l,s,c)<=o||xr(e,t,s,c,f,h)<=o||xr(e,t,f,h,a,l)<=o))return true}return false}function nc(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}function xr(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function _r(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*Ge;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function Cr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var ac={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},lc=40,sc=10.5,pa=2.5,cc=16,fc=4,uc=7,Ft=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(_=>_.type==="symbol"&&_.layout?.placement==="map"&&r.layerVisibleAt(_,c));if(!f.length)return;let h=t.center,u=te(h.lng),d=oe(h.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let _ of f){let S=o.get(_.source??K);if(!S)continue;let C=r.bucketKeyFor(_);if(C===null)continue;let M=_.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let w=m*1.5,T=_.layout?.arrowUnits==="meters"?m:1/t.worldSize,k=B(_.layout?.arrowLength,c,lc)*T,L=B(_.layout?.arrowWidth,c,sc)*T,P=B(_.layout?.arrowOutline,c,pa)*T,A=B(_.layout?.arrowGap,c,cc)*T,I=B(_.layout?.arrowDotRadius,c,fc)*T,E=B(_.layout?.arrowDotGap,c,uc)*T,F=Mr(k,L,I,A-E),z=P>0?Mr(k,L,I,A-E,P).outline:null,R={layer:_,verts:[],shape:F};for(let H of S.visibleTiles){let V=S.getTile(H)?.data?.buckets?.[C];if(!V||!xo(V))continue;let W=new Int16Array(V.anchors),D=V.rotations?new Int16Array(V.rotations):null,Y=H.bounds(),$=(Y.maxX-Y.minX)/V.extent,ee=Y.minX,se=Y.minY;for(let Q=0;Q<W.length/2;Q++){let U=ee+W[Q*2]*$,ce=se+W[Q*2+1]*$;if(M&&!Oe(this.highlightFootprint,U,ce,w))continue;let ne=(D?D[Q]:0)*Math.PI/180,q=Math.sin(ne),j=-Math.cos(ne),X=U-u-q*A,de=ce-d-j*A;z&&Tr(R,z,X,de,q,j),Tr(R,F.outline,X,de,q,j),this.count++;}}R.verts.length&&y.push(R);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let _ of y){let S=g.length/2/b;for(let C of _.verts)g.push(C);v.push({layer:_.layer,first:S,count:_.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,p,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(u,d,0)),n.setMat4("u_matrix",t.objectMatrix(u,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let _ of v){let S=_.layer.paint,C=B(S.opacity,c,1),M=ke(S.color,c,[.18,.45,.76,1]),w=ke(S.haloColor,c,[1,1,1,1]),x=B(_.layer.layout?.arrowOutline,c,pa)>0;hc(e,n,_,w,M,C,x,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new ye(e,new Uint8Array(this.capacity*n*8),ac,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new ue(e,a),this.vao=new le(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function hc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)ba(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)ba(i,t.first+c,l);}function ba(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var ya=4,Sr=12;function Mr(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,h=[],u=(b,g)=>h.push(b,g);u(0,0),u(-n,a),u(-n+l,c),u(f,s);for(let b=1;b<ya;b++){let g=b/ya*Math.PI;u(f-Math.sin(g)*s,Math.cos(g)*s);}u(f,-s),u(-n+l,-c),u(-n,-a);let d=r>0?dc(h,r):h,m=Yn(h,void 0,2);if(t<=0)return {outline:d,indices:m};let y=d.length/2,p=t+r;for(let b=0;b<Sr;b++){let g=b/Sr*Math.PI*2;d.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Sr-1;b++)m.push(y,y+b,y+b+1);return {outline:d,indices:m}}function dc(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],h=i[(a+1)%t*2],u=i[(a+1)%t*2+1],d=Math.hypot(c-l,f-s)||1,m=Math.hypot(h-c,u-f)||1,y=r*(f-s)/d,p=-r*(c-l)/d,b=r*(u-f)/m,g=-r*(h-c)/m,v=y+b,_=p+g,S=Math.hypot(v,_);if(S<1e-9){n.push(c,f);continue}v/=S,_/=S;let C=Math.min(1/Math.max(v*y+_*p,.35),3);n.push(c+v*e*C,f+_*e*C);}return n}function Tr(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function mc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Tr(s,Mr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var pc=5;function ga(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var _o=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let h=a.get(f.source);if(!h)continue;let u=B(f.paint?.opacity,l,1);if(!(u<=.001)){r.setFloat("u_opacity",u),o.bind();for(let d of h.visibleTiles){let m=this.patchFor(e,h,d);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=pc&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:ga(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var bc="indoor-",Rt=class{constructor(){this.parts=null;this.stamp="";this.cache=new O;this.box=null;this.hidden=new J;this.collected=new J;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let u of t.layers){if(!u.id.startsWith(bc)||u.type!=="fill"||!t.layerVisibleAt(u,o))continue;let d=t.bucketKeyFor(u);d&&(r.push(d),n??(n=e.get(u.source??K)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(u=>u.dataKey+(n.getTile(u)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,h=-1/0;for(let u of n.visibleTiles){let d=n.getTile(u)?.data?.buckets;if(d)for(let m of r){let y=d[m];if(!y||y.kind!=="fill")continue;let p=_r(y,u);l.push(p);for(let b=0;b<p.length;b+=2)p[b]<s&&(s=p[b]),p[b]>f&&(f=p[b]),p[b+1]<c&&(c=p[b+1]),p[b+1]>h&&(h=p[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,h]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new O;for(let h=0;h*3<r.length;h++){let u=n[h];if(this.hidden.has(u))continue;let d=f.get(u);d||f.set(u,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[h*3+m]*Me,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<d[0]&&(d[0]=p),b<d[1]&&(d[1]=b),p>d[2]&&(d[2]=p),b>d[3]&&(d[3]=b);}}for(let[h,u]of f){let d=l.minX+(u[0]+u[2])/2*s,m=l.minY+(u[1]+u[3])/2*s;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||Oe(o,d,m,0)&&this.hidden.add(h);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),h=new Float64Array(s.featureIds),u=[];for(let d=0;d*3<f.length;d++)this.hidden.has(h[d])||u.push(f[d*3],f[d*3+1],f[d*3+2]);if(u.length<f.length){let d=new ue(e,new Uint32Array(u));c={vao:new le(e,[{buffer:n,locations:a}],d),ibo:d,count:u.length};}}return this.cache.set(r.dataKey,c),c}};var va=35,yc=70,gc=.35,vc=.5,wc=1.1;function ht(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-va)/(yc-va),0,1),n=t.fogRange[0]*(1-gc*r)*o,a=t.fogRange[1]*(1-vc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*wc:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Er(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f),u=h&&wa(h,t);if(!u||!Fe(l,i.tileMatrix64(f,u.extent))||(ae(s,l,[r,n,-1,1]),ae(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-d,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=_c(u,d,m,y,p,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function kr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f);if(h)for(let u of t){let d=h.data?.buckets?.[u];if(!d||d.kind!=="fill"||!d.featureIds||!Fe(l,i.tileMatrix64(f,d.extent))||(ae(s,l,[r,n,-1,1]),ae(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],y=s[1]/s[3],p=s[2]/s[3],b=c[2]/c[3]-p;if(Math.abs(b)<1e-9)continue;let g=-p/b;if(g<0||g>1)continue;let v=m+(c[0]/c[3]-m)*g,_=y+(c[1]/c[3]-y)*g,S=xc(d,v,_);S!==null&&(!a||g<a.distance)&&(a={featureId:S,tile:f,layerId:u,distance:g});}}return a}function xc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Ge,true),l=s=>o.getInt16(s*Ge+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],h=r[s*3+2],u=a(c),d=l(c),m=a(f),y=l(f),p=a(h),b=l(h),g=(e-m)*(d-y)-(u-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),_=(e-u)*(b-d)-(p-u)*(t-d),S=g<0||v<0||_<0,C=g>0||v>0||_>0;if(!(S&&C))return n[s]}return null}function wa(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function _c(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=y=>l.getInt16(y*Me,true),h=y=>l.getInt16(y*Me+2,true),u=y=>l.getUint16(y*Me+4,true)/it,d=1/0,m=-1;for(let y=0;y+2<s.length;y+=3){let p=s[y],b=s[y+1],g=s[y+2],v=f(p),_=h(p),S=u(p),C=f(b)-v,M=h(b)-_,w=u(b)-S,x=f(g)-v,T=h(g)-_,k=u(g)-S,L=n*k-a*T,P=a*x-r*k,A=r*T-n*x,I=C*L+M*P+w*A;if(I>-1e-9&&I<1e-9)continue;let E=1/I,F=e-v,z=t-_,R=o-S,H=(F*L+z*P+R*A)*E;if(H<0||H>1)continue;let N=z*w-R*M,V=R*C-F*w,W=F*M-z*C,D=(r*N+n*V+a*W)*E;if(D<0||H+D>1)continue;let Y=(x*N+T*V+k*W)*E;Y<0||Y>1||Y>=d||(d=Y,m=c[y/3]??0);}return m>=0?{featureId:m,t:d}:null}function Co(i,e,t){let o=wa(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var dt=24,Ar=8,Sc=2,Mc=12,So=8,Mo=8;function zt(i){let e=0;for(let d of i)e+=d.length/2;if(e<2)return null;let t=(So+2)*2,o=e*t+i.length*(Mo+2)*2+8,r=e*(So+2)*6+i.length*Mo*6+24,n=new ArrayBuffer(o*dt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(d,m,y,p,b,g)=>{let v=s*dt;return a.setFloat32(v,d,true),a.setFloat32(v+4,m,true),a.setFloat32(v+8,y,true),a.setFloat32(v+12,p,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},h=(d,m,y,p)=>{l[c++]=d,l[c++]=m,l[c++]=p,l[c++]=d,l[c++]=p,l[c++]=y;},u=(d,m,y,p,b,g,v)=>{let _=f(d,m,0,0,0,v),S=f(d,m,y,p,1,v);for(let C=1;C<=Mo;C++){let M=Math.PI*C/Mo,w=y*Math.cos(M)+b*Math.sin(M),x=p*Math.cos(M)+g*Math.sin(M),T=f(d,m,w,x,1,v);l[c++]=_,l[c++]=S,l[c++]=T,S=T;}};for(let d of i){let m=Tc(d),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let C=0;C<y-1;C++){let M=m[C*2+2]-m[C*2],w=m[C*2+3]-m[C*2+1],x=Math.hypot(M,w)||1;p[C]=M/x,b[C]=w/x;}let g=0,v=-1,_=-1;for(let C=0;C<y;C++){let M=m[C*2],w=m[C*2+1];C>0&&(g+=Math.hypot(M-m[C*2-2],w-m[C*2-1]));let x=C>0?C-1:0,T=C<y-1?C:y-2,k=-b[x],L=p[x],P=-b[T],A=p[T],I=k+P,E=L+A,F=Math.hypot(I,E);F>1e-9?(I/=F,E/=F):(I=k,E=L);let z=I*P+E*A,R=z>1e-6?1/z:1/0,H=Math.acos(Math.min(1,Math.max(-1,p[x]*p[T]+b[x]*b[T])));if(!(H>Mc*Math.PI/180)&&R<=Sc){let V=f(M,w,I*R,E*R,1,g),W=f(M,w,-I*R,-E*R,-1,g);v>=0&&h(v,_,V,W),v=V,_=W;}else {let V=Math.max(1,Math.min(So,Math.ceil(H/(Math.PI/So)))),D=p[x]*b[T]-b[x]*p[T]>=0?1:-1,Y=f(M,w,k,L,1,g),$=f(M,w,-k,-L,-1,g);v>=0&&h(v,_,Y,$);for(let ee=1;ee<=V;ee++){let se=D*H*(ee/V),Q=Math.cos(se),U=Math.sin(se),ce=k*Q-L*U,ne=k*U+L*Q,q=f(M,w,ce,ne,1,g),j=f(M,w,-ce,-ne,-1,g);h(Y,$,q,j),Y=q,$=j;}v=Y,_=$;}}let S=y-2;u(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),u(m[(y-1)*2],m[(y-1)*2+1],-b[S],p[S],p[S],b[S],g);}return c?{vertices:n.slice(0,s*dt),indices:l.slice(0,c),vertexCount:s}:null}function Lr(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=Yn(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Tc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Pt=5126,Ec={stride:Ar,attribs:[{name:"a_pos",size:2,type:Pt,offset:0}]},Fr={stride:dt,attribs:[{name:"a_pos",size:2,type:Pt,offset:0},{name:"a_extrude",size:2,type:Pt,offset:8},{name:"a_side",size:1,type:Pt,offset:16},{name:"a_dist",size:1,type:Pt,offset:20}]},Ir=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},kc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Ht=class{constructor(){this.objects=[];this.markers=[];this.gpu=new O;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,y)=>m.zIndex-y.zIndex);let f=e.gl.drawingBufferWidth,h=t.width>0?f/t.width:1,u=t.worldSize*h,d=null;for(let m of this.objects){if(!m.visible)continue;let y=m.ghostOpacity;if(c&&y<=0)continue;let p=this.gpuFor(e,m,r,a);if(!p)continue;let b=s?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,g=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:v,vao:_,ibo:S}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let C=c?kc(v.color,y):v.color;if(v.kind==="fill")d!==o&&(o.use(),l?.(o),d=o),o.setVec4v("u_color",_e(C)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {d!==n&&(n.use(),l?.(n),d=n);let M=v.width/2*h,w=u>1e-9?1/u:1;if(n.setVec4v("u_color",_e(C)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*h),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",w),n.setFloat("u_units_to_px",u),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[x,T]=v.dashArray;n.setVec2("u_dash",x*h,(x+T)*h);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let x=(v.arrowSize??5)*h;n.setVec3("u_arrow",(v.arrowPeriod??46)*h,Math.max(x*.4,1),Math.min(x,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}_.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,S.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(te(a)*r,oe(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=Z(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?Ec:Fr,f=s.kind==="fill"?o:r,h=new ye(e,new Uint8Array(s.mesh.vertices),c),u=new ue(e,s.mesh.indices),d=new le(e,[{buffer:h,locations:f}],u);a.push({part:s,vao:d,vbo:h,ibo:u});}let l=new Ir(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var To=32,Ac=1179937895,Lc=1313821514,Ic=5130562,Fc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Rc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Rr(i){let{json:e,bin:t}=xa(i),o=await Pc(e,t);return Ca(e,t,o)}function zc(i){let{json:e,bin:t}=xa(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return Ca(e,t,null)}function xa(i){let e=new DataView(i);if(e.getUint32(0,true)!==Ac)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===Lc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===Ic&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Pc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function _a(i){let e=G();if(i.matrix){for(let w=0;w<16;w++)e[w]=i.matrix[w];return e}ze(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,h]=i.scale??[1,1,1],u=n+n,d=a+a,m=l+l,y=n*u,p=n*d,b=n*m,g=a*d,v=a*m,_=l*m,S=s*u,C=s*d,M=s*m;return e[0]=(1-(g+_))*c,e[1]=(p+M)*c,e[2]=(b-C)*c,e[4]=(p-M)*f,e[5]=(1-(y+_))*f,e[6]=(v+S)*f,e[8]=(b+C)*h,e[9]=(v-S)*h,e[10]=(1-(y+g))*h,e[12]=t,e[13]=o,e[14]=r,e}var Hc={5120:127,5121:255,5122:32767,5123:65535};function Oc(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let h=1/f;return [(n*c-a*s)*h,(a*l-r*c)*h,(r*s-n*l)*h,(o*s-t*c)*h,(e*c-o*l)*h,(t*l-e*s)*h,(t*a-o*n)*h,(o*r-e*a)*h,(e*n-t*r)*h]}function Ca(i,e,t){let o=w=>{let x=t?.get(w);if(x)return x;let T=i.bufferViews?.[w];if(!T)return null;let k=T.byteOffset??0;return e.subarray(k,k+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],h=w=>{if(w===void 0)return null;let x=i.accessors?.[w];if(!x)return null;let T=Rc[x.type]??1,k=new Float64Array(x.count*T),L=x.bufferView!==void 0?i.bufferViews?.[x.bufferView]:void 0;if(!L||x.bufferView===void 0)return {data:k,components:T};let P=o(x.bufferView);if(!P)return {data:k,components:T};let A=Fc[x.componentType]??4,I=L.extensions?.EXT_meshopt_compression,E=I?I.byteStride:L.byteStride,F=E&&E>0?E:A*T,z=x.byteOffset??0,R=new DataView(P.buffer,P.byteOffset,P.byteLength),H=x.normalized?Hc[x.componentType]??1:1;for(let N=0;N<x.count;N++)for(let V=0;V<T;V++){let W=z+N*F+V*A,D;switch(x.componentType){case 5120:D=R.getInt8(W);break;case 5121:D=R.getUint8(W);break;case 5122:D=R.getInt16(W,true);break;case 5123:D=R.getUint16(W,true);break;case 5125:D=R.getUint32(W,true);break;default:D=R.getFloat32(W,true);}k[N*T+V]=H===1?D:Math.max(D/H,-1);}return {data:k,components:T}},u=(w,x,T=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let k=h(w.attributes.POSITION);if(!k)return;let L=h(w.attributes.NORMAL),P=h(w.attributes.TEXCOORD_0),A=h(w.indices),I=r.length/3,E=k.data.length/3,F=Oc(x),R=(w.material!==void 0?i.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,H=R?{ox:R.offset?.[0]??0,oy:R.offset?.[1]??0,sx:R.scale?.[0]??1,sy:R.scale?.[1]??1,rot:R.rotation??0}:null;for(let U=0;U<E;U++){let ce=k.data[U*3],ne=k.data[U*3+1],q=k.data[U*3+2],j=x[0]*ce+x[4]*ne+x[8]*q+x[12],X=x[1]*ce+x[5]*ne+x[9]*q+x[13],de=x[2]*ce+x[6]*ne+x[10]*q+x[14];if(r.push(j,X,de),j<c[0]&&(c[0]=j),X<c[1]&&(c[1]=X),de<c[2]&&(c[2]=de),j>f[0]&&(f[0]=j),X>f[1]&&(f[1]=X),de>f[2]&&(f[2]=de),L){let re=L.data[U*3],ge=L.data[U*3+1],Ee=L.data[U*3+2],ve=F[0]*re+F[3]*ge+F[6]*Ee,eo=F[1]*re+F[4]*ge+F[7]*Ee,to=F[2]*re+F[5]*ge+F[8]*Ee,oo=Math.hypot(ve,eo,to);oo>1e-12?(ve/=oo,eo/=oo,to/=oo):(ve=0,eo=1,to=0),n.push(ve,eo,to);}else n.push(0,1,0);let ie=P?P.data[U*2]:0,me=P?P.data[U*2+1]:0;if(H){if(H.rot!==0){let re=Math.cos(H.rot),ge=Math.sin(H.rot),Ee=re*ie+ge*me,ve=-ge*ie+re*me;ie=Ee,me=ve;}ie=ie*H.sx+H.ox,me=me*H.sy+H.oy;}a.push(ie,me);}let N=l.length;if(A)for(let U=0;U<A.data.length;U++)l.push(I+A.data[U]);else for(let U=0;U<E;U++)l.push(I+U);let V=w.material!==void 0?i.materials?.[w.material]:void 0,W=V?.pbrMetallicRoughness,D=W?.metallicFactor!==void 0||W?.roughnessFactor!==void 0,Y=W?.baseColorFactor??[1,1,1,1],$=W?.baseColorTexture?.index,ee=$!==void 0?i.textures?.[$]?.source:void 0,se=V?.emissiveFactor??[0,0,0],Q=V?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[Y[0],Y[1],Y[2],Y[3]??1],metallic:D?W?.metallicFactor??1:0,roughness:D?W?.roughnessFactor??1:1,emissive:[se[0]*Q,se[1]*Q,se[2]*Q],texture:ee??-1,doubleSided:V?.doubleSided===true,blend:V?.alphaMode==="BLEND",alphaCutoff:V?.alphaMode==="MASK"?V.alphaCutoff??.5:.02,node:T});},d=i.skins?.length?null:Wc(i,h),m=d?d.nodes:null,y=(w,x,T,k)=>{let L=i.nodes?.[w];if(!L)return;let P=_a(L),A=G();xe(A,x,P);let I=G(),E=k,F=m?.get(w);if(F?(F.parentNode=k,F.parent=T.slice(),ze(I),E=w):xe(I,T,P),L.mesh!==void 0)for(let R of i.meshes?.[L.mesh]?.primitives??[])u(R,I,E);let z=L.extensions?.KHR_lights_punctual?.light;if(z!==void 0){let R=i.extensions?.KHR_lights_punctual?.lights?.[z],H=R?.type;if(R&&(H==="point"||H==="spot"||H==="directional")){let N=-A[8],V=-A[9],W=-A[10],D=Math.hypot(N,V,W)||1,Y=R.spot?.innerConeAngle??0,$=R.spot?.outerConeAngle??Math.PI/4;p.push({type:H,color:[R.color?.[0]??1,R.color?.[1]??1,R.color?.[2]??1],intensity:R.intensity??1,range:R.range??0,position:[A[12],A[13],A[14]],direction:[N/D,V/D,W/D],cosInner:Math.cos(Y),cosOuter:Math.cos($)});}}for(let R of L.children??[])y(R,A,I,E);},p=[],b=G();ze(b);let g=G();ze(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((w,x)=>x)??[];for(let w of v)y(w,b,g,-1);let _=[];for(let w of i.images??[]){if(w.bufferView===void 0){_.push(new Uint8Array(0));continue}let x=o(w.bufferView);_.push(x?x.slice():new Uint8Array(0));}let S=r.length/3,C=new ArrayBuffer(S*To),M=new Float32Array(C);for(let w=0;w<S;w++){let x=w*8;M[x]=r[w*3],M[x+1]=r[w*3+1],M[x+2]=r[w*3+2],M[x+3]=n[w*3],M[x+4]=n[w*3+1],M[x+5]=n[w*3+2],M[x+6]=a[w*2],M[x+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:C,indices:new Uint32Array(l),primitives:s,images:_,min:c,max:f,animation:d,lights:p}}function Wc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let h=l==="rotation"?4:3,u=s.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*h);for(let p=0;p<d;p++){let b=u?(p*3+1)*h:p*h;for(let g=0;g<h;g++)m[p*h+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:ze(G()),base:Bc(i.nodes?.[a]),channels:[]};y.channels.push({path:l,times:Float32Array.from(c.data),values:m,step:s.interpolation==="STEP"}),o.set(a,y),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Bc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function zr(i,e,t,o){let r=i.nodes.get(e);if(!r)return ze(o);let n=G();Vc(r,t,n);let a=G();if(xe(a,r.parent,n),r.parentNode<0)return Sa(o,a);let l=G();return zr(i,r.parentNode,t,l),xe(o,l,a)}var Sa=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Vc(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),h=a.times[f]-a.times[c],u=a.step||h<=0?0:Math.min(Math.max((e-a.times[c])/h,0),1),d=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[d+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[d+g]*(1-u)+a.values[m+g]*p*u,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let y=a.path==="translation"?o:n;for(let p=0;p<3;p++)y[p]=a.values[d+p]*(1-u)+a.values[m+p]*u;}}return Sa(t,_a({translation:o,rotation:r,scale:n}))}var Te=5126,Dc=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ma={stride:To,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},Hr=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Pr=256,Eo=41,Ta={stride:Eo*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Ot=2,mt=16,je=class{constructor(){this.models=[];this.gpu=new O;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Pr*Eo);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Ot);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let h=c.fade<1;o.setFloat("u_opacity",c.fade);let u=c.matrixFor(t);o.setMat4("u_matrix",u),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let y of [false,true])if(!(h&&!y))for(let p of c.mesh.primitives){if(!h&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):u),d&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):d);let b=p.texture>=0?f.textures[p.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),b&&e.bindTexture(Ot,b),o.setVec4v("u_base_color",p.baseColor),o.setVec3("u_emissive",p.emissive[0],p.emissive[1],p.emissive[2]),o.setFloat("u_metallic",p.metallic),o.setFloat("u_roughness",p.roughness),e.setCull(p.doubleSided?"none":"back"),e.setBlend(y?"premultiplied":"none"),e.setDepthMask(!y),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new O;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(h=>h.blend||h.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ye(e,this.instScratch,Ta,true)),f.instVao||(f.instVao=new le(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Ot),o.setFloat("u_opacity",1),s=true);let h=c[0].mesh;for(let u=0;u<c.length;u+=Pr){let d=Math.min(Pr,c.length-u);for(let m=0;m<d;m++){let y=c[u+m],p=m*Eo;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):Dc;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,d*Eo)),e.bindVAO(f.instVao.vao);for(let m of h.primitives){let y=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",y?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),y&&e.bindTexture(Ot,y),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,d);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=mt?r:[...r].sort((f,h)=>h.intensity-f.intensity).slice(0,mt),a=new Float32Array(mt*4),l=new Float32Array(mt*4),s=new Float32Array(mt*4),c=new Float32Array(mt*4);n.forEach((f,h)=>{let u=h*4;a[u]=f.position[0],a[u+1]=f.position[1],a[u+2]=f.position[2],a[u+3]=f.range,l[u]=f.color[0]*f.intensity,l[u+1]=f.color[1]*f.intensity,l[u+2]=f.color[2]*f.intensity,l[u+3]=f.type==="spot"?1:0,s[u]=f.direction[0],s[u+1]=f.direction[1],s[u+2]=f.direction[2],c[u]=f.cosInner,c[u+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new ye(e,new Uint8Array(t.mesh.vertices),Ma),l=new ue(e,t.mesh.indices),s=new le(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(h=>{if(!h)return null;let u=n.createTexture();return u?(e.bindTexture(Ot,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,h),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),u):null}),f=new Hr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return Ma}static get instanceLayout(){return Ta}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Or=4,Ea=new J;function Gc(i){Ea.has(i)||(Ea.add(i),console.warn(`[osmgl] ${i}`));}var Nc=.5,Uc=.01,jc=300,Wr=127,Br=128,Wt=5120,Lo=5121,Bt=5122,ka=5123,Vt=5126,Xc={stride:8,attribs:[{name:"a_pos",size:2,type:Vt,offset:0}]},Vr={stride:Ge,attribs:[{name:"a_pos",size:2,type:Bt,offset:0}]},Aa={stride:Ne,attribs:[{name:"a_p0",size:2,type:Bt,offset:0},{name:"a_p1",size:2,type:Bt,offset:4},{name:"a_corner",size:2,type:Wt,offset:8},{name:"a_ground",size:2,type:Wt,offset:10},{name:"a_dist",size:1,type:Vt,offset:12},{name:"a_width",size:1,type:Vt,offset:16}]},ko={stride:Me,attribs:[{name:"a_pos",size:2,type:Bt,offset:0},{name:"a_height",size:1,type:ka,offset:4},{name:"a_tint",size:1,type:Lo,normalized:true,offset:6},{name:"a_ao",size:1,type:Lo,normalized:true,offset:7},{name:"a_normal",size:3,type:Wt,normalized:true,offset:8},{name:"a_kind",size:1,type:Lo,offset:11},{name:"a_wall",size:3,type:ka,offset:12}]},Yc={flat:0,water:1,foliage:2,sand:3,asphalt:4},Kc=[1,9,14,26,3],La={stride:at,attribs:[{name:"a_pos",size:2,type:Vt,offset:0},{name:"a_level",size:1,type:Bt,offset:8},{name:"a_normal",size:3,type:Wt,normalized:true,offset:10},{name:"a_kind",size:1,type:Lo,offset:13},{name:"a_bleed",size:2,type:Wt,offset:14}]},Dr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Fa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Dt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new O;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new _o;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new O;this.lineLocs=new O;this.objectLine=null;this.objectLineLocs=new O;this.buildingLocs=new O;this.shadows={...Fa};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new O;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new O;this.highlightKey="";this.groundArrows=new Ft;this.highlightTris=new O;this.fillHighlightGpu=new O;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Rt;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new O;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new je;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new O;this.modelInstLocs=new O;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),h=new Float64Array(c.featureIds),u=[];for(let m=0;m*3<f.length;m++)a.has(h[m])||u.push(f[m*3],f[m*3+1],f[m*3+2]);let d=null;if(u.length<f.length){let m=new ue(e,new Uint32Array(u));d={vao:new le(e,[{buffer:n,locations:this.buildingLocs}],m),ibo:m,count:u.length,vbo:n};}return this.hiddenCut.set(l,d),d}init(e){this.symbols?.init(e),this.fill=new he(e,"fill",oa,ra),this.surface=new he(e,"surface",fa,ua),this.line=new he(e,"line",na,ia),this.objectLine=new he(e,"objectLine",aa,la),this.building=new he(e,"buildings",sa,ca),this.depth=new he(e,"depth",Xi,vr),this.groundShadow=new he(e,"groundShadow",ea,ta),this.sky=new he(e,"sky",qi,Zi),this.raster=new he(e,"raster",Qi,Ji),this.globeBody=new he(e,"globeBody",Gi,Ni),this.globeClip=new he(e,"globeClip",Ui,ji),this.globeMesh=$c(e,this.globeBody),this.model=new he(e,"model",Yi,wr),this.modelInstanced=new he(e,"model-instanced",Ki,wr),this.modelDepth=new he(e,"modelDepth",$i,vr);for(let n of je.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...je.layout.attribs,...je.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=Vi(e);let t=new O([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),Xc),r=new ue(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new le(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Vr.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of La.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of Aa.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Fr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of ko.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new O){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=ht(t,r),this.patternScale=io/Math.max(Ae(t.center.lat),1);let c=u=>o.get(u.source??K);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=u=>u.type==="line"&&B(u.paint.elevation,l,0)!==0;for(let u of r.layers){if(u.type==="raster"||u.type==="fill-extrusion"||u.type==="symbol"||u.overlay||f(u)||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){if(!this.flattened(d,r,u))continue;this.drawFill(e,t,d,r,u,l);continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let u of r.layers){if(u.type!=="surface"||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.flattened(d,r,u)||this.drawSurface(e,t,d,r,u,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);for(let u of r.layers){if(u.type==="raster"||!f(u)||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&this.drawLine(e,t,d,r,u,l);}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let u of r.layers){if(u.type!=="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.drawBuildings(e,t,d,r,u,l,n)&&(s=true),this.drawHighlight(e,t,d,r,u,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,u=>{this.applyShadowUniforms(u),this.applyFogUniforms(u,t,r),this.applyLight(u,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let u of r.layers){if(u.type==="raster"||!u.overlay||u.type==="symbol"||u.type==="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){this.flattened(d,r,u)?this.drawFill(e,t,d,r,u,l):this.drawSurface(e,t,d,r,u,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let h=r.layers.filter(u=>u.type==="line"&&B(u.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(u,l));if(h.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let u of h){let d=c(u);d&&this.drawLine(e,t,d,r,u,l,B(u.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Or,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(h=>h.type==="fill-extrusion"&&!h.overlay&&r.layerVisibleAt(h,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Lt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(Ao(l.keyAzimuth,l.keyAltitude),jc),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let h of a){let u=o.get(h.source??K);if(!u)continue;let d=r.bucketKeyFor(h);if(d===null)continue;let m=B(h.paint.heightScale,t.zoom,1);(h.source??K)===K&&this.indoorMask.prepare(u,d);for(let y of u.visibleTiles){if(!this.drawsTile(t,r,h,y))continue;let p=u.getTile(y),b=p&&this.bucketFor(e,p,d,ko,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!u.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(h.source??K)===K,v=this.cutHidden(e,p,d,y.dataKey,b.buffer,this.hiddenFor(d,g)),_=g?v??this.indoorMask.indicesFor(e,p,d,y,b.buffer,this.buildingLocs):v;_?(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Or),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),We(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(ae(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),We(r,"u_sky_color",o.sky.skyColor),We(r,"u_horizon_color",o.sky.horizonColor);let n=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*n,s=Math.max(a,1)*n,c=Math.min(s*.5,t.height*n*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){We(r,"u_space_color",o.sky.spaceColor),We(r,"u_atmo_color",o.sky.atmosphereColor);let h=t.globeDisc();r.setVec4("u_globe_disc",h.dir[0],h.dir[1],h.dir[2],h.angle);let[u,d,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",u[0],u[1],u[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",y[0],y[1],y[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let n=t.globeCamera();e.setVec4("u_globe_cam",n.dir[0],n.dir[1],n.dir[2],n.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??ht(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}We(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,B(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Nc/Math.max(t.pixelsPerMeter,1e-9),Uc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Wr);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(K);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Wr)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Wr),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let h=0;h<4;h++)s[12+h]+=l*f[8+h];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=Ao(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=fe(l.ambientColor),h=fe(l.keyColor),u=[0,0,0];for(let d=0;d<3;d++){let m=f[d]*l.ambientIntensity,y=h[d]*l.keyIntensity*c;u[d]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",u[0],u[1],u[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Or),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=fe(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=Uo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=_n(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Yc[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=B(a.materialStrength,o,1)*this.detailScale,s=B(a.materialScale,o,Kc[n]),c=B(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=B(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let h of o.visibleTiles){if(!this.drawsTile(t,r,n,h))continue;let u=o.getTile(h),d=u&&this.bucketFor(e,u,f,Vr,this.fillLocs,"fill");d&&(this.clipToTile(e,h),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),this.applyTileScale(l,h,d.extent),this.applyTileMatrix(l,t,h,d.extent),d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0){let s=this.line,c=r.colorAt(n,a),f=B(n.paint.opacity,a,1)*(l||1),h=B(n.paint.width,a,1);if(f<=.001||h<=.01)return;let u=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,m=t.width>0?u/t.width:1,y=h/2*m;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t),this.applyLight(s,r),this.applyMaterial(s,n,a),s.setVec4v("u_color",_e([c[0],c[1],c[2],c[3]*f])),s.setFloat("u_center_w",t.cameraToCenterDistance);let p=B(n.paint.offset,a,0)*m;s.setFloat("u_elevation",B(n.paint.elevation,a,0)*this.reliefScale),s.setFloat("u_relief",this.reliefScale),s.setVec2("u_viewport",u,d);let b=n.paint.dashArray,g=n.paint.arrow===true,v=n.paint.arrowStyle,_=g&&(v==="head"||v==="headOnly"),S=g&&v==="dash";if(s.setInt("u_pattern",S?5:b?1:v==="headOnly"&&g?4:_?3:g?2:0),b){let[M,w]=b;s.setVec2("u_dash",M*m,(M+w)*m);}if(g){let M=ke(n.paint.arrowColor,a,[1,1,1,1]);s.setVec4v("u_arrow_color",_e(M));let w=B(n.paint.arrowPeriod,a,46)*m,x=B(n.paint.arrowSize,a,5)*m;if(S){let T=B(n.paint.arrowGap,a,24)*m,k=Math.max(w-T,1),L=Math.min(x,k),P=B(n.paint.arrowShaft,a,2)*m,A=B(n.paint.arrowHead,a,4)*m,I=B(n.paint.arrowOutline,a,0)*m;s.setVec4("u_arrow",P,L,A,k),s.setVec2("u_dash",I,w);}else _?s.setVec4("u_arrow",w,x,y,0):s.setVec4("u_arrow",w,Math.max(x*.4,1),Math.min(x,y*.72),0);}let C=r.bucketKeyFor(n);if(C!==null)for(let M of o.visibleTiles){if(!this.drawsTile(t,r,n,M))continue;let w=o.getTile(M),x=w&&this.bucketFor(e,w,C,Aa,this.lineLocs,"line");if(!x)continue;let T=M.bounds(),k=(T.maxX-T.minX)*t.worldSize/x.extent*m;s.setFloat("u_tile_to_px",k);let L=k>1e-6?1/k:1;s.setFloat("u_half_width",y*L),s.setFloat("u_meters_to_units",t.pixelsPerMeter*L),s.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),s.setFloat("u_width_extra",B(n.paint.widthExtra,a,0)*L),s.setFloat("u_offset",p*L),s.setFloat("u_tile_per_px",L),this.applyTileScale(s,M,x.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(M,x.extent)),this.applyTileMatrix(s,t,M,x.extent),x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.indexCount,x.indexType,0);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=fe(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",B(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",B(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let h of o.visibleTiles){let u=o.getTile(h);if(!u)continue;let d=u.data?.buckets?.[n.id];if(!d)continue;let m=h.dataKey,y=this.highlightGpu.get(m);if(y===void 0){let p=Co(u,n.id,l.featureId);if(p){let b=new ye(e,new Uint8Array(p.vertices),ko),g=new ue(e,p.indices);y={vao:new le(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:p.indices.length};}else y=null;this.highlightGpu.set(m,y);}y&&(this.applyTileScale(f,h,d.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),f.setMat4("u_matrix",t.tileMatrix(h,d.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??K);if(!a)return;let l=new J;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let h=Co(c,o.layerId,o.featureId);h&&this.highlightTris.set(s.dataKey,Cr(h,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(u=>u.id===n.layerId),s=l?o.get(l.source??K):void 0;if(!l||!s)return;let c=n.bucketKey,f=fe(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let h=e.gl;e.setStencilTest(true),h.stencilFunc(h.NOTEQUAL,Br,Br),h.stencilOp(h.KEEP,h.KEEP,h.REPLACE),h.stencilMask(Br);for(let u of s.visibleTiles){let d=s.getTile(u),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,u,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(u,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),h.stencilOp(h.KEEP,h.KEEP,h.KEEP),h.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(u=>{u?.vao.destroy(),u?.ibo.destroy(),u?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let u=0;u*3<s.length;u++)c[u]===r&&f.push(s[u*3],s[u*3+1],s[u*3+2]);let h=null;if(f.length){let u=new ye(e,new Uint8Array(t.vertices),Vr),d=new ue(e,new Uint32Array(f));h={vao:new le(e,[{buffer:u,locations:this.fillLocs}],d),vbo:u,ibo:d,count:f.length};}return this.fillHighlightGpu.set(a,h),h}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=B(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",B(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),h=n.paint.sideColor?ke(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",h[0],h[1],h[2]),l.setFloat("u_side_light",B(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let u=r.bucketKeyFor(n);if(u===null)return;let d=c>=1&&!n.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,u,La,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v});}let y=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),l.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},p=m.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of p){y(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:b,bucket:g}of m)y(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,h=B(n.paint.opacity,a,1);if(h<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",h),s.setFloat("u_ao_strength",B(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",B(n.paint.tintVariation,a,.07));let u=(_,S)=>n.paint[_]?r.colorAt({...n,paint:{...n.paint,color:n.paint[_]}},a,S):S,d=u("windowColor",[.62,.71,.8,1]),m=u("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",d[0],d[1],d[2]),s.setVec3("u_window_frame",m[0],m[1],m[2]),s.setFloat("u_facade_detail",B(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",B(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",B(n.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",B(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=h>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=B(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??K)===K;v&&this.indoorMask.prepare(o,g);for(let _ of o.visibleTiles){if(!this.drawsTile(t,r,n,_))continue;let S=o.getTile(_),C=S&&this.bucketFor(e,S,g,ko,this.buildingLocs,"fill-extrusion");if(!C)continue;let M=this.growScale(C,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,_,C.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(_,C.extent)),s.setMat4("u_matrix",t.tileMatrix(_,C.extent));let x=this.cutHidden(e,S,g,_.dataKey,C.buffer,this.hiddenFor(g,v))??(S&&v?this.indoorMask.indicesFor(e,S,g,_,C.buffer,this.buildingLocs):null);x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.indexCount,C.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?qc(Math.max(r,0)):1}applyLight(e,t){let o=t.light;We(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=Ao(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),We(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=Ao(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),We(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return Gc(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new ye(e,new Uint8Array(s.vertices),r),f=new ue(e,new Uint32Array(s.indices)),h=new le(e,[{buffer:c,locations:n}],f),u=new Dr(h,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,u),u}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Ia=new O;function $c(i,e){let r=new Float32Array(4290),n=0;for(let u=0;u<=32;u++){let d=(u/32-.5)*Math.PI;for(let m=0;m<=64;m++)r[n++]=m/64*2*Math.PI-Math.PI,r[n++]=d;}let a=new Uint16Array(2048*6),l=0;for(let u=0;u<32;u++)for(let d=0;d<64;d++){let m=u*65+d,y=m+64+1;a[l++]=m,a[l++]=m+1,a[l++]=y,a[l++]=m+1,a[l++]=y+1,a[l++]=y;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Vt,offset:0}]},c=new O([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),h=new ue(i,a);return {vao:new le(i,[{buffer:f,locations:c}],h),vbo:f,ibo:h,count:a.length}}function We(i,e,t){let o=Ia.get(t);o||(o=fe(t),Ia.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function Ao(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function qc(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Io=1,Gt=class{constructor(e=1024){this.entries=new O;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+Io>this.size&&(this.shelfY+=this.shelfHeight+Io,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Io>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+Io,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),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),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Gr=.75,Ut=8,be=3,Be=24,pt=256,Ra=255,Nt=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new O;this.loaded=new J;this.inflight=new O;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/pt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/pt);if(r<=Ra&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new J;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/pt);n>Ra||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*pt}-${e*pt+pt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of za(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function za(i){let e=new Sl(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,h={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((u,d,m)=>{m&&(u===1?h.id=m.readVarint():u===2?h.bitmap=m.readBytes():u===3?h.width=m.readVarint():u===4?h.height=m.readVarint():u===5?h.left=m.readSVarint():u===6?h.top=m.readSVarint():u===7&&(h.advance=m.readVarint()));},null,f),t.push(h);},null,a);},null),t}var Qc=.25,bt=1e20;function Nr(i,e,t){let o=e+be*2,r=t+be*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(bt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let h=i[c*e+f]/255,u=(c+be)*o+(f+be);if(h>=1)a[u]=0,l[u]=bt;else if(h>0){let d=.5-h;a[u]=d>0?d*d:0,l[u]=d<0?d*d:0;}else a[u]=bt,l[u]=0;}Pa(a,o,r),Pa(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=Jc(Math.round(255-255*(f/Ut+Qc)));}return {data:s,width:o,height:r}}function Pa(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];Ha(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];Ha(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function Ha(i,e,t,o,r){t[0]=0,o[0]=-bt,o[1]=bt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=bt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var Jc=i=>i<0?0:i>255?255:i;var Oa=48,jt=class{constructor(e={}){this.defs=e;this.sdfs=new O;this.pending=new J;this.failed=new J;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Oa*(n>1?n:1))),l=Math.max(8,Math.round(Oa/(n<1?n:1))),s=await ef(o,a,l);return this.sdfs.set(e,Nr(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function ef(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((h,u)=>{a.onload=()=>h(),a.onerror=()=>u(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let h=0;h<f.length;h++)f[h]=c[h*4+3];return f}finally{URL.revokeObjectURL(n);}}var Je={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},tf={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(tf)){let t=Je[e];t?Je[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var of=1.2;function Ur(i,e,t=16,o=0){let r=rf(i,t),n=[],a=[],l=0;for(let f of r){let h=0,u=0;for(let d of f){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(h+=y.advance,u++);}u>1&&(h+=o*(u-1)),a.push(h),h>l&&(l=h);}if(l===0)return null;let s=Be*of,c=r.length*s;for(let f=0;f<r.length;f++){let h=-a[f]/2,u=-c/2+f*s+s/2;for(let d of r[f]){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(y.width>0&&y.height>0&&y.bitmap&&n.push({glyph:y,x:h,y:u}),h+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function rf(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function jr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=u=>u.x>=r&&u.x<=a&&u.y>=n&&u.y<=l,c=[],f=[],h=()=>{f.length>=2&&c.push(f),f=[];};for(let u=0;u+1<i.length;u++){let d=i[u],m=i[u+1],y=s(d),p=s(m);if(y&&p){f.length||f.push(d),f.push(m);continue}let b=nf(d,m,r,n,a,l);if(!b){h();continue}f.length||f.push(b[0]),f.push(b[1]),p||h();}return h(),c}function nf(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[h,u]of f){if(h===0){if(u<0)return null;continue}let d=u/h;if(h<0){if(d>c)return null;d>s&&(s=d);}else {if(d<s)return null;d<c&&(c=d);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var af=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Yr(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=ff(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,h=[],u=o.spacing??250,d=u>0&&u-t<u*.25?t+u*.25:u;if(o.accept)return lf(i,r,e,t,d,c,a,f,o.accept);if(d>0&&s>=t+d){let y=Math.min(Math.floor((s-t)/d)+1,24),p=t+d*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=d){let v=b/l,_=Xr(i,r,e,t,v,c,a,f);_&&h.push({glyphs:_,path:_.map(S=>({x:S.x,y:S.y})),at:v});}if(h.length)return h}let m=(n-t)/2;for(let y of af){let p=m+m*y,b=Xr(i,r,e,t,p,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:p}];if(m===0)break}return []}function lf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),h=[],u=-1/0;for(let d=0;d+o<=c;d+=f){if(d-u<r)continue;let m=Xr(i,e,t,o,d,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:d};if(s(y)&&(h.push(y),u=d,h.length>=24))break}return h}function Xr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!sf(i,e,r,r+o,n,a))return null;let s=Xt(i,e,r),c=Xt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Wa(i,e,t,r,l);let f=e[e.length-1];return Wa([...i].reverse(),uf(e),t,f-(r+o),l)}function sf(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),h=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),u=Math.abs((h-f)*180/Math.PI+540)%360-180,d=Math.abs(u);for(a.push({at:c,delta:d}),l+=d;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Wa(i,e,t,o,r){let n=[];for(let c of t){let f=Ba(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let h=Math.abs(cf(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(h,Math.PI/3)/2);}l=o+t[c].offset+s;let f=Ba(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Ba(i,e,t,o){let r=Xt(i,e,t+o/2);if(!r)return null;let n=Xt(i,e,t),a=Xt(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function cf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function ff(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function uf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Xt(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var $r=20,Va={stride:$r,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},hf=220,Xe=64,Da=2,df=1.22,mf=128,pf=.7;function bf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return B(o,e,0)*Be;let r=B(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*pf/(t/Be)}var yf=256,gf=200,Kr="frame-circle",yt=class i{constructor(e,t){this.shader=null;this.locations=new O;this.atlas=new Gt(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new O;this.fading=false;this.styleOrder=new O;this.glyphs=new Nt(e,t),this.icons=new jt(Je);}init(e){this.shader=new he(e,"symbol",ha,da);for(let t of Va.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/hf;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?gf:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new O,f=new O,h=new O;l.forEach((d,m)=>h.set(d.id,m));let u=0;for(let d of s){let m=this.place(d,a,c);if(!m)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:m.box,order:h.get(d.layer.id)??0});let y=f.get(d.layer.id);y||f.set(d.layer.id,y={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),y.verts.push(...m.verts),y.texs.push(...m.texs),y.iconVerts.push(...m.iconVerts),y.iconTexs.push(...m.iconTexs),y.frameVerts.push(...m.frameVerts),y.frameTexs.push(...m.frameTexs),u+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),u&&(this.styleOrder=h,this.draw(e,t,f,u,a));}collect(e,t,o,r){let n=[],l=this.padding,s=ht(e,o).far,[c,f,h]=e.cameraPositionPx;for(let u of r){let d=(u.layout?.priority??0)*yf,m=t.get(u.source??K);if(!m)continue;let y=u.layout?.showFor==="highlight",p=u.layout?.placement==="map",{shift:b,drop:g}=p?ja(u,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(y&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,_=o.bucketKeyFor(u);if(_!==null)for(let S of m.visibleTiles){if(!o.layerVisibleAt(u,e.detailZoom(e.distanceToTile(S))))continue;let M=m.getTile(S)?.data?.buckets?.[_];if(!M||!xo(M))continue;let w=new Int16Array(M.anchors),x=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,k=M.lines?new Int16Array(M.lines):null,L=M.lineStarts?new Uint32Array(M.lineStarts):null,P=S.bounds(),A=e.worldSize,I=(P.maxX-P.minX)*A/M.extent,E=P.minX*A,F=P.minY*A;for(let z=0;z<x.length;z++){let R=E+w[z*2]*I,H=F+w[z*2+1]*I;if(s!==1/0&&Math.hypot(R-c,H-f,h)>s||y&&!Oe(this.highlightFootprint,R/A,H/A,v))continue;let N=R,V=H;if(p&&T){let $=T[z]*Math.PI/180,ee=b;N-=Math.sin($)*ee,V+=Math.cos($)*ee;}let W=e.worldPxToPoint(N,V),D=k&&L?vf(e,k,L,z,E,F,I):void 0;if(u.layout?.textPlacement==="line"){if(!D)continue}else if(!W||W.x<l.left-64||W.y<l.top-64||W.x>e.width-l.right+64||W.y>e.height-l.bottom+64)continue;n.push({layer:u,screenX:W?W.x:D[0].x,screenY:(W?W.y:D[0].y)+g,text:M.texts[z]??"",icon:M.icons[z]??"",priority:x[z]+d,rotate:Xa(u,T,z,e.bearing),mercX:R/A,mercY:H/A,line:D});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=B(r.textSize,t,13),c=B(r.iconSize,t,16),f=r.iconTextGap??5,[h,u]=r.offset??[0,0],d=r.placement==="map",m=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let q=`icon:${e.icon}`,j=this.atlas.get(q);if(!j){let X=this.icons.get(e.icon);X?j=this.atlas.add(q,X.data,X.width,X.height)??void 0:this.pendingIcons.add(e.icon);}j&&(m=j);}let y=null;if(m&&r.iconFrame==="circle"){let q=`icon:${Kr}`,j=this.atlas.get(q);if(!j){let X=this.icons.get(Kr);X?j=this.atlas.add(q,X.data,X.width,X.height)??void 0:this.pendingIcons.add(Kr);}j&&(y=j);}let p=y?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=Ur(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,bf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/Be,v=b?b.width*g:0,_=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,_,o,t,a):null;let S=r.iconPlacement??"top",C=S==="behind"&&!!m&&!!b,M=S==="top"&&!!m&&!!b,w=m?m.width/Math.max(m.height,1):1,x=C?_+f*2:c,T=m?x*w:0,k=Math.max(T,m?c*p:0),L=Math.max(x,m?c*p:0),P=C?Math.max(T,v+f*2):M?Math.max(k,v):k+(m&&b?f:0)+v,A=C?Math.max(x,_):M?L+f+_:Math.max(m?L:0,_),I=e.screenX+h,E=e.screenY+u,F=Da+(r.collisionPadding??0),z={x1:I-P/2-F,y1:E-A/2-F,x2:I+P/2+F,y2:E+A/2+F},R=this.padding;if(z.x1<R.left||z.y1<R.top||z.x2>this.viewport.width-R.right||z.y2>this.viewport.height-R.bottom)return null;if(!r.allowOverlap){if(Ga(o,z))return null;Na(o,z);}let H=[],N=[],V=[],W=[],D=[],Y=[],$=0,ee=I-P/2,se=M?(L+f)/2:0,Q=1/0,U=1/0,ce=-1/0,ne=-1/0;if(b){let q=M||C?I:ee+(m?k+f:0)+v/2;for(let j of b.glyphs){let X=j.glyph,de=`g:${X.id}`,ie=this.atlas.get(de);if(!ie&&(!X.bitmap||(ie=this.atlas.add(de,X.bitmap,X.width+be*2,X.height+be*2)??void 0,!ie)))continue;let me=q+(j.x+X.left-be)*g,re=E+se+(j.y-X.top-be)*g,ge=ie.width*g,Ee=ie.height*g;Fo(H,N,me,re,ge,Ee,ie,0,a),$++;let ve=be*g;Q=Math.min(Q,me+ve),U=Math.min(U,re+ve),ce=Math.max(ce,me+ge-ve),ne=Math.max(ne,re+Ee-ve);}if(M&&m&&U<1/0){let j=E-A/2+L+f-U;if(j!==0){for(let X=1;X<H.length;X+=4)H[X]+=j;U+=j,ne+=j;}}}if(m){let q=l?df:1,j=T*q,X=x*q,de=(M?I-T/2:ee+(k-T)/2)-(j-T)/2,ie=(M?E-A/2+(L-x)/2:E-x/2)-(X-x)/2;if(y){let re=c*p*q,ge=de+j/2-re/2,Ee=ie+X/2-re/2,ve=be/Math.max(y.height-be*2,1)*re;Fo(D,Y,ge-ve,Ee-ve,re+ve*2,re+ve*2,y,0,a),$++;}if(C&&ce>Q){let re=f*1.6,ge=f;j=(ce-Q+re*2)*q,X=(ne-U+ge*2)*q,de=Q-re,ie=U-ge;}let me=be/Math.max(m.height-be*2,1)*X;Fo(V,W,de-me,ie-me,j+me*2,X+me*2,m,e.rotate,a),$++;}return $?{verts:H,texs:N,iconVerts:V,iconTexs:W,frameVerts:D,frameTexs:Y,quads:$,box:z}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,h=e.layer.layout??{},u=[],d=[],m=[],y=0,p=r/2+Da,b=this.padding,g=T=>{let k=T.path.map(L=>({x1:L.x-p,y1:L.y-p,x2:L.x+p,y2:L.y+p}));for(let L of k)if(L.x1<b.left||L.y1<b.top||L.x2>this.viewport.width-b.right||L.y2>this.viewport.height-b.bottom||!h.allowOverlap&&Ga(n,L))return false;if(!h.allowOverlap)for(let L of k)Na(n,L);return m.push(...k),true},v=-1/0,_=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),_=Math.min(_,T.glyph.top-T.glyph.height));let S=Number.isFinite(v)?(v+_)/2*o:0,M=jr(s,this.viewport.width,this.viewport.height,mf).flatMap(T=>Yr(T,c,f,{spacing:h.symbolSpacing,fontSize:Be*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let k=0;k<t.glyphs.length;k++){let L=t.glyphs[k].glyph,P=T.glyphs[k],A=`g:${L.id}`,I=this.atlas.get(A);if(!I&&(!L.bitmap||(I=this.atlas.add(A,L.bitmap,L.width+be*2,L.height+be*2)??void 0,!I)))continue;let E=I.width*o,F=I.height*o,z=(L.height/2-L.top)*o+S,R=P.angle*Math.PI/180;Fo(u,d,P.x-E/2-Math.sin(R)*z,P.y-F/2+Math.cos(R)*z,E,F,I,P.angle,l),y++;}if(!y)return null;let w=m.map(T=>(T.x1+T.x2)/2),x=m.map(T=>(T.y1+T.y2)/2);return {verts:u,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...w)-p,y1:Math.min(...x)-p,x2:Math.max(...w)+p,y2:Math.max(...x)+p}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*$r),h=new Float32Array(f),u=new Uint16Array(f),d=[],m=0,y=(p,b,g,v)=>{let _=p.length/16;if(_){d.push({layer:g,role:v,first:m/4*6,count:_*6});for(let S=0;S<_*4;S++){let C=m*5;h[C]=p[S*4],h[C+1]=p[S*4+1],u[C*2+4]=b[S*2],u[C*2+5]=b[S*2+1],h[C+3]=p[S*4+2],h[C+4]=p[S*4+3],m++;}}};for(let p of this.inStyleOrder(o))y(p.frameVerts,p.frameTexs,p.layer,"frame"),y(p.iconVerts,p.iconTexs,p.layer,"icon"),y(p.verts,p.texs,p.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Gr),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let p of d){let b=p.layer.paint,g=B(b.opacity,n,1),v=p.role==="icon",_=p.role==="frame",S=(k,L,P)=>_?L??k??P:v?k??P:P,C=ke(_?b.frameColor??b.haloColor??b.color:S(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=_?b.frameHaloColor:S(b.iconHaloColor,void 0,b.haloColor),w=ke(M??(_?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);_&&b.frameHaloColor===void 0&&(w[3]*=.35),_&&(C[3]*=B(b.frameOpacity,n,1));let x=B(_?b.frameHaloWidth??1.1:S(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=B(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([C[0],C[1],C[2],C[3]*g])),a.setVec4v("u_halo_color",_e([w[0],w[1],w[2],w[3]*g])),a.setFloat("u_halo",x/(Ut*(T/Be))),l.drawElements(l.TRIANGLES,p.count,l.UNSIGNED_INT,p.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ye(e,new Uint8Array(this.capacityQuads*4*$r),Va,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new ue(e,o),this.vao=new le(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Fo(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,h=Math.cos(f),u=Math.sin(f),d=t+r/2,m=o+n/2;for(let[y,p]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=y-d,g=p-m;i.push(d+b*h-g*u,m+b*u+g*h,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function vf(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let h=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!h)break;c.push(h);}return c.length>=2?c:void 0}var Ua=(i,e)=>i*4096+e;function Ga(i,e){let t=Math.floor(e.x1/Xe),o=Math.floor(e.y1/Xe),r=Math.floor(e.x2/Xe),n=Math.floor(e.y2/Xe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(Ua(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Na(i,e){let t=Math.floor(e.x1/Xe),o=Math.floor(e.y1/Xe),r=Math.floor(e.x2/Xe),n=Math.floor(e.y2/Xe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=Ua(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function ja(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=B(i.layout?.arrowLength,e,50)*r;return {shift:B(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function Xa(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var gt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new O;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var vt=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function wf(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new vt(t,s,l),f=c.bounds(),h=(f.minX+f.maxX)/2,u=(f.minY+f.maxY)/2,d=[[h,u],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of d)if(i.isOnGlobeFront(Se(p),Ce(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of d){let g=i.localToPoint(i.globeLocal(p,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){y=true;break}}if(y&&(n.push(c),n.length>=r))return n}return n}function Yt(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return wf(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],h=[];for(let d=s;d<=c;d++)h.push(new vt(0,0,0,d));let u=0;for(;h.length&&!(++u>2e4||f.length>=n);){let d=h.pop();if(!i.isTileVisible(d))continue;if(d.z>=l){d.z>=o&&f.push(d);continue}if(i.tileScreenSize(d.z,i.distanceToTile(d))<=a&&d.z>=o){f.push(d);continue}for(let y of d.children())h.push(y);}return f.sort((d,m)=>i.distanceToTile(d)-i.distanceToTile(m)),f}var qr=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new O;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},xf=1500,Ro=class extends Ve{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new gt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Yt(t,this.opts),r=new J;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>xf?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new J;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new qr(t);this.cache.set(t.dataKey,o);let r=_f(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:xn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function _f(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var zo=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},Kt=class extends Ve{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new gt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=Yt(t,this.opts);let o=new J;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new zo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Ya(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function Ya(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var Cf="osmgl-assets",wt="assets";var Po=null;function $a(){return Po||(Po=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(Cf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(wt)||t.createObjectStore(wt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Po)}function Sf(i){return $a().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(wt,"readonly").objectStore(wt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Mf(i){$a().then(e=>{if(e)try{e.transaction(wt,"readwrite").objectStore(wt).put(i);}catch{}});}var Ka=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Tf(i,e,t){let o=await crypto.subtle.importKey("raw",Ka(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ka(t),tagLength:128},o,i)}var $t=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await Sf(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),Mf({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return Tf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var Ef=1,qt=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=G();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${Ef++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await Rr(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=Z(this.coordinates);return {x:te(e.lng),y:oe(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Ae(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=Qr(n(-this.rotation));this.rotationTiltX&&(a=Ye(Zr(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ye(Jr(n(this.rotationTiltZ)),a));let l=Ye(r,a),s=this.matrix;return ze(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=Z(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return xe(n,r,this.localMatrix(o.lat)),Pe(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Z(this.coordinates),n=Ae(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,h=s,u=f,d=c,m=p=>p*Math.PI/180,y=Qr(m(-this.rotation));return this.rotationTiltX&&(y=Ye(Zr(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Ye(Jr(m(this.rotationTiltZ)),y)),[(y[0]*h+y[1]*u+y[2]*d)/t,(y[3]*h+y[4]*u+y[5]*d)/t,(y[6]*h+y[7]*u+y[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=Z(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],h=s[8],u=s[9],d=c*u-f*h;if(Math.abs(d)<1e-30)return false;let m=(n*u-a*h)/d,y=(c*a-f*n)/d,p=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*p,_=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=_}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=G();for(let h=0;h<16;h++)a[h]=e[h];let l=Z(this.coordinates),s=G();xe(s,a,this.localMatrix(l.lat));let c=G();zr(n,t,n.duration>0?o%n.duration:0,c);let f=G();return xe(f,s,c),Pe(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=Qr(e(-this.rotation));this.rotationTiltX&&(t=Ye(Zr(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ye(Jr(e(this.rotationTiltZ)),t));let o=Ye([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function Ye(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var Zr=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},Qr=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},Jr=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Oo=class{constructor(){this.hit=new O;this.miss=new J;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),h=new Uint32Array(a.indices),u=new Float64Array(a.featureIds),d=f.length/a.vertexCount;for(let m=0;m*3+2<h.length;m++){let y=h[m*3]*d,p=h[m*3+1]*d,b=h[m*3+2]*d;if(!zf(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=u[m];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},kf=14,Af=2e3,Lf=4e3,qa=160,If=50,Ff=4e3,en=6,Wo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new O;this.loading=0;this.pending=[];this.known=new O;this.underBuilding=new Oo;this.underVenue=new Oo;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=qa;this.replacedBuildings=new J;this.replacedVenues=new J;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new $t(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??kf,f=s.loadRadius??Af,h=Math.max(s.keepRadius??Lf,f),u=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((s.budget??qa)*this.budgetScale*u));this.budget=d,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let E of [...this.entries.values()])E.model.retire(),E.model.grow<=0&&this.release(E,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let p=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let E of t.visibleTiles)g+=E.dataKey+(t.getTile(E)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let E=new J;v=0;for(let F of t.visibleTiles){let z=t.getTile(F)?.data?.buckets?.[e.id];if(!z||!ma(z))continue;let R=new Int16Array(z.anchors),H=F.bounds(),N=H.maxX-H.minX,V=H.maxY-H.minY;for(let W=0;W<z.props.length;W++){let D=z.props[W],Y=et(D.file,NaN);if(!Number.isFinite(Y))continue;let $=String(D.kind??"model"),ee=$==="rule"?`t-${D.rid}-${D.oid}`:`m-${D.mid}`;if(E.has(ee))continue;E.add(ee),$==="rule"&&v++;let se=H.minX+R[W*2]/z.extent*N,Q=H.minY+R[W*2+1]/z.extent*V,U=Rf(se,Q);this.known.set(ee,{id:ee,fileId:Y,lng:U.lng,lat:U.lat,mercX:se,mercY:Q,altitude:et(D.alt,0),scale:et(D.scale,1),rotation:et(D.rx,0),tiltX:et(D.rz,0),tiltZ:et(D.ry,0),kind:$==="rule"?"rule":"model",target:Ho($==="rule"?D.oid:D.replaces),replaces:m?$==="rule"?Ho(D.oid):String(D.anchor??"replace")==="replace"?Ho(D.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let _=this.found,S=new J;for(let E of _)E.kind==="model"&&E.target!==null&&S.add(E.target);let C=111320,M=Math.cos(p.lat*Math.PI/180),w=E=>Math.hypot((E.lng-p.lng)*C*M,(E.lat-p.lat)*C);this.replacedBuildings.clear(),this.replacedVenues.clear();let x=new J,T=[],k=0,L=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*C*M,(p.lat-this.sortedAt.lat)*C)>If)&&(_.sort((E,F)=>w(E)-w(F)),this.sortedAt={lng:p.lng,lat:p.lat});let A=0;for(let E of _){let F=w(E);if(F>h){k++;continue}if(E.kind==="rule"&&E.target!==null&&S.has(E.target)){let N=this.entries.get(E.id);N&&N.model.retire();continue}let z=this.entries.get(E.id);if(A>=d){L++,z&&z.model.retire();continue}A++,x.add(E.id);let R=()=>{if(E.replaces===null)return;this.replacedBuildings.add(E.replaces);let N=this.underBuilding.find(E,a);N!==null&&this.replacedBuildings.add(N);let V=this.underVenue.find(E,l);V!==null&&this.replacedVenues.add(V);},H=z;if(H){R(),H.distance=F,H.leftAt=0,H.model.revive(),b<H.lod&&!H.upgrading&&this.loading<en&&this.upgrade(H,b,r,n);continue}if(F>f){k++;continue}if(this.loading>=en){T.push(E),R();continue}R(),this.spawn(E,F,b,r);}for(let E of [...this.entries.values()])if(!x.has(E.placement.id)){if(E.leftAt===0){E.leftAt=y;continue}y-E.leftAt>Ff&&E.model.retire();}for(let E of [...this.entries.values()])E.model.growTarget===0&&E.model.grow<=0&&this.release(E,n);if(this.known.size>4e3)for(let[E,F]of [...this.known.entries()])w(F)>h*3&&this.known.delete(E);let I=this.stats;I.found=_.length,I.kept=x.size,I.live=this.entries.size,I.tooFar=k,I.overBudget=L,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<en&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new qt({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},et=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Ho=i=>{let e=et(i,NaN);return Number.isFinite(e)?e:null};function Rf(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function zf(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}var Pf=200,Hf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Zt=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Hf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Of),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=Z(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(te(t.lng)*o,oe(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Pf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Of='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var Qt=class extends Zt{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var Wf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],Za=new Map(Wf);function tn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=Za.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>Za.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function rn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let h of i.features()){if(!pe(e.filter,h.properties))continue;let u=h.loadGeometry(),d=Df(h.type,u);if(!d)continue;let m=e.textField?on(e.textField,h.properties):"",y=m&&e.abbreviate?tn(m):m,p=e.iconImage?on(e.iconImage,h.properties):"";if(!(!y&&!p)){if(l){let b=Vf(h.type,u);if(!b)continue;f.push({text:y,line:b});continue}t.push(d[0],d[1]),o.push(y),r.push(p),n.push(Gf(h.properties)),a.push(e.iconRotate&&Math.round(Number(h.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:h,line:u}of Bf(f)){c.push(s.length/2);for(let d of u)s.push(d);t.push(Math.round(u[0]),Math.round(u[1])),o.push(h),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Bf(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let h=e[f];if(h.line.push(...a.slice(2)),o.delete(l),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f),c!==void 0&&c!==f){let u=e[c];h.line.push(...u.line.slice(2)),u.line=[],t.delete(s),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f);}continue}if(c!==void 0){let h=e[c];h.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,h.line[0],h.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function Vf(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function Df(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let h=c[f+2]-c[f],u=c[f+3]-c[f+1],d=h*h+u*u;d>a&&(a=d,l=c[f]+h/2,s=c[f+1]+u/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Gf(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function on(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function Qa(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&pe(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Nf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function el(i,e){let t=performance.now(),o=Nf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(p,b,g,v,_=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:v,parseMs:_},diag:{status:p,bytes:b,layers:g,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new Tt(a),f=Object.keys(c.layers),h={},u={},d=[],y=i.plan.some(p=>p.type==="surface"&&(p.elevation??0)>0)&&i.plan.some(p=>p.type==="line"&&p.ground)?fr(i.metersPerTile):void 0;for(let p of i.plan){if(!jf(p,i.zoom,i.sourceMaxZoom))continue;let b=c.layers[p.sourceLayer];if(!b)continue;let g=Xf(i.zoom,b.extent);try{if(p.splitBy){let _=Yf(b,p.splitBy,p.filter);if(!_.length)continue;let S=u[p.splitBy]??(u[p.splitBy]=[]);for(let C of _){S.includes(C)||S.push(C);let M={...p,splitBy:void 0,filter:Kf(p.filter,p.splitBy,C)},w=Ja(M,b,g,i.metersPerTile,y);w&&(h[ct(p.id,C)]=w);}continue}let v=Ja(p,b,g,i.metersPerTile,y);v&&(h[p.id]=v);}catch(v){d.push(`${p.id}: ${v instanceof Error?v.message:String(v)}`);}}return {type:"loaded",id:i.id,buckets:h,...Object.keys(u).length?{splits:u}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(h).length,...d.length?{failed:d}:{}}}}function Uf(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function jf(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Xf(i,e){return i<=6?Math.max(64,e/24):0}function Ja(i,e,t,o,r){{if(i.type==="fill"){let a=o>0?o/e.extent:0,l=i.cornerRadius&&a>0?{radius:i.cornerRadius/a,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Vn/a}:void 0,s=cr(e,i.filter,t,l,i.clipToTile===true,e.extent);return s?{kind:"fill",...s,extent:e.extent}:null}if(i.type==="surface"){let a=sr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:l=>ur(r,l,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Uf(i.groundBy)}:{}});return a?{kind:"surface",...a}:null}if(i.type==="line"){let a=mr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0);return a?{kind:"line",...a,extent:e.extent}:null}if(i.type==="model"){let a=Qa(e,i.filter);return a?{kind:"placement",...a,extent:e.extent}:null}if(i.type==="symbol"){let a=rn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return a?{kind:"symbol",...a,extent:e.extent}:null}let n=or(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return n?{kind:"fill-extrusion",vertices:n.vertices,indices:n.indices,featureIds:n.featureIds,vertexCount:n.vertexCount,indexCount:n.indexCount,extent:n.extent}:null}}function Yf(i,e,t){let o=[];for(let r of i.features()){if(!pe(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function Kf(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var nn='"use strict";(()=>{var er=Object.create;var Yt=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,ir=Object.prototype.hasOwnProperty;var or=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var sr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nr(e))!ir.call(t,o)&&o!==n&&Yt(t,o,{get:()=>e[o],enumerable:!(r=tr(e,o))||r.enumerable});return t};var ur=(t,e,n)=>(n=t!=null?er(rr(t)):{},sr(e||!t||!t.__esModule?Yt(n,"default",{value:t,enumerable:!0}):n,t));var Mn=or((Ot,Ut)=>{(function(t,e){typeof Ot=="object"&&typeof Ut<"u"?Ut.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Ot,function(){"use strict";function t(g,i){var u={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},f,p,a,S;return S={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function w(M){return function(V){return F([M,V])}}function F(M){if(f)throw new TypeError("Generator is already executing.");for(;u;)try{if(f=1,p&&(a=M[0]&2?p.return:M[0]?p.throw||((a=p.return)&&a.call(p),0):p.next)&&!(a=a.call(p,M[1])).done)return a;switch(p=0,a&&(M=[M[0]&2,a.value]),M[0]){case 0:case 1:a=M;break;case 4:return u.label++,{value:M[1],done:!1};case 5:u.label++,p=M[1],M=[0];continue;case 7:M=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(M[0]===6||M[0]===2)){u=0;continue}if(M[0]===3&&(!a||M[1]>a[0]&&M[1]<a[3])){u.label=M[1];break}if(M[0]===6&&u.label<a[1]){u.label=a[1],a=M;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(M);break}a[2]&&u.ops.pop(),u.trys.pop();continue}M=i.call(g,u)}catch(V){M=[6,V],p=0}finally{f=a=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}}var e=function(){function g(i,u){this.next=null,this.key=i,this.data=u,this.left=null,this.right=null}return g}();function n(g,i){return g>i?1:g<i?-1:0}function r(g,i,u){for(var f=new e(null,null),p=f,a=f;;){var S=u(g,i.key);if(S<0){if(i.left===null)break;if(u(g,i.left.key)<0){var w=i.left;if(i.left=w.right,w.right=i,i=w,i.left===null)break}a.left=i,a=i,i=i.left}else if(S>0){if(i.right===null)break;if(u(g,i.right.key)>0){var w=i.right;if(i.right=w.left,w.left=i,i=w,i.right===null)break}p.right=i,p=i,i=i.right}else break}return p.right=i.left,a.left=i.right,i.left=f.right,i.right=f.left,i}function o(g,i,u,f){var p=new e(g,i);if(u===null)return p.left=p.right=null,p;u=r(g,u,f);var a=f(g,u.key);return a<0?(p.left=u.left,p.right=u,u.left=null):a>=0&&(p.right=u.right,p.left=u,u.right=null),p}function s(g,i,u){var f=null,p=null;if(i){i=r(g,i,u);var a=u(i.key,g);a===0?(f=i.left,p=i.right):a<0?(p=i.right,i.right=null,f=i):(f=i.left,i.left=null,p=i)}return{left:f,right:p}}function l(g,i,u){return i===null?g:(g===null||(i=r(g.key,i,u),i.left=g),i)}function c(g,i,u,f,p){if(g){f(""+i+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+p(g)+`\n`);var a=i+(u?" ":"\\u2502 ");g.left&&c(g.left,a,!1,f,p),g.right&&c(g.right,a,!0,f,p)}}var h=function(){function g(i){i===void 0&&(i=n),this._root=null,this._size=0,this._comparator=i}return g.prototype.insert=function(i,u){return this._size++,this._root=o(i,u,this._root,this._comparator)},g.prototype.add=function(i,u){var f=new e(i,u);this._root===null&&(f.left=f.right=null,this._size++,this._root=f);var p=this._comparator,a=r(i,this._root,p),S=p(i,a.key);return S===0?this._root=a:(S<0?(f.left=a.left,f.right=a,a.left=null):S>0&&(f.right=a.right,f.left=a,a.right=null),this._size++,this._root=f),this._root},g.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},g.prototype._remove=function(i,u,f){var p;if(u===null)return null;u=r(i,u,f);var a=f(i,u.key);return a===0?(u.left===null?p=u.right:(p=r(i,u.left,f),p.right=u.right),this._size--,p):u},g.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=r(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},g.prototype.findStatic=function(i){for(var u=this._root,f=this._comparator;u;){var p=f(i,u.key);if(p===0)return u;p<0?u=u.left:u=u.right}return null},g.prototype.find=function(i){return this._root&&(this._root=r(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},g.prototype.contains=function(i){for(var u=this._root,f=this._comparator;u;){var p=f(i,u.key);if(p===0)return!0;p<0?u=u.left:u=u.right}return!1},g.prototype.forEach=function(i,u){for(var f=this._root,p=[],a=!1;!a;)f!==null?(p.push(f),f=f.left):p.length!==0?(f=p.pop(),i.call(u,f),f=f.right):a=!0;return this},g.prototype.range=function(i,u,f,p){for(var a=[],S=this._comparator,w=this._root,F;a.length!==0||w;)if(w)a.push(w),w=w.left;else{if(w=a.pop(),F=S(w.key,u),F>0)break;if(S(w.key,i)>=0&&f.call(p,w))return this;w=w.right}return this},g.prototype.keys=function(){var i=[];return this.forEach(function(u){var f=u.key;return i.push(f)}),i},g.prototype.values=function(){var i=[];return this.forEach(function(u){var f=u.data;return i.push(f)}),i},g.prototype.min=function(){return this._root?this.minNode(this._root).key:null},g.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},g.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},g.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},g.prototype.at=function(i){for(var u=this._root,f=!1,p=0,a=[];!f;)if(u)a.push(u),u=u.left;else if(a.length>0){if(u=a.pop(),p===i)return u;p++,u=u.right}else f=!0;return null},g.prototype.next=function(i){var u=this._root,f=null;if(i.right){for(f=i.right;f.left;)f=f.left;return f}for(var p=this._comparator;u;){var a=p(i.key,u.key);if(a===0)break;a<0?(f=u,u=u.left):u=u.right}return f},g.prototype.prev=function(i){var u=this._root,f=null;if(i.left!==null){for(f=i.left;f.right;)f=f.right;return f}for(var p=this._comparator;u;){var a=p(i.key,u.key);if(a===0)break;a<0?u=u.left:(f=u,u=u.right)}return f},g.prototype.clear=function(){return this._root=null,this._size=0,this},g.prototype.toList=function(){return y(this._root)},g.prototype.load=function(i,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var p=i.length,a=this._comparator;if(f&&E(i,u,0,p-1,a),this._root===null)this._root=m(i,u,0,p),this._size=p;else{var S=v(this.toList(),d(i,u),a);p=this._size+p,this._root=x({head:S},0,p)}return this},g.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),g.prototype.toString=function(i){i===void 0&&(i=function(f){return String(f.key)});var u=[];return c(this._root,"",!0,function(f){return u.push(f)},i),u.join("")},g.prototype.update=function(i,u,f){var p=this._comparator,a=s(i,this._root,p),S=a.left,w=a.right;p(i,u)<0?w=o(u,f,w,p):S=o(u,f,S,p),this._root=l(S,w,p)},g.prototype.split=function(i){return s(i,this._root,this._comparator)},g.prototype[Symbol.iterator]=function(){var i,u,f;return t(this,function(p){switch(p.label){case 0:i=this._root,u=[],f=!1,p.label=1;case 1:return f?[3,6]:i===null?[3,2]:(u.push(i),i=i.left,[3,5]);case 2:return u.length===0?[3,4]:(i=u.pop(),[4,i]);case 3:return p.sent(),i=i.right,[3,5];case 4:f=!0,p.label=5;case 5:return[3,1];case 6:return[2]}})},g}();function m(g,i,u,f){var p=f-u;if(p>0){var a=u+Math.floor(p/2),S=g[a],w=i[a],F=new e(S,w);return F.left=m(g,i,u,a),F.right=m(g,i,a+1,f),F}return null}function d(g,i){for(var u=new e(null,null),f=u,p=0;p<g.length;p++)f=f.next=new e(g[p],i[p]);return f.next=null,u.next}function y(g){for(var i=g,u=[],f=!1,p=new e(null,null),a=p;!f;)i?(u.push(i),i=i.left):u.length>0?(i=a=a.next=u.pop(),i=i.right):f=!0;return a.next=null,p.next}function x(g,i,u){var f=u-i;if(f>0){var p=i+Math.floor(f/2),a=x(g,i,p),S=g.head;return S.left=a,g.head=g.head.next,S.right=x(g,p+1,u),S}return null}function v(g,i,u){for(var f=new e(null,null),p=f,a=g,S=i;a!==null&&S!==null;)u(a.key,S.key)<0?(p.next=a,a=a.next):(p.next=S,S=S.next),p=p.next;return a!==null?p.next=a:S!==null&&(p.next=S),f.next}function E(g,i,u,f,p){if(!(u>=f)){for(var a=g[u+f>>1],S=u-1,w=f+1;;){do S++;while(p(g[S],a)<0);do w--;while(p(g[w],a)>0);if(S>=w)break;var F=g[S];g[S]=g[w],g[w]=F,F=i[S],i[S]=i[w],i[w]=F}E(g,i,u,w,p),E(g,i,w+1,f,p)}}let A=(g,i)=>g.ll.x<=i.x&&i.x<=g.ur.x&&g.ll.y<=i.y&&i.y<=g.ur.y,R=(g,i)=>{if(i.ur.x<g.ll.x||g.ur.x<i.ll.x||i.ur.y<g.ll.y||g.ur.y<i.ll.y)return null;let u=g.ll.x<i.ll.x?i.ll.x:g.ll.x,f=g.ur.x<i.ur.x?g.ur.x:i.ur.x,p=g.ll.y<i.ll.y?i.ll.y:g.ll.y,a=g.ur.y<i.ur.y?g.ur.y:i.ur.y;return{ll:{x:u,y:p},ur:{x:f,y:a}}},P=Number.EPSILON;P===void 0&&(P=Math.pow(2,-52));let C=P*P,_=(g,i)=>{if(-P<g&&g<P&&-P<i&&i<P)return 0;let u=g-i;return u*u<C*g*i?0:g<i?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new U,this.yRounder=new U}round(i,u){return{x:this.xRounder.round(i),y:this.yRounder.round(u)}}}class U{constructor(){this.tree=new h,this.round(0)}round(i){let u=this.tree.add(i),f=this.tree.prev(u);if(f!==null&&_(u.key,f.key)===0)return this.tree.remove(i),f.key;let p=this.tree.next(u);return p!==null&&_(u.key,p.key)===0?(this.tree.remove(i),p.key):i}}let O=new L,N=11102230246251565e-32,k=134217729,T=(3+8*N)*N;function j(g,i,u,f,p){let a,S,w,F,M=i[0],V=f[0],b=0,I=0;V>M==V>-M?(a=M,M=i[++b]):(a=V,V=f[++I]);let B=0;if(b<g&&I<u)for(V>M==V>-M?(S=M+a,w=a-(S-M),M=i[++b]):(S=V+a,w=a-(S-V),V=f[++I]),a=S,w!==0&&(p[B++]=w);b<g&&I<u;)V>M==V>-M?(S=a+M,F=S-a,w=a-(S-F)+(M-F),M=i[++b]):(S=a+V,F=S-a,w=a-(S-F)+(V-F),V=f[++I]),a=S,w!==0&&(p[B++]=w);for(;b<g;)S=a+M,F=S-a,w=a-(S-F)+(M-F),M=i[++b],a=S,w!==0&&(p[B++]=w);for(;I<u;)S=a+V,F=S-a,w=a-(S-F)+(V-F),V=f[++I],a=S,w!==0&&(p[B++]=w);return(a!==0||B===0)&&(p[B++]=a),B}function X(g,i){let u=i[0];for(let f=1;f<g;f++)u+=i[f];return u}function K(g){return new Float64Array(g)}let q=(3+16*N)*N,Y=(2+12*N)*N,$=(9+64*N)*N*N,D=K(4),z=K(8),Q=K(12),te=K(16),J=K(4);function he(g,i,u,f,p,a,S){let w,F,M,V,b,I,B,H,G,W,Z,ee,le,re,ce,fe,me,ae,we=g-p,ve=u-p,Se=i-a,Ee=f-a;re=we*Ee,I=k*we,B=I-(I-we),H=we-B,I=k*Ee,G=I-(I-Ee),W=Ee-G,ce=H*W-(re-B*G-H*G-B*W),fe=Se*ve,I=k*Se,B=I-(I-Se),H=Se-B,I=k*ve,G=I-(I-ve),W=ve-G,me=H*W-(fe-B*G-H*G-B*W),Z=ce-me,b=ce-Z,D[0]=ce-(Z+b)+(b-me),ee=re+Z,b=ee-re,le=re-(ee-b)+(Z-b),Z=le-fe,b=le-Z,D[1]=le-(Z+b)+(b-fe),ae=ee+Z,b=ae-ee,D[2]=ee-(ae-b)+(Z-b),D[3]=ae;let Me=X(4,D),We=Y*S;if(Me>=We||-Me>=We||(b=g-we,w=g-(we+b)+(b-p),b=u-ve,M=u-(ve+b)+(b-p),b=i-Se,F=i-(Se+b)+(b-a),b=f-Ee,V=f-(Ee+b)+(b-a),w===0&&F===0&&M===0&&V===0)||(We=$*S+T*Math.abs(Me),Me+=we*V+Ee*w-(Se*M+ve*F),Me>=We||-Me>=We))return Me;re=w*Ee,I=k*w,B=I-(I-w),H=w-B,I=k*Ee,G=I-(I-Ee),W=Ee-G,ce=H*W-(re-B*G-H*G-B*W),fe=F*ve,I=k*F,B=I-(I-F),H=F-B,I=k*ve,G=I-(I-ve),W=ve-G,me=H*W-(fe-B*G-H*G-B*W),Z=ce-me,b=ce-Z,J[0]=ce-(Z+b)+(b-me),ee=re+Z,b=ee-re,le=re-(ee-b)+(Z-b),Z=le-fe,b=le-Z,J[1]=le-(Z+b)+(b-fe),ae=ee+Z,b=ae-ee,J[2]=ee-(ae-b)+(Z-b),J[3]=ae;let Kn=j(4,D,4,J,z);re=we*V,I=k*we,B=I-(I-we),H=we-B,I=k*V,G=I-(I-V),W=V-G,ce=H*W-(re-B*G-H*G-B*W),fe=Se*M,I=k*Se,B=I-(I-Se),H=Se-B,I=k*M,G=I-(I-M),W=M-G,me=H*W-(fe-B*G-H*G-B*W),Z=ce-me,b=ce-Z,J[0]=ce-(Z+b)+(b-me),ee=re+Z,b=ee-re,le=re-(ee-b)+(Z-b),Z=le-fe,b=le-Z,J[1]=le-(Z+b)+(b-fe),ae=ee+Z,b=ae-ee,J[2]=ee-(ae-b)+(Z-b),J[3]=ae;let Jn=j(Kn,z,4,J,Q);re=w*V,I=k*w,B=I-(I-w),H=w-B,I=k*V,G=I-(I-V),W=V-G,ce=H*W-(re-B*G-H*G-B*W),fe=F*M,I=k*F,B=I-(I-F),H=F-B,I=k*M,G=I-(I-M),W=M-G,me=H*W-(fe-B*G-H*G-B*W),Z=ce-me,b=ce-Z,J[0]=ce-(Z+b)+(b-me),ee=re+Z,b=ee-re,le=re-(ee-b)+(Z-b),Z=le-fe,b=le-Z,J[1]=le-(Z+b)+(b-fe),ae=ee+Z,b=ae-ee,J[2]=ee-(ae-b)+(Z-b),J[3]=ae;let qn=j(Jn,Q,4,J,te);return te[qn-1]}function pe(g,i,u,f,p,a){let S=(i-a)*(u-p),w=(g-p)*(f-a),F=S-w,M=Math.abs(S+w);return Math.abs(F)>=q*M?F:-he(g,i,u,f,p,a,M)}let oe=(g,i)=>g.x*i.y-g.y*i.x,Ve=(g,i)=>g.x*i.x+g.y*i.y,de=(g,i,u)=>{let f=pe(g.x,g.y,i.x,i.y,u.x,u.y);return f>0?-1:f<0?1:0},ge=g=>Math.sqrt(Ve(g,g)),Pe=(g,i,u)=>{let f={x:i.x-g.x,y:i.y-g.y},p={x:u.x-g.x,y:u.y-g.y};return oe(p,f)/ge(p)/ge(f)},Ae=(g,i,u)=>{let f={x:i.x-g.x,y:i.y-g.y},p={x:u.x-g.x,y:u.y-g.y};return Ve(p,f)/ge(p)/ge(f)},Ie=(g,i,u)=>i.y===0?null:{x:g.x+i.x/i.y*(u-g.y),y:u},ke=(g,i,u)=>i.x===0?null:{x:u,y:g.y+i.y/i.x*(u-g.x)},Oe=(g,i,u,f)=>{if(i.x===0)return ke(u,f,g.x);if(f.x===0)return ke(g,i,u.x);if(i.y===0)return Ie(u,f,g.y);if(f.y===0)return Ie(g,i,u.y);let p=oe(i,f);if(p==0)return null;let a={x:u.x-g.x,y:u.y-g.y},S=oe(a,i)/p,w=oe(a,f)/p,F=g.x+w*i.x,M=u.x+S*f.x,V=g.y+w*i.y,b=u.y+S*f.y,I=(F+M)/2,B=(V+b)/2;return{x:I,y:B}};class se{static compare(i,u){let f=se.comparePoints(i.point,u.point);return f!==0?f:(i.point!==u.point&&i.link(u),i.isLeft!==u.isLeft?i.isLeft?1:-1:ye.compare(i.segment,u.segment))}static comparePoints(i,u){return i.x<u.x?-1:i.x>u.x?1:i.y<u.y?-1:i.y>u.y?1:0}constructor(i,u){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=u}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");let u=i.point.events;for(let f=0,p=u.length;f<p;f++){let a=u[f];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}checkForConsuming(){let i=this.point.events.length;for(let u=0;u<i;u++){let f=this.point.events[u];if(f.segment.consumedBy===void 0)for(let p=u+1;p<i;p++){let a=this.point.events[p];a.consumedBy===void 0&&f.otherSE.point.events===a.otherSE.point.events&&f.segment.consume(a.segment)}}}getAvailableLinkedEvents(){let i=[];for(let u=0,f=this.point.events.length;u<f;u++){let p=this.point.events[u];p!==this&&!p.segment.ringOut&&p.segment.isInResult()&&i.push(p)}return i}getLeftmostComparator(i){let u=new Map,f=p=>{let a=p.otherSE;u.set(p,{sine:Pe(this.point,i.point,a.point),cosine:Ae(this.point,i.point,a.point)})};return(p,a)=>{u.has(p)||f(p),u.has(a)||f(a);let{sine:S,cosine:w}=u.get(p),{sine:F,cosine:M}=u.get(a);return S>=0&&F>=0?w<M?1:w>M?-1:0:S<0&&F<0?w<M?-1:w>M?1:0:F<S?-1:F>S?1:0}}}let Ue=0;class ye{static compare(i,u){let f=i.leftSE.point.x,p=u.leftSE.point.x,a=i.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(a<p)return-1;let w=i.leftSE.point.y,F=u.leftSE.point.y,M=i.rightSE.point.y,V=u.rightSE.point.y;if(f<p){if(F<w&&F<M)return 1;if(F>w&&F>M)return-1;let b=i.comparePoint(u.leftSE.point);if(b<0)return 1;if(b>0)return-1;let I=u.comparePoint(i.rightSE.point);return I!==0?I:-1}if(f>p){if(w<F&&w<V)return-1;if(w>F&&w>V)return 1;let b=u.comparePoint(i.leftSE.point);if(b!==0)return b;let I=i.comparePoint(u.rightSE.point);return I<0?1:I>0?-1:1}if(w<F)return-1;if(w>F)return 1;if(a<S){let b=u.comparePoint(i.rightSE.point);if(b!==0)return b}if(a>S){let b=i.comparePoint(u.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(a!==S){let b=M-w,I=a-f,B=V-F,H=S-p;if(b>I&&B<H)return 1;if(b<I&&B>H)return-1}return a>S?1:a<S||M<V?-1:M>V?1:i.id<u.id?-1:i.id>u.id?1:0}constructor(i,u,f,p){this.id=++Ue,this.leftSE=i,i.segment=this,i.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=i,this.rings=f,this.windings=p}static fromRing(i,u,f){let p,a,S,w=se.comparePoints(i,u);if(w<0)p=i,a=u,S=1;else if(w>0)p=u,a=i,S=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);let F=new se(p,!0),M=new se(a,!1);return new ye(F,M,[f],[S])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let i=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<u?i:u},ur:{x:this.rightSE.point.x,y:i>u?i:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;let u=this.leftSE.point,f=this.rightSE.point,p=this.vector();if(u.x===f.x)return i.x===u.x?0:i.x<u.x?1:-1;let a=(i.y-u.y)/p.y,S=u.x+a*p.x;if(i.x===S)return 0;let w=(i.x-u.x)/p.x,F=u.y+w*p.y;return i.y===F?0:i.y<F?-1:1}getIntersection(i){let u=this.bbox(),f=i.bbox(),p=R(u,f);if(p===null)return null;let a=this.leftSE.point,S=this.rightSE.point,w=i.leftSE.point,F=i.rightSE.point,M=A(u,w)&&this.comparePoint(w)===0,V=A(f,a)&&i.comparePoint(a)===0,b=A(u,F)&&this.comparePoint(F)===0,I=A(f,S)&&i.comparePoint(S)===0;if(V&&M)return I&&!b?S:!I&&b?F:null;if(V)return b&&a.x===F.x&&a.y===F.y?null:a;if(M)return I&&S.x===w.x&&S.y===w.y?null:w;if(I&&b)return null;if(I)return S;if(b)return F;let B=Oe(a,this.vector(),w,i.vector());return B===null||!A(p,B)?null:O.round(B.x,B.y)}split(i){let u=[],f=i.events!==void 0,p=new se(i,!0),a=new se(i,!1),S=this.rightSE;this.replaceRightSE(a),u.push(a),u.push(p);let w=new ye(p,S,this.rings.slice(),this.windings.slice());return se.comparePoints(w.leftSE.point,w.rightSE.point)>0&&w.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),f&&(p.checkForConsuming(),a.checkForConsuming()),u}swapEvents(){let i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,f=this.windings.length;u<f;u++)this.windings[u]*=-1}consume(i){let u=this,f=i;for(;u.consumedBy;)u=u.consumedBy;for(;f.consumedBy;)f=f.consumedBy;let p=ye.compare(u,f);if(p!==0){if(p>0){let a=u;u=f,f=a}if(u.prev===f){let a=u;u=f,f=a}for(let a=0,S=f.rings.length;a<S;a++){let w=f.rings[a],F=f.windings[a],M=u.rings.indexOf(w);M===-1?(u.rings.push(w),u.windings.push(F)):u.windings[M]+=F}f.rings=null,f.windings=null,f.consumedBy=u,f.leftSE.consumedBy=u.leftSE,f.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,f=this._afterState.windings,p=this._afterState.multiPolys;for(let w=0,F=this.rings.length;w<F;w++){let M=this.rings[w],V=this.windings[w],b=u.indexOf(M);b===-1?(u.push(M),f.push(V)):f[b]+=V}let a=[],S=[];for(let w=0,F=u.length;w<F;w++){if(f[w]===0)continue;let M=u[w],V=M.poly;if(S.indexOf(V)===-1)if(M.isExterior)a.push(V);else{S.indexOf(V)===-1&&S.push(V);let b=a.indexOf(M.poly);b!==-1&&a.splice(b,1)}}for(let w=0,F=a.length;w<F;w++){let M=a[w].multiPoly;p.indexOf(M)===-1&&p.push(M)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let i=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(be.type){case"union":{let f=i.length===0,p=u.length===0;this._isInResult=f!==p;break}case"intersection":{let f,p;i.length<u.length?(f=i.length,p=u.length):(f=u.length,p=i.length),this._isInResult=p===be.numMultiPolys&&f<p;break}case"xor":{let f=Math.abs(i.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=p=>p.length===1&&p[0].isSubject;this._isInResult=f(i)!==f(u);break}default:throw new Error(`Unrecognized operation type found ${be.type}`)}return this._isInResult}}class Ye{constructor(i,u,f){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=f,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let p=O.round(i[0][0],i[0][1]);this.bbox={ll:{x:p.x,y:p.y},ur:{x:p.x,y:p.y}};let a=p;for(let S=1,w=i.length;S<w;S++){if(typeof i[S][0]!="number"||typeof i[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=O.round(i[S][0],i[S][1]);F.x===a.x&&F.y===a.y||(this.segments.push(ye.fromRing(a,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),a=F)}(p.x!==a.x||p.y!==a.y)&&this.segments.push(ye.fromRing(a,p,this))}getSweepEvents(){let i=[];for(let u=0,f=this.segments.length;u<f;u++){let p=this.segments[u];i.push(p.leftSE),i.push(p.rightSE)}return i}}class ut{constructor(i,u){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ye(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let f=1,p=i.length;f<p;f++){let a=new Ye(i[f],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=u}getSweepEvents(){let i=this.exteriorRing.getSweepEvents();for(let u=0,f=this.interiorRings.length;u<f;u++){let p=this.interiorRings[u].getSweepEvents();for(let a=0,S=p.length;a<S;a++)i.push(p[a])}return i}}class Ze{constructor(i,u){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let f=0,p=i.length;f<p;f++){let a=new ut(i[f],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=u}getSweepEvents(){let i=[];for(let u=0,f=this.polys.length;u<f;u++){let p=this.polys[u].getSweepEvents();for(let a=0,S=p.length;a<S;a++)i.push(p[a])}return i}}class Be{static factory(i){let u=[];for(let f=0,p=i.length;f<p;f++){let a=i[f];if(!a.isInResult()||a.ringOut)continue;let S=null,w=a.leftSE,F=a.rightSE,M=[w],V=w.point,b=[];for(;S=w,w=F,M.push(w),w.point!==V;)for(;;){let I=w.getAvailableLinkedEvents();if(I.length===0){let G=M[0].point,W=M[M.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${W.x}, ${W.y}].`)}if(I.length===1){F=I[0].otherSE;break}let B=null;for(let G=0,W=b.length;G<W;G++)if(b[G].point===w.point){B=G;break}if(B!==null){let G=b.splice(B)[0],W=M.splice(G.index);W.unshift(W[0].otherSE),u.push(new Be(W.reverse()));continue}b.push({index:M.length,point:w.point});let H=w.getLeftmostComparator(S);F=I.sort(H)[0].otherSE;break}u.push(new Be(M))}return u}constructor(i){this.events=i;for(let u=0,f=i.length;u<f;u++)i[u].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point,u=[i];for(let M=1,V=this.events.length-1;M<V;M++){let b=this.events[M].point,I=this.events[M+1].point;de(b,i,I)!==0&&(u.push(b),i=b)}if(u.length===1)return null;let f=u[0],p=u[1];de(f,i,p)===0&&u.shift(),u.push(u[0]);let a=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:u.length-1,w=this.isExteriorRing()?u.length:-1,F=[];for(let M=S;M!=w;M+=a)F.push([u[M].x,u[M].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let p=1,a=this.events.length;p<a;p++){let S=this.events[p];se.compare(i,S)>0&&(i=S)}let u=i.segment.prevInResult(),f=u?u.prevInResult():null;for(;;){if(!u)return null;if(!f)return u.ringOut;if(f.ringOut!==u.ringOut)return f.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=f.prevInResult(),f=u?u.prevInResult():null}}}class lt{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){let i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let u=0,f=this.interiorRings.length;u<f;u++){let p=this.interiorRings[u].getGeom();p!==null&&i.push(p)}return i}}class bt{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){let i=[];for(let u=0,f=this.polys.length;u<f;u++){let p=this.polys[u].getGeom();p!==null&&i.push(p)}return i}_composePolys(i){let u=[];for(let f=0,p=i.length;f<p;f++){let a=i[f];if(!a.poly)if(a.isExteriorRing())u.push(new lt(a));else{let S=a.enclosingRing();S.poly||u.push(new lt(S)),S.poly.addInterior(a)}}return u}}class ct{constructor(i){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye.compare;this.queue=i,this.tree=new h(u),this.segments=[]}process(i){let u=i.segment,f=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(u),f;let p=i.isLeft?this.tree.add(u):this.tree.find(u);if(!p)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let a=p,S=p,w,F;for(;w===void 0;)a=this.tree.prev(a),a===null?w=null:a.key.consumedBy===void 0&&(w=a.key);for(;F===void 0;)S=this.tree.next(S),S===null?F=null:S.key.consumedBy===void 0&&(F=S.key);if(i.isLeft){let M=null;if(w){let b=w.getIntersection(u);if(b!==null&&(u.isAnEndpoint(b)||(M=b),!w.isAnEndpoint(b))){let I=this._splitSafely(w,b);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}let V=null;if(F){let b=F.getIntersection(u);if(b!==null&&(u.isAnEndpoint(b)||(V=b),!F.isAnEndpoint(b))){let I=this._splitSafely(F,b);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}if(M!==null||V!==null){let b=null;M===null?b=V:V===null?b=M:b=se.comparePoints(M,V)<=0?M:V,this.queue.remove(u.rightSE),f.push(u.rightSE);let I=u.split(b);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}f.length>0?(this.tree.remove(u),f.push(i)):(this.segments.push(u),u.prev=w)}else{if(w&&F){let M=w.getIntersection(F);if(M!==null){if(!w.isAnEndpoint(M)){let V=this._splitSafely(w,M);for(let b=0,I=V.length;b<I;b++)f.push(V[b])}if(!F.isAnEndpoint(M)){let V=this._splitSafely(F,M);for(let b=0,I=V.length;b<I;b++)f.push(V[b])}}}this.tree.remove(u)}return f}_splitSafely(i,u){this.tree.remove(i);let f=i.rightSE;this.queue.remove(f);let p=i.split(u);return p.push(f),i.consumedBy===void 0&&this.tree.add(i),p}}let Xt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Zn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Wn{run(i,u,f){be.type=i,O.reset();let p=[new Ze(u,!0)];for(let b=0,I=f.length;b<I;b++)p.push(new Ze(f[b],!1));if(be.numMultiPolys=p.length,be.type==="difference"){let b=p[0],I=1;for(;I<p.length;)R(p[I].bbox,b.bbox)!==null?I++:p.splice(I,1)}if(be.type==="intersection")for(let b=0,I=p.length;b<I;b++){let B=p[b];for(let H=b+1,G=p.length;H<G;H++)if(R(B.bbox,p[H].bbox)===null)return[]}let a=new h(se.compare);for(let b=0,I=p.length;b<I;b++){let B=p[b].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(a.insert(B[H]),a.size>Xt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new ct(a),w=a.size,F=a.pop();for(;F;){let b=F.key;if(a.size===w){let B=b.segment;throw new Error(`Unable to pop() ${b.isLeft?"left":"right"} SweepEvent [${b.point.x}, ${b.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(a.size>Xt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>Zn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=S.process(b);for(let B=0,H=I.length;B<H;B++){let G=I[B];G.consumedBy===void 0&&a.insert(G)}w=a.size,F=a.pop()}O.reset();let M=Be.factory(S.segments);return new bt(M).getGeom()}}let be=new Wn;var Qn={union:function(g){for(var i=arguments.length,u=new Array(i>1?i-1:0),f=1;f<i;f++)u[f-1]=arguments[f];return be.run("union",g,u)},intersection:function(g){for(var i=arguments.length,u=new Array(i>1?i-1:0),f=1;f<i;f++)u[f-1]=arguments[f];return be.run("intersection",g,u)},xor:function(g){for(var i=arguments.length,u=new Array(i>1?i-1:0),f=1;f<i;f++)u[f-1]=arguments[f];return be.run("xor",g,u)},difference:function(g){for(var i=arguments.length,u=new Array(i>1?i-1:0),f=1;f<i;f++)u[f-1]=arguments[f];return be.run("difference",g,u)}};return Qn})});var qe=new Set,wt=!1;function _e(t,e,n=2){let r=e&&e.length,o=r?e[0]*n:t.length;qe.size&&qe.clear();let s=Kt(t,0,o,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,h=0,m=0;if(r&&(s=hr(t,e,s,n)),t.length>80*n){c=t[0],h=t[1];let d=c,y=h;for(let x=n;x<o;x+=n){let v=t[x],E=t[x+1];v<c&&(c=v),E<h&&(h=E),v>d&&(d=v),E>y&&(y=E)}m=Math.max(d-c,y-h),m=m!==0?32767/m:0}return vt(s,l,c,h,m),l}function Kt(t,e,n,r,o){let s=null;if(o===Rr(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=Qt(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=Qt(l/r|0,t[l],t[l+1],s);return s&&et(s,s.next)&&(nt(s),s=s.next),s}function Te(t,e=t){let n=e===t,r=t,o;do o=!1,r!==r.next&&(qe.size===0||!qe.has(r))&&(et(r,r.next)||ie(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),wt=!0,nt(r),r=r.prev,o=!0):(n||r!==e)&&(r=r.next,o=!n);while(o||r!==e);return e}function vt(t,e,n,r,o){o&&br(t,n,r,o);let s=t,l=!1;for(;t.prev!==t.next;){let c=t.prev,h=t.next;if(ie(c,t,h)<0&&(o?cr(t,n,r,o):lr(t))){e.push(c.i,t.i,h.i),nt(t),t=h,s=h;continue}if(t=h,t===s){if(wt=!1,t=Te(t),wt){s=t;continue}if(!l){t=fr(t,e),s=t,l=!0;continue}ar(t,e,n,r,o);break}}}function lr(t){let e=t.prev,n=t,r=t.next,o=e.x,s=n.x,l=r.x,c=e.y,h=n.y,m=r.y,d=Math.min(o,s,l),y=Math.min(c,h,m),x=Math.max(o,s,l),v=Math.max(c,h,m),E=r.next;for(;E!==e;){if(E.x>=d&&E.x<=x&&E.y>=y&&E.y<=v&&!(o===E.x&&c===E.y)&&pt(o,c,s,h,l,m,E.x,E.y)&&ie(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function cr(t,e,n,r){let o=t.prev,s=t,l=t.next,c=o.x,h=s.x,m=l.x,d=o.y,y=s.y,x=l.y,v=Math.min(c,h,m),E=Math.min(d,y,x),A=Math.max(c,h,m),R=Math.max(d,y,x),P=Rt(v,E,e,n,r),C=Rt(A,R,e,n,r),_=t.prevZ;for(;_&&_.z>=P;){if(_.x>=v&&_.x<=A&&_.y>=E&&_.y<=R&&_!==l&&!(c===_.x&&d===_.y)&&pt(c,d,h,y,m,x,_.x,_.y)&&ie(_.prev,_,_.next)>=0)return!1;_=_.prevZ}let L=t.nextZ;for(;L&&L.z<=C;){if(L.x>=v&&L.x<=A&&L.y>=E&&L.y<=R&&L!==l&&!(c===L.x&&d===L.y)&&pt(c,d,h,y,m,x,L.x,L.y)&&ie(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function fr(t,e){let n=t,r=!1;do{let o=n.prev,s=n.next.next;en(o,n,n.next,s,!1)&&tt(o,s)&&tt(s,o)&&(e.push(o.i,n.i,s.i),nt(n),nt(n.next),n=t=s,r=!0),n=n.next}while(n!==t);return r?Te(n):n}function ar(t,e,n,r,o){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&Sr(s,l)){let c=tn(s,l);s=Te(s,s.next),c=Te(c,c.next),vt(s,e,n,r,o),vt(c,e,n,r,o);return}l=l.next}s=s.next}while(s!==t)}var St=!1;function hr(t,e,n,r){let o=[];for(let s=0,l=e.length;s<l;s++){let c=e[s]*r,h=s<l-1?e[s+1]*r:t.length,m=Kt(t,c,h,r,!1);m===m.next&&qe.add(m),o.push(vr(m))}o.sort(pr),xr(t.length/r,e.length),qt(n,n),St=!0;for(let s=0;s<o.length;s++)n=mr(o[s],n);return St=!1,Te(n)}function pr(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function mr(t,e){let n=gr(t,e);if(!n)return e;let r=tn(n,t),o=r.next;return qt(n,o.next),Te(r,r.next),Te(n,n.next)}var Jt=16,ne=new Float64Array(0),ht=0,Et=[],Mt=[];function xr(t,e){let n=Math.ceil((t+2*e)/Jt)+e+2;ne.length<n*4&&(ne=new Float64Array(n*4)),ht=0}function qt(t,e){let n=t;do{let r=ht++;Et[r]=n;let o=1/0,s=1/0,l=-1/0,c=-1/0,h=0;do{let d=n.next;n.z=r,n.x<o&&(o=n.x),n.x>l&&(l=n.x),n.y<s&&(s=n.y),n.y>c&&(c=n.y),d.x<o&&(o=d.x),d.x>l&&(l=d.x),d.y<s&&(s=d.y),d.y>c&&(c=d.y),n=d}while(++h<Jt&&n!==e);Mt[r]=n;let m=r*4;ne[m]=o,ne[m+1]=s,ne[m+2]=l,ne[m+3]=c}while(n!==e)}function dr(t,e){let n=t.z*4;e.x<ne[n]&&(ne[n]=e.x),e.y<ne[n+1]&&(ne[n+1]=e.y),e.x>ne[n+2]&&(ne[n+2]=e.x),e.y>ne[n+3]&&(ne[n+3]=e.y)}function Zt(t){let e=Mt[t];for(;e.prev.next!==e;)e=e.next;return Mt[t]=e,e}function Wt(t){let e=Et[t];for(;e.prev.next!==e;)e=e.next;return Et[t]=e,e}function gr(t,e){let n=e,r=t.x,o=t.y,s=-1/0,l;if(et(t,n))return n;for(let x=0,v=0;x<ht;x++,v+=4){if(o<ne[v+1]||o>ne[v+3]||ne[v]>r||ne[v+2]<=s)continue;let E=Zt(x);n=Wt(x);do{if(n.prev.next===n){if(et(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let A=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(A<=r&&A>s&&(s=A,l=n.x<n.next.x?n:n.next,A===r))return l}}n=n.next}while(n!==E)}if(!l)return null;let c=l.x,h=l.y,m=Math.min(o,h),d=Math.max(o,h),y=1/0;for(let x=0,v=0;x<ht;x++,v+=4){if(ne[v+2]<c||ne[v]>r||ne[v+3]<m||ne[v+1]>d)continue;let E=Zt(x);n=Wt(x);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&pt(o<h?r:s,o,c,h,o<h?s:r,o,n.x,n.y)){let A=Math.abs(o-n.y)/(r-n.x);(tt(n,t)||n.y===o&&n.next.y===o&&n.next.x>r)&&(A<y||A===y&&(n.x>l.x||n.x===l.x&&yr(l,n)))&&(l=n,y=A)}n=n.next}while(n!==E)}return l}function yr(t,e){return ie(t.prev,t,e.prev)<0&&ie(e.next,t,t.next)<0}var xe=[],Qe=[],Le=new Uint32Array(0),Ke=new Uint32Array(0),Je=new Uint32Array(256);function br(t,e,n,r){let o=t,s=0;do o.z=Rt(o.x,o.y,e,n,r),xe[s++]=o,o=o.next;while(o!==t);wr(s);let l=null;for(let c=0;c<s;c++){let h=xe[c];h.prevZ=l,l&&(l.nextZ=h),l=h}l.nextZ=null}function wr(t){if(t<=32){for(let e=1;e<t;e++){let n=xe[e],r=n.z,o=e-1;for(;o>=0&&xe[o].z>r;)xe[o+1]=xe[o],o--;xe[o+1]=n}return}Le.length<t&&(Le=new Uint32Array(t),Ke=new Uint32Array(t),Qe=new Array(t));for(let e=0;e<t;e++)Le[e]=xe[e].z;ft(t,xe,Le,Qe,Ke,0),ft(t,Qe,Ke,xe,Le,8),ft(t,xe,Le,Qe,Ke,16),ft(t,Qe,Ke,xe,Le,24)}function ft(t,e,n,r,o,s){Je.fill(0);for(let c=0;c<t;c++)Je[n[c]>>>s&255]++;let l=0;for(let c=0;c<256;c++){let h=Je[c];Je[c]=l,l+=h}for(let c=0;c<t;c++){let h=n[c],m=Je[h>>>s&255]++;r[m]=e[c],o[m]=h}}function Rt(t,e,n,r,o){return t=(t-n)*o|0,e=(e-r)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vr(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function pt(t,e,n,r,o,s,l,c){return(o-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(r-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(o-l)*(r-c)}function Sr(t,e){let n=et(t,e)&&ie(t.prev,t,t.next)>0&&ie(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||tt(t,e)&&tt(e,t)&&(ie(t.prev,t,e.prev)!==0||ie(t,e.prev,e)!==0))&&!Er(t,e)&&(n||Mr(t,e))}function ie(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function et(t,e){return t.x===e.x&&t.y===e.y}function en(t,e,n,r,o=!0){let s=ie(t,e,n),l=ie(t,e,r),c=ie(n,r,t),h=ie(n,r,e);return(s>0&&l<0||s<0&&l>0)&&(c>0&&h<0||c<0&&h>0)?!0:o?!!(s===0&&at(t,n,e)||l===0&&at(t,r,e)||c===0&&at(n,t,r)||h===0&&at(n,e,r)):!1}function at(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Er(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),l=t;do{let c=l.next;if(l.x>r&&c.x>r||l.x<n&&c.x<n||l.y>s&&c.y>s||l.y<o&&c.y<o){l=c;continue}if(l.i!==t.i&&c.i!==t.i&&l.i!==e.i&&c.i!==e.i&&en(l,c,t,e))return!0;l=c}while(l!==t);return!1}function tt(t,e){return ie(t.prev,t,t.next)<0?ie(t,e,t.next)>=0&&ie(t,t.prev,e)>=0:ie(t,e,t.prev)<0||ie(t,t.next,e)<0}function Mr(t,e){let n=t,r=!1,o=(t.x+e.x)/2,s=(t.y+e.y)/2;do{let l=n.next;n.y>s!=l.y>s&&o<(l.x-n.x)*(s-n.y)/(l.y-n.y)+n.x&&(r=!r),n=l}while(n!==t);return r}function tn(t,e){let n=Ft(t.i,t.x,t.y),r=Ft(e.i,e.x,e.y),o=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function Qt(t,e,n,r){let o=Ft(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function nt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),St&&dr(t.prev,t.next)}function Ft(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Rr(t,e,n,r){let o=0;for(let s=e,l=n-r;s<n;s+=r)o+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return o}var nn=23283064365386963e-26,Fr=12,rn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Pt=0,mt=1,rt=2,xt=5,it=class{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,n,r=this.length){for(;this.pos<r;){let o=this.readVarint(),s=o>>3,l=this.pos;this.type=o&7,e(s,n,this),this.pos===l&&this.skip(o)}return n}readMessage(e,n){return this.readFields(e,n,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)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;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 n=this.buf,r,o;return o=n[this.pos++],r=o&127,o<128||(o=n[this.pos++],r|=(o&127)<<7,o<128)||(o=n[this.pos++],r|=(o&127)<<14,o<128)||(o=n[this.pos++],r|=(o&127)<<21,o<128)?r:(o=n[this.pos],r|=(o&15)<<28,Pr(r,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,n=this.pos;return this.pos=e,e-n>=Fr&&rn?rn.decode(this.buf.subarray(n,e)):Gr(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===rt?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===Pt)for(;this.buf[this.pos++]>127;);else if(n===rt)this.pos=this.readVarint()+this.pos;else if(n===xt)this.pos+=4;else if(n===mt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}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,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*nn),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*nn),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Ir(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=Nr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&on(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}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 n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let o=this.pos-r;o>=128&&on(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o}writeMessage(e,n,r){this.writeTag(e,rt),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Ar,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Br,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,Cr,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Lr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Tr,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Vr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,Or,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Dr,n)}writeBytesField(e,n){this.writeTag(e,rt),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,xt),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,xt),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,mt),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,mt),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,Pt),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,Pt),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,rt),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,xt),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,mt),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Pr(t,e,n){let r=n.buf,o,s;if(s=r[n.pos++],o=(s&112)>>4,s<128||(s=r[n.pos++],o|=(s&127)<<3,s<128)||(s=r[n.pos++],o|=(s&127)<<10,s<128)||(s=r[n.pos++],o|=(s&127)<<17,s<128)||(s=r[n.pos++],o|=(s&127)<<24,s<128)||(s=r[n.pos++],o|=(s&1)<<31,s<128))return De(t,o,e);throw new Error("Expected varint not more than 10 bytes")}function De(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ir(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),kr(n,r,e),_r(r,e)}function kr(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function _r(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function on(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function Ar(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Br(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Lr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Tr(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function Cr(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Vr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function Or(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Dr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Gr(t,e,n){let r="",o=e;for(;o<n;){let s=t[o],l=null,c=s>239?4:s>223?3:s>191?2:1;if(o+c>n)break;let h,m,d;c===1?s<128&&(l=s):c===2?(h=t[o+1],(h&192)===128&&(l=(s&31)<<6|h&63,l<=127&&(l=null))):c===3?(h=t[o+1],m=t[o+2],(h&192)===128&&(m&192)===128&&(l=(s&15)<<12|(h&63)<<6|m&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(h=t[o+1],m=t[o+2],d=t[o+3],(h&192)===128&&(m&192)===128&&(d&192)===128&&(l=(s&15)<<18|(h&63)<<12|(m&63)<<6|d&63,(l<=65535||l>=1114112)&&(l=null))),l===null?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),r+=String.fromCharCode(l),o+=c}return r}function Nr(t,e,n){for(let r=0,o,s;r<e.length;r++){if(o=e.charCodeAt(r),o>55295&&o<57344)if(s)if(o<56320){t[n++]=239,t[n++]=191,t[n++]=189,s=o;continue}else o=s-55296<<10|o-56320|65536,s=null;else{o>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):s=o;continue}else s&&(t[n++]=239,t[n++]=191,t[n++]=189,s=null);o<128?t[n++]=o:(o<2048?t[n++]=o>>6|192:(o<65536?t[n++]=o>>12|224:(t[n++]=o>>18|240,t[n++]=o>>12&63|128),t[n++]=o>>6&63|128),t[n++]=o&63|128)}return n}var It=class t{constructor(e,n,r,o){this.pbf=e;this.keys=n;this.values=r;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,o,s){let l=new t(e,r,o,s);return e.readFields(zr,l,n),l}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,o=1,s=0,l=0,c=0,h=[],m=[];for(;e.pos<r;){if(s<=0){let d=e.readVarint();o=d&7,s=d>>3}if(s--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&(m.length&&h.push(m),m=[]),m.push(l,c);else if(o===7)m.length>=2&&m.push(m[0],m[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${o}`)}return m.length&&h.push(m),e.pos=n,h}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,o=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>o&&(o=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return[n,r,o,s]}};function zr(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Hr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Hr(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],o=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=o)}}var kt=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields($r,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return It.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function $r(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(jr(n)))}function jr(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var dt=class{constructor(e){this.layers={};new it(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,o,s)=>{if(r===3&&s){let l=kt.read(s,s.readVarint()+s.pos);l.length&&(this.layers[l.name]=l)}},null)}};function Ge(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let o=Xr(r);o!==0&&(o>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Xr(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function ue(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>ue(r,e));case"any":return t.slice(1).some(r=>ue(r,e));case"!":return!ue(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],o=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===o;case"!=":return r!==o;case">":return r>o;case">=":return r>=o;case"<":return r<o;case"<=":return r<=o;default:return!0}}}}var Yr=Math.PI/8,Zr=.35,Wr=32,sn=.25,un=.07;function Re(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let o=Math.max(2,Math.round(e.segments??4)),s=Math.max(e.minCutRatio??Zr,0),l=e.extent,c=e.margin??0,h=[];for(let m=0;m<r;m++){let d=t[m*2],y=t[m*2+1],x=t[(m+r-1)%r*2],v=t[(m+r-1)%r*2+1],E=t[(m+1)%r*2],A=t[(m+1)%r*2+1],R=d-x,P=y-v,C=E-d,_=A-y,L=Math.hypot(R,P),U=Math.hypot(C,_);if(L<1e-6||U<1e-6){h.push(d,y);continue}let O=R/L,N=P/L,k=C/U,T=_/U;if(e.keep?.[m]){h.push(d,y);continue}let j=O*k+N*T;if(j>.985){h.push(d,y);continue}if(l!==void 0&&(_t(d,y,l,c)||_t(x,v,l,c)||_t(E,A,l,c))){h.push(d,y);continue}let X=Math.min(n,L*.4,U*.4);if(X<n*s){h.push(d,y);continue}let K=d-O*X,q=y-N*X,Y=d+k*X,$=y+T*X,D=Math.acos(Math.max(-1,Math.min(1,j))),z=Math.min(Yr,Math.PI/2/o),Q=Math.ceil(D/z-1e-6),te=e.maxChord&&e.maxChord>0?Math.ceil(X/Math.tan(D/2)*D/e.maxChord):0,J=Math.max(1,Math.min(Wr,Math.max(Math.min(o,Q),te)));h.push(K,q);for(let he=1;he<J;he++){let pe=he/J,oe=1-pe;h.push(oe*oe*K+2*oe*pe*d+pe*pe*Y,oe*oe*q+2*oe*pe*y+pe*pe*$)}h.push(Y,$)}return h.length<6?t:(h.push(h[0],h[1]),h)}var _t=(t,e,n,r)=>t<=-r||e<=-r||t>=n+r||e>=n+r;var Fe=t=>t/64;function Ne(t,e,n=0){let r=ln(t.outer,e,n);if(!r)return null;let o=[];for(let s of t.holes){let l=ln(s,e,n);l&&o.push(l)}return{outer:r,holes:o}}function ln(t,e,n){let r=[];for(let o=0;o<t.length-2;o+=2)r.push(t[o],t[o+1]);if(r.length<6)return null;for(let o=0;o<4;o++){let s=r;r=[];let l=s.length/2;if(l===0)return null;for(let c=0;c<l;c++){let h=s[c*2],m=s[c*2+1],d=s[(c+l-1)%l*2],y=s[(c+l-1)%l*2+1],x=cn(h,m,o,e,n),v=cn(d,y,o,e,n);if(x!==v){let E=Qr(d,y,h,m,o,e,n);r.push(d+(h-d)*E,y+(m-y)*E)}x&&r.push(h,m)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function cn(t,e,n,r,o){return n===0?t>=-o:n===1?t<=r+o:n===2?e>=-o:e<=r+o}function Qr(t,e,n,r,o,s,l){return o===0?(-l-t)/(n-t):o===1?(s+l-t)/(n-t):o===2?(-l-e)/(r-e):(s+l-e)/(r-e)}function gt(t,e,n,r,o,s=0){let l=-s,c=o+s;return t===l&&n===l||t===c&&n===c||e===l&&r===l||e===c&&r===c}function fn(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Lt=18,Tt=4,xn=65535/Tt,Kr=9,Jr=1,qr=0,ei=1,ti=2;var an=0,ni=1,hn=2,ri=3,ii=.47;function dn(t,e,n,r={}){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:ii,s=Math.max(1024,t.length*48),l=new ArrayBuffer(s*Lt),c={verts:new DataView(l),vertsU8:new Uint8Array(l),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};c.ensure=x=>h(x);let h=x=>{if(c.vertexCount+x<=s)return;s=Math.max(s*2,c.vertexCount+x);let v=new ArrayBuffer(s*Lt);new Uint8Array(v).set(c.vertsU8.subarray(0,c.vertOffset)),l=v,c.verts=new DataView(v),c.vertsU8=new Uint8Array(v)};for(let x of t.features()){if(x.type!==3||!ue(n,x.properties))continue;let v=Ri(x.properties),E=Fi(x.properties,v);if(v<=E)continue;let A=Ii(x.properties)??Number(x.id??0),R=Mi(A>>>0),P=Ei(R,x.properties),C=Si(x.properties,v),_=Ge(x.loadGeometry());for(let L of _){let U=Ne(L,e);if(!U)continue;let O=fn(U.outer,e),N=(r.cornerRadius??0)/o,k={radius:N,segments:r.cornerSegments,extent:e,minCutRatio:0},T=N>0?{outer:Re(U.outer,k),holes:U.holes.map($=>Re($,k))}:U,j=T.outer.length/2+T.holes.reduce(($,D)=>$+D.length/2,0);h(j*5+32);let X=T.holes.length||O?null:li(T.outer),K=X?mi(x.properties,X,v,R,o):null,q=null,Y=[];if(K&&X){let $=gn(gi(T.outer,o),X,K.shape);Y=yi($,T.outer);let D=bi($,Y);if(D>1e-6){let z=Math.min(Math.max(D*o*ai,pi),hi);q=wi($,z/D,v)}}pn(c,T.outer,E,v,A,P,C,o,e,q);for(let $ of T.holes)pn(c,$,E,v,A,P,C,o,e,null);q?vi(c,Y,q,v,A,P,C,o):ui(c,T.outer,T.holes,v,A,P,C)}}if(!c.indices.length)return null;let m=new Uint32Array(c.indices),d=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:m.buffer,featureIds:d.buffer,vertexCount:c.vertexCount,indexCount:m.length,extent:e}}var Ct=(t,e)=>t|e<<2,At=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,xn)*Tt)));function ze(t,e,n,r,o,s,l,c,h,m,d=0,y=0,x=0){let v=t.vertOffset;return t.verts.setInt16(v,Math.round(e),!0),t.verts.setInt16(v+2,Math.round(n),!0),t.verts.setUint16(v+4,Math.round(Math.min(r,xn)*Tt),!0),t.vertsU8[v+6]=h,t.vertsU8[v+7]=c,t.verts.setInt8(v+8,Bt(Math.round(o*127))),t.verts.setInt8(v+9,Bt(Math.round(s*127))),t.verts.setInt8(v+10,Bt(Math.round(l*127))),t.vertsU8[v+11]=m,t.verts.setUint16(v+12,At(d),!0),t.verts.setUint16(v+14,At(y),!0),t.verts.setUint16(v+16,At(x),!0),t.vertOffset+=Lt,t.vertexCount++}function pn(t,e,n,r,o,s,l,c,h,m=null){let d=e.length/2;if(d<3)return;let y=Ct(qr,l),x=si(e,c),v=r-n,E=new Float64Array(d*2),A=new Uint8Array(d);{let R=new Float64Array(d*2);for(let P=0;P<d-1;P++){let C=e[P*2+2]-e[P*2],_=e[P*2+3]-e[P*2+1],L=Math.hypot(C,_)||1;R[P*2]=_/L,R[P*2+1]=-C/L}for(let P=0;P<d-1;P++){let C=(P+d-2)%(d-1),_=R[C*2]*R[P*2]+R[C*2+1]*R[P*2+1],L=R[C*2]+R[P*2],U=R[C*2+1]+R[P*2+1],O=Math.hypot(L,U);_>.5&&O>1e-6&&(E[P*2]=L/O,E[P*2+1]=U/O,A[P]=1)}}for(let R=0;R<d-1;R++){let P=e[R*2],C=e[R*2+1],_=e[R*2+2],L=e[R*2+3];if(P===_&&C===L||gt(P,C,_,L,h))continue;let U=_-P,O=L-C,N=Math.hypot(U,O)||1,k=O/N,T=-U/N,j=x.offset[R],X=x.width[R],K=[0,1];if(m){for(let Y=0;Y<m.length;Y++)for(let $=Y+1;$<m.length;$++){let D=Ce(m[Y],P,C)-Ce(m[$],P,C),z=Ce(m[Y],_,L)-Ce(m[$],_,L);if(D===z)continue;let Q=D/(D-z);Q>1e-4&&Q<1-1e-4&&K.push(Q)}K.sort((Y,$)=>Y-$)}let q=(Y,$)=>{if(!m)return r;let D=1/0;for(let z of m)D=Math.min(D,Ce(z,Y,$));return Math.max(r,D)};for(let Y=0;Y+1<K.length;Y++){let $=K[Y],D=K[Y+1];if(D-$<1e-6)continue;let z=P+U*$,Q=C+O*$,te=P+U*D,J=C+O*D,he=j+N*$*c,pe=j+N*D*c,oe=(R+1)%(d-1),Ve=A[R]?E[R*2]:k,de=A[R]?E[R*2+1]:T,ge=A[oe]?E[oe*2]:k,Pe=A[oe]?E[oe*2+1]:T,Ae=k+(Ve-k)*(1-$),Ie=T+(de-T)*(1-$),ke=k+(ge-k)*D,Oe=T+(Pe-T)*D,se=Math.hypot(Ae,Ie)||1,Ue=Math.hypot(ke,Oe)||1,ye=Ae/se,Ye=Ie/se,ut=ke/Ue,Ze=Oe/Ue;t.ensure(4);let Be=ze(t,z,Q,n,ye,Ye,0,0,s,y,he,X,v),lt=ze(t,te,J,n,ut,Ze,0,0,s,y,pe,X,v),bt=ze(t,z,Q,q(z,Q),ye,Ye,0,255,s,y,he,X,v),ct=ze(t,te,J,q(te,J),ut,Ze,0,255,s,y,pe,X,v);t.indices.push(Be,ct,lt,Be,bt,ct),t.featureIds.push(o,o)}}}var oi=.9976;function si(t,e){let n=t.length/2-1,r=[];for(let h=0;h<n;h++){let m=t[h*2+2]-t[h*2],d=t[h*2+3]-t[h*2+1],y=Math.hypot(m,d);r.push(y>0?{x:m/y,y:d/y,len:y*e}:{x:0,y:0,len:0})}let o=(h,m)=>r[h].len>0&&r[m].len>0&&r[h].x*r[m].x+r[h].y*r[m].y>=oi,s=0;for(;s<n&&o((s-1+n)%n,s);)s++;s>=n&&(s=0);let l=new Array(n).fill(0),c=new Array(n).fill(0);for(let h=0;h<n;){let m=(s+h)%n,d=[m],y=r[m].len,x=h+1;for(;x<n;){let E=(s+x)%n;if(!o((s+x-1)%n,E))break;d.push(E),y+=r[E].len,x++}let v=0;for(let E of d)l[E]=v,c[E]=y,v+=r[E].len;h=x}return{offset:l,width:c}}function ui(t,e,n,r,o,s,l){let c=[],h=[];for(let x=0;x<e.length;x++)c.push(e[x]);for(let x of n){h.push(c.length/2);for(let v=0;v<x.length;v++)c.push(x[v])}let m=_e(c,h.length?h:void 0,2);if(!m.length)return;let d=Ct(ei,l),y=t.vertexCount;for(let x=0;x<c.length;x+=2)ze(t,c[x],c[x+1],r,0,0,1,255,s,d);for(let x=0;x<m.length;x+=3)t.indices.push(y+m[x],y+m[x+2],y+m[x+1]),t.featureIds.push(o)}function li(t){let e=ci(t);if(e.length<3)return null;let n=Math.abs(fi(t));if(n<=0)return null;let r=null,o=1/0;for(let s=0;s<e.length;s++){let l=(s+1)%e.length,c=e[l].x-e[s].x,h=e[l].y-e[s].y,m=Math.hypot(c,h);if(m<1e-6)continue;c/=m,h/=m;let d=1/0,y=-1/0,x=1/0,v=-1/0;for(let L of e){let U=L.x*c+L.y*h,O=-L.x*h+L.y*c;U<d&&(d=U),U>y&&(y=U),O<x&&(x=O),O>v&&(v=O)}let E=y-d,A=v-x,R=E*A;if(R<=0||R>=o)continue;o=R;let P=(d+y)/2,C=(x+v)/2,_=E>=A;r={cx:P*c-C*h,cy:P*h+C*c,ax:_?c:-h,ay:_?h:c,halfLong:(_?E:A)/2,halfShort:(_?A:E)/2,fill:n/R}}return r}function ci(t){let e=[];for(let s=0;s<t.length-2;s+=2)e.push({x:t[s],y:t[s+1]});if(e.length<3)return e;e.sort((s,l)=>s.x===l.x?s.y-l.y:s.x-l.x);let n=(s,l,c)=>(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x),r=[];for(let s of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],s)<=0;)r.pop();r.push(s)}let o=[];for(let s=e.length-1;s>=0;s--){let l=e[s];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],l)<=0;)o.pop();o.push(l)}return r.pop(),o.pop(),r.concat(o)}function fi(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var ai=Math.tan(30*Math.PI/180),hi=3.5,pi=.9;function mi(t,e,n,r,o){if(e.fill<.86)return null;let s=e.halfShort*2*o,l=e.halfLong*2*o,c=s*l,h=e.halfShort>0?e.halfLong/e.halfShort:99,m=xi(t);if(!m){if(n>15||c>600||s<3)return null;let d=r%1e3/1e3;c<30?m=d<.5?"skillion":"gabled":h<1.25?m=d<.35?"pyramidal":"hipped":m=d<.8?"gabled":"hipped"}return m==="flat"?null:{shape:m}}function xi(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ce=(t,e,n)=>t.a*e+t.b*n+t.c;function di(t,e,n,r){let o=t.length/2;if(o<3)return[];let s=[],l=c=>[t[c*2],t[c*2+1]];for(let c=0;c<o;c++){let[h,m]=l(c),[d,y]=l((c+o-1)%o),x=e*h+n*m+r,v=e*d+n*y+r;if(x<=0!=v<=0){let E=v/(v-x);s.push(d+(h-d)*E,y+(m-y)*E)}x<=0&&s.push(h,m)}return s}function gi(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let o=[],s=0;o.push(t[0],t[1]);for(let l=1;l<r;l++){let c=t[s*2],h=t[s*2+1],m=t[l*2],d=t[l*2+1],y=m-c,x=d-h,v=Math.hypot(y,x),E=v>1e-6;if(E){for(let A=s+1;A<l;A++)if(Math.abs((t[A*2]-c)*x-(t[A*2+1]-h)*y)/v>=n){E=!1;break}}E||(o.push(t[(l-1)*2],t[(l-1)*2+1]),s=l-1)}return o.length/2<3?t:(o.push(o[0],o[1]),o)}function gn(t,e,n){let{ax:r,ay:o,halfLong:s}=e;if(n==="skillion"){let h=-o,m=r;return[{a:h,b:m,c:-(h*e.cx+m*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let h=0;h<c;h++){let m=t[h*2],d=t[h*2+1],y=t[(h+1)%c*2],x=t[(h+1)%c*2+1],v=y-m,E=x-d,A=Math.hypot(v,E);if(A<1e-6||n==="gabled"&&Math.abs((v*r+E*o)/A)<.86)continue;let R=-E/A,P=v/A;l.push({a:R,b:P,c:-(R*m+P*d)})}return!l.length&&s>0?gn(t,e,"hipped"):l}function yi(t,e){let n=[];for(let o=0;o<e.length-2;o+=2)n.push(e[o],e[o+1]);if(n.length<6)return[];let r=[];for(let o=0;o<t.length;o++){let s=n;for(let l=0;l<t.length&&s.length>=6;l++)l!==o&&(s=di(s,t[o].a-t[l].a,t[o].b-t[l].b,t[o].c-t[l].c));r.push(s.length>=6?s:[])}return r}function bi(t,e){let n=0;for(let r=0;r<e.length;r++){let o=e[r];for(let s=0;s<o.length;s+=2){let l=Ce(t[r],o[s],o[s+1]);l>n&&(n=l)}}return n}function wi(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function vi(t,e,n,r,o,s,l,c){let h=Ct(ti,l);for(let m=0;m<n.length;m++){let d=e[m];if(!d||d.length<6)continue;let y=_e(d,void 0,2);if(!y.length)continue;let x=-n[m].a/c,v=-n[m].b/c,E=Math.hypot(x,v,1),A={x:x/E,y:v/E,z:1/E};t.ensure(d.length/2);let R=t.vertexCount;for(let P=0;P<d.length;P+=2){let C=Math.max(r,Ce(n[m],d[P],d[P+1]));ze(t,d[P],d[P+1],C,A.x,A.y,A.z,255,s,h)}for(let P=0;P<y.length;P+=3)t.indices.push(R+y[P],R+y[P+2],R+y[P+1]),t.featureIds.push(o)}}function Si(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?ri:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?hn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?an:e>=40?hn:ni}function Ei(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function Mi(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Ri(t){let e=He(t.render_height)??He(t.height)??Pi(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,Jr):Kr}function Fi(t,e){let n=He(t.render_min_height)??He(t.min_height)??He(t.base)??0;return n>0&&n<e?n:0}function Pi(t){let e=He(t);return e&&e>0?e*3:null}function He(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Bt=t=>t>127?127:t<-127?-127:t;function Ii(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function ki(t,e,n,r,o){let s=r*r,l=[],c=d=>t[d*2],h=d=>t[d*2+1],m=(d,y)=>{let x=t.length/2;return t.push((c(d)+c(y))/2,(h(d)+h(y))/2),x};for(let d=0;d<e.length;d+=3){l.push([n+e[d],n+e[d+1],n+e[d+2]]);let y=0;for(;l.length&&!(++y>2e4);){let[x,v,E]=l.pop(),A=(c(x)-c(v))**2+(h(x)-h(v))**2,R=(c(v)-c(E))**2+(h(v)-h(E))**2,P=(c(E)-c(x))**2+(h(E)-h(x))**2,C=Math.max(A,R,P);if(C<=s){o.push(x,v,E);continue}if(C===A){let _=m(x,v);l.push([x,_,E],[_,v,E])}else if(C===R){let _=m(v,E);l.push([v,_,x],[_,E,x])}else{let _=m(E,x);l.push([E,_,v],[_,x,v])}}}}function yn(t,e,n=0,r,o=!1,s=4096){let l=[],c=[],h=[];for(let v of t.features()){if(v.type!==3||!ue(e,v.properties))continue;let E=v.properties.osm_id,A=typeof E=="number"?E:typeof E=="string"?Number(E):NaN,R=Number.isFinite(A)?A:Number(v.id??0);for(let P of Ge(v.loadGeometry())){let C=o?Ne(P,s):P;if(!C)continue;let _=[],L=[],U=r?Re(C.outer,r):C.outer;for(let k=0;k<U.length;k++)_.push(U[k]);for(let k of C.holes){let T=r?Re(k,r):k;L.push(_.length/2);for(let j=0;j<T.length;j++)_.push(T[j])}let O=_e(_,L.length?L:void 0,2);if(!O.length)continue;let N=l.length/2;for(let k=0;k<_.length;k++)l.push(_[k]);if(n>0){let k=[];ki(l,O,N,n,k);for(let T=0;T<k.length;T+=3)c.push(k[T],k[T+2],k[T+1]),h.push(R);continue}for(let k=0;k<O.length;k+=3)c.push(N+O[k],N+O[k+2],N+O[k+1]),h.push(R)}}if(!c.length)return null;let m=l.length/2,d=new Int16Array(l),y=new Uint32Array(c);return{featureIds:new Float64Array(h).buffer,vertices:d.buffer,indices:y.buffer,vertexCount:m,indexCount:y.length}}function wn(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function vn(t,e,n,r){if(!(n<=0)){t.extent=r;for(let o of e){let s=o.outer;if(s.length<6)continue;let l=1/0,c=1/0,h=-1/0,m=-1/0;for(let d=0;d<s.length;d+=2)s[d]<l&&(l=s[d]),s[d]>h&&(h=s[d]),s[d+1]<c&&(c=s[d+1]),s[d+1]>m&&(m=s[d+1]);t.shapes.push({outer:s,holes:o.holes,level:n,minX:l,minY:c,maxX:h,maxY:m})}t.cells=[]}}function _i(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],o=$e(Math.floor(r.minX/e)),s=$e(Math.floor(r.maxX/e)),l=$e(Math.floor(r.minY/e)),c=$e(Math.floor(r.maxY/e));for(let h=l;h<=c;h++)for(let m=o;m<=s;m++)t.cells[h*32+m].push(n)}}var Sn=t=>t.shapes.length===0;function Vt(t,e,n){!t.cells.length&&t.shapes.length&&_i(t);let r=t.extent/32,o=t.cells[$e(Math.floor(n/r))*32+$e(Math.floor(e/r))];if(!o||!o.length)return 0;let s=0;for(let l of o){let c=t.shapes[l];if(c.level<=s||e<c.minX||e>c.maxX||n<c.minY||n>c.maxY||!bn(c.outer,e,n))continue;let h=!1;for(let m of c.holes)if(bn(m,e,n)){h=!0;break}h||(s=c.level)}return Math.min(Math.round(s*100),127)}function En(t,e){let n=[],r=[],o=t.extent>0?t.metersPerTile/t.extent:0,s=o>0?2/o:0,l=Vt(t,e[0],e[1]);n.push(e[0],e[1]),r.push(l);for(let c=0;c+3<e.length;c+=2){let h=e[c],m=e[c+1],d=e[c+2],y=e[c+3],x=Vt(t,d,y);if(x!==l&&s>0){let v=Math.hypot(d-h,y-m),E=Math.min(Math.ceil(v/s),64),A=l;for(let R=1;R<E;R++){let P=R/E,C=h+(d-h)*P,_=m+(y-m)*P,L=Vt(t,C,_);L!==A&&(n.push(C,_),r.push(L),A=L)}}n.push(d,y),r.push(x),l=x}return{pts:n,levels:r}}var $e=t=>t<0?0:t>31?31:t;function bn(t,e,n){let r=!1,o=t.length/2;for(let s=0,l=o-1;s<o;l=s++){let c=t[s*2],h=t[s*2+1],m=t[l*2],d=t[l*2+1];h>n!=d>n&&e<(m-c)*(n-h)/(d-h)+c&&(r=!r)}return r}var Pn=ur(Mn(),1);function Rn(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function Fn(t){let e=[];for(let r of t)e.push(r[0],r[1]);let n=e.length;return n>=4&&(e[0]!==e[n-2]||e[1]!==e[n-1])&&e.push(e[0],e[1]),e}function In(t,e,n=0){if(t.length<2)return t;let r=new Map;for(let s of t){let l=s.lift??0,c=r.get(l);c?c.push(s):r.set(l,[s])}let o=[];for(let[s,l]of r){if(l.length<2){o.push(...l);continue}let h=(n>0&&e?l.map(y=>({outer:e(y.outer,-n)??y.outer,holes:y.holes.map(x=>e(x,n)??x)})):l).map(y=>[Rn(y.outer),...y.holes.map(Rn)]),m;try{m=Pn.union(h[0],...h.slice(1))}catch{o.push(...l);continue}let d=m;if(!Array.isArray(d)||d.length===0){o.push(...l);continue}for(let y of d){if(!y.length)continue;let x=Fn(y[0]);if(x.length<8)continue;let v=[];for(let E=1;E<y.length;E++){let A=Fn(y[E]);A.length>=8&&v.push(A)}o.push(s?{outer:x,holes:v,lift:s}:{outer:x,holes:v})}}return o}var Ht=16,Ai=64,Bi=0,Li=1,kn=2,Ti=3,yt=1,Ci=.6;function Tn(t,e,n,r){let o=r.metersPerUnit>0?r.metersPerUnit:.5,s=r.elevation,l=r.base??0,c=Math.max(r.bevel??0,0)/o,h=Math.max(r.bevelDrop??0,0),m=Math.max(r.cornerRadius??0,0)/o,d=Math.max(512,t.length*24),y=new ArrayBuffer(d*Ht),x={view:new DataView(y),bytes:new Uint8Array(y),offset:0,count:0,indices:[],extent:e,ensure(k){if(x.count+k<=d)return;d=Math.max(d*2,x.count+k);let T=new ArrayBuffer(d*Ht);new Uint8Array(T).set(x.bytes.subarray(0,x.offset)),y=T,x.view=new DataView(T),x.bytes=new Uint8Array(T)}},v=[],E=new Map;for(let k of t.features()){if(k.type!==3||!ue(n,k.properties))continue;let T=r.liftBy?.(k.properties)??0;for(let j of Ge(k.loadGeometry())){let X=Ne(j,e,Fe(e));X&&v.push(T?{...X,lift:T}:X)}}let A=new Set,R=Math.max(r.weld??Ci,0),P=In(v,(k,T)=>Gt(k,T,e,A),R/o),C=R>0?P.map(k=>({...k,outer:Ln(k.outer,R/o,e),holes:k.holes.map(T=>Ln(T,R/o,e))})):P;for(let k of C){_n(k.outer,E);for(let T of k.holes)_n(T,E)}r.onShapes?.(C);let _=new Set;for(let[k,T]of E)T>1&&_.add(k);let L=[],U={radius:m,segments:r.cornerSegments,extent:e,margin:Fe(e),minCutRatio:0,maxChord:sn/o};for(let k of C){let T=m>0?{outer:Re(k.outer,{...U,keep:An(k.outer,_)}),holes:k.holes.map(z=>Re(z,{...U,keep:An(z,_)}))}:k,j=c>0?Gt(T.outer,c,e,_):T.outer,X=T.holes.map(z=>c>0?Gt(z,-c,e,_):z),K=k.lift??0,q=s+K,Y=l+K;Bn(x,j??T.outer,X.map((z,Q)=>z??T.holes[Q]),q);let $=q,D=q-h;j&&c>0&&h>0&&Dt(x,j,T.outer,$,D,Li,e,_),D!==Y&&Dt(x,T.outer,T.outer,D,Y,kn,e,_);for(let z of T.holes)if(D!==Y&&Dt(x,z,z,D,Y,kn,e,_),q<Y){let Q=x.indices.length;Bn(x,z,[],Y,Ti);for(let te=Q;te<x.indices.length;te++)L.push(x.indices[te]);x.indices.length=Q}}if(!x.indices.length&&!L.length)return null;let O=x.indices.length,N=new Uint32Array(O+L.length);return N.set(x.indices,0),N.set(L,O),{vertices:y.slice(0,x.offset),indices:N.buffer,vertexCount:x.count,indexCount:N.length,extent:e,capIndexOffset:O}}function je(t,e,n,r){let o=`${Math.round(t*100)},${Math.round(e*100)}`,s=`${Math.round(n*100)},${Math.round(r*100)}`;return o<s?`${o}|${s}`:`${s}|${o}`}function _n(t,e){for(let n=0;n+3<t.length;n+=2){let r=je(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function An(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let o=0;o<n;o++){let s=je(t[(o+n-1)%n*2],t[(o+n-1)%n*2+1],t[o*2],t[o*2+1]),l=je(t[o*2],t[o*2+1],t[(o+1)%n*2],t[(o+1)%n*2+1]);(e.has(s)||e.has(l))&&(r[o]=!0)}return r}function ot(t,e,n,r,o,s,l,c){let h=t.offset;return t.view.setFloat32(h,e,!0),t.view.setFloat32(h+4,n,!0),t.view.setInt16(h+8,Vi(Math.round(r*Ai)),!0),t.view.setInt8(h+10,zt(Math.round(o*127))),t.view.setInt8(h+11,zt(Math.round(s*127))),t.view.setInt8(h+12,zt(Math.round(l*127))),t.bytes[h+13]=c,t.view.setInt8(h+14,e<=0?-yt:e>=t.extent?yt:0),t.view.setInt8(h+15,n<=0?-yt:n>=t.extent?yt:0),t.offset+=Ht,t.count++}function Bn(t,e,n,r,o=Bi){let s=[],l=[];for(let m=0;m<e.length;m++)s.push(e[m]);for(let m of n){l.push(s.length/2);for(let d=0;d<m.length;d++)s.push(m[d])}let c=_e(s,l.length?l:void 0,2);if(!c.length)return;t.ensure(s.length/2);let h=t.count;for(let m=0;m<s.length;m+=2)ot(t,s[m],s[m+1],r,0,0,1,o);for(let m=0;m<c.length;m+=3)t.indices.push(h+c[m],h+c[m+2],h+c[m+1])}function Dt(t,e,n,r,o,s,l,c){let h=Math.min(e.length,n.length)/2;if(!(h<3)){t.ensure((h-1)*4);for(let m=0;m<h-1;m++){let d=n[m*2],y=n[m*2+1],x=n[m*2+2],v=n[m*2+3];if(d===x&&y===v||gt(d,y,x,v,l,Fe(l))||c.has(je(d,y,x,v)))continue;let E=x-d,A=v-y,R=Math.hypot(E,A)||1,P=A/R,C=-E/R,_=r-o,L=Math.hypot(e[m*2]-d,e[m*2+1]-y)||0,U=0;if(L>1e-6&&_!==0){let j=1/Math.hypot(1,_/L);U=L/Math.hypot(L,_)*Math.sign(_),P*=j,C*=j}let O=ot(t,e[m*2],e[m*2+1],r,P,C,U,s),N=ot(t,e[m*2+2],e[m*2+3],r,P,C,U,s),k=ot(t,d,y,o,P,C,U,s),T=ot(t,x,v,o,P,C,U,s);t.indices.push(k,N,T,k,O,N)}}}function Gt(t,e,n,r){let o=t.length/2-1;if(o<3)return null;let s=[];for(let d=0;d<o;d++){let y=t[d*2],x=t[d*2+1],v=t[(d+o-1)%o*2],E=t[(d+o-1)%o*2+1],A=t[(d+1)%o*2],R=t[(d+1)%o*2+1],P=Math.hypot(y-v,x-E)||1,C=Math.hypot(A-y,R-x)||1,_=(x-E)/P,L=-(y-v)/P,U=(R-x)/C,O=-(A-y)/C,N=_+U,k=L+O,T=Math.hypot(N,k);if(T<1e-6){s.push(y,x);continue}N/=T,k/=T;let j=Math.min(1/Math.max(N*_+k*L,.35),3),X=y-N*e*j,K=x-k*e*j,q=je(v,E,y,x),Y=je(y,x,A,R);if(r.has(q)||r.has(Y)){s.push(y,x);continue}let $=-Fe(n),D=n+Fe(n),z=(Q,te)=>Q<=$||Q>=D||te<=$||te>=D;(z(y,x)||z(v,E)||z(A,R))&&(X=y,K=x),s.push(X,K)}s.push(s[0],s[1]);let l=Math.abs(Nt(t)),c=Nt(s);if(Math.sign(c)!==Math.sign(Nt(t))||Math.abs(c)<l*.25)return null;let h=-Fe(n),m=n+Fe(n);for(let d=0;d<s.length;d+=2)s[d]=Math.max(h,Math.min(m,s[d])),s[d+1]=Math.max(h,Math.min(m,s[d+1]));return s}function Nt(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var zt=t=>t>127?127:t<-127?-127:t,Vi=t=>t>32767?32767:t<-32768?-32768:t;function Ln(t,e,n){if(!(e>0))return t;let r=Fe(n),o=-r,s=n+r,l=t;for(let c=0;c<3;c++){let h=l.length/2-1;if(h<6)break;let m=new Array(h).fill(!0),d=h;for(let x=0;x<h&&!(d<=5);x++){let v=l[x*2],E=l[x*2+1];if(v<=o||v>=s||E<=o||E>=s)continue;let A=(x+h-1)%h;for(;!m[A]&&A!==x;)A=(A+h-1)%h;let R=(x+1)%h;for(;!m[R]&&R!==x;)R=(R+1)%h;if(A===x||R===x)break;let P=l[A*2],C=l[A*2+1],_=l[R*2]-P,L=l[R*2+1]-C,U=Math.hypot(_,L);U<1e-6||Math.abs((v-P)*L-(E-C)*_)/U<e&&(m[x]=!1,d--)}if(d===h)break;let y=[];for(let x=0;x<h;x++)m[x]&&y.push(l[x*2],l[x*2+1]);y.push(y[0],y[1]),l=y}return l}var st=20;function On(t,e,n=0,r,o=0){let s=Math.max(256,t.length*24),l=new ArrayBuffer(s*st),c=new DataView(l),h=0,m=[],d=R=>{if(h+R<=s)return;s=Math.max(s*2,h+R);let P=new ArrayBuffer(s*st);new Uint8Array(P).set(new Uint8Array(l,0,h*st)),l=P,c=new DataView(P)},y=(R,P,C,_,L,U,O,N=0,k=0,T=0)=>{let j=h*st;return c.setInt16(j,R,!0),c.setInt16(j+2,P,!0),c.setInt16(j+4,C,!0),c.setInt16(j+6,_,!0),c.setInt8(j+8,L),c.setInt8(j+9,U),c.setInt8(j+10,N),c.setInt8(j+11,k),c.setFloat32(j+12,O,!0),c.setFloat32(j+16,T,!0),h++},x=0,v=o>0?12/o:0,E=v>0?Gi(t):null;for(let R of t.features()){if(R.type!==2&&R.type!==3||!ue(e,R.properties))continue;let P=R.properties.width;x=typeof P=="number"&&P>.5&&P<100?P:0;let C=R.type===3;for(let _ of R.loadGeometry()){let L=n>0?Oi(Cn(_),n):Cn(_);if(L.length<4)continue;let U=r&&!Sn(r)?En(r,L):null,O=U?U.pts:L,N=U?.levels,k=O.length/2;if(k<2)continue;let T=null;if(E&&x>0&&!C){let X=0;for(let z=0;z<k-1;z++)X+=Math.hypot(O[z*2+2]-O[z*2],O[z*2+3]-O[z*2+1]);let K=E.get($t(Math.round(O[0]),Math.round(O[1])))??0,q=E.get($t(Math.round(O[k*2-2]),Math.round(O[k*2-1])))??0,Y=K-x,$=q-x,D=Math.min(v,X/2);D>0&&(Y>0||$>0)&&(T=z=>{let Q=0;return Y>0&&z<D&&(Q=Y*(1-z/D)),$>0&&X-z<D&&(Q=Math.max(Q,$*(1-(X-z)/D))),x+Q})}d((k-1)*4);let j=0;for(let X=0;X<k-1;X++){let K=O[X*2],q=O[X*2+1],Y=O[X*2+2],$=O[X*2+3],D=Math.hypot(Y-K,$-q);if(C&&Di(K,q,Y,$,t.extent)){j+=D;continue}let z=Ui(K,q,Y,$,t.extent);if(!z){j+=D;continue}let[Q,te,J,he]=z,pe=Math.hypot(Q-K,te-q),oe=Math.hypot(J-Q,he-te),Ve=Math.hypot(Y-J,$-he),de=j+pe,ge=N?N[X]:0,Pe=N?N[X+1]:0,Ae=T?T(de):x,Ie=T?T(de+oe):x,ke=y(Q,te,J,he,0,-1,de,ge,Pe,Ae),Oe=y(Q,te,J,he,0,1,de,ge,Pe,Ae),se=y(Q,te,J,he,1,1,de,ge,Pe,Ie),Ue=y(Q,te,J,he,1,-1,de,ge,Pe,Ie);j+=pe+oe+Ve,m.push(ke,Oe,se,ke,se,Ue)}}}if(!m.length)return null;let A=new Uint32Array(m);return{vertices:l.slice(0,h*st),indices:A.buffer,vertexCount:h,indexCount:A.length}}function Oi(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let o=t[r],s=t[r+1],l=t[r+2],c=t[r+3];n.push(o,s);let h=Math.min(64,Math.floor(Math.hypot(l-o,c-s)/e));for(let m=1;m<h;m++){let d=m/h;n.push(o+(l-o)*d,s+(c-s)*d)}}return n.push(t[t.length-2],t[t.length-1]),n}function Cn(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1],s=e.length;s>=2&&e[s-2]===r&&e[s-1]===o||e.push(r,o)}return e}function Ui(t,e,n,r,o){let s=n-t,l=r-e,c=0,h=1,m=[[-s,t],[s,o-t],[-l,e],[l,o-e]];for(let[d,y]of m){if(d===0){if(y<0)return null;continue}let x=y/d;if(d<0){if(x>h)return null;x>c&&(c=x)}else{if(x<c)return null;x<h&&(h=x)}}return h-c<1e-6?null:[Math.round(t+s*c),Math.round(e+l*c),Math.round(t+s*h),Math.round(e+l*h)]}function Di(t,e,n,r,o){return t===n&&(t<=0||t>=o)?!0:e===r&&(e<=0||e>=o)}var Vn=new WeakMap,$t=(t,e)=>(t+512)*65536+(e+512);function Gi(t){let e=Vn.get(t);if(e)return e;let n=new Map,r=(o,s,l)=>{let c=$t(Math.round(o),Math.round(s)),h=n.get(c);(h===void 0||l>h)&&n.set(c,l)};for(let o of t.features()){if(o.type!==2)continue;let s=o.properties.width;if(!(typeof s!="number"||!(s>.5)||!(s<100)))for(let l of o.loadGeometry())l.length<4||(r(l[0],l[1],s),r(l[l.length-2],l[l.length-1],s))}return Vn.set(t,n),n}var Ni=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],Un=new Map(Ni);function Dn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=Un.get(s.toLowerCase());return l?(n=!0,s[0]===s[0].toUpperCase()?l[0].toUpperCase()+l.slice(1):l):s});return!n||!e.filter(s=>Un.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function Nn(t,e){let n=[],r=[],o=[],s=[],l=[],c=e.textPlacement==="line",h=[],m=[],d=[];for(let y of t.features()){if(!ue(e.filter,y.properties))continue;let x=y.loadGeometry(),v=$i(y.type,x);if(!v)continue;let E=e.textField?Gn(e.textField,y.properties):"",A=E&&e.abbreviate?Dn(E):E,R=e.iconImage?Gn(e.iconImage,y.properties):"";if(!(!A&&!R)){if(c){let P=Hi(y.type,x);if(!P)continue;d.push({text:A,line:P});continue}n.push(v[0],v[1]),r.push(A),o.push(R),s.push(ji(y.properties)),l.push(e.iconRotate&&Math.round(Number(y.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:y,line:x}of zi(d)){m.push(h.length/2);for(let v of x)h.push(v);n.push(Math.round(x[0]),Math.round(x[1])),r.push(y),o.push(""),s.push(128),l.push(0)}m.push(h.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:o,priorities:new Uint8Array(s).buffer,rotations:new Int16Array(l).buffer,...c?{lines:new Int16Array(h).buffer,lineStarts:new Uint32Array(m).buffer}:{}}:null}function zi(t){let e=[],n=new Map,r=new Map,o=(s,l,c)=>`${s}\\u241F${l}\\u241F${c}`;for(let{text:s,line:l}of t){let c=o(s,l[0],l[1]),h=o(s,l[l.length-2],l[l.length-1]),m=n.get(h),d=r.get(c);if(d!==void 0){let y=e[d];if(y.line.push(...l.slice(2)),r.delete(c),r.set(o(s,y.line[y.line.length-2],y.line[y.line.length-1]),d),m!==void 0&&m!==d){let x=e[m];y.line.push(...x.line.slice(2)),x.line=[],n.delete(h),r.set(o(s,y.line[y.line.length-2],y.line[y.line.length-1]),d)}continue}if(m!==void 0){let y=e[m];y.line.unshift(...l.slice(0,l.length-2)),n.delete(h),n.set(o(s,y.line[0],y.line[1]),m);continue}n.set(c,e.length),r.set(h,e.length),e.push({text:s,line:l})}return e.filter(s=>s.line.length>=4)}function Hi(t,e){if(t!==2)return null;let n=null,r=0;for(let o of e){if(o.length<4)continue;let s=0;for(let l=0;l+3<o.length;l+=2)s+=Math.hypot(o[l+2]-o[l],o[l+3]-o[l+1]);s>r&&(r=s,n=o)}return n}function $i(t,e){if(!e.length)return null;if(t===1){let l=e[0];return l.length>=2?[l[0],l[1]]:null}if(t===2){let l=-1,c=0,h=0;for(let m of e)for(let d=0;d+3<m.length;d+=2){let y=m[d+2]-m[d],x=m[d+3]-m[d+1],v=y*y+x*x;v>l&&(l=v,c=m[d]+y/2,h=m[d+1]+x/2)}return l>0?[Math.round(c),Math.round(h)]:null}let n=1/0,r=1/0,o=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>o&&(o=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((r+s)/2)]:null}function ji(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Gn(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let o=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,h)=>{let m=e[h];return m==null||m===""?(o=!1,""):String(m)}).trim();if(o&&l)return l}return""}function zn(t,e){let n=[],r=[];for(let o=0;o<t.length;o++){let s=t.feature(o);if(s.type===1&&ue(e,s.properties))for(let l of s.loadGeometry())for(let c=0;c+1<l.length;c+=2)n.push(l[c],l[c+1]),r.push(s.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Xi="\\u241F",Hn=(t,e)=>t+Xi+String(e);function Yi(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function jn(t,e){let n=performance.now(),r=Yi(),o=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),s=(R,P,C,_,L=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:_,parseMs:L},diag:{status:R,bytes:P,layers:C,built:0}});if(!o.ok){if(o.status===404||o.status===204)return s(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${t.url}`)}let l=await o.arrayBuffer(),c=performance.now()-n;if(l.byteLength===0)return s(o.status,0,[],c);let h=performance.now(),m=new dt(l),d=Object.keys(m.layers),y={},x={},v=[],A=t.plan.some(R=>R.type==="surface"&&(R.elevation??0)>0)&&t.plan.some(R=>R.type==="line"&&R.ground)?wn(t.metersPerTile):void 0;for(let R of t.plan){if(!Wi(R,t.zoom,t.sourceMaxZoom))continue;let P=m.layers[R.sourceLayer];if(!P)continue;let C=Qi(t.zoom,P.extent);try{if(R.splitBy){let L=Ki(P,R.splitBy,R.filter);if(!L.length)continue;let U=x[R.splitBy]??(x[R.splitBy]=[]);for(let O of L){U.includes(O)||U.push(O);let N={...R,splitBy:void 0,filter:Ji(R.filter,R.splitBy,O)},k=$n(N,P,C,t.metersPerTile,A);k&&(y[Hn(R.id,O)]=k)}continue}let _=$n(R,P,C,t.metersPerTile,A);_&&(y[R.id]=_)}catch(_){v.push(`${R.id}: ${_ instanceof Error?_.message:String(_)}`)}}return{type:"loaded",id:t.id,buckets:y,...Object.keys(x).length?{splits:x}:{},timing:{fetchMs:c,parseMs:performance.now()-h},diag:{status:o.status,bytes:l.byteLength,layers:d,built:Object.keys(y).length,...v.length?{failed:v}:{}}}}function Zi(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let o of n.split(",")){let s=t[o];typeof s=="number"&&s>r&&(r=s)}return r}}function Wi(t,e,n){let r=e-1,o=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>o)}function Qi(t,e){return t<=6?Math.max(64,e/24):0}function $n(t,e,n,r,o){{if(t.type==="fill"){let l=r>0?r/e.extent:0,c=t.cornerRadius&&l>0?{radius:t.cornerRadius/l,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:un/l}:void 0,h=yn(e,t.filter,n,c,t.clipToTile===!0,e.extent);return h?{kind:"fill",...h,extent:e.extent}:null}if(t.type==="surface"){let l=Tn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,weld:t.weld,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...o?{onShapes:c=>vn(o,c,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:Zi(t.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(t.type==="line"){let l=On(e,t.filter,n,t.ground?o:void 0,r>0?r/e.extent:0);return l?{kind:"line",...l,extent:e.extent}:null}if(t.type==="model"){let l=zn(e,t.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(t.type==="symbol"){let l=Nn(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let s=dn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return s?{kind:"fill-extrusion",vertices:s.vertices,indices:s.indices,featureIds:s.featureIds,vertexCount:s.vertexCount,indexCount:s.indexCount,extent:s.extent}:null}}function Ki(t,e,n){let r=[];for(let o of t.features()){if(!ue(n,o.properties))continue;let s=o.properties[e];typeof s!="string"&&typeof s!="number"||r.includes(s)||r.push(s)}return r.sort((o,s)=>typeof o=="number"&&typeof s=="number"?o-s:String(o).localeCompare(String(s))),r}function Ji(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var qi=t=>t.kind==="symbol",eo=t=>t.kind==="placement";function Xn(t){let e=[];for(let n of Object.values(t.buckets)){if(eo(n)){e.push(n.anchors);continue}if(qi(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var Yn=Map;var Xe=new Yn,jt=self;jt.onmessage=t=>{let e=t.data;if(e.type==="abort"){Xe.get(e.id)?.abort(),Xe.delete(e.id);return}let n=new AbortController;Xe.set(e.id,n),jn(e,n.signal).then(r=>{Xe.has(e.id)&&(Xe.delete(e.id),jt.postMessage(r,Xn(r)))}).catch(r=>{let o=n.signal.aborted;Xe.delete(e.id);let s={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:o};jt.postMessage(s)})};})();\n';var Bo=class{constructor(e=an()){this.workers=[];this.blobUrl=null;this.pending=new O;this.nextId=1;this.cursor=0;this.mainThreadAborts=new O;this.destroyed=false;try{let t=new Blob([nn],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),el(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function an(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function tl(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function ln(i,e){let t=tl(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function sn(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function ol(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var rl={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},xt=i=>rl[i]??rl.high;function Vo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Do(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function cn(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function fn(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function nl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function un(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var $f=1,Jt=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${$f++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=Z(l),c=te(s.lng),f=oe(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=Z(o);t.push(te(r.lng)-this.originX,oe(r.lat)-this.originY);}return t}color(e,t){let o=fe(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},dn=class extends Jt{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=zt([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=zt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=fe(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=pn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(il(e,n[a],n[a+1])<=r)return true;return false}},Go=class extends Jt{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Lr(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(hn(a))),n=zt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=pn(hn(this.coordinates[0]??[]),this.altitude,t);if(!bn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(bn(e,pn(hn(this.coordinates[r]),this.altitude,t)))return false;return true}},mn=class extends Go{constructor(e){super({...e,coordinates:[qf(e.center,e.radius,e.segments)]});}};function qf(i,e,t){let o=Z(i),r=e/Ae(o.lat),n=te(o.lng),a=oe(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function pn(i,e,t){let o=[];for(let r of i){let n=Z(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function hn(i){if(i.length<2)return i;let e=Z(i[0]),t=Z(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function il(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function bn(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var al="objects3d",_t="level",Zf=32,Qf=100,yn=120,Jf=40,eu=.35,tu=.02,ou=150,ru=250;function ll(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function nu(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var gn=class extends Ve{constructor(t){super();this.options=t;this.transform=new Mt;this.ctx=null;this.sources=new O;this.rasterSources=new O;this.renderer=new Dt;this.objects=new Ht;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(yn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new O;this.autoIndoorLevel=true;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Vo(Do()):t.quality;this.qualityCeiling=r,this.quality=xt(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ft(t.theme?vo(t.theme,t.style):t.style),this.background=t.background?fe(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=Z(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Bo(t.workerCount??Math.min(an(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new no(t);let o=new yt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...Je,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(K,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Wo({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:al,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(nu):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:al,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(Oe(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(K);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??K)!==K)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===_t&&t.add(o.source??K);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??K;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new Kt({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Ro(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===K&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new ho(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let h of this.getPopups())h.closeOnClick&&this.removePopup(h);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=cn(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=Z(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=Z(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?Z(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+tt((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Z(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+tt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=De(r.zoom),s=(te(a.center.lng)-te(r.center.lng))*l,c=(oe(a.center.lat)-oe(r.center.lat))*l,f=Math.hypot(s,c),h=Math.max(o.width,o.height),u=h*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,y,p=null;if(f<1e-6){let g=Math.log(u/h);y=Math.abs(g)/d,p=v=>({u:0,w:h*Math.exp(d*Math.sign(g)*v)});}else {let g=w=>{let x=w===0?h:u,T=w===0?u:h;return (T*T-x*x+(w===0?1:-1)*m*m*f*f)/(2*x*m*f)},v=w=>Math.log(-g(w)+Math.sqrt(g(w)*g(w)+1)),_=v(0);y=(v(1)-_)/d;let C=w=>(Math.exp(w)+Math.exp(-w))/2,M=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);p=w=>{let x=d*w+_;return {u:h*C(_)*M(x)/m-h*Math.sinh(_)/m,w:h*C(_)/C(x)}};}if(!Number.isFinite(y)||y<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,y/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:y,u1:f,curve:p,w0:h}},this.triggerRepaint(),this}setPadding(t){return this.padding=ll(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Ct;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=jo(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?ll(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:ro(r),a=this.transform,l=Z(o.from.center),s=Z(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),h=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*h,lat:l.lat+(s.lat-l.lat)*h},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*ro(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*ro(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(Z(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new ft(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(vo(t,this.options.style))}static get themes(){return Object.keys(ut)}static get themeList(){return Object.entries(ut).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:yt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??K);if(!n)continue;let a=Er(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new O,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??K)));}if(!n||!o.length)return null;let a=kr(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=ln({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,ol("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=sn(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?Vo(Do()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(xt(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>Qf?3:t>Zf?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%yn,this.ringFilled<yn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<Jf)return;let r=this.ringSum/this.ringFilled;if(r>=eu){let a=un(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(xt(a),true);return}if(r>tu||this.steadyFrames<ou)return;let n=nl(this.quality.name);!n||fn(n)>fn(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(xt(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=fe(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??K)===o&&"splitBy"in n&&n.splitBy===_t))for(let n of r.splitValues(_t)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[_t];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[_t]:this._style.splitValues[_t]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof Qt)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,St):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let d of this.sources.values())d.update(this.transform);this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<ru,h=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let u=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(u),this.emit("render",{frameMs:l,intervalMs:h}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},G0=gn;
1953
+ export{$t as AssetLoader,K as BASE_SOURCE,it as BUILDING_HEIGHT_SCALE,Me as BUILDING_VERTEX_STRIDE,oc as CITY_STYLE,mn as Circle,Je as DEFAULT_ICONS,br as DEFAULT_LIGHT,Fa as DEFAULT_SHADOWS,pr as DEFAULT_SKY,yr as DEFAULT_STYLE,Lt as DepthTarget,io as EARTH_CIRCUMFERENCE,Ge as FILL_VERTEX_STRIDE,St as GLOBE_MAX_PITCH,qe as GLOBE_ZOOM_MAX,so as GLOBE_ZOOM_MIN,be as GLYPH_BORDER,Be as GLYPH_SIZE,ws as GROUND_SCALE,Et as GeomType,Nt as GlyphSource,Ft as GroundArrows,jt as IconSource,Rt as IndoorMask,Ne as LINE_VERTEX_STRIDE,Dt as LayerRenderer,Ct as LngLatBounds,wn as MAX_LATITUDE,To as MODEL_VERTEX_STRIDE,gn as Map,Jt as MapObject,Zt as Marker,qt as Model,je as ModelLayer,Ht as ObjectManager,Go as Polygon,dn as Polyline,Qt as Popup,tc as RELIEF_STYLE,Ar as RUNTIME_FILL_STRIDE,dt as RUNTIME_LINE_STRIDE,Kt as RasterSource,zo as RasterTile,Gr as SDF_EDGE,Ut as SDF_PX,ec as SOFT_STYLE,Bi as SPLIT_SEP,kt as SURFACE_CUT_BLEED,ii as SURFACE_LEVEL_SCALE,at as SURFACE_VERTEX_STRIDE,Gt as SdfAtlas,ft as Style,yt as SymbolRenderer,ut as THEMES,$e as TILE_SIZE,vt as TileID,Mt as Transform,Tt as VectorTile,mo as VectorTileFeature,po as VectorTileLayer,tn as abbreviateStreet,ur as addGround,uu as altitudeFromMercatorZ,go as applyTheme,ja as arrowLabelOffset,mc as arrowVertices,Lr as buildRuntimeFill,zt as buildRuntimeLine,jo as cameraForBounds,Ae as circumferenceAtLatitude,ao as clampLat,cn as clampPixelRatio,jr as clipLineToRect,tl as coordinateDigits,Yt as coveringTiles,fr as createGround,G0 as default,Do as deviceHints,il as distToSegment,ke as evaluateColor,B as evaluateNumber,Co as extractFeature,_r as fillFootprint,ht as fogPlanes,Cr as footprintOf,ln as formatHash,or as generateBuildings,cr as generateFill,mr as generateLine,sr as generateSurface,rn as generateSymbols,qo as globeBasis,fo as globeFlatMix,co as globeRadius,kn as globeToLocal,yo as groundAt,Xa as iconRotation,Oe as insideFootprint,Ce as latFromMercatorY,Se as lngFromMercatorX,uo as lngLatToUnit,pe as matchesFilter,Uo as mercatorMetersPerTile,te as mercatorX,oe as mercatorY,No as mercatorZFromAltitude,du as metersPerPixel,xn as metersPerTile,un as nextQualityDown,zc as parseGlb,Rr as parseGlbAsync,za as parseGlyphs,sn as parseHash,ga as patchUV,Er as pickBuilding,kr as pickFill,Pn as pitchIntent,hu as pixelsPerMeter,Yr as placeAlongLine,bn as pointInRing,Vo as qualityFor,xt as qualityProfile,Zo as raySphere,on as resolveTemplate,Re as roundRing,Nr as sdfFromAlpha,Ur as shapeText,ct as splitBucketKey,hr as splitByGround,Ze as splitPolygons,vo as styleWithTheme,_n as tileOriginMeters,Ya as tileUrl,Z as toLngLat,$o as unitToLngLat,De as worldSize};//# sourceMappingURL=osmgl.js.map
1954
1954
  //# sourceMappingURL=osmgl.js.map