osmgl 0.10.0 → 0.12.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.cjs CHANGED
@@ -1,11 +1,11 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var ki=require('earcut'),ys=require('pbf'),lc=require('polygon-clipping');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ki__default=/*#__PURE__*/_interopDefault(ki);var ys__default=/*#__PURE__*/_interopDefault(ys);var lc__namespace=/*#__PURE__*/_interopNamespace(lc);var z=Map,ee=Set;var Qe=class{constructor(){this.listeners=new z;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new ee),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 Ce=(i,e,t)=>i<e?e:i>t?t:i;var Be=i=>i*Math.PI/180,Yn=i=>i*180/Math.PI;function bt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var wo=i=>1-Math.pow(1-i,3);function me(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 ke(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var xo=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 z;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=ts(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){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}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 ts(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 lt=512,_o=40075016686e-3,$n=85.051129;function te(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Je=i=>512*Math.pow(2,i),Co=i=>Math.max(-$n,Math.min($n,i));function ne(i){return (180+i)/360}function ie(i){let e=Co(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Fe(i){return i*360-180}function Ee(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function We(i){return _o*Math.cos(i*Math.PI/180)}function hr(i,e){return i/We(e)}function Rd(i,e){return i*We(e)}function Fd(i,e){return hr(1,i)*Je(e)}function zd(i,e){return We(i)/Je(e)}function qn(i,e){let t=Math.pow(2,i);return We(Ee((e+.5)/t))/t}function So(i){return _o/Math.pow(2,i)}function Zn(i,e,t){let o=So(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Bt=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=te(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=te(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:ne(this.west),maxX:ne(this.east),minY:ie(this.north),maxY:ie(this.south)}}};function mr(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,Qn),r=Math.max(e.height-t.top-t.bottom,Qn),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,u=(n.minY+n.maxY)/2,d=0,h=0;for(let[v,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let x=(v-f)*s-(w-u)*c,_=(v-f)*c+(w-u)*s;d=Math.max(d,Math.abs(x)*2),h=Math.max(h,Math.abs(_)*2);}let m=Math.min(o/Math.max(d,1e-12),r/Math.max(h,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Je(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Fe(f-(b*s+g*c)),lat:Ee(u-(-b*c+g*s))},zoom:y,bearing:a}}var Qn=32;function U(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Xe(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function Se(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],u=e[8],d=e[9],h=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],x=t[v*4+1],_=t[v*4+2],T=t[v*4+3];i[v*4]=w*o+x*l+_*u+T*y,i[v*4+1]=w*r+x*s+_*d+T*p,i[v*4+2]=w*n+x*c+_*h+T*b,i[v*4+3]=w*a+x*f+_*m+T*g;}return i}function Ne(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 Ve(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 br(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],u=e[10],d=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+u*o,i[7]=s*r+d*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=d*r-s*o,i}function yr(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],u=e[6],d=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+u*o,i[3]=s*r+d*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=d*r-s*o,i}function ei(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 ti(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 Ge(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],u=e[9],d=e[10],h=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,x=o*s-r*l,_=o*c-n*l,T=r*c-n*s,C=f*y-u*m,S=f*p-d*m,E=f*b-h*m,L=u*p-d*y,A=u*b-h*y,M=d*b-h*p,R=g*M-v*A+w*L+x*E-_*S+T*C;return R?(R=1/R,i[0]=(l*M-s*A+c*L)*R,i[1]=(r*A-o*M-n*L)*R,i[2]=(y*T-p*_+b*x)*R,i[3]=(d*_-u*T-h*x)*R,i[4]=(s*E-a*M-c*S)*R,i[5]=(t*M-r*E+n*S)*R,i[6]=(p*w-m*T-b*v)*R,i[7]=(f*T-d*w+h*v)*R,i[8]=(a*A-l*E+c*C)*R,i[9]=(o*E-t*A-n*C)*R,i[10]=(m*_-y*w+b*g)*R,i[11]=(u*w-f*_-h*g)*R,i[12]=(l*S-a*L-s*C)*R,i[13]=(t*L-o*S+r*C)*R,i[14]=(y*v-m*x-p*g)*R,i[15]=(f*x-u*v+d*g)*R,i):null}function pe(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 Ke(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function Mo(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Jn(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 os(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function pr(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function oi(i,e,t,o){let r=Mo(os(t,e)),n=Mo(Jn(r,o)),a=Jn(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]=-pr(n,e),i[13]=-pr(a,e),i[14]=pr(r,e),i[15]=1,i}var Wt=60,To=4.5,st=6,ko=i=>i/(2*Math.PI);function Eo(i){if(i<=To)return 0;if(i>=st)return 1;let e=(i-To)/(st-To);return e*e*(3-2*e)}function Ao(i,e){let t=i*Math.PI/180,o=Co(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function gr(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 rs(i,e){return Ao(Fe(i),Ee(e))}function vr(i,e){let t=i*Math.PI/180,o=Co(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 ri(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 ns(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 ni(i,e,t,o,r,n,a,l){let s=ri(rs(i,e),r,a);if(l<=0)return s;let c=ns(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 wr(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 ii=1e3,is=2,ai=84,as=.42,Vt=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=Be(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=U();this._viewProjPx=U();this._viewMatrix=U();this._pixelMatrix=U();this._pixelMatrixInverse=U();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=U();this._localView=U();this._localProj=U();this._localPixel=U();this._localPixelInverse=U();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=U();this._shadowView=U();this._shadowProj=U();this._shadowVP=U();this._shadowVPm=U();this._shadowTile=U();this._shadowObject=U();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=as*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=Ce(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=bt(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<st?Math.min(this.maxPitch,Wt):this.maxPitch,o=Ce(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Yn(this._fov)}set fov(e){let t=Be(Ce(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){if(this._ensure(),this.globeActive){let a=this.globeLocal(ne(e.lng),ie(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[ne(e.lng)*this._worldSize,ie(e.lat)*this._worldSize,t,1],r=[0,0,0,0];pe(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:Fe(e/this._worldSize),lat:Ee(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 pe(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:Fe(t.x/this._worldSize),lat:Ee(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];pe(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),pe(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=Ce(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=bt(this._center.lng+(e.lng-l.lng)),c=Ce(this._center.lat+(e.lat-l.lat),-ai,ai);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ne(e.lng)*this._worldSize,y:ie(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Fe((this._centerX+n)/this._worldSize),lat:Ee((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 Ne(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(n,n,r,r,1),Ke(this._f32,n)}tileMatrix64(e,t,o=U()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ne(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ve(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ne(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Ke(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Be(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Be(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<st}get globeFlatMix(){return this._ensure(),Eo(this._zoom)}get globeRadiusPx(){return this._ensure(),ko(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=U();if(!Ge(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];pe(a,this._localPixelInverse,[r,n,0,1]),pe(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,u=l[1]/c-a[1]/s,d=l[2]/c-a[2]/s,h=Math.hypot(f,u,d)||1;return [f/h,u/h,d/h]})}cameraRay(){this._ensure();let e=Be(this._pitch),t=Be(this._bearing),o=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);return {right:[a,n,0],up:[n*r,-a*r,o],fwd:[n*o,-a*o,-r],focal:this.height/2/Math.tan(this._fov/2),axisElev:e-Math.PI/2}}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(),Ke(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),ni(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,Eo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return pe(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];pe(t,this._localPixelInverse,[e.x,e.y,0,1]),pe(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],u=wr(l,f,a);if(!u)return null;let d=this._globeBasis,h=[u[0]/a,u[1]/a,u[2]/a],m=[h[0]*d.east[0]+h[1]*d.south[0]+h[2]*d.up[0],h[0]*d.east[1]+h[1]*d.south[1]+h[2]*d.up[1],h[0]*d.east[2]+h[1]*d.south[2]+h[2]*d.up[2]];return gr(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=Ao(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)*is,r=U();if(!Ge(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let x of [-1,1])for(let _ of [-1,1])for(let T of [-1,1]){if(pe(l,r,[x,_,T,1]),l[3]===0)continue;let C=l[0]/l[3],S=l[1]/l[3],E=C-n[0],L=S-n[1],A=Math.hypot(E,L);if(A>o){let M=o/A;C=n[0]+E*M,S=n[1]+L*M;}a.push({x:C,y:S,z:0});}if(!a.length)return;let s=Mo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;oi(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let u=Math.min(t*this._pixelsPerMeter,o),d=1/0,h=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let x of a)for(let _ of [0,u])pe(g,f,[x.x,x.y,_,1]),g[0]<d&&(d=g[0]),g[0]>y&&(y=g[0]),g[1]<h&&(h=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=u+1,w=this._shadowProj;ti(w,d,y,h,p,-b-v,-m+v),Se(this._shadowVP,w,f),Ve(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 Ne(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Ke(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ne(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(n,n,r,r,1),Ke(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=ii*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,u=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*u+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-ii*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=Je(this._zoom);this._worldSize=e,this._pixelsPerMeter=hr(1,this._center.lat)*e,this._centerX=ne(this._center.lng)*e,this._centerY=ie(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Be(this._pitch),n=-Be(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(Ce(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,u=Math.min(f*1.01,a*30),d=o/50;if(this.projection==="globe"&&this._zoom<st){let g=ko(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Ve(h,U(),1,-1,1),Ne(h,h,0,0,-a),br(h,h,r),yr(h,h,n),Ne(h,h,-this._centerX,-this._centerY,0);let m=U();ei(m,this._fov,t/o,d,u),Se(this._viewProjPx,m,h);let y=U();Ve(y,h,1,1,this._pixelsPerMeter),Se(this._projMatrix,m,y);let p=this._localView;Ve(p,U(),1,-1,1),Ne(p,p,0,0,-a),br(p,p,r),yr(p,p,n),Se(this._localProj,m,p),this._globeBasis=vr(this._center.lng,this._center.lat);let b=U();Ve(b,U(),t/2,-o/2,1),Ne(b,b,1,-1,0),Se(this._pixelMatrix,b,this._projMatrix),Ge(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"),Se(this._localPixel,b,this._localProj),Ge(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=U();if(!Ge(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=U();if(!Ge(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];pe(f,e,[c,s,l,1]);let u=f[3]||1e-9;t.push([f[0]/u,f[1]/u,f[2]/u]);}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],u=t[s],d=t[c],h=u[0]-f[0],m=u[1]-f[1],y=u[2]-f[2],p=d[0]-f[0],b=d[1]-f[1],g=d[2]-f[2],v=m*g-y*b,w=y*p-h*g,x=h*b-m*p,_=Math.hypot(v,w,x)||1;v/=_,w/=_,x/=_;let T=new Float64Array(4);return T[0]=v,T[1]=w,T[2]=x,T[3]=-(v*f[0]+w*f[1]+x*f[2]),T});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:Ce(t,-3,3),max:Ce(o,-3,3)}}};var ls={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},li=2,ss=100,cs=.5,fs=.1,us=25,si=i=>Math.abs(i.y)>Math.abs(i.x);function fi(i,e,t){let o=Math.hypot(i.x,i.y)>=li,r=Math.hypot(e.x,e.y)>=li;return !o&&!r?void 0:!o||!r?t<ss?void 0:false:i.y>0==e.y>0&&si(i)&&si(e)}function ci(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var ds=160,xr=4,Io=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new z;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=Ce(-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={...ls,...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?fi(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*cs,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))>=fs&&(e.zoomActive=true),e.zoomActive)){let u=Math.log2(r/f);u!==0&&(this.tr.zoom=this.tr.zoom+u,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let u=us/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(ci(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let d=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),h=ci(n,d);h!==0&&(this.tr.bearing=this.tr.bearing-h,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>ds;)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>xr&&(r=r/a*xr,n=n/a*xr);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let u=Math.exp(-25e-4*f*10);if(r*=u,n*=u,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let d={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,d),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);}},ce=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 ms=["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"],ge=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new z;this.attribs=new z;let a=e.gl,l=ps(n),s=di(a,a.VERTEX_SHADER,ui(o,l),`${t}.vert`),c=di(a,a.FRAGMENT_SHADER,ui(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),ms.forEach((u,d)=>a.bindAttribLocation(f,d,u)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let u=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: ${u}`)}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 ps(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 ui(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Ds=require('earcut'),Sf=require('pbf'),Rh=require('polygon-clipping');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Ds__default=/*#__PURE__*/_interopDefault(Ds);var Sf__default=/*#__PURE__*/_interopDefault(Sf);var Rh__namespace=/*#__PURE__*/_interopNamespace(Rh);var D=Map,ae=Set;var Ue=class{constructor(){this.listeners=new D;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new ae),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 Re=(i,e,t)=>i<e?e:i>t?t:i;var je=i=>i*Math.PI/180,Qa=i=>i*180/Math.PI;function Mt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var Cr=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 Le(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var Sr=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 D;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=cf(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}resetState(){let e=this.gl;this._program=null,this._vao=null,this._activeTexture=-1,this._boundTextures.clear(),e.bindVertexArray(null),e.useProgram(null),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer);let t=this._depthFunc;this._depthFunc=t==="lequal"?"less":"lequal",this.setDepthFunc(t),e.depthMask(this._depthMask),this._depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._stencilTest?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),e.viewport(...this._viewport);let o=this._blend;this._blend="none",this.setBlend(o);let r=this._cull;this._cull="none",this.setCull(r);}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){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}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 cf(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 ct=512,Tr=40075016686e-3,Ja=85.051129;function Q(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Ct=i=>512*Math.pow(2,i),kr=i=>Math.max(-Ja,Math.min(Ja,i));function oe(i){return (180+i)/360}function re(i){let e=kr(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Oe(i){return i*360-180}function Pe(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function $e(i){return Tr*Math.cos(i*Math.PI/180)}function Vn(i,e){return i/$e(e)}function Y1(i,e){return i*$e(e)}function K1(i,e){return Vn(1,i)*Ct(e)}function $1(i,e){return $e(i)/Ct(e)}function xo(i,e){let t=Math.pow(2,i);return $e(Pe((e+.5)/t))/t}function Ft(i){return Tr/Math.pow(2,i)}function es(i,e,t){let o=Ft(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var jt=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:oe(this.west),maxX:oe(this.east),minY:re(this.north),maxY:re(this.south)}}};function Nn(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,ts),r=Math.max(e.height-t.top-t.bottom,ts),n=i.toMercator(),a=e.bearing??0,s=-a*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=(n.minX+n.maxX)/2,f=(n.minY+n.maxY)/2,h=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 x=(v-u)*l-(w-f)*c,_=(v-u)*c+(w-f)*l;h=Math.max(h,Math.abs(x)*2),d=Math.max(d,Math.abs(_)*2);}let m=Math.min(o/Math.max(h,1e-12),r/Math.max(d,1e-12)),b=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Ct(b),g=(t.left-t.right)/2/p,y=(t.top-t.bottom)/2/p;return {center:{lng:Oe(u-(g*l+y*c)),lat:Pe(f-(-g*c+y*l))},zoom:b,bearing:a}}var ts=32;function X(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function ut(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function Ie(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],m=e[11],b=e[12],p=e[13],g=e[14],y=e[15];for(let v=0;v<4;v++){let w=t[v*4],x=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+x*s+_*f+M*b,i[v*4+1]=w*r+x*l+_*h+M*p,i[v*4+2]=w*n+x*c+_*d+M*g,i[v*4+3]=w*a+x*u+_*m+M*y;}return i}function rt(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 qe(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 Un(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],h=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+u*o,i[6]=s*r+f*o,i[7]=l*r+h*o,i[8]=c*r-n*o,i[9]=u*r-a*o,i[10]=f*r-s*o,i[11]=h*r-l*o,i}function _o(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],h=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+u*o,i[2]=s*r+f*o,i[3]=l*r+h*o,i[4]=c*r-n*o,i[5]=u*r-a*o,i[6]=f*r-s*o,i[7]=h*r-l*o,i}function rs(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 ns(i,e,t,o,r,n,a){let s=1/(e-t),l=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*s,i[5]=-2*l,i[10]=2*c,i[12]=(e+t)*s,i[13]=(r+o)*l,i[14]=(a+n)*c,i[15]=1,i}function nt(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],m=e[12],b=e[13],p=e[14],g=e[15],y=t*s-o*a,v=t*l-r*a,w=t*c-n*a,x=o*l-r*s,_=o*c-n*s,M=r*c-n*l,S=u*b-f*m,C=u*p-h*m,k=u*g-d*m,T=f*p-h*b,P=f*g-d*b,L=h*g-d*p,A=y*L-v*P+w*T+x*k-_*C+M*S;return A?(A=1/A,i[0]=(s*L-l*P+c*T)*A,i[1]=(r*P-o*L-n*T)*A,i[2]=(b*M-p*_+g*x)*A,i[3]=(h*_-f*M-d*x)*A,i[4]=(l*k-a*L-c*C)*A,i[5]=(t*L-r*k+n*C)*A,i[6]=(p*w-m*M-g*v)*A,i[7]=(u*M-h*w+d*v)*A,i[8]=(a*P-s*k+c*S)*A,i[9]=(o*k-t*P-n*S)*A,i[10]=(m*_-b*w+g*y)*A,i[11]=(f*w-u*_-d*y)*A,i[12]=(s*C-a*T-l*S)*A,i[13]=(t*T-o*C+r*S)*A,i[14]=(b*v-m*x-p*y)*A,i[15]=(u*x-f*v+h*y)*A,i):null}function ve(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 ft(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function Er(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function os(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 uf(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function Gn(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function is(i,e,t,o){let r=Er(uf(t,e)),n=Er(os(r,o)),a=os(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]=-Gn(n,e),i[13]=-Gn(a,e),i[14]=Gn(r,e),i[15]=1,i}var Mo=60,Ar=4.5,zt=6,Rr=i=>i/(2*Math.PI);function Ir(i){if(i<=Ar)return 0;if(i>=zt)return 1;let e=(i-Ar)/(zt-Ar);return e*e*(3-2*e)}function Lr(i,e){let t=i*Math.PI/180,o=kr(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function jn(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 ff(i,e){return Lr(Oe(i),Pe(e))}function Xn(i,e){let t=i*Math.PI/180,o=kr(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 as(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 hf(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 ss(i,e,t,o,r,n,a,s){let l=as(ff(i,e),r,a);if(s<=0)return l;let c=hf(i,e,t,o,n);return [l[0]+(c[0]-l[0])*s,l[1]+(c[1]-l[1])*s,l[2]+(c[2]-l[2])*s]}function Yn(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 ls=1e3,df=2,cs=84,mf=.42,Co=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.maxBounds=null;this.renderWorldCopies=true;this.minPitch=0;this.maxPitch=75;this._roll=0;this._center={lng:0,lat:0};this._centerElevation=0;this._zoom=0;this._bearing=0;this._pitch=0;this._fov=je(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=X();this._viewProjPx=X();this._viewMatrix=X();this._pixelMatrix=X();this._pixelMatrixInverse=X();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=X();this._localView=X();this._localProj=X();this._localPixel=X();this._localPixelInverse=X();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=X();this._shadowView=X();this._shadowProj=X();this._shadowVP=X();this._shadowVPm=X();this._shadowTile=X();this._shadowObject=X();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this.elevationAt=null;this._calc();}get center(){return {...this._center}}set center(e){let t=this.maxBounds;this._center=t?{lng:Math.min(Math.max(e.lng,t.west),t.east),lat:Math.min(Math.max(e.lat,t.south),t.north)}:{lng:e.lng,lat:e.lat},this._dirty=true;}get centerElevation(){return this._centerElevation}set centerElevation(e){this._centerElevation!==e&&(this._centerElevation=e,this._dirty=true);}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=mf*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=Re(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=Mt(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<zt?Math.min(this.maxPitch,Mo):this.maxPitch,o=Re(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get roll(){return this._roll}set roll(e){let t=Mt(e);t!==this._roll&&(this._roll=t,this._dirty=true);}get fov(){return Qa(this._fov)}set fov(e){let t=je(Re(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._roll=this._roll,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){if(this._ensure(),this.globeActive){let a=this.globeLocal(oe(e.lng),re(e.lat));a[2]+=t*this._pixelsPerMeter;let s=this.localToPoint(a);if(s)return s}let o=[oe(e.lng)*this._worldSize,re(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ve(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:Oe(e/this._worldSize),lat:Pe(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 ve(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:Oe(t.x/this._worldSize),lat:Pe(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ve(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ve(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},s={x:o[0]/n,y:o[1]/n,z:o[2]/n},l=s.z-a.z,c=d=>{let m=Math.abs(l)<1e-9?1:(d-a.z)/l,b=Re(m,-1e6,1e6);return {x:a.x+(s.x-a.x)*b,y:a.y+(s.y-a.y)*b}},u=this.elevationAt;if(!u)return c(0);let f=0,h=c(0);for(let d=0;d<3;d++){let m=u(h.x/this._worldSize,h.y/this._worldSize);if(Math.abs(m-f)<.5)break;f=m,h=c(f);}return h}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let s=this.globeUnproject(t);if(!s)return;let l=Mt(this._center.lng+(e.lng-s.lng)),c=Re(this._center.lat+(e.lat-s.lat),-cs,cs);this._center={lng:l,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:oe(e.lng)*this._worldSize,y:re(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Oe((this._centerX+n)/this._worldSize),lat:Pe((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 rt(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),qe(n,n,r,r,1),ft(this._f32,n)}tileMatrix64(e,t,o=X()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return rt(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),qe(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return rt(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),qe(r,r,this._worldSize,this._worldSize,1),ft(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-je(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,je(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<zt}get globeFlatMix(){return this._ensure(),Ir(this._zoom)}get globeRadiusPx(){return this._ensure(),Rr(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=X();if(!nt(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],s=[0,0,0,0];ve(a,this._localPixelInverse,[r,n,0,1]),ve(s,this._localPixelInverse,[r,n,1,1]);let l=a[3]||1e-9,c=s[3]||1e-9,u=s[0]/c-a[0]/l,f=s[1]/c-a[1]/l,h=s[2]/c-a[2]/l,d=Math.hypot(u,f,h)||1;return [u/d,f/d,h/d]})}cameraRay(){this._ensure();let e=je(this._pitch),t=je(this._bearing),o=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);return {right:[a,n,0],up:[n*r,-a*r,o],fwd:[n*o,-a*o,-r],focal:this.height/2/Math.tan(this._fov/2),axisElev:e-Math.PI/2}}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(),ft(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),ss(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,Ir(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ve(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];ve(t,this._localPixelInverse,[e.x,e.y,0,1]),ve(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,s=[t[0]/r,t[1]/r,t[2]/r+a],l=[o[0]/n-s[0],o[1]/n-s[1],o[2]/n+a-s[2]],c=Math.hypot(l[0],l[1],l[2])||1,u=[l[0]/c,l[1]/c,l[2]/c],f=Yn(s,u,a);if(!f)return null;let h=this._globeBasis,d=[f[0]/a,f[1]/a,f[2]/a],m=[d[0]*h.east[0]+d[1]*h.south[0]+d[2]*h.up[0],d[0]*h.east[1]+d[1]*h.south[1]+d[2]*h.up[1],d[0]*h.east[2]+d[1]*h.south[2]+d[2]*h.up[2]];return jn(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=Lr(e,t),s=[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 s[0]*r.dir[0]+s[1]*r.dir[1]+s[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t,o=0,r=0){this._ensure();let n=Math.max(this.width,this.height)*df,a=X();if(!nt(a,this._viewProjPx))return;let s=this._cameraPosPx,l=[],c=[0,0,0,0];for(let C of [-1,1])for(let k of [-1,1])for(let T of [-1,1]){if(ve(c,a,[C,k,T,1]),c[3]===0)continue;let P=c[0]/c[3],L=c[1]/c[3],A=P-s[0],R=L-s[1],I=Math.hypot(A,R);if(I>n){let H=n/I;P=s[0]+A*H,L=s[1]+R*H;}l.push({x:P,y:L,z:0});}if(!l.length)return;let u=Er(e),f=Math.abs(u[2])>.999?[0,1,0]:[0,0,1],h=this._shadowView;is(h,[this._centerX,this._centerY,0],[this._centerX+u[0],this._centerY+u[1],u[2]],f);let d=Math.min(o,r)*this._pixelsPerMeter,b=Math.max(o,r)*this._pixelsPerMeter+Math.min(t*this._pixelsPerMeter,n),p=1/0,g=1/0,y=1/0,v=-1/0,w=-1/0,x=-1/0,_=[0,0,0,0];for(let C of l)for(let k of [d,b])ve(_,h,[C.x,C.y,k,1]),_[0]<p&&(p=_[0]),_[0]>v&&(v=_[0]),_[1]<g&&(g=_[1]),_[1]>w&&(w=_[1]),_[2]<y&&(y=_[2]),_[2]>x&&(x=_[2]);let M=b+1,S=this._shadowProj;ns(S,p,v,g,w,-x-M,-y+M),Ie(this._shadowVP,S,h),qe(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 rt(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),qe(r,r,this._worldSize,this._worldSize,1),ft(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return rt(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),qe(n,n,r,r,1),ft(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,s=ls*this._pixelsPerMeter;for(let l of this._frustumPlanes){let c=l[0]>0?r:o,u=l[1]>0?a:n,f=l[2]>0?s:0;if(l[0]*c+l[1]*u+l[2]*f+l[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,s=o*this._pixelsPerMeter,l=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*s+c[3]<-l)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),s=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),l=Math.max(0-n,0,n-ls*this._pixelsPerMeter);return Math.hypot(a,s,l)}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=Ct(this._zoom);this._worldSize=e,this._pixelsPerMeter=Vn(1,this._center.lat)*e,this._centerX=oe(this._center.lng)*e,this._centerY=re(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=je(this._pitch),n=-je(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let s=Math.PI/2+r,l=this._fov/2,c=Math.sin(l)*a/Math.sin(Re(Math.PI-s-l,.01,Math.PI-.01)),u=Math.cos(Math.PI/2-r)*c+a,f=Math.min(u*1.01,a*30),h=o/50;if(this.projection==="globe"&&this._zoom<zt){let v=Rr(e);h=Math.max(a-v*1.6,a*.02),f=a+v*2.4;}let d=je(this._roll),m=this._viewMatrix;qe(m,X(),1,-1,1),rt(m,m,0,0,-a),d!==0&&_o(m,m,-d),Un(m,m,r),_o(m,m,n),rt(m,m,-this._centerX,-this._centerY,-this._centerElevation*this._pixelsPerMeter);let b=X();rs(b,this._fov,t/o,h,f),Ie(this._viewProjPx,b,m);let p=X();qe(p,m,1,1,this._pixelsPerMeter),Ie(this._projMatrix,b,p);let g=this._localView;qe(g,X(),1,-1,1),rt(g,g,0,0,-a),d!==0&&_o(g,g,-d),Un(g,g,r),_o(g,g,n),Ie(this._localProj,b,g),this._globeBasis=Xn(this._center.lng,this._center.lat);let y=X();qe(y,X(),t/2,-o/2,1),rt(y,y,1,-1,0),Ie(this._pixelMatrix,y,this._projMatrix),nt(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"),Ie(this._localPixel,y,this._localProj),nt(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=X();if(!nt(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=X();if(!nt(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let s of [-1,1])for(let l of [-1,1])for(let c of [-1,1]){let u=[0,0,0,0];ve(u,e,[c,l,s,1]);let f=u[3]||1e-9;t.push([u[0]/f,u[1]/f,u[2]/f]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([s,l,c])=>{let u=t[s],f=t[l],h=t[c],d=f[0]-u[0],m=f[1]-u[1],b=f[2]-u[2],p=h[0]-u[0],g=h[1]-u[1],y=h[2]-u[2],v=m*y-b*g,w=b*p-d*y,x=d*g-m*p,_=Math.hypot(v,w,x)||1;v/=_,w/=_,x/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=x,M[3]=-(v*u[0]+w*u[1]+x*u[2]),M});let r=0,n=0,a=0;for(let s of t)r+=s[0]/8,n+=s[1]/8,a+=s[2]/8;for(let s of this._frustumPlanes)s[0]*r+s[1]*n+s[2]*a+s[3]<0&&(s[0]=-s[0],s[1]=-s[1],s[2]=-s[2],s[3]=-s[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){if(this._ensure(),!this.renderWorldCopies)return {min:0,max:0};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:Re(t,-3,3),max:Re(o,-3,3)}}};var $n={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},us=2,pf=100,bf=.5,gf=.1,yf=25,fs=i=>Math.abs(i.y)>Math.abs(i.x);function ds(i,e,t){let o=Math.hypot(i.x,i.y)>=us,r=Math.hypot(e.x,e.y)>=us;return !o&&!r?void 0:!o||!r?t<pf?void 0:false:i.y>0==e.y>0&&fs(i)&&fs(e)}function hs(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var vf=160,Kn=4,Pr=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new D;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=Re(-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={...$n,...n},this.bind();}get moving(){return this.dragMode!=="none"||this.inertiaRaf!==0||this.touch!==null}get rotating(){return this.dragMode==="rotate"||(this.touch?.rotateActive??false)}get zooming(){return this.touch?.zoomActive??false}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?ds(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*bf,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},s={x:(t.x+o.x)/2,y:(t.y+o.y)/2},l=this.tr.unproject(a),c="pan",u=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&u>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=gf&&(e.zoomActive=true),e.zoomActive)){let f=Math.log2(r/u);f!==0&&(this.tr.zoom=this.tr.zoom+f,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let f=yf/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(hs(n,e.startAngle))>=f&&(e.rotateActive=true),e.rotateActive){let h=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=hs(n,h);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(l,s),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>vf;)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>Kn&&(r=r/a*Kn,n=n/a*Kn);let s=performance.now(),l=()=>{if(this.disposed)return;let c=performance.now(),u=Math.min(c-s,34);s=c;let f=Math.exp(-25e-4*u*10);if(r*=f,n*=f,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let h={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*u,-n*u,h),this.inertiaRaf=requestAnimationFrame(l);};this.inertiaRaf=requestAnimationFrame(l);}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 Ze=class{constructor(e,t,o){this.manager=e;this.key=t;this.enabled=o;}isEnabled(){return this.enabled}isActive(){let e=this.manager();return e?this.key==="dragRotate"?e.rotating:this.key==="touchZoomRotate"||this.key==="scrollZoom"?e.zooming:this.key==="dragPan"?e.moving&&!e.rotating:e.moving:false}enable(){this.set(true);}disable(){this.set(false);}set(e){this.enabled!==e&&(this.enabled=e,this.manager()?.setOptions({[this.key]:e}));}},So=class{constructor(e,t,o){this.canvas=e;this.container=t;this.fit=o;this.enabled=true;this.start=null;this.box=null;this.onDown=e=>{!this.enabled||!e.shiftKey||e.button!==0||(e.preventDefault(),this.start=this.pointOf(e),this.box=document.createElement("div"),this.box.style.cssText="position:absolute;border:2px dashed #2b6cb0;background:rgba(43,108,176,.12);pointer-events:none;z-index:3",this.container.appendChild(this.box));};this.onMove=e=>{if(!this.start||!this.box)return;let t=this.pointOf(e),o=Math.min(t.x,this.start.x),r=Math.min(t.y,this.start.y);this.box.style.left=`${o}px`,this.box.style.top=`${r}px`,this.box.style.width=`${Math.abs(t.x-this.start.x)}px`,this.box.style.height=`${Math.abs(t.y-this.start.y)}px`;};this.onUp=e=>{let t=this.start;if(!t)return;let o=this.pointOf(e);this.finish(),!(Math.abs(o.x-t.x)<8||Math.abs(o.y-t.y)<8)&&this.fit(t,o);};this.canvas.addEventListener("pointerdown",this.onDown),window.addEventListener("pointermove",this.onMove),window.addEventListener("pointerup",this.onUp);}isEnabled(){return this.enabled}isActive(){return this.start!==null}enable(){this.enabled=true;}disable(){this.enabled=false,this.finish();}destroy(){this.canvas.removeEventListener("pointerdown",this.onDown),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onUp),this.finish();}finish(){this.box?.remove(),this.box=null,this.start=null;}pointOf(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}},To=class{constructor(e,t,o,r={}){this.canvas=e;this.container=t;this.setScrollZoom=o;this.texts=r;this.enabled=false;this.hint=null;this.timer=0;this.onWheel=e=>{if(this.enabled){if(e.ctrlKey||e.metaKey){e.preventDefault(),this.setScrollZoom(true),this.hide(),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>this.setScrollZoom(false),400);return}this.show(this.isMac()?this.texts.mac??"\u2318 + \u043A\u043E\u043B\u0435\u0441\u043E, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u044C":this.texts.windows??"Ctrl + \u043A\u043E\u043B\u0435\u0441\u043E, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u044C");}};this.onTouch=e=>{this.enabled&&(e.touches.length<2?this.show(this.texts.mobile??"\u0414\u0432\u0443\u043C\u044F \u043F\u0430\u043B\u044C\u0446\u0430\u043C\u0438, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u0432\u0438\u043D\u0443\u0442\u044C \u043A\u0430\u0440\u0442\u0443"):this.hide());};this.canvas.addEventListener("wheel",this.onWheel,{passive:false}),this.canvas.addEventListener("touchstart",this.onTouch,{passive:true});}isEnabled(){return this.enabled}enable(){this.enabled||(this.enabled=true,this.setScrollZoom(false));}disable(){this.enabled&&(this.enabled=false,this.setScrollZoom(true),this.hide());}destroy(){this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("touchstart",this.onTouch),this.hide();}show(e){this.hint||(this.hint=document.createElement("div"),this.hint.style.cssText=["position:absolute;inset:0;display:flex;align-items:center;justify-content:center","background:rgba(0,0,0,.5);color:#fff;font:600 15px/1.4 system-ui,sans-serif;text-align:center","pointer-events:none;z-index:4;transition:opacity .2s;padding:16px"].join(";"),this.container.appendChild(this.hint)),this.hint.textContent=e,this.hint.style.opacity="1",window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>this.hide(),1200);}hide(){this.hint&&(this.hint.style.opacity="0");}isMac(){return /Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)}};var xf={"top-left":"top:0;left:0;flex-direction:column;align-items:flex-start","top-right":"top:0;right:0;flex-direction:column;align-items:flex-end","bottom-left":"bottom:0;left:0;flex-direction:column-reverse;align-items:flex-start","bottom-right":"bottom:0;right:0;flex-direction:column-reverse;align-items:flex-end"},Fr=class{constructor(e){this.container=e;this.corners=new Map;this.holders=new Map;}add(e,t,o){if(this.holders.has(e))return;let r=o??e.getDefaultPosition?.()??"top-right",n=e.onAdd(t);n.style.pointerEvents="auto",this.corner(r).appendChild(n),this.holders.set(e,{element:n,position:r});}remove(e,t){let o=this.holders.get(e);o&&(e.onRemove(t),o.element.remove(),this.holders.delete(e));}has(e){return this.holders.has(e)}destroy(e){for(let t of [...this.holders.keys()])this.remove(t,e);for(let t of this.corners.values())t.remove();this.corners.clear();}corner(e){let t=this.corners.get(e);if(t)return t;let o=document.createElement("div");return o.className=`osmgl-ctrl-corner osmgl-ctrl-${e}`,o.style.cssText=`position:absolute;display:flex;gap:8px;padding:8px;pointer-events:none;z-index:2;${xf[e]}`,this.container.appendChild(o),this.corners.set(e,o),o}};function ht(i,e,t){let o=document.createElement("button");return o.type="button",o.title=e,o.setAttribute("aria-label",e),o.innerHTML=i,o.style.cssText=["width:29px;height:29px;display:flex;align-items:center;justify-content:center","border:0;background:#fff;color:#333;cursor:pointer;font:600 15px/1 system-ui,sans-serif","padding:0"].join(";"),o.addEventListener("click",r=>{r.preventDefault(),t();}),o}function Xt(...i){let e=document.createElement("div");return e.className="osmgl-ctrl-group",e.style.cssText=["display:flex;flex-direction:column;overflow:hidden","background:#fff;border-radius:8px;box-shadow:0 1px 4px rgba(0,0,0,.25)"].join(";"),i.forEach((t,o)=>{o>0&&(t.style.borderTop="1px solid #e2e2e2"),e.appendChild(t);}),e}var de=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);}},he=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);}},ue=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:s}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let l of a.layout.attribs){let c=s.get(l.name);c===void 0||c<0||(r.enableVertexAttribArray(c),l.integer?r.vertexAttribIPointer(c,l.size,l.type,a.layout.stride,l.offset):r.vertexAttribPointer(c,l.size,l.type,l.normalized??false,a.layout.stride,l.offset),l.divisor&&r.vertexAttribDivisor(c,l.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 _f=["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"],pe=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new D;this.attribs=new D;let a=e.gl,s=Mf(n),l=ps(a,a.VERTEX_SHADER,ms(o,s),`${t}.vert`),c=ps(a,a.FRAGMENT_SHADER,ms(r,s),`${t}.frag`),u=a.createProgram();if(!u)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(u,l),a.attachShader(u,c),_f.forEach((f,h)=>a.bindAttribLocation(u,h,f)),a.linkProgram(u),a.detachShader(u,l),a.detachShader(u,c),a.deleteShader(l),a.deleteShader(c),!a.getProgramParameter(u,a.LINK_STATUS)){let f=a.getProgramInfoLog(u);throw a.deleteProgram(u),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${f}`)}this.program=u,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 Mf(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 ms(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 di(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 ps(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
- ${bs(t)}`)}return r}function bs(i){return i.split(`
6
+ ${Cf(t)}`)}return r}function Cf(i){return i.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
- `)}var Nt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Nt||{}),Lo=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(gs,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 gs(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?vs(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function vs(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 Ro=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(ws,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 Lo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function ws(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(xs(t)));}function xs(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 Dt=class{constructor(e){this.layers={};new ys__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=Ro.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function ct(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=_s(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 _s(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 D(i,e,t){return i===void 0?t:typeof i=="number"?i:hi(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function He(i,e,t){return i===void 0?t:typeof i=="string"?me(i):hi(i.stops,e,(o,r,n)=>{let a=me(o),l=me(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 hi(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,u=f===0?0:(e-s)/f;return t(c,l,u)}return o}function ve(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>ve(o,e));case "any":return i.slice(1).some(o=>ve(o,e));case "!":return !ve(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 Cs=Math.PI/8,Ss=.35,Ms=32,pi=.25,bi=.5,yi=.07;function Ue(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??Ss,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+o-1)%o*2],d=i[(s+o-1)%o*2+1],h=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-u,p=f-d,b=h-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 x=y/v,_=p/v,T=b/w,C=g/w;if(e.keep?.[s]){l.push(c,f);continue}let S=x*T+_*C;if(S>.985){l.push(c,f);continue}if(a!==void 0&&(c<=0||c>=a||f<=0||f>=a)){l.push(c,f);continue}let E=Math.min(t,v*mi,w*mi);if(E<t*n){l.push(c,f);continue}let L=c-x*E,A=f-_*E,M=c+T*E,R=f+C*E,I=Math.acos(Math.max(-1,Math.min(1,S))),k=Math.min(Cs,Math.PI/2/r),H=Math.ceil(I/k-1e-6),B=e.maxChord&&e.maxChord>0?Math.ceil(E/Math.tan(I/2)*I/e.maxChord):0,F=Math.max(1,Math.min(Ms,Math.max(Math.min(r,H),B)));l.push(L,A);for(let P=1;P<F;P++){let G=P/F,O=1-G;l.push(O*O*L+2*O*G*c+G*G*M,O*O*A+2*O*G*f+G*G*R);}l.push(M,R);}return l.length<6?i:(l.push(l[0],l[1]),l)}var mi=.4;var Ae=i=>i/64;function Ye(i,e,t=0){let o=gi(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=gi(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function gi(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],u=n[(l+a-1)%a*2+1],d=vi(s,c,r,e,t),h=vi(f,u,r,e,t);if(d!==h){let m=Ts(f,u,s,c,r,e,t),y=r===0?-t:r===1?e+t:f+(s-f)*m,p=r===2?-t:r===3?e+t:u+(c-u)*m;o.push(y,p);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function vi(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Ts(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 Fo(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 _r(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 wi=1,ze=18,wt=32,vt=8,Ei=65535/wt,ks=9,Es=1,As=0,Is=1,Ls=2;var xi=0,Rs=1,_i=2,Fs=3,Ai=.47;function Mr(i,e,t,o={},r){let n=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Ai,{b:a,ensure:l,take:s}=Ii(Math.max(1024,i.length*48));for(let c of i.features()){if(c.type!==3||!ve(t,c.properties))continue;let f=ec(c.properties),u=tc(c.properties,f);if(f<=u)continue;let d=rc(c.properties)??Number(c.id??0),h=Js(d>>>0),m=Qs(h,c.properties),y=Zs(c.properties,f),p=ct(c.loadGeometry()),b=r?p.some(g=>{let v=Ye(g,e,Ae(e));return v?_r(v.outer,e):false}):false;for(let g of p){if(r&&b){let v=ic(g,e,f,u,d,h,m,y);v&&r.push(v);}Fi(a,g,l,{extent:e,metersPerUnit:n,height:f,minHeight:u,featureId:d,seed:h,tint:m,facade:y,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return s(e)}function Ii(i){let e=i,t=new ArrayBuffer(e*ze),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let l=new ArrayBuffer(e*ze);new Uint8Array(l).set(o.vertsU8.subarray(0,o.vertOffset)),t=l,o.verts=new DataView(l),o.vertsU8=new Uint8Array(l);};return o.ensure=r,{b:o,ensure:r,take:a=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),s=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:s.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a}}}}function Li(i,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:Ai,{b:r,ensure:n,take:a}=Ii(Math.max(1024,i.length*64));for(let{rings:l,seam:s}of i)Fi(r,l,n,{extent:e,metersPerUnit:o,height:s.height,minHeight:s.minHeight,featureId:s.osmId,seed:s.seed,tint:s.tint,facade:s.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var Tr=(i,e)=>i|e<<2,Ci=i=>Math.max(-32768,Math.min(32767,i)),Cr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,Ei)*wt)));function yt(i,e,t,o,r,n,a,l,s,c,f=0,u=0,d=0){let h=i.vertOffset;return i.verts.setInt16(h,Ci(Math.round(e*vt)),true),i.verts.setInt16(h+2,Ci(Math.round(t*vt)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,Ei)*wt),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,Sr(Math.round(r*127))),i.verts.setInt8(h+9,Sr(Math.round(n*127))),i.verts.setInt8(h+10,Sr(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,Cr(f),true),i.verts.setUint16(h+14,Cr(u),true),i.verts.setUint16(h+16,Cr(d),true),i.vertOffset+=ze,i.vertexCount++}function Si(i,e,t,o,r,n,a,l,s,c){let f=e.length/2;if(f<3)return;let u=Tr(As,a),d=Ps(e,l),h=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],x=p[g*2+1]+p[b*2+1],_=Math.hypot(w,x);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=x/_,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||c[p])continue;let x=v-b,_=w-g,T=Math.hypot(x,_)||1,C=_/T,S=-x/T,E=d.offset[p],L=d.width[p],A=[0,1];if(s){for(let R=0;R<s.length;R++)for(let I=R+1;I<s.length;I++){let k=ft(s[R],b,g)-ft(s[I],b,g),H=ft(s[R],v,w)-ft(s[I],v,w);if(k===H)continue;let B=k/(k-H);B>1e-4&&B<1-1e-4&&A.push(B);}A.sort((R,I)=>R-I);}let M=(R,I)=>{if(!s)return o;let k=1/0;for(let H of s)k=Math.min(k,ft(H,R,I));return Math.max(o,k)};for(let R=0;R+1<A.length;R++){let I=A[R],k=A[R+1];if(k-I<1e-6)continue;let H=b+x*I,B=g+_*I,F=b+x*k,P=g+_*k,G=E+T*I*l,O=E+T*k*l,W=(p+1)%(f-1),V=y[p]?m[p*2]:C,N=y[p]?m[p*2+1]:S,K=y[W]?m[W*2]:C,$=y[W]?m[W*2+1]:S,Q=C+(V-C)*(1-I),Z=S+(N-S)*(1-I),X=C+(K-C)*k,oe=S+($-S)*k,re=Math.hypot(Q,Z)||1,se=Math.hypot(X,oe)||1,ue=Q/re,Me=Z/re,de=X/se,he=oe/se;i.ensure(4);let ae=yt(i,H,B,t,ue,Me,0,0,n,u,G,L,h),_e=yt(i,F,P,t,de,he,0,0,n,u,O,L,h),xe=yt(i,H,B,M(H,B),ue,Me,0,255,n,u,G,L,h),J=yt(i,F,P,M(F,P),de,he,0,255,n,u,O,L,h);i.indices.push(ae,J,_e,ae,xe,J),i.featureIds.push(r,r);}}}var zs=.9976;function Ps(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],u=Math.hypot(c,f);o.push(u>0?{x:c/u,y:f/u,len:u*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>=zs,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],u=o[c].len,d=s+1;for(;d<t;){let m=(n+d)%t;if(!r((n+d-1)%t,m))break;f.push(m),u+=o[m].len,d++;}let h=0;for(let m of f)a[m]=h,l[m]=u,h+=o[m].len;s=d;}return {offset:a,width:l}}function Hs(i,e,t,o,r,n,a){let l=[],s=[];for(let d=0;d<e.length;d++)l.push(e[d]);for(let d of t){s.push(l.length/2);for(let h=0;h<d.length;h++)l.push(d[h]);}let c=ki__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=Tr(Is,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)yt(i,l[d],l[d+1],o,0,0,1,255,n,f);for(let d=0;d<c.length;d+=3)i.indices.push(u+c[d],u+c[d+2],u+c[d+1]),i.featureIds.push(r);}function Os(i){let e=Bs(i);if(e.length<3)return null;let t=Math.abs(Ws(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,u=-1/0,d=1/0,h=-1/0;for(let w of e){let x=w.x*l+w.y*s,_=-w.x*s+w.y*l;x<f&&(f=x),x>u&&(u=x),_<d&&(d=_),_>h&&(h=_);}let m=u-f,y=h-d,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+u)/2,g=(d+h)/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 Bs(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 Ws(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 Vs=Math.tan(30*Math.PI/180),Ds=3.5,Ns=.9;function Gs(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=Us(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 Us(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 ft=(i,e,t)=>i.a*e+i.b*t+i.c;function js(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,u]=a((l+r-1)%r),d=e*s+t*c+o,h=e*f+t*u+o;if(d<=0!=h<=0){let m=h/(h-d);n.push(f+(s-f)*m,u+(c-u)*m);}d<=0&&n.push(s,c);}return n}function Xs(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],u=c-l,d=f-s,h=Math.hypot(u,d),m=h>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*d-(i[y*2+1]-s)*u)/h>=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 Ri(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],u=i[(s+1)%l*2],d=i[(s+1)%l*2+1],h=u-c,m=d-f,y=Math.hypot(h,m);if(y<1e-6||t==="gabled"&&Math.abs((h*o+m*r)/y)<.86)continue;let p=-m/y,b=h/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?Ri(i,e,"hipped"):a}function Ks(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=js(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 Ys(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=ft(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function $s(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function qs(i,e,t,o,r,n,a,l){let s=Tr(Ls,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=ki__default.default(f,void 0,2);if(!u.length)continue;let d=-t[c].a/l,h=-t[c].b/l,m=Math.hypot(d,h,1),y={x:d/m,y:h/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,ft(t[c],f[b],f[b+1]));yt(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(p+u[b],p+u[b+2],p+u[b+1]),i.featureIds.push(r);}}function Zs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Fs:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?_i:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?xi:e>=40?_i:Rs}function Qs(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 Js(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function ec(i){let e=gt(i.render_height)??gt(i.height)??oc(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Es):ks}function tc(i,e){let t=gt(i.render_min_height)??gt(i.min_height)??gt(i.base)??0;return t>0&&t<e?t:0}function oc(i){let e=gt(i);return e&&e>0?e*3:null}function gt(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 Sr=i=>i>127?127:i<-127?-127:i;function rc(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 Mi(i,e){let t=i.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:i,cut:o};let r=(a,l)=>a===0?1:a===e?2:l===0?3:l===e?4:0,n=i.slice();for(let a=0;a<t;a++){let l=i[a*2],s=i[a*2+1],c=r(l,s);if(!c)continue;let f=(a+t-1)%t,u=(a+1)%t,d=r(i[f*2],i[f*2+1])===c,h=r(i[u*2],i[u*2+1])===c;h&&(o[a]=true);let m=d===h?-1:d?u:f;if(m<0)continue;let y=l-i[m*2],p=s-i[m*2+1],b=Math.hypot(y,p);b<1e-6||(n[a*2]=l+y/b*wi,n[a*2+1]=s+p/b*wi);}return n[t*2]=n[0],n[t*2+1]=n[1],{ring:n,cut:o}}function Fi(i,e,t,o){let{extent:r,metersPerUnit:n,height:a,minHeight:l,featureId:s,seed:c,tint:f,facade:u}=o,d=o.whole?e:Ye(e,r,Ae(r));if(!d)return;let h=o.cornerRadius/n,m={radius:h,segments:o.cornerSegments,minCutRatio:0,maxChord:n>0?bi/n:0,...o.whole?{}:{extent:r,margin:Ae(r)}},y=h>0?{outer:Ue(d.outer,m),holes:d.holes.map(L=>Ue(L,m))}:d,p=o.whole?y:Ye(y,r);if(!p)return;let b=L=>({ring:L,cut:new Array(Math.max(L.length/2-1,0)).fill(false)}),g=o.whole?b(p.outer):Mi(p.outer,r),v=p.holes.map(L=>o.whole?b(L):Mi(L,r)),w={outer:g.ring,holes:v.map(L=>L.ring)},x=o.whole?true:_r(w.outer,r),_=w.outer.length/2+w.holes.reduce((L,A)=>L+A.length/2,0);t(_*5+32);let T=w.holes.length||x?null:Os(w.outer),C=T?Gs(o.props,T,a,c,n):null,S=null,E=[];if(C&&T){let L=Ri(Xs(w.outer,n),T,C.shape);E=Ks(L,w.outer);let A=Ys(L,E);if(A>1e-6){let M=Math.min(Math.max(A*n*Vs,Ns),Ds);S=$s(L,M/A,a);}}Si(i,w.outer,l,a,s,f,u,n,S,g.cut);for(let L=0;L<w.holes.length;L++)Si(i,w.holes[L],l,a,s,f,u,n,null,v[L].cut);S?qs(i,E,S,a,s,f,u,n):Hs(i,w.outer,w.holes,a,s,f,u);}function nc(i,e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a=0;a<i.length;a+=2)i[a]<t&&(t=i[a]),i[a]>r&&(r=i[a]),i[a+1]<o&&(o=i[a+1]),i[a+1]>n&&(n=i[a+1]);return r>0&&t<e&&n>0&&o<e}function Ti(i,e){let t=Ae(e),o=Math.max(i.length/2-1,0),r=new Array(o);for(let n=0;n<o;n++)r[n]=Fo(i[n*2],i[n*2+1],i[n*2+2],i[n*2+3],e,t);return r}function ic(i,e,t,o,r,n,a,l){let s=Ye(i,e,Ae(e));if(!s||!nc(s.outer,e))return null;let c=Ti(s.outer,e);return {osmId:r,height:t,minHeight:o,seed:n,tint:a,facade:l,outer:s.outer,holes:s.holes,outerCut:c,holeCuts:s.holes.map(f=>Ti(f,e))}}var et=4;function kr(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,u)=>{let d=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),d};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[d,h,m]=a.pop(),y=(l(d)-l(h))**2+(s(d)-s(h))**2,p=(l(h)-l(m))**2+(s(h)-s(m))**2,b=(l(m)-l(d))**2+(s(m)-s(d))**2,g=Math.max(y,p,b);if(g<=n){r.push(d,h,m);continue}if(g===y){let v=c(d,h);a.push([d,v,m],[v,h,m]);}else if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else {let v=c(m,d);a.push([m,v,h],[v,d,h]);}}}}function Er(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!ve(e,h.properties))continue;let m=h.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(h.id??0);for(let b of ct(h.loadGeometry())){let g=r?Ye(b,n):b;if(!g)continue;let v=[],w=[],x=o?Ue(g.outer,o):g.outer;for(let C=0;C<x.length;C++)v.push(x[C]);for(let C of g.holes){let S=o?Ue(C,o):C;w.push(v.length/2);for(let E=0;E<S.length;E++)v.push(S[E]);}let _=ki__default.default(v,w.length?w:void 0,2);if(!_.length)continue;let T=a.length/2;for(let C=0;C<v.length;C++)a.push(v[C]);if(t>0){let C=[];kr(a,_,T,t,C);for(let S=0;S<C.length;S+=3)l.push(C[S],C[S+2],C[S+1]),s.push(p);continue}for(let C=0;C<_.length;C+=3)l.push(T+_[C],T+_[C+2],T+_[C+1]),s.push(p);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),u=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:u.buffer,vertexCount:c,indexCount:u.length}}var zi=lc__namespace,Ar=zi.union??zi.default?.union??null;Ar||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");function Pi(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Hi(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 zo(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(u=>({outer:e(u.outer,-t)??u.outer,holes:u.holes.map(d=>e(d,t)??d)})):a).map(u=>[Pi(u.outer),...u.holes.map(Pi)]),c;try{if(!Ar)throw new Error("\u043D\u0435\u0442 union");c=Ar(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 u of f){if(!u.length)continue;let d=Hi(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=Hi(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var xt=16,Gi=64,Ui=0,cc=1,Oi=2,fc=3,Gt=1,uc=.6;function Pr(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),u=new ArrayBuffer(f*xt),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(A){if(d.count+A<=f)return;f=Math.max(f*2,d.count+A);let M=new ArrayBuffer(f*xt);new Uint8Array(M).set(d.bytes.subarray(0,d.offset)),u=M,d.view=new DataView(M),d.bytes=new Uint8Array(M);}},h=[],m=[],y=new Map;for(let A of i.features()){if(A.type!==3||!ve(t,A.properties))continue;let M=o.liftBy?.(A.properties)??0,R=A.properties.osm_id,I=typeof R=="number"?R:typeof R=="string"?Number(R):NaN,k=Number.isFinite(I)?I:Number(A.id??0);for(let H of ct(A.loadGeometry())){let B=Ye(H,e,Ae(e));B&&(h.push(M?{...B,lift:M}:B),m.push(k));}}let p=new Set,b=Math.max(o.weld??uc,0),g=zo(h,(A,M)=>Lr(A,M,e,p),b/r),v=b>0?g.map(A=>({...A,outer:Ni(A.outer,b/r,e),holes:A.holes.map(M=>Ni(M,b/r,e))})):g;for(let A of v){Wi(A.outer,y);for(let M of A.holes)Wi(M,y);}o.onShapes?.(v);let w=dc(v,h,m),x=new Set;for(let[A,M]of y)M>1&&x.add(A);let _=[],T={radius:c,segments:o.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:pi/r},C=[];for(let A of v){let M=d.indices.length,R=_.length,I=c>0?{outer:Ue(A.outer,{...T,keep:Vi(A.outer,x)}),holes:A.holes.map(W=>Ue(W,{...T,keep:Vi(W,x)}))}:A,k=l>0?Lr(I.outer,l,e,x):I.outer,H=I.holes.map(W=>l>0?Lr(W,-l,e,x):W),B=A.lift??0,F=n+B,P=a+B;Di(d,k??I.outer,H.map((W,V)=>W??I.holes[V]),F,Ui,o.maxSegment??0);let G=F,O=F-s;k&&l>0&&s>0&&Ir(d,k,I.outer,G,O,cc,e,x),O!==P&&Ir(d,I.outer,I.outer,O,P,Oi,e,x);for(let W of I.holes)if(O!==P&&Ir(d,W,W,O,P,Oi,e,x),F<P){let V=d.indices.length;Di(d,W,[],P,fc);for(let N=V;N<d.indices.length;N++)_.push(d.indices[N]);d.indices.length=V;}C.push(M,d.indices.length,R,_.length);}if(!d.indices.length&&!_.length)return null;let S=d.indices.length;for(let A=0;A<C.length;A+=4)C[A+2]+=S,C[A+3]+=S;let E=[];for(let A of w){E.push(A.length);for(let M of A)E.push(M);}let L=new Uint32Array(S+_.length);return L.set(d.indices,0),L.set(_,S),{vertices:u.slice(0,d.offset),indices:L.buffer,vertexCount:d.count,indexCount:L.length,extent:e,capIndexOffset:S,shapeFeatures:new Float64Array(E).buffer,shapeRanges:new Uint32Array(C).buffer}}function dc(i,e,t){let o=i.map(()=>[]);if(!i.length)return o;let r=i.map(n=>Bi(n.outer));for(let n=0;n<e.length;n++){let a=hc(e[n].outer);if(!a)continue;let l=-1;for(let s=0;s<i.length;s++){let c=r[s];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!zr(i[s].outer,a[0],a[1]))continue;let f=false;for(let u of i[s].holes)if(zr(u,a[0],a[1])){f=true;break}if(!f){l=s;break}}if(l<0){let s=Bi(e[n].outer),c=0;for(let f=0;f<i.length;f++){let u=r[f],d=Math.min(s[2],u[2])-Math.max(s[0],u[0]),h=Math.min(s[3],u[3])-Math.max(s[1],u[1]),m=d>0&&h>0?d*h:0;m>c&&(c=m,l=f);}}l<0&&(l=0),o[l].includes(t[n])||o[l].push(t[n]);}return o}function Bi(i){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let n=0;n<i.length;n+=2)i[n]<e&&(e=i[n]),i[n]>o&&(o=i[n]),i[n+1]<t&&(t=i[n+1]),i[n+1]>r&&(r=i[n+1]);return [e,t,o,r]}function hc(i){let e=i.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let n=(r+1)%e;t+=i[r*2]*i[n*2+1]-i[n*2]*i[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let n=(r+e-1)%e*2,a=r*2,l=(r+1)%e*2,s=(i[a]-i[n])*(i[l+1]-i[n+1])-(i[a+1]-i[n+1])*(i[l]-i[n]);if(s===0||s>0!==o)continue;let c=(i[n]+i[a]+i[l])/3,f=(i[n+1]+i[a+1]+i[l+1])/3;if(zr(i,c,f))return [c,f]}return null}function zr(i,e,t){let o=false,r=i.length/2-1;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}function _t(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 Wi(i,e){for(let t=0;t+3<i.length;t+=2){let o=_t(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function Vi(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=_t(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=_t(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 Ut(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,mc(Math.round(o*Gi)),true),i.view.setInt8(s+10,Fr(Math.round(r*127))),i.view.setInt8(s+11,Fr(Math.round(n*127))),i.view.setInt8(s+12,Fr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-Gt:e>=i.extent?Gt:0),i.view.setInt8(s+15,t<=0?-Gt:t>=i.extent?Gt:0),i.offset+=xt,i.count++}function Di(i,e,t,o,r=Ui,n=0){let a=[],l=[];for(let u=0;u<e.length;u++)a.push(e[u]);for(let u of t){l.push(a.length/2);for(let d=0;d<u.length;d++)a.push(u[d]);}let s=ki__default.default(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];kr(a,s,0,n,u),c=u;}i.ensure(a.length/2);let f=i.count;for(let u=0;u<a.length;u+=2)Ut(i,a[u],a[u+1],o,0,0,1,r);for(let u=0;u<c.length;u+=3)i.indices.push(f+c[u],f+c[u+2],f+c[u+1]);}function Ir(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],u=t[c*2+1],d=t[c*2+2],h=t[c*2+3];if(f===d&&u===h||Fo(f,u,d,h,a,Ae(a))||l.has(_t(f,u,d,h)))continue;let m=d-f,y=h-u,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]-u)||0,x=0;if(w>1e-6&&v!==0){let E=1/Math.hypot(1,v/w);x=w/Math.hypot(w,v)*Math.sign(v),b*=E,g*=E;}let _=Ut(i,e[c*2],e[c*2+1],o,b,g,x,n),T=Ut(i,e[c*2+2],e[c*2+3],o,b,g,x,n),C=Ut(i,f,u,r,b,g,x,n),S=Ut(i,d,h,r,b,g,x,n);i.indices.push(C,T,S,C,_,T);}}}function Lr(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 u=i[f*2],d=i[f*2+1],h=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(u-h,d-m)||1,g=Math.hypot(y-u,p-d)||1,v=(d-m)/b,w=-(u-h)/b,x=(p-d)/g,_=-(y-u)/g,T=v+x,C=w+_,S=Math.hypot(T,C);if(S<1e-6){n.push(u,d);continue}T/=S,C/=S;let E=Math.min(1/Math.max(T*v+C*w,.35),3),L=u-T*e*E,A=d-C*e*E,M=_t(h,m,u,d),R=_t(u,d,y,p);if(o.has(M)||o.has(R)){n.push(u,d);continue}let I=-Ae(t),k=t+Ae(t);((B,F)=>B<=I||B>=k||F<=I||F>=k)(u,d)&&(L=u,A=d),n.push(L,A);}n.push(n[0],n[1]);let a=Math.abs(Rr(i)),l=Rr(n);if(Math.sign(l)!==Math.sign(Rr(i))||Math.abs(l)<a*.25)return null;let s=-Ae(t),c=t+Ae(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 Rr(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 Fr=i=>i>127?127:i<-127?-127:i,mc=i=>i>32767?32767:i<-32768?-32768:i;function Ni(i,e,t){if(!(e>0))return i;let o=Ae(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 d=0;d<s&&!(f<=5);d++){let h=a[d*2],m=a[d*2+1];if(h<=r||h>=n||m<=r||m>=n)continue;let y=(d+s-1)%s;for(;!c[y]&&y!==d;)y=(y+s-1)%s;let p=(d+1)%s;for(;!c[p]&&p!==d;)p=(p+1)%s;if(y===d||p===d)break;let b=a[y*2],g=a[y*2+1],v=a[p*2]-b,w=a[p*2+1]-g,x=Math.hypot(v,w);x<1e-6||Math.abs((h-b)*w-(m-g)*v)/x<e&&(c[d]=false,f--);}if(f===s)break;let u=[];for(let d=0;d<s;d++)c[d]&&u.push(a[d*2],a[d*2+1]);u.push(u[0],u[1]),a=u;}return a}var pc=100;function Hr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function Or(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 bc(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=Ct(Math.floor(o.minX/e)),n=Ct(Math.floor(o.maxX/e)),a=Ct(Math.floor(o.minY/e)),l=Ct(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 Xi=i=>i.shapes.length===0;function Po(i,e,t){!i.cells.length&&i.shapes.length&&bc(i);let o=i.extent/32,r=i.cells[Ct(Math.floor(t/o))*32+Ct(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||!ji(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(ji(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function Br(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=Po(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],u=e[l+3],d=Po(i,f,u);if(d!==a&&n>0){let h=Math.hypot(f-s,u-c),m=Math.min(Math.ceil(h/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(u-c)*b,w=Po(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var Ct=i=>i<0?0:i>31?31:i;function ji(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 yc=5;function ut(i){let e=i.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=i.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var tt=20;function Wr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*tt),c=new DataView(s),f=0,u=[],d=[],h=x=>{if(f+x<=l)return;l=Math.max(l*2,f+x);let _=new ArrayBuffer(l*tt);new Uint8Array(_).set(new Uint8Array(s,0,f*tt)),s=_,c=new DataView(_);},m=(x,_,T,C,S,E,L,A=0,M=0,R=0)=>{let I=f*tt;return c.setInt16(I,x,true),c.setInt16(I+2,_,true),c.setInt16(I+4,T,true),c.setInt16(I+6,C,true),c.setInt8(I+8,S),c.setInt8(I+9,E),c.setInt8(I+10,A),c.setInt8(I+11,M),c.setFloat32(I+12,L,true),c.setFloat32(I+16,R,true),f++},y=0,p=0,b=r>0?12/r:0,g=b>0?_c(i):null;for(let x of i.features()){if(x.type!==2&&x.type!==3||!ve(e,x.properties)||a!==void 0&&ut(x.properties)!==a)continue;let _=x.properties.osm_id,T=typeof _=="number"?_:typeof _=="string"?Number(_):NaN;p=Number.isFinite(T)?T:Number(x.id??0);let C=x.properties.width;y=typeof C=="number"&&C>.5&&C<100?C:0;let S=x.type===3;for(let E of x.loadGeometry()){let L=t>0?vc(Ki(E),t):Ki(E);if(L.length<4)continue;let A=o&&!Xi(o)?Br(o,L):null,M=A?A.pts:L,R=A?.levels,I=M.length/2;if(I<2)continue;let k=ut(x.properties),H=Ho(Math.round(M[0]),Math.round(M[1])),B=Ho(Math.round(M[I*2-2]),Math.round(M[I*2-1])),F=null,P=y;if(g&&y>0&&!S){let O=0;for(let $=0;$<I-1;$++)O+=Math.hypot(M[$*2+2]-M[$*2],M[$*2+3]-M[$*2+1]);P=$i(k,y,H,B,g);let W=$=>Math.min(g.width.get($)??0,P*2),V=W(H)-P,N=W(B)-P,K=Math.min(b,O/2);if(K>0&&(V>0||N>0)){F=Q=>{let Z=0;return V>0&&Q<K&&(Z=V*(1-Q/K)),N>0&&O-Q<K&&(Z=Math.max(Z,N*(1-(O-Q)/K))),P+Z};let $=[];for(let Q of [K,O-K])Q>.01&&Q<O-.01&&$.push(Q);if($.length){let Q=gc(M,R,$);M=Q.pts,R=Q.levels,I=M.length/2;}}}h((I-1)*4);let G=0;for(let O=0;O<I-1;O++){let W=M[O*2],V=M[O*2+1],N=M[O*2+2],K=M[O*2+3],$=Math.hypot(N-W,K-V);if(S&&xc(W,V,N,K,i.extent)){G+=$;continue}let Q=wc(W,V,N,K,i.extent);if(!Q){G+=$;continue}let[Z,X,oe,re]=Q,se=Math.hypot(Z-W,X-V),ue=Math.hypot(oe-Z,re-X),Me=Math.hypot(N-oe,K-re),de=G+se,he=R?R[O]:0,ae=R?R[O+1]:0,_e=F?F(de):P,xe=F?F(de+ue):P,J=m(Z,X,oe,re,0,-1,de,he,ae,_e),q=m(Z,X,oe,re,0,1,de,he,ae,_e),Y=m(Z,X,oe,re,1,1,de,he,ae,xe),Te=m(Z,X,oe,re,1,-1,de,he,ae,xe);G+=se+ue+Me,u.push(J,q,Y,J,Y,Te),d.push(p,p);}}}if(!u.length)return null;let v=new Uint32Array(u),w=new Float64Array(d);return {vertices:s.slice(0,f*tt),indices:v.buffer,vertexCount:f,indexCount:v.length,featureIds:w.buffer}}function gc(i,e,t){let o=[...t].sort((s,c)=>s-c),r=[i[0],i[1]],n=e?[e[0]]:void 0,a=0,l=0;for(let s=0;s+3<i.length;s+=2){let c=i[s],f=i[s+1],u=i[s+2],d=i[s+3],h=Math.hypot(u-c,d-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+h-.01;){let m=(o[l]-a)/h;r.push(c+(u-c)*m,f+(d-f)*m),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*m)),l++;}a+=h,r.push(u,d),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}function vc(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 Ki(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 wc(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,u]of c){if(f===0){if(u<0)return null;continue}let d=u/f;if(f<0){if(d>s)return null;d>l&&(l=d);}else {if(d<l)return null;d<s&&(s=d);}}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 xc(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var Yi=new WeakMap,Ho=(i,e)=>(i+512)*65536+(e+512);function $i(i,e,t,o,r){if(i===0||e<=0)return e;let n=8*4294967296,a=Math.max(r.raw.get(t+n)??0,r.raw.get(o+n)??0);return a>0&&e>a?a:e}function _c(i){let e=Yi.get(i);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width,a=typeof n=="number"&&n>.5&&n<100?n:0,l=ut(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=Ho(Math.round(s[0]),Math.round(s[1])),f=Ho(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let d=u+(l+8)*4294967296;t.ends.set(d,(t.ends.get(d)??0)+1),a>0&&t.raw.set(d,Math.max(t.raw.get(d)??0,a));}o.push({h:c,t:f,lv:l,w:a});}}for(let r of o){let n=$i(r.lv,r.w,r.h,r.t,t);if(!(n<=0))for(let a of [r.h,r.t]){let l=t.width.get(a);(l===void 0||n>l)&&t.width.set(a,n);}}return Yi.set(i,t),t}function Vr(i,e=0){if(!i.length)return null;for(let r of i)if(!r.cut.some(Boolean))return [{outer:r.ring,holes:r.holes??[]}];if(i.length<2)return null;let t=zo(i.map(r=>({outer:r.ring,holes:r.holes??[]}))),o=e>0?t.filter(r=>qi(r.outer,e)):t;return o.length?e>0?o.map(r=>({outer:r.outer,holes:r.holes.filter(n=>qi(n,e))})):o:null}function qi(i,e){let t=0,o=0;for(let r=0;r+3<i.length;r+=2)t+=i[r]*i[r+3]-i[r+2]*i[r+1],o+=Math.hypot(i[r+2]-i[r],i[r+3]-i[r+1]);return o<=0?false:Math.abs(t)/o>=e}var ot=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}};var Oo=class{constructor(){this.meshes=new z;this.stitched=new ee;this.hiddenByTile=new z;this.changed=new ee;this.signature="";this.meshSig=new z;this.cache=new z;}update(e,t,o){let r=new z,n=0,a="";for(let[u,d]of e.loadedTiles()){if(d.id.z!==o.zoom)continue;let h=d.data?.seams;if(h?.length){a+=u+";",n=d.data?.buckets?.[t]?.extent??n;for(let m of h){let y=r.get(m.osmId);y?y.push({seam:m,tile:d.id}):r.set(m.osmId,[{seam:m,tile:d.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!n||!r.size){for(let u of this.meshes.keys())this.changed.add(u);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let l=new z,s=new z,c=new z,f=new ee;for(let[u,d]of r){f.add(u);let h=d.map(b=>b.tile.dataKey).sort().join(","),m=this.cache.get(u);if(!m||m.sig!==h){let b=d[0].tile,g=d.map(({seam:x,tile:_})=>({ring:Zi(x.outer,_,b,n),holes:x.holes.map(T=>Zi(T,_,b,n)),cut:x.outerCut})),v=o.metersPerTile>0?.5*n/o.metersPerTile:0,w=Vr(g,v);if(w?.length){let x=Cc(w,b,n);m={sig:h,shapes:w,owner:x,seam:d[0].seam,tiles:d.map(_=>_.tile.dataKey)},this.cache.set(u,m);}else if(!m)continue}let y=m.owner.dataKey;s.set(y,m.owner);let p=l.get(y)??[];for(let b of m.shapes)p.push({rings:{outer:b.outer,holes:b.holes},seam:m.seam});l.set(y,p),c.set(y,(c.get(y)??"")+u+":"+m.sig+";"),this.stitched.add(u);for(let b of [...m.tiles,...d.map(g=>g.tile.dataKey)]){let g=this.hiddenByTile.get(b);g?g.add(u):this.hiddenByTile.set(b,new Set([u]));}}for(let u of [...this.cache.keys()])f.has(u)||this.cache.delete(u);for(let[u,d]of l){let h=c.get(u);if(this.meshSig.get(u)===h&&this.meshes.has(u))continue;let m=Li(d,n,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/n:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(u),m?(this.meshes.set(u,{tile:s.get(u),mesh:m}),this.meshSig.set(u,h)):(this.meshes.delete(u),this.meshSig.delete(u));}for(let u of [...this.meshes.keys()])l.has(u)||(this.meshes.delete(u),this.meshSig.delete(u),this.changed.add(u));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}};function Cc(i,e,t){let o=-1/0,r=-1/0;for(let c of i)for(let f=0;f<c.outer.length;f+=2)c.outer[f]>o&&(o=c.outer[f]),c.outer[f+1]>r&&(r=c.outer[f+1]);if(!Number.isFinite(o))return e;let n=Math.ceil(o/t)-1,a=Math.ceil(r/t)-1;if(n===0&&a===0)return e;let l=n*t,s=a*t;for(let c of i)for(let f of [c.outer,...c.holes])for(let u=0;u<f.length;u+=2)f[u]-=l,f[u+1]-=s;return new ot(e.z,e.x+n,e.y+a,e.wrap)}function Zi(i,e,t,o){let r=(e.x-t.x)*o,n=(e.y-t.y)*o,a=new Array(i.length);for(let l=0;l<i.length;l+=2)a[l]=i[l]+r,a[l+1]=i[l+1]+n;return a}var Dr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Nr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Qi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Ji={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"},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",minzoom:7,"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-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 ea={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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,weld:0,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-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 ta={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5",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",minzoom:7,"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,weld:0,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-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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-casing",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:{from:"road-casing-minor"},width:{stops:[[14,2.8],[17,4],[19,6],[20,10],[21,18],[22,34]]},material:"flat",elevation:.011}},{id:"road-path",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 oa={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:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"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:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",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:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var ra={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:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"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:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var na={name:"\u0420\u203A\u0420\xB5\u0420\u0491\u0421\u040F\u0420\u0405\u0420\xB0\u0421\u040F",background:"#f5f3f0",light:{ambientColor:"#eaf6fb",ambientIntensity:.72,keyAzimuth:120,keyAltitude:45,keyColor:"#ffffff",keyIntensity:.36,fillAzimuth:300,fillAltitude:25,fillColor:"#cfe6f2",fillIntensity:.22},paint:{"landcover-wood":{color:"#b4ebb8"},"landcover-grass":{color:"#c2f0c3"},"landcover-sand":{color:"#f7efd6"},"landcover-ice":{color:"#eaf6fb"},"landcover-wetland":{color:"#d8eef0"},"landuse-residential":{color:"#ecf1fb"},"landuse-industrial":{color:"#eceef1"},"landuse-civic":{color:"#f6ecf9"},"landuse-sport":{color:"#c2f0c3"},"landuse-cemetery":{color:"#cdeccf"},"landuse-parking":{color:"#e6e7e9"},park:{color:"#c2f0c3"},"aeroway-area":{color:"#e6e9f2"},water:{color:"#90ddf6"},waterway:{color:"#90ddf6"},"aeroway-line":{color:"#f3f1ee"},"road-casing-major":{color:"#f0c24f"},"road-casing-secondary":{color:"#e8d7a4"},"road-casing-minor":{color:"#dbdbdd"},"road-rail":{color:"#c9c9cd"},"road-path":{color:"#ffffff",dashArray:null},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffecba"},"road-ramp":{color:"#ffe49a"},"road-major":{color:"#ffd86b"},boundary:{color:"#c9a7d8"},building:{color:"#d5e4ef",roofColor:"#e9f0f6",aoStrength:0,tintVariation:0,seamStrength:0,windowColor:"#8fbcd8",windowFrameColor:"#d5e4ef",windowVariation:.6,windowGlow:0,ice:1},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#90ddf6"},"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"},"road-bridge-outline":{opacity:0},"road-bridge-outline-thin":{opacity:0},"road-lane-divider-major":{opacity:0},"road-lane-divider-secondary":{opacity:0},"road-path-casing":{color:"#dbdbdd"},crossing:{sideColor:"#c9c9cd",sideShade:.45}},sky:{skyColor:"#a9d8ee",horizonColor:"#eef4f7",fogRange:[2.6,12],fogIntensity:.82,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.4}};var ia={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:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"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:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var aa={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",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:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",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:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var la={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:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var sa={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:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"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:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var ca={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:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var fa={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:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var ua={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:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var da={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:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var ha={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:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var ma={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:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var pa={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:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var ba={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:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var ya={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:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"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:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var ga={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:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var va={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:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"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:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var wa={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:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"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:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var xa={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:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"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:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var _a={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:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Ca={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:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"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:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Sa={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:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"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:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Ma={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:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"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:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Ta={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:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"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:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var ka={"3d":aa,cartoon:la,cyberpunk:sa,dawn:ca,dusk:fa,earth:ua,future:da,"glass-refined":ha,glass:ma,"harmony-black":pa,"harmony-blue":ba,"harmony-green":ya,lunar:ga,matte:va,minimal:wa,ocean:xa,premium:_a,realistic:Ca,space:Sa,volcano:Ma,white:Ta};function Bo(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 j="base",Ea="\u241F",je=(i,e)=>i+"\u241F"+String(e);var St=class{constructor(e=Gr){this.splitValues={};this.spec=e,this.light={...Nr,...e.light??{}},this.sky={...Dr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return me(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let n=e.paint?.color;if(n&&typeof n=="object"&&"from"in n){let l=this.layers.find(f=>f.id===n.from)?.paint?.color,s=He(l,t,o),c=1-Math.min(Math.max(n.darken??0,0),1);return [s[0]*c,s[1]*c,s[2]*c,s[3]]}return He(n,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=j){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??j)===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.type==="line"&&t.network?{network:t.network}:{},...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??j))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:je(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Gr=Qi,Jc=Ji,ef=ea,tf=ta;function Ur(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function jr(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:Ur(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Aa=.93;function of(i){let e=i.paint?.building;return e?{...i,paint:{...i.paint,building:{...e,windowFrameColor:Ur(e.color,Aa)}}}:i}function Ia(i){let e=i.paint?.building;return e?{...i,paint:{...i.paint,building:{...e,ice:1,seamStrength:0,windowFrameColor:Ur(e.color,Aa)}}}:i}var we={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:oa,mono:ra,pale:ia,ice:na,...ka};we["3d"]=Ia(we["3d"]);we.night=Ia(we.night);we.ice=of(we.ice);we["3d-tone"]=jr(we["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});we["night-tone"]=jr(we.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});we["ice-tone"]=jr(we.ice,"\u041B\u0435\u0434\u044F\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});function Wo(i,e=Gr){if(typeof i!="string")return Bo(e,i);if(i==="day")return e;let t=we[i];return t?Bo(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(we).join(", ")}`),e)}var jt=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 La(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 Xt=`
8
+ `)}var Yt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Yt||{}),zr=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(Tf,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,s=0,l=[],c=[];for(;e.pos<o;){if(n<=0){let u=e.readVarint();r=u&7,n=u>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),s+=e.readSVarint(),r===1&&(c.length&&l.push(c),c=[]),c.push(a,s);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&&l.push(c),e.pos=t,l}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>n&&(n=a[s+1]);return [t,o,r,n]}};function Tf(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?kf(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function kf(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 Or=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(Ef,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 zr.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Ef(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(Af(t)));}function Af(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 dt=class{constructor(e){this.layers={};new Sf__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=Or.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Ot(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=qn(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 qn(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 Kt(i){return Array.isArray(i)&&typeof i[0]=="string"}var bs=new WeakMap;function St(i,e){if(!Kt(i))return i;let t=bs.get(i);t||(t=vs(i),bs.set(i,t));try{return t(e)}catch{return null}}var gs=new WeakMap,Rf=new Set(["get","has","id","geometry-type","properties","feature-state","within"]);function Qe(i){if(!Array.isArray(i))return false;let e=gs.get(i);if(e!==void 0)return e;let t=typeof i[0]=="string"&&Rf.has(i[0]);if(!t){for(let o of i)if(Qe(o)){t=true;break}}return gs.set(i,t),t}function Zn(i,e,t){let o=St(i,e);return typeof o=="number"&&Number.isFinite(o)?o:t}function Eo(i,e){let t=St(i,e);return typeof t=="string"?fe(t):Dr(t)?[t.r,t.g,t.b,t.a]:null}function Dr(i){return !!i&&typeof i=="object"&&"r"in i&&"a"in i}function Hr(i){if(Dr(i))return i;if(typeof i=="string"){let[e,t,o,r]=fe(i);return {r:e,g:t,b:o,a:r}}return null}var $=i=>typeof i=="number"?i:Number(i),Xe=i=>i===null?"":Dr(i)?`rgba(${i.r},${i.g},${i.b},${i.a})`:typeof i=="string"?i:JSON.stringify(i),ko=i=>!(i===null||i===false||i===0||i==="");function it(i,e){if(typeof i=="number"&&typeof e=="number")return i-e;let t=Xe(i),o=Xe(e);return t<o?-1:t>o?1:0}function vs(i){let e=i[0],t=i.slice(1),o=n=>{let a=t[n];return Kt(a)?vs(a):()=>a},r=t.map((n,a)=>o(a));switch(e){case "get":{let n=o(0),a=t.length>1?o(1):null;return s=>(a?a(s):s.properties)?.[Xe(n(s))]??null}case "has":{let n=o(0),a=t.length>1?o(1):null;return s=>{let l=a?a(s):s.properties;return !!l&&l[Xe(n(s))]!=null}}case "properties":return n=>n.properties??{};case "id":return n=>n.id??null;case "geometry-type":return n=>n.geometryType??null;case "feature-state":{let n=o(0);return a=>a.featureState?.[Xe(n(a))]??null}case "global-state":{let n=o(0);return a=>a.globalState?.[Xe(n(a))]??null}case "zoom":return n=>n.zoom??0;case "literal":return ()=>t[0];case "array":return n=>r[r.length-1](n);case "to-string":return n=>Xe(r[0](n));case "to-number":return n=>{for(let a of r){let s=Number(a(n));if(Number.isFinite(s))return s}return 0};case "to-boolean":return n=>ko(r[0](n));case "to-color":return n=>Hr(r[0](n))??null;case "typeof":return n=>{let a=r[0](n);return a===null?"null":Array.isArray(a)?"array":Dr(a)?"color":typeof a};case "rgb":case "rgba":return n=>({r:$(r[0](n))/255,g:$(r[1](n))/255,b:$(r[2](n))/255,a:r[3]?$(r[3](n)):1});case "to-rgba":return n=>{let a=Hr(r[0](n));return a?[a.r*255,a.g*255,a.b*255,a.a]:null};case "case":return n=>{for(let a=0;a+1<r.length;a+=2)if(ko(r[a](n)))return r[a+1](n);return r.length%2===1?r[r.length-1](n):null};case "match":return n=>{let a=r[0](n);for(let s=1;s+1<r.length;s+=2){let l=t[s];if(Array.isArray(l)?l.some(u=>it(u,a)===0):it(l,a)===0)return r[s+1](n)}return r.length%2===0?r[r.length-1](n):null};case "coalesce":return n=>{for(let a of r){let s=a(n);if(s!=null)return s}return null};case "all":return n=>r.every(a=>ko(a(n)));case "any":return n=>r.some(a=>ko(a(n)));case "!":return n=>!ko(r[0](n));case "==":return n=>it(r[0](n),r[1](n))===0;case "!=":return n=>it(r[0](n),r[1](n))!==0;case "<":return n=>it(r[0](n),r[1](n))<0;case "<=":return n=>it(r[0](n),r[1](n))<=0;case ">":return n=>it(r[0](n),r[1](n))>0;case ">=":return n=>it(r[0](n),r[1](n))>=0;case "in":return n=>{let a=r[0](n),s=r[1](n);return typeof s=="string"?s.includes(Xe(a)):Array.isArray(s)&&s.some(l=>it(l,a)===0)};case "index-of":return n=>{let a=r[0](n),s=r[1](n);return typeof s=="string"?s.indexOf(Xe(a)):Array.isArray(s)?s.findIndex(l=>it(l,a)===0):-1};case "step":return n=>{let a=$(r[0](n)),s=r[1](n);for(let l=2;l+1<r.length&&a>=$(r[l](n));l+=2)s=r[l+1](n);return s};case "interpolate":case "interpolate-hcl":case "interpolate-lab":{let n=t[0],a=o(1),s=[];for(let l=2;l+1<t.length;l+=2)s.push({at:o(l),value:o(l+1)});return l=>{let c=$(a(l));if(!s.length)return null;if(c<=$(s[0].at(l)))return s[0].value(l);let u=s[s.length-1];if(c>=$(u.at(l)))return u.value(l);for(let f=1;f<s.length;f++){let h=$(s[f].at(l));if(c>h)continue;let d=$(s[f-1].at(l)),m=If(n,d,h,c);return ws(s[f-1].value(l),s[f].value(l),m)}return u.value(l)}}case "+":return n=>r.reduce((a,s)=>a+$(s(n)),0);case "*":return n=>r.reduce((a,s)=>a*$(s(n)),1);case "-":return n=>r.length===1?-$(r[0](n)):$(r[0](n))-$(r[1](n));case "/":return n=>$(r[0](n))/$(r[1](n));case "%":return n=>$(r[0](n))%$(r[1](n));case "^":return n=>Math.pow($(r[0](n)),$(r[1](n)));case "abs":return n=>Math.abs($(r[0](n)));case "ceil":return n=>Math.ceil($(r[0](n)));case "floor":return n=>Math.floor($(r[0](n)));case "round":return n=>Math.round($(r[0](n)));case "sqrt":return n=>Math.sqrt($(r[0](n)));case "ln":return n=>Math.log($(r[0](n)));case "ln2":return ()=>Math.LN2;case "log10":return n=>Math.log10($(r[0](n)));case "log2":return n=>Math.log2($(r[0](n)));case "sin":return n=>Math.sin($(r[0](n)));case "cos":return n=>Math.cos($(r[0](n)));case "tan":return n=>Math.tan($(r[0](n)));case "asin":return n=>Math.asin($(r[0](n)));case "acos":return n=>Math.acos($(r[0](n)));case "atan":return n=>Math.atan($(r[0](n)));case "e":return ()=>Math.E;case "pi":return ()=>Math.PI;case "min":return n=>Math.min(...r.map(a=>$(a(n))));case "max":return n=>Math.max(...r.map(a=>$(a(n))));case "random":return n=>{let a=r.length>0?$(r[0](n)):0,s=r.length>1?$(r[1](n)):1;return a+Math.random()*(s-a)};case "concat":return n=>r.map(a=>Xe(a(n))).join("");case "downcase":return n=>Xe(r[0](n)).toLowerCase();case "upcase":return n=>Xe(r[0](n)).toUpperCase();case "length":return n=>{let a=r[0](n);return typeof a=="string"?[...a].length:Array.isArray(a)?a.length:0};case "at":return n=>{let a=$(r[0](n)),s=r[1](n);return Array.isArray(s)?s[a]??null:null};case "slice":return n=>{let a=r[0](n),s=$(r[1](n)),l=r.length>2?$(r[2](n)):void 0;return typeof a=="string"||Array.isArray(a)?a.slice(s,l):null};case "number-format":return n=>{let a=$(r[0](n)),s=t[1]??{};return new Intl.NumberFormat(s.locale??void 0,{minimumFractionDigits:s["min-fraction-digits"],maximumFractionDigits:s["max-fraction-digits"],currency:s.currency,style:s.currency?"currency":void 0}).format(a)};case "let":{let n=[],a=[];for(let l=0;l+1<t.length-1;l+=2)n.push(t[l]),a.push(o(l+1));let s=o(t.length-1);return l=>{let c={...l.vars};return n.forEach((u,f)=>{c[u]=a[f](l);}),s({...l,vars:c})}}case "var":{let n=t[0];return a=>a.vars?.[n]??null}case "within":{let n=t[0];return a=>{let s=a.point;if(!s||!n?.coordinates)return false;let l=n.type==="MultiPolygon"?n.coordinates.flat():n.coordinates,c=false;for(let u of l)for(let f=0,h=u.length-1;f<u.length;h=f++){let[d,m]=u[f],[b,p]=u[h];m>s[1]!=p>s[1]&&s[0]<(b-d)*(s[1]-m)/(p-m)+d&&(c=!c);}return c}}default:return ()=>(ys.has(e)||(ys.add(e),console.warn(`[osmgl] \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \xAB${e}\xBB \u043F\u043E\u043A\u0430 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0430\u043D\u043E`)),null)}}var ys=new Set;function If(i,e,t,o){let r=t-e,n=r===0?0:(o-e)/r;if(!Array.isArray(i))return n;let a=i[0];if(a==="exponential"){let s=Number(i[1]??1);return s===1||r===0?n:(Math.pow(s,o-e)-1)/(Math.pow(s,r)-1)}if(a==="cubic-bezier"){let[,s,l,c,u]=i;return Lf(s,l,c,u,n)}return n}function Lf(i,e,t,o,r){let n=3*i,a=3*(t-i)-n,s=1-n-a,l=3*e,c=3*(o-e)-l,u=1-l-c,f=r;for(let h=0;h<8;h++){let d=((s*f+a)*f+n)*f-r;if(Math.abs(d)<1e-5)break;let m=(3*s*f+2*a)*f+n;if(Math.abs(m)<1e-6)break;f-=d/m;}return ((u*f+c)*f+l)*f}function ws(i,e,t){if(typeof i=="number"&&typeof e=="number")return i+(e-i)*t;let o=Hr(i),r=Hr(e);return o&&r?{r:o.r+(r.r-o.r)*t,g:o.g+(r.g-o.g)*t,b:o.b+(r.b-o.b)*t,a:o.a+(r.a-o.a)*t}:Array.isArray(i)&&Array.isArray(e)?i.map((n,a)=>ws(n,e[a]??n,t)):t<.5?i:e}function N(i,e,t){if(i===void 0)return t;if(typeof i=="number")return i;if(Kt(i))return Ms(i),Zn(i,{zoom:e,globalState:Ht},t);let o=i.stops;return Cs(o,e,(r,n,a)=>r+(n-r)*a,t)}var Ht={};function Fe(i,e,t){if(i===void 0)return t;if(typeof i=="string")return fe(i);if(Kt(i))return Ms(i),Eo(i,{zoom:e,globalState:Ht})??t;let o=i.stops;return Cs(o,e,(r,n,a)=>{let s=fe(r),l=fe(n);return [s[0]+(l[0]-s[0])*a,s[1]+(l[1]-s[1])*a,s[2]+(l[2]-s[2])*a,s[3]+(l[3]-s[3])*a]},t)}var xs=new WeakSet,_s=new WeakSet;function Br(i){i&&typeof i=="object"&&_s.add(i);}function Ms(i){_s.has(i)||!Qe(i)||xs.has(i)||(xs.add(i),console.warn("[osmgl] \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u043D\u0430 \u0444\u0438\u0447\u0443, \u0430 \u044D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0440\u0430\u0437 \u043D\u0430 \u0441\u043B\u043E\u0439 \u2014 \u043E\u043D\u043E \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043F\u0430\u0441\u043D\u044B\u043C. \u041D\u0430 \u0444\u0438\u0447\u0435 \u0441\u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u0446\u0432\u0435\u0442, \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u0438 \u0448\u0438\u0440\u0438\u043D\u0430 \u043B\u0438\u043D\u0438\u0438; \u0441\u043C. porting/maplibre-api.md, \u0444\u0430\u0437\u0430 7\u0431.",i));}function Pf(i){let e=i[0];return Ff.has(e)?e==="all"||e==="any"||e==="!"?false:Array.isArray(i[1]):true}var Ff=new Set(["==","!=",">",">=","<","<=","in","!in","has","!has","all","any","!"]);function Cs(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,s]=i[n];if(e>a)continue;let[l,c]=i[n-1],u=a-l,f=u===0?0:(e-l)/u;return t(c,s,f)}return o}function we(i,e,t){if(!i)return true;let o=i[0];if(Pf(i))return St(i,{properties:e,id:t?.id??null,geometryType:t?.geometryType,featureState:t?.featureState,globalState:Ht})===true;switch(o){case "all":return i.slice(1).every(r=>we(r,e));case "any":return i.slice(1).some(r=>we(r,e));case "!":return !we(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let r=e[i[1]];return r==null?false:i.slice(2).includes(r)}case "!in":{let r=e[i[1]];return r==null?true:!i.slice(2).includes(r)}default:{let r=e[i[1]],n=i[2];if(r==null)return o==="!=";switch(o){case "==":return r===n;case "!=":return r!==n;case ">":return r>n;case ">=":return r>=n;case "<":return r<n;case "<=":return r<=n;default:return true}}}}var zf=Math.PI/8,Of=.35,Hf=32,Ts=.25,ks=.5,Es=.07;function He(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??Of,0),a=e.extent,s=[];for(let l=0;l<o;l++){let c=i[l*2],u=i[l*2+1],f=i[(l+o-1)%o*2],h=i[(l+o-1)%o*2+1],d=i[(l+1)%o*2],m=i[(l+1)%o*2+1],b=c-f,p=u-h,g=d-c,y=m-u,v=Math.hypot(b,p),w=Math.hypot(g,y);if(v<1e-6||w<1e-6){s.push(c,u);continue}let x=b/v,_=p/v,M=g/w,S=y/w;if(e.keep?.[l]){s.push(c,u);continue}let C=x*M+_*S;if(C>.985){s.push(c,u);continue}if(a!==void 0&&(c<=0||c>=a||u<=0||u>=a)){s.push(c,u);continue}let k=Math.min(t,v*Ss,w*Ss);if(k<t*n){s.push(c,u);continue}let T=c-x*k,P=u-_*k,L=c+M*k,A=u+S*k,R=Math.acos(Math.max(-1,Math.min(1,C))),I=Math.min(zf,Math.PI/2/r),H=Math.ceil(R/I-1e-6),z=e.maxChord&&e.maxChord>0?Math.ceil(k/Math.tan(R/2)*R/e.maxChord):0,E=Math.max(1,Math.min(Hf,Math.max(Math.min(r,H),z)));s.push(T,P);for(let F=1;F<E;F++){let B=F/E,O=1-B;s.push(O*O*T+2*O*B*c+B*B*L,O*O*P+2*O*B*u+B*B*A);}s.push(L,A);}return s.length<6?i:(s.push(s[0],s[1]),s)}var Ss=.4;function Ao(i,e,t=6){let o=i.length/2;if(!(e>0)||o<3)return i;let r=[i[0],i[1]];for(let n=1;n<o-1;n++){let a=i[n*2-2],s=i[n*2-1],l=i[n*2],c=i[n*2+1],u=i[n*2+2],f=i[n*2+3],h=Math.hypot(l-a,c-s),d=Math.hypot(u-l,f-c);if(h<1e-6||d<1e-6)continue;let m=(a-l)/h,b=(s-c)/h,p=(u-l)/d,g=(f-c)/d,y=Math.max(-1,Math.min(1,m*p+b*g)),v=Math.acos(y)/2;if(v>Math.PI/2-.02){r.push(l,c);continue}let w=Math.tan(v);if(!(w>1e-6)){r.push(l,c);continue}let x=e/w,_=Math.min(h,d)*.5;x>_&&(x=_);let M=x*w;if(!(M>1e-4)){r.push(l,c);continue}let S=l+m*x,C=c+b*x,k=l+p*x,T=c+g*x,P=m+p,L=b+g,A=Math.hypot(P,L);if(A<1e-9){r.push(l,c);continue}P/=A,L/=A;let R=M/Math.sin(v),I=l+P*R,H=c+L*R,z=Math.atan2(C-H,S-I),E=Math.atan2(T-H,k-I)-z;for(;E>Math.PI;)E-=Math.PI*2;for(;E<-Math.PI;)E+=Math.PI*2;let F=Math.max(2,Math.min(t,Math.ceil(Math.abs(E)/(Math.PI/2)*t)));for(let B=0;B<=F;B++){let O=z+E*B/F;r.push(I+Math.cos(O)*M,H+Math.sin(O)*M);}}return r.push(i[o*2-2],i[o*2-1]),r}function $t(i,e=2){let t=Array.from(i);for(let o=0;o<e&&!(t.length/2<3);o++){let n=[t[0],t[1]];for(let a=0;a+3<t.length;a+=2){let s=t[a],l=t[a+1],c=t[a+2],u=t[a+3];n.push(s+(c-s)*.25,l+(u-l)*.25),n.push(s+(c-s)*.75,l+(u-l)*.75);}n.push(t[t.length-2],t[t.length-1]),t=n;}return t}function Qn(i,e){if(i.length/2<2||!(e>0))return i;let o=[i[0],i[1]];for(let r=0;r+3<i.length;r+=2){let n=i[r],a=i[r+1],s=i[r+2],l=i[r+3],c=Math.hypot(s-n,l-a),u=Math.ceil(c/e);for(let f=1;f<u;f++)o.push(n+(s-n)*f/u,a+(l-a)*f/u);o.push(s,l);}return o}var ze=i=>i/64;function mt(i,e,t=0){let o=As(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=As(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function As(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 s=0;s<a;s++){let l=n[s*2],c=n[s*2+1],u=n[(s+a-1)%a*2],f=n[(s+a-1)%a*2+1],h=Rs(l,c,r,e,t),d=Rs(u,f,r,e,t);if(h!==d){let m=Df(u,f,l,c,r,e,t),b=r===0?-t:r===1?e+t:u+(l-u)*m,p=r===2?-t:r===3?e+t:f+(c-f)*m;o.push(b,p);}h&&o.push(l,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Rs(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Df(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 Wr(i,e,t,o,r,n=0){let a=-n,s=r+n;return i===a&&t===a||i===s&&t===s||e===a&&o===a||e===s&&o===s}function Jn(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 Is=1,Ee=18,Qt=32,pt=8,Bs=65535/Qt,Bf=9,Wf=1,Vf=0,Nf=1,Gf=2;var Ls=0,Uf=1,Ps=2,jf=3,Ws=.47;function oi(i,e,t,o={},r){let n=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Ws,{b:a,ensure:s,take:l}=Vs(Math.max(1024,i.length*48));for(let c of i.features()){if(c.type!==3||!we(t,c.properties))continue;let u=hh(c.properties),f=dh(c.properties,u);if(u<=f)continue;let h=ph(c.properties)??Number(c.id??0),d=fh(h>>>0),m=uh(d,c.properties),b=ch(c.properties,u);o.paint?.setFeature(c.properties,c.id??null,"Polygon");let p=Ot(c.loadGeometry()),g=r?p.some(y=>{let v=mt(y,e,ze(e));return v?Jn(v.outer,e):false}):false;for(let y of p){if(r&&g){let v=gh(y,e,u,f,h,d,m,b);v&&r.push(v);}Us(a,y,s,{extent:e,metersPerUnit:n,height:u,minHeight:f,featureId:h,seed:d,tint:m,facade:b,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}o.paint?.advanceTo(a.vertexCount);}return l(e,o.paint)}function Vs(i){let e=i,t=new ArrayBuffer(e*Ee),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let s=new ArrayBuffer(e*Ee);new Uint8Array(s).set(o.vertsU8.subarray(0,o.vertOffset)),t=s,o.verts=new DataView(s),o.vertsU8=new Uint8Array(s);};return o.ensure=r,{b:o,ensure:r,take:(a,s)=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),c=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:c.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a,...s?{dataPaint:s.take(o.vertexCount)}:{}}}}}function Ns(i,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:Ws,{b:r,ensure:n,take:a}=Vs(Math.max(1024,i.length*64));for(let{rings:s,seam:l}of i)Us(r,s,n,{extent:e,metersPerUnit:o,height:l.height,minHeight:l.minHeight,featureId:l.osmId,seed:l.seed,tint:l.tint,facade:l.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var ri=(i,e)=>i|e<<2,Fs=i=>Math.max(-32768,Math.min(32767,i)),ei=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,Bs)*Qt)));function qt(i,e,t,o,r,n,a,s,l,c,u=0,f=0,h=0){let d=i.vertOffset;return i.verts.setInt16(d,Fs(Math.round(e*pt)),true),i.verts.setInt16(d+2,Fs(Math.round(t*pt)),true),i.verts.setUint16(d+4,Math.round(Math.min(o,Bs)*Qt),true),i.vertsU8[d+6]=l,i.vertsU8[d+7]=s,i.verts.setInt8(d+8,ti(Math.round(r*127))),i.verts.setInt8(d+9,ti(Math.round(n*127))),i.verts.setInt8(d+10,ti(Math.round(a*127))),i.vertsU8[d+11]=c,i.verts.setUint16(d+12,ei(u),true),i.verts.setUint16(d+14,ei(f),true),i.verts.setUint16(d+16,ei(h),true),i.vertOffset+=Ee,i.vertexCount++}function zs(i,e,t,o,r,n,a,s,l,c){let u=e.length/2;if(u<3)return;let f=ri(Vf,a),h=Yf(e,s),d=o-t,m=new Float64Array(u*2),b=new Uint8Array(u);{let p=new Float64Array(u*2);for(let g=0;g<u-1;g++){let y=e[g*2+2]-e[g*2],v=e[g*2+3]-e[g*2+1],w=Math.hypot(y,v)||1;p[g*2]=v/w,p[g*2+1]=-y/w;}for(let g=0;g<u-1;g++){let y=(g+u-2)%(u-1),v=p[y*2]*p[g*2]+p[y*2+1]*p[g*2+1],w=p[y*2]+p[g*2],x=p[y*2+1]+p[g*2+1],_=Math.hypot(w,x);v>.5&&_>1e-6&&(m[g*2]=w/_,m[g*2+1]=x/_,b[g]=1);}}for(let p=0;p<u-1;p++){let g=e[p*2],y=e[p*2+1],v=e[p*2+2],w=e[p*2+3];if(g===v&&y===w||c[p])continue;let x=v-g,_=w-y,M=Math.hypot(x,_)||1,S=_/M,C=-x/M,k=h.offset[p],T=h.width[p],P=[0,1];if(l){for(let A=0;A<l.length;A++)for(let R=A+1;R<l.length;R++){let I=Dt(l[A],g,y)-Dt(l[R],g,y),H=Dt(l[A],v,w)-Dt(l[R],v,w);if(I===H)continue;let z=I/(I-H);z>1e-4&&z<1-1e-4&&P.push(z);}P.sort((A,R)=>A-R);}let L=(A,R)=>{if(!l)return o;let I=1/0;for(let H of l)I=Math.min(I,Dt(H,A,R));return Math.max(o,I)};for(let A=0;A+1<P.length;A++){let R=P[A],I=P[A+1];if(I-R<1e-6)continue;let H=g+x*R,z=y+_*R,E=g+x*I,F=y+_*I,B=k+M*R*s,O=k+M*I*s,W=(p+1)%(u-1),V=b[p]?m[p*2]:S,j=b[p]?m[p*2+1]:C,G=b[W]?m[W*2]:S,ee=b[W]?m[W*2+1]:C,le=S+(V-S)*(1-R),K=C+(j-C)*(1-R),U=S+(G-S)*I,ne=C+(ee-C)*I,te=Math.hypot(le,K)||1,Z=Math.hypot(U,ne)||1,se=le/te,me=K/te,ge=U/Z,Ce=ne/Z;i.ensure(4);let Se=qt(i,H,z,t,se,me,0,0,n,f,B,T,d),_e=qt(i,E,F,t,ge,Ce,0,0,n,f,O,T,d),Me=qt(i,H,z,L(H,z),se,me,0,255,n,f,B,T,d),Te=qt(i,E,F,L(E,F),ge,Ce,0,255,n,f,O,T,d);i.indices.push(Se,Te,_e,Se,Me,Te),i.featureIds.push(r,r);}}}var Xf=.9976;function Yf(i,e){let t=i.length/2-1,o=[];for(let l=0;l<t;l++){let c=i[l*2+2]-i[l*2],u=i[l*2+3]-i[l*2+1],f=Math.hypot(c,u);o.push(f>0?{x:c/f,y:u/f,len:f*e}:{x:0,y:0,len:0});}let r=(l,c)=>o[l].len>0&&o[c].len>0&&o[l].x*o[c].x+o[l].y*o[c].y>=Xf,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),s=new Array(t).fill(0);for(let l=0;l<t;){let c=(n+l)%t,u=[c],f=o[c].len,h=l+1;for(;h<t;){let m=(n+h)%t;if(!r((n+h-1)%t,m))break;u.push(m),f+=o[m].len,h++;}let d=0;for(let m of u)a[m]=d,s[m]=f,d+=o[m].len;l=h;}return {offset:a,width:s}}function Kf(i,e,t,o,r,n,a){let s=[],l=[];for(let h=0;h<e.length;h++)s.push(e[h]);for(let h of t){l.push(s.length/2);for(let d=0;d<h.length;d++)s.push(h[d]);}let c=Ds__default.default(s,l.length?l:void 0,2);if(!c.length)return;let u=ri(Nf,a),f=i.vertexCount;for(let h=0;h<s.length;h+=2)qt(i,s[h],s[h+1],o,0,0,1,255,n,u);for(let h=0;h<c.length;h+=3)i.indices.push(f+c[h],f+c[h+2],f+c[h+1]),i.featureIds.push(r);}function $f(i){let e=qf(i);if(e.length<3)return null;let t=Math.abs(Zf(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,s=e[a].x-e[n].x,l=e[a].y-e[n].y,c=Math.hypot(s,l);if(c<1e-6)continue;s/=c,l/=c;let u=1/0,f=-1/0,h=1/0,d=-1/0;for(let w of e){let x=w.x*s+w.y*l,_=-w.x*l+w.y*s;x<u&&(u=x),x>f&&(f=x),_<h&&(h=_),_>d&&(d=_);}let m=f-u,b=d-h,p=m*b;if(p<=0||p>=r)continue;r=p;let g=(u+f)/2,y=(h+d)/2,v=m>=b;o={cx:g*s-y*l,cy:g*l+y*s,ax:v?s:-l,ay:v?l:s,halfLong:(v?m:b)/2,halfShort:(v?b:m)/2,fill:t/p};}return o}function qf(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,s)=>(a.x-n.x)*(s.y-n.y)-(a.y-n.y)*(s.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 Zf(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 Qf=Math.tan(30*Math.PI/180),Jf=3.5,eh=.9;function th(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,s=n*a,l=e.halfShort>0?e.halfLong/e.halfShort:99,c=oh(i);if(!c){if(t>15||s>600||n<3)return null;let u=o%1e3/1e3;s<30?c=u<.5?"skillion":"gabled":l<1.25?c=u<.35?"pyramidal":"hipped":c=u<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function oh(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 Dt=(i,e,t)=>i.a*e+i.b*t+i.c;function rh(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=s=>[i[s*2],i[s*2+1]];for(let s=0;s<r;s++){let[l,c]=a(s),[u,f]=a((s+r-1)%r),h=e*l+t*c+o,d=e*u+t*f+o;if(h<=0!=d<=0){let m=d/(d-h);n.push(u+(l-u)*m,f+(c-f)*m);}h<=0&&n.push(l,c);}return n}function nh(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 s=i[n*2],l=i[n*2+1],c=i[a*2],u=i[a*2+1],f=c-s,h=u-l,d=Math.hypot(f,h),m=d>1e-6;if(m){for(let b=n+1;b<a;b++)if(Math.abs((i[b*2]-s)*h-(i[b*2+1]-l)*f)/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 Gs(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let l=-r,c=o;return [{a:l,b:c,c:-(l*e.cx+c*e.cy)+e.halfShort}]}let a=[],s=i.length/2-1;for(let l=0;l<s;l++){let c=i[l*2],u=i[l*2+1],f=i[(l+1)%s*2],h=i[(l+1)%s*2+1],d=f-c,m=h-u,b=Math.hypot(d,m);if(b<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/b)<.86)continue;let p=-m/b,g=d/b;a.push({a:p,b:g,c:-(p*c+g*u)});}return !a.length&&n>0?Gs(i,e,"hipped"):a}function ih(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=rh(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 ah(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=Dt(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function sh(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function lh(i,e,t,o,r,n,a,s){let l=ri(Gf,a);for(let c=0;c<t.length;c++){let u=e[c];if(!u||u.length<6)continue;let f=Ds__default.default(u,void 0,2);if(!f.length)continue;let h=-t[c].a/s,d=-t[c].b/s,m=Math.hypot(h,d,1),b={x:h/m,y:d/m,z:1/m};i.ensure(u.length/2);let p=i.vertexCount;for(let g=0;g<u.length;g+=2){let y=Math.max(o,Dt(t[c],u[g],u[g+1]));qt(i,u[g],u[g+1],y,b.x,b.y,b.z,255,n,l);}for(let g=0;g<f.length;g+=3)i.indices.push(p+f[g],p+f[g+2],p+f[g+1]),i.featureIds.push(r);}}function ch(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?jf:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Ps:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Ls:e>=40?Ps:Uf}function uh(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 fh(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function hh(i){let e=Zt(i.render_height)??Zt(i.height)??mh(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Wf):Bf}function dh(i,e){let t=Zt(i.render_min_height)??Zt(i.min_height)??Zt(i.base)??0;return t>0&&t<e?t:0}function mh(i){let e=Zt(i);return e&&e>0?e*3:null}function Zt(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 ti=i=>i>127?127:i<-127?-127:i;function ph(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 Os(i,e){let t=i.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:i,cut:o};let r=(a,s)=>a===0?1:a===e?2:s===0?3:s===e?4:0,n=i.slice();for(let a=0;a<t;a++){let s=i[a*2],l=i[a*2+1],c=r(s,l);if(!c)continue;let u=(a+t-1)%t,f=(a+1)%t,h=r(i[u*2],i[u*2+1])===c,d=r(i[f*2],i[f*2+1])===c;d&&(o[a]=true);let m=h===d?-1:h?f:u;if(m<0)continue;let b=s-i[m*2],p=l-i[m*2+1],g=Math.hypot(b,p);g<1e-6||(n[a*2]=s+b/g*Is,n[a*2+1]=l+p/g*Is);}return n[t*2]=n[0],n[t*2+1]=n[1],{ring:n,cut:o}}function Us(i,e,t,o){let{extent:r,metersPerUnit:n,height:a,minHeight:s,featureId:l,seed:c,tint:u,facade:f}=o,h=o.whole?e:mt(e,r,ze(r));if(!h)return;let d=o.cornerRadius/n,m={radius:d,segments:o.cornerSegments,minCutRatio:0,maxChord:n>0?ks/n:0,...o.whole?{}:{extent:r,margin:ze(r)}},b=d>0?{outer:He(h.outer,m),holes:h.holes.map(T=>He(T,m))}:h,p=o.whole?b:mt(b,r);if(!p)return;let g=T=>({ring:T,cut:new Array(Math.max(T.length/2-1,0)).fill(false)}),y=o.whole?g(p.outer):Os(p.outer,r),v=p.holes.map(T=>o.whole?g(T):Os(T,r)),w={outer:y.ring,holes:v.map(T=>T.ring)},x=o.whole?true:Jn(w.outer,r),_=w.outer.length/2+w.holes.reduce((T,P)=>T+P.length/2,0);t(_*5+32);let M=w.holes.length||x?null:$f(w.outer),S=M?th(o.props,M,a,c,n):null,C=null,k=[];if(S&&M){let T=Gs(nh(w.outer,n),M,S.shape);k=ih(T,w.outer);let P=ah(T,k);if(P>1e-6){let L=Math.min(Math.max(P*n*Qf,eh),Jf);C=sh(T,L/P,a);}}zs(i,w.outer,s,a,l,u,f,n,C,y.cut);for(let T=0;T<w.holes.length;T++)zs(i,w.holes[T],s,a,l,u,f,n,null,v[T].cut);C?lh(i,k,C,a,l,u,f,n):Kf(i,w.outer,w.holes,a,l,u,f);}function bh(i,e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a=0;a<i.length;a+=2)i[a]<t&&(t=i[a]),i[a]>r&&(r=i[a]),i[a+1]<o&&(o=i[a+1]),i[a+1]>n&&(n=i[a+1]);return r>0&&t<e&&n>0&&o<e}function Hs(i,e){let t=ze(e),o=Math.max(i.length/2-1,0),r=new Array(o);for(let n=0;n<o;n++)r[n]=Wr(i[n*2],i[n*2+1],i[n*2+2],i[n*2+3],e,t);return r}function gh(i,e,t,o,r,n,a,s){let l=mt(i,e,ze(e));if(!l||!bh(l.outer,e))return null;let c=Hs(l.outer,e);return {osmId:r,height:t,minHeight:o,seed:n,tint:a,facade:s,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(u=>Hs(u,e))}}var Je=4;function ni(i,e,t,o,r){let n=o*o,a=[],s=u=>i[u*2],l=u=>i[u*2+1],c=(u,f)=>{let h=i.length/2;return i.push((s(u)+s(f))/2,(l(u)+l(f))/2),h};for(let u=0;u<e.length;u+=3){a.push([t+e[u],t+e[u+1],t+e[u+2]]);let f=0;for(;a.length&&!(++f>2e4);){let[h,d,m]=a.pop(),b=(s(h)-s(d))**2+(l(h)-l(d))**2,p=(s(d)-s(m))**2+(l(d)-l(m))**2,g=(s(m)-s(h))**2+(l(m)-l(h))**2,y=Math.max(b,p,g);if(y<=n){r.push(h,d,m);continue}if(y===b){let v=c(h,d);a.push([h,v,m],[v,d,m]);}else if(y===p){let v=c(d,m);a.push([d,v,h],[v,m,h]);}else {let v=c(m,h);a.push([m,v,d],[v,h,d]);}}}}function ii(i,e,t=0,o,r=false,n=4096,a){let s=[],l=[],c=[];for(let m of i.features()){if(m.type!==3||!we(e,m.properties))continue;let b=m.properties.osm_id,p=typeof b=="number"?b:typeof b=="string"?Number(b):NaN,g=Number.isFinite(p)?p:Number(m.id??0);a?.setFeature(m.properties,m.id??null,"Polygon");for(let y of Ot(m.loadGeometry())){let v=r?mt(y,n):y;if(!v)continue;let w=[],x=[],_=o?He(v.outer,o):v.outer;for(let C=0;C<_.length;C++)w.push(_[C]);for(let C of v.holes){let k=o?He(C,o):C;x.push(w.length/2);for(let T=0;T<k.length;T++)w.push(k[T]);}let M=Ds__default.default(w,x.length?x:void 0,2);if(!M.length)continue;let S=s.length/2;for(let C=0;C<w.length;C++)s.push(w[C]);if(t>0){let C=[];ni(s,M,S,t,C);for(let k=0;k<C.length;k+=3)l.push(C[k],C[k+2],C[k+1]),c.push(g);continue}for(let C=0;C<M.length;C+=3)l.push(S+M[C],S+M[C+2],S+M[C+1]),c.push(g);}a?.advanceTo(s.length/2);}if(!l.length)return null;let u=s.length/2,f=new Int16Array(s),h=new Uint32Array(l);return {featureIds:new Float64Array(c).buffer,vertices:f.buffer,indices:h.buffer,vertexCount:u,indexCount:h.length,...a?{dataPaint:a.take(u)}:{}}}function vh(i,e){return Jt(i,e)?.outer??null}function Jt(i,e){let t=e.halfWidth;if(!(t>0))return null;let o=wh(i);if(o.length<4)return null;let r=xh(t,e.metersPerUnit),n=[],a=o.length/2,s=new Float64Array(a);for(let b=1;b<a;b++)s[b]=s[b-1]+Math.hypot(o[b*2]-o[b*2-2],o[b*2+1]-o[b*2-1]);let l=e.halfWidthAt,c=l?b=>Math.max(l(b),0):()=>t,u=b=>c(s[(b%a+a)%a]),f=1/0;for(let b=0;b<a;b++)f=Math.min(f,u(b));if(e.closed===true){let b=[],p=[];Vr(b,o,u,true,r,true),Vr(p,o,u,false,r,true);let g=[];for(let w of [b,p]){let x=js(w);if(x.length<8)continue;x.push(x[0],x[1]);let _=Ks(x,o,s,c,f);_&&_.length>=8&&g.push(_);}if(!g.length)return null;g.sort((w,x)=>Math.abs(Ro(x))-Math.abs(Ro(w)));let y=Ro(g[0])<0?ai(g[0]):g[0],v=g.slice(1).map(w=>Ro(w)>0?ai(w):w);return {outer:y,holes:v}}if(Vr(n,o,u,true,r,false),Vr(n,o,u,false,r,false),n.length<8)return null;let d=js(n);if(d.length<8)return null;d.push(d[0],d[1]);let m=Ks(d,o,s,c,f);return !m||m.length<8?null:{outer:Ro(m)<0?ai(m):m,holes:[]}}function js(i){let e=[];for(let o=0;o+1<i.length;o+=2){let r=e.length;r>=2&&Math.abs(e[r-2]-i[o])<1e-9&&Math.abs(e[r-1]-i[o+1])<1e-9||e.push(i[o],i[o+1]);}let t=e.length;return t>=4&&Math.abs(e[0]-e[t-2])<1e-9&&Math.abs(e[1]-e[t-1])<1e-9&&(e.length=t-2),e}function Ro(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}function ai(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function wh(i){let e=[];for(let t=0;t+1<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&Math.abs(e[n-2]-o)<1e-6&&Math.abs(e[n-1]-r)<1e-6||e.push(o,r);}return e}function xh(i,e){let t=i*(e>0?e:.5),o=Math.ceil(Math.PI*t/1);return Math.max(2,Math.min(10,o))}function Vr(i,e,t,o,r,n){let a=e.length/2,s=c=>{let u=(c%a+a)%a;return [e[u*2],e[u*2+1]]},l=[];if(o)for(let c=0;c<a;c++)l.push(c);else for(let c=a-1;c>=0;c--)l.push(c);for(let c=0;c<l.length;c++){let u=l[c],f=c>0?l[c-1]:n?l[l.length-1]:-1,h=c+1<l.length?l[c+1]:n?l[0]:-1,[d,m]=s(u),b=t(u);if(!(b>0))continue;let p=f>=0?Ys(s(f),[d,m]):null,g=h>=0?Ys([d,m],s(h)):null;if(p&&g){let y=p[0]*g[1]-p[1]*g[0],w=1+(p[0]*g[0]+p[1]*g[1]),x=w>1e-6?b*Math.sqrt(2/w):1/0,_=Xs(s(f),[d,m]),M=Xs([d,m],s(h));y>0&&x<=b*2&&x<=Math.min(_,M)?i.push(d+(p[0]+g[0])*b/w,m+(p[1]+g[1])*b/w):si(i,d,m,b,p,g,r);}else g?si(i,d,m,b,[-g[1],g[0]],g,r):p&&si(i,d,m,b,p,[p[1],-p[0]],r);}}function Xs(i,e){return Math.hypot(e[0]-i[0],e[1]-i[1])}function Ys(i,e){let t=e[0]-i[0],o=e[1]-i[1],r=Math.hypot(t,o);return r>0?[-o/r,t/r]:null}function si(i,e,t,o,r,n,a){let s=Math.atan2(r[1],r[0]),l=Math.atan2(n[1],n[0])-s;for(;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;let c=Math.max(1,Math.min(a,Math.ceil(Math.abs(l)/Math.PI*a)));for(let u=0;u<=c;u++){let f=s+l*u/c;i.push(e+Math.cos(f)*o,t+Math.sin(f)*o);}}function Ks(i,e,t,o,r){let n=Ch(i);if(!n.length)return i;let a=[],s=[],l=i.length/2-1,c=[];for(let m=0;m<l;m++){a.push(i[m*2],i[m*2+1]),s.push(false),c.length=0;for(let b of n)b.i===m&&c.push({t:b.t,x:b.x,y:b.y}),b.j===m&&c.push({t:b.u,x:b.x,y:b.y});if(c.length){c.sort((b,p)=>b.t-p.t);for(let b of c)a.push(b.x,b.y),s.push(true);}}let u=s.length,f=s.indexOf(true);if(f<0)return i;let h=[],d=0;for(let m=1;m<=u;m++){let b=(f+m)%u;if(!s[b])continue;let p=m;if(!_h(a,f,d,p,u,e,t,o,r))for(let g=d;g<=p;g++){let y=(f+g)%u,v=a[y*2],w=a[y*2+1],x=h.length;x>=2&&Math.abs(h[x-2]-v)<1e-9&&Math.abs(h[x-1]-w)<1e-9||h.push(v,w);}d=p;}return h.length<6?i:(h.push(h[0],h[1]),h)}function _h(i,e,t,o,r,n,a,s,l){for(let c=t;c<=o;c++){let u=(e+c)%r;if(Mh(i[u*2],i[u*2+1],n,a,s,l))return true}return false}function Mh(i,e,t,o,r,n){let a=t.length/2-1,s=n*(1-.01),l=s*s,c=1/0,u=0,f=0;for(let g=0;g<a;g++){let y=t[g*2],v=t[g*2+1],w=t[g*2+2]-y,x=t[g*2+3]-v,_=w*w+x*x,M=_>0?Math.max(0,Math.min(1,((i-y)*w+(e-v)*x)/_)):0,S=i-(y+w*M),C=e-(v+x*M),k=S*S+C*C;if(k<l)return true;k<c&&(c=k,u=g,f=M);}if(!(c<1/0))return false;let h=t[u*2],d=t[u*2+1],m=t[u*2+2]-h,b=t[u*2+3]-d,p=r(o[u]+Math.hypot(m,b)*f)*(1-.01);return c<p*p}function Ch(i){let e=[],t=i.length/2-1;if(t<4)return e;let o=new Float64Array(t),r=new Float64Array(t),n=new Float64Array(t),a=new Float64Array(t),s=[];for(let l=0;l<t;l++){s.push(l);let c=i[l*2],u=i[l*2+2],f=i[l*2+1],h=i[l*2+3];o[l]=c<u?c:u,r[l]=c<u?u:c,n[l]=f<h?f:h,a[l]=f<h?h:f;}s.sort((l,c)=>o[l]-o[c]);for(let l=0;l<s.length;l++){let c=s[l];for(let u=l+1;u<s.length;u++){let f=s[u];if(o[f]>r[c])break;let h=Math.abs(c-f);if(h<2||h===t-1||n[f]>a[c]||n[c]>a[f])continue;let d=c<f?c:f,m=c<f?f:c,b=Sh(i[d*2],i[d*2+1],i[d*2+2],i[d*2+3],i[m*2],i[m*2+1],i[m*2+2],i[m*2+3]);b&&e.push({i:d,j:m,t:b[2],u:b[3],x:b[0],y:b[1]});}}return e}function Sh(i,e,t,o,r,n,a,s){let l=t-i,c=o-e,u=a-r,f=s-n,h=l*f-c*u;if(Math.abs(h)<1e-12)return null;let d=((r-i)*f-(n-e)*u)/h,m=((r-i)*c-(n-e)*l)/h;return d<=1e-9||d>=1-1e-9||m<=1e-9||m>=1-1e-9?null:[i+l*d,e+c*d,d,m]}var Th=5;function Ye(i){let e=i.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=i.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var $s=new WeakMap,Tt=(i,e)=>(i+512)*65536+(e+512);function Zs(i,e,t,o,r){if(i===0||e<=0)return e;let n=8*4294967296,a=Math.max(r.raw.get(t+n)??0,r.raw.get(o+n)??0);return a>0&&e>a?a:e}function Io(i){let e=$s.get(i);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width,a=typeof n=="number"&&n>.5&&n<100?n:0,s=Ye(r.properties);for(let l of r.loadGeometry()){if(l.length<4)continue;let c=Tt(Math.round(l[0]),Math.round(l[1])),u=Tt(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let f of [c,u]){let h=f+(s+8)*4294967296;t.ends.set(h,(t.ends.get(h)??0)+1),a>0&&t.raw.set(h,Math.max(t.raw.get(h)??0,a));}o.push({h:c,t:u,lv:s,w:a});}}for(let r of o){let n=Zs(r.lv,r.w,r.h,r.t,t);if(!(n<=0))for(let a of [r.h,r.t]){let s=t.width.get(a);(s===void 0||n>s)&&t.width.set(a,n);}}return $s.set(i,t),t}var Lo=12;function Po(i,e){let t=i.length/2,o=0;for(let d=0;d<t-1;d++)o+=Math.hypot(i[d*2+2]-i[d*2],i[d*2+3]-i[d*2+1]);let r=Tt(Math.round(i[0]),Math.round(i[1])),n=Tt(Math.round(i[t*2-2]),Math.round(i[t*2-1])),a=Zs(e.level,e.width,r,n,e.junctions),s=d=>Math.min(e.junctions.width.get(d)??0,a*2),l=s(r)-a,c=s(n)-a,u=Math.min(e.taper,o/2);if(!(u>0)||l<=0&&c<=0)return {width:a,at:null,total:o,knots:[]};let f=d=>{let m=0;return l>0&&d<u&&(m=l*(1-d/u)),c>0&&o-d<u&&(m=Math.max(m,c*(1-(o-d)/u))),a+m},h=[];for(let d of [u,o-u])d>.01&&d<o-.01&&h.push(d);return {width:a,at:f,total:o,knots:h}}function Qs(i,e){let t=[...e].sort((a,s)=>a-s);if(!t.length)return i;let o=[i[0],i[1]],r=0,n=0;for(let a=0;a+3<i.length;a+=2){let s=i[a],l=i[a+1],c=i[a+2],u=i[a+3],f=Math.hypot(c-s,u-l);for(;n<t.length&&t[n]<=r+.01;)n++;for(;n<t.length&&t[n]<r+f-.01;){let h=(t[n]-r)/f;o.push(s+(c-s)*h,l+(u-l)*h),n++;}r+=f,o.push(c,u);}return o}function li(i,e,t){let o=[];for(let l of i.features()){if(l.type!==2||!e(l.properties))continue;let c=t(l.properties);if(!c||!(c>0))continue;let u=l.properties.osm_id,f=typeof u=="number"?u:typeof u=="string"?Number(u):NaN,h=Number.isFinite(f)?f:Number(l.id??0),d=Ye(l.properties);for(let m of l.loadGeometry())m.length<4||o.push({pts:Array.from(m),props:l.properties,id:h,w:c,lv:d,used:false});}let r=new Map,n=(l,c)=>c?Tt(Math.round(l[l.length-2]),Math.round(l[l.length-1])):Tt(Math.round(l[0]),Math.round(l[1]));o.forEach((l,c)=>{for(let u of [false,true]){let f=n(l.pts,u),h=r.get(f);h?h.push({piece:c,tail:u}):r.set(f,[{piece:c,tail:u}]);}});let a=(l,c,u)=>{let f=r.get(l);if(!f||f.length!==2)return null;let h=f.filter(m=>!o[m.piece].used);if(h.length!==1)return null;let d=o[h[0].piece];return d.w===c&&d.lv===u?h[0]:null},s=[];for(let l=0;l<o.length;l++){let c=o[l];if(c.used)continue;c.used=true;let u=c.pts.slice(),f=[c.id];for(let h=0;h<256;h++){let d=a(n(u,true),c.w,c.lv);if(!d)break;let m=o[d.piece];m.used=true;let b=d.tail?qs(m.pts):m.pts;for(let p=2;p<b.length;p+=2)u.push(b[p],b[p+1]);f.push(m.id);}for(let h=0;h<256;h++){let d=a(n(u,false),c.w,c.lv);if(!d)break;let m=o[d.piece];m.used=true;let b=d.tail?m.pts:qs(m.pts),p=[];for(let g=0;g+3<b.length;g+=2)p.push(b[g],b[g+1]);u=p.concat(u),f.push(m.id);}s.push({pts:u,props:c.props,ids:f});}return s}function qs(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}var Nr=.25,kh="liftPath";function Js(i,e,t){if(typeof i!="string"||!i.length)return null;let o=Math.pow(2,e.z),r=[];for(let a of i.split("|")){let s=[],l=[],c=[];for(let u of a.split(";")){let f=u.split(",");if(f.length<3)continue;let h=Number(f[0]),d=Number(f[1]),m=Number(f[2]);!Number.isFinite(h)||!Number.isFinite(d)||!Number.isFinite(m)||(s.push((oe(h)*o-e.x)*t),l.push((re(d)*o-e.y)*t),c.push(m));}s.length>=2&&r.push({xs:s,ys:l,hs:c});}if(!r.length)return null;if(r.length===1)return Ah(r[0].xs,r[0].ys,r[0].hs);let n=r.map(a=>Eh(a.xs,a.ys,a.hs));return (a,s)=>{let l=1/0,c=0;for(let u of n){let f=u(a,s);f.d<l&&(l=f.d,c=f.h);}return c}}function Eh(i,e,t){let o=i.length,r=new Array(o-1);for(let n=0;n+1<o;n++){let a=i[n+1]-i[n],s=e[n+1]-e[n];r[n]=a*a+s*s;}return (n,a)=>{let s=1/0,l=t[0];for(let c=0;c+1<o;c++){let u=i[c+1]-i[c],f=e[c+1]-e[c],h=r[c]>1e-12?Math.max(0,Math.min(1,((n-i[c])*u+(a-e[c])*f)/r[c])):0,d=i[c]+u*h,m=e[c]+f*h,b=(n-d)*(n-d)+(a-m)*(a-m);b<s&&(s=b,l=t[c]+(t[c+1]-t[c])*h);}return {d:s,h:l}}}function Ah(i,e,t){let o=i.length,r=new Array(o-1);for(let n=0;n+1<o;n++){let a=i[n+1]-i[n],s=e[n+1]-e[n];r[n]=a*a+s*s;}return (n,a)=>{let s=1/0,l=t[0];for(let c=0;c+1<o;c++){let u=i[c+1]-i[c],f=e[c+1]-e[c],h=r[c]>1e-12?Math.max(0,Math.min(1,((n-i[c])*u+(a-e[c])*f)/r[c])):0,d=i[c]+u*h,m=e[c]+f*h,b=(n-d)*(n-d)+(a-m)*(a-m);b<s&&(s=b,l=t[c]+(t[c+1]-t[c])*h);}return l}}function ci(i,e){let t=new Map;return o=>{if(!i)return null;let r=o[kh];if(typeof r!="string"||!r.length)return null;let n=t.get(r);if(n!==void 0)return n;let a=Js(r,i,e);return t.set(r,a),a}}var el=Rh__namespace,Fo=el.union??el.default?.union??null;Fo||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");var Gr=0,Ur=0;function ol(i){for(let e of i)if(e.length>=2){Gr=Math.round(e[0]),Ur=Math.round(e[1]);return}Gr=0,Ur=0;}function jr(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t]-Gr,i[t+1]-Ur]);return e}function Xr(i){let e=[];for(let o of i)e.push(o[0]+Gr,o[1]+Ur);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 Yr(i){if(!Fo)return [i];ol([i.outer]);let e=[jr(i.outer),...i.holes.map(jr)],t;try{t=Fo(e);}catch{return [i]}let o=[];for(let r of t??[])r?.length&&o.push({outer:Xr(r[0]),holes:r.slice(1).map(Xr),lift:i.lift,at:i.at});return o.length?o:[i]}function eo(i,e,t=0){if(i.length<2)return i;let o=new Map;for(let n of i){let a=n.at?n:n.lift??0,s=o.get(a);s?s.push(n):o.set(a,[n]);}let r=[];for(let[n,a]of o){if(a.length<2){r.push(...a);continue}let s=typeof n=="number"?n:0;r.push(...Ih(a,s,e,t));}return r}var ui=256;function Ih(i,e,t,o=0){let r=i,n=o>0&&t?o:0;for(let a=0;a<32;a++){if(r.length<2)return r;if(r.length<=ui)return tl(r,e,t,n);let s=Lh(r),l=[];for(let c=0;c<s.length;c+=ui)l.push(...tl(s.slice(c,c+ui),e,t,n));if(n=0,l.length>=r.length)return l;r=l;}return r}function Lh(i){let e=1/0,t=1/0,o=-1/0,r=-1/0,n=i.map(c=>{let u=0,f=0,h=0;for(let b=0;b+1<c.outer.length;b+=2)u+=c.outer[b],f+=c.outer[b+1],h++;let d=h?u/h:0,m=h?f/h:0;return d<e&&(e=d),d>o&&(o=d),m<t&&(t=m),m>r&&(r=m),{s:c,cx:d,cy:m}}),a=o-e||1,s=r-t||1,l=c=>{let u=Math.max(0,Math.min(65535,Math.round(c*65535)));return u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,u};return n.map(c=>({s:c.s,key:l((c.cx-e)/a)|l((c.cy-t)/s)<<1})).sort((c,u)=>c.key-u.key).map(c=>c.s)}function tl(i,e,t,o=0){{let r=[],n=o>0&&t?i.map(c=>({outer:t(c.outer,-o)??c.outer,holes:c.holes.map(u=>t(u,o)??u)})):i;ol(n.map(c=>c.outer));let a=n.map(c=>[jr(c.outer),...c.holes.map(jr)]),s;try{if(!Fo)throw new Error("\u043D\u0435\u0442 union");s=Fo(a[0],...a.slice(1));}catch{return i}let l=s;if(!Array.isArray(l)||l.length===0)return i;for(let c of l){if(!c.length)continue;let u=Xr(c[0]);if(u.length<8)continue;let f=[];for(let h=1;h<c.length;h++){let d=Xr(c[h]);d.length>=8&&f.push(d);}r.push(e?{outer:u,holes:f,lift:e}:{outer:u,holes:f});}return r}}var Fh=5,bt=16,cl=64,ul=0,zh=1,rl=2,Oh=3,zo=1,Hh=.6;function Dh(i,e,t,o){if(!e||!(e>0)||!(t>0))return [];let r=e/2/t,n=[];for(let a of i){let s=a.length>=8&&Math.abs(a[0]-a[a.length-2])<1e-6&&Math.abs(a[1]-a[a.length-1])<1e-6,l,c=a;if(o&&!s){let d=Array.from(a),m=Po(d,{junctions:o.junctions,width:o.width,level:o.level,taper:o.reach});if(m.at){let b=o.extra/2/t,p=m.at;l=g=>p(g)/2/t+b,m.knots.length&&(c=Qs(d,m.knots));}}let u=Jt(c,{halfWidth:r,metersPerUnit:t,closed:s,halfWidthAt:l});if(!u)continue;let f=u.outer,h=[];if(o&&!s){let d=a.length/2;for(let[m,b,p]of [[a[0],a[1],0],[a[d*2-2],a[d*2-1],-1]]){if(!Wh(o,m,b))continue;let g=p===0?0:Bh(c),y=l?l(g):r;h.push({x:m,y:b,r:y});}}n.push(h.length?{outer:f,holes:u.holes,caps:h}:{outer:f,holes:u.holes});}return n}function Bh(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=Math.hypot(i[t+2]-i[t],i[t+3]-i[t+1]);return e}function Wh(i,e,t){let o=Tt(Math.round(e),Math.round(t))+(i.level+8)*4294967296;return (i.junctions.ends.get(o)??0)>1}function pi(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,s=Math.max(o.bevel??0,0)/r,l=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,u=Math.max(512,i.length*24),f=new ArrayBuffer(u*bt),h={view:new DataView(f),bytes:new Uint8Array(f),offset:0,count:0,indices:[],extent:e,ensure(E){if(h.count+E<=u)return;u=Math.max(u*2,h.count+E);let F=new ArrayBuffer(u*bt);new Uint8Array(F).set(h.bytes.subarray(0,h.offset)),f=F,h.view=new DataView(F),h.bytes=new Uint8Array(F);}},d=o.widthOf?Io(i):null,m=Math.max(o.widthExtra??0,0),b=Lo/r,p=E=>{if(!d)return;let F=o.widthOf(E);if(!(!F||!(F>0)))return {junctions:d,width:Math.max(F-m,0),extra:m,level:Ye(E),reach:b}},g=[],y=[],v=new Map,w=o.widthOf?li(i,E=>we(t,E),o.widthOf):null,x=w?w.map(E=>({geometry:[E.pts],props:E.props,ids:E.ids})):[];if(!w)for(let E of i.features()){if(E.type!==3||!we(t,E.properties))continue;let F=E.properties.osm_id,B=typeof F=="number"?F:typeof F=="string"?Number(F):NaN;x.push({geometry:E.loadGeometry(),props:E.properties,ids:[Number.isFinite(B)?B:Number(E.id??0)]});}for(let E of x){let F=w!==null,B=o.liftAt?.(E.props)??null,O=B?0:o.liftBy?.(E.props)??0,W=E.ids;for(let V of F?Dh(E.geometry,o.widthOf(E.props),r,p(E.props)):Ot(E.geometry)){let j=mt(V,e,ze(e));if(!j)continue;let G=V.caps;g.push({...j,...O?{lift:O}:{},...B?{at:B}:{},...G?{caps:G}:{}}),y.push(W);}}let _=new Set,M=Math.max(o.weld??Hh,0),S=o.widthOf?g:eo(g,(E,F)=>hi(E,F,e,_),M/r),C=M>0?S.map(E=>({...E,outer:ll(E.outer,M/r,e),holes:E.holes.map(F=>ll(F,M/r,e))})):S;for(let E of C){il(E.outer,v);for(let F of E.holes)il(F,v);}o.onShapes?.(C);let k=Vh(C,g,y),T=new Set;for(let[E,F]of v)F>1&&T.add(E);if(C.some(E=>E.at)||new Set(C.map(E=>E.lift??0)).size>1){let E=(F,B,O)=>{let W=C[F];return (W.lift??0)+(W.at?W.at(B,O):0)};Uh(C,(F,B,O)=>n+E(F,B,O),E,T);}for(let E of C){let F=E.caps;if(F)for(let B of F)Xh(E.outer,B,T);}let L=[],A={radius:c,segments:o.cornerSegments,extent:e,margin:ze(e),minCutRatio:0,maxChord:Ts/r},R=[];for(let E of C){let F=h.indices.length,B=L.length,O=c>0?{outer:He(E.outer,{...A,keep:al(E.outer,T)}),holes:E.holes.map(Z=>He(Z,{...A,keep:al(Z,T)}))}:E,W=s>0?hi(O.outer,s,e,T):O.outer,V=O.holes.map(Z=>s>0?hi(Z,-s,e,T):Z),j=E.lift??0,G=E.at,ee=n+j,le=Math.max(o.deck??0,0),K=a+j-(j>0||G?le:0),U=G?Math.min(o.maxSegment||1/0,Fh/r):o.maxSegment??0;sl(h,W??O.outer,V.map((Z,se)=>Z??O.holes[se]),ee,ul,U,G);let ne=ee,te=ee-l;W&&s>0&&l>0&&fi(h,W,O.outer,ne,te,zh,e,T,G),(te!==K||G)&&fi(h,O.outer,O.outer,te,K,rl,e,T,G);for(let Z of O.holes)if((te!==K||G)&&fi(h,Z,Z,te,K,rl,e,T,G),ee<K){let se=h.indices.length;sl(h,Z,[],K,Oh,0,G);for(let me=se;me<h.indices.length;me++)L.push(h.indices[me]);h.indices.length=se;}R.push(F,h.indices.length,B,L.length);}if(!h.indices.length&&!L.length)return null;let I=h.indices.length;for(let E=0;E<R.length;E+=4)R[E+2]+=I,R[E+3]+=I;let H=[];for(let E of k){H.push(E.length);for(let F of E)H.push(F);}let z=new Uint32Array(I+L.length);return z.set(h.indices,0),z.set(L,I),{vertices:f.slice(0,h.offset),indices:z.buffer,vertexCount:h.count,indexCount:z.length,extent:e,capIndexOffset:I,shapeFeatures:new Float64Array(H).buffer,shapeRanges:new Uint32Array(R).buffer}}function Vh(i,e,t){let o=i.map(()=>[]);if(!i.length)return o;let r=i.map(n=>nl(n.outer));for(let n=0;n<e.length;n++){let a=Nh(e[n].outer);if(!a)continue;let s=-1;for(let l=0;l<i.length;l++){let c=r[l];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!Ho(i[l].outer,a[0],a[1]))continue;let u=false;for(let f of i[l].holes)if(Ho(f,a[0],a[1])){u=true;break}if(!u){s=l;break}}if(s<0){let l=nl(e[n].outer),c=0;for(let u=0;u<i.length;u++){let f=r[u],h=Math.min(l[2],f[2])-Math.max(l[0],f[0]),d=Math.min(l[3],f[3])-Math.max(l[1],f[1]),m=h>0&&d>0?h*d:0;m>c&&(c=m,s=u);}}s<0&&(s=0);for(let l of t[n])o[s].includes(l)||o[s].push(l);}return o}function nl(i){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let n=0;n<i.length;n+=2)i[n]<e&&(e=i[n]),i[n]>o&&(o=i[n]),i[n+1]<t&&(t=i[n+1]),i[n+1]>r&&(r=i[n+1]);return [e,t,o,r]}function Nh(i){let e=i.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let n=(r+1)%e;t+=i[r*2]*i[n*2+1]-i[n*2]*i[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let n=(r+e-1)%e*2,a=r*2,s=(r+1)%e*2,l=(i[a]-i[n])*(i[s+1]-i[n+1])-(i[a+1]-i[n+1])*(i[s]-i[n]);if(l===0||l>0!==o)continue;let c=(i[n]+i[a]+i[s])/3,u=(i[n+1]+i[a+1]+i[s+1])/3;if(Ho(i,c,u))return [c,u]}return null}function Ho(i,e,t){let o=false,r=i.length/2-1;for(let n=0,a=r-1;n<r;a=n++){let s=i[n*2],l=i[n*2+1],c=i[a*2],u=i[a*2+1];l>t!=u>t&&e<(c-s)*(t-l)/(u-l)+s&&(o=!o);}return o}var Gh=Nr;function Uh(i,e,t,o){if(i.length<2)return;let r=i.map(a=>{let s=1/0,l=1/0,c=-1/0,u=-1/0;for(let f=0;f<a.outer.length;f+=2)a.outer[f]<s&&(s=a.outer[f]),a.outer[f]>c&&(c=a.outer[f]),a.outer[f+1]<l&&(l=a.outer[f+1]),a.outer[f+1]>u&&(u=a.outer[f+1]);return {minX:s,minY:l,maxX:c,maxY:u}}),n=(a,s,l)=>{let c=r[a];if(s<c.minX||s>c.maxX||l<c.minY||l>c.maxY||!Ho(i[a].outer,s,l))return false;for(let u of i[a].holes)if(Ho(u,s,l))return false;return true};for(let a=0;a<i.length;a++)for(let s of [i[a].outer,...i[a].holes])for(let l=0;l+3<s.length;l+=2){let c=(s[l]+s[l+2])/2,u=(s[l+1]+s[l+3])/2;for(let f=0;f<i.length;f++)if(!(f===a||!n(f,c,u))&&!(t(a,c,u)<=Nr&&t(f,c,u)<=Nr)&&!(Math.abs(e(a,c,u)-e(f,c,u))>Gh)){o.add(kt(s[l],s[l+1],s[l+2],s[l+3]));break}}}function kt(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 il(i,e){for(let t=0;t+3<i.length;t+=2){let o=kt(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function al(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=kt(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=kt(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 Oo(i,e,t,o,r,n,a,s){let l=i.offset;return i.view.setFloat32(l,e,true),i.view.setFloat32(l+4,t,true),i.view.setInt16(l+8,jh(Math.round(o*cl)),true),i.view.setInt8(l+10,mi(Math.round(r*127))),i.view.setInt8(l+11,mi(Math.round(n*127))),i.view.setInt8(l+12,mi(Math.round(a*127))),i.bytes[l+13]=s,i.view.setInt8(l+14,e<=0?-zo:e>=i.extent?zo:0),i.view.setInt8(l+15,t<=0?-zo:t>=i.extent?zo:0),i.offset+=bt,i.count++}function sl(i,e,t,o,r=ul,n=0,a){let s=[],l=[];for(let h=0;h<e.length;h++)s.push(e[h]);for(let h of t){l.push(s.length/2);for(let d=0;d<h.length;d++)s.push(h[d]);}let c=Ds__default.default(s,l.length?l:void 0,2);if(!c.length)return;let u=c;if(n>0){let h=[];ni(s,c,0,n,h),u=h;}i.ensure(s.length/2);let f=i.count;for(let h=0;h<s.length;h+=2)Oo(i,s[h],s[h+1],a?o+a(s[h],s[h+1]):o,0,0,1,r);for(let h=0;h<u.length;h+=3)i.indices.push(f+u[h],f+u[h+2],f+u[h+1]);}function fi(i,e,t,o,r,n,a,s,l,c){let u=Math.min(e.length,t.length)/2;if(!(u<3)){i.ensure((u-1)*4);for(let f=0;f<u-1;f++){let h=t[f*2],d=t[f*2+1],m=t[f*2+2],b=t[f*2+3];if(h===m&&d===b||Wr(h,d,m,b,a,ze(a))||s.has(kt(h,d,m,b)))continue;let p=m-h,g=b-d,y=Math.hypot(p,g)||1,v=g/y,w=-p/y,x=o-r,_=Math.hypot(e[f*2]-h,e[f*2+1]-d)||0,M=0;if(_>1e-6&&x!==0){let H=1/Math.hypot(1,x/_);M=_/Math.hypot(_,x)*Math.sign(x),v*=H,w*=H;}let S=l?l(e[f*2],e[f*2+1]):0,C=l?l(e[f*2+2],e[f*2+3]):0,k=l,T=k?k(h,d):0,P=k?k(m,b):0,L=Oo(i,e[f*2],e[f*2+1],o+S,v,w,M,n),A=Oo(i,e[f*2+2],e[f*2+3],o+C,v,w,M,n),R=Oo(i,h,d,r+T,v,w,M,n),I=Oo(i,m,b,r+P,v,w,M,n);i.indices.push(R,A,I,R,L,A);}}}function hi(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let u=0;u<r;u++){let f=i[u*2],h=i[u*2+1],d=i[(u+r-1)%r*2],m=i[(u+r-1)%r*2+1],b=i[(u+1)%r*2],p=i[(u+1)%r*2+1],g=Math.hypot(f-d,h-m)||1,y=Math.hypot(b-f,p-h)||1,v=(h-m)/g,w=-(f-d)/g,x=(p-h)/y,_=-(b-f)/y,M=v+x,S=w+_,C=Math.hypot(M,S);if(C<1e-6){n.push(f,h);continue}M/=C,S/=C;let k=Math.min(1/Math.max(M*v+S*w,.35),3),T=f-M*e*k,P=h-S*e*k,L=kt(d,m,f,h),A=kt(f,h,b,p);if(o.has(L)||o.has(A)){n.push(f,h);continue}let R=-ze(t),I=t+ze(t);((z,E)=>z<=R||z>=I||E<=R||E>=I)(f,h)&&(T=f,P=h),n.push(T,P);}n.push(n[0],n[1]);let a=Math.abs(di(i)),s=di(n);if(Math.sign(s)!==Math.sign(di(i))||Math.abs(s)<a*.25)return null;let l=-ze(t),c=t+ze(t);for(let u=0;u<n.length;u+=2)n[u]=Math.max(l,Math.min(c,n[u])),n[u+1]=Math.max(l,Math.min(c,n[u+1]));return n}function di(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 mi=i=>i>127?127:i<-127?-127:i,jh=i=>i>32767?32767:i<-32768?-32768:i;function ll(i,e,t){if(!(e>0))return i;let o=ze(t),r=-o,n=t+o,a=i;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),u=l;for(let h=0;h<l&&!(u<=5);h++){let d=a[h*2],m=a[h*2+1];if(d<=r||d>=n||m<=r||m>=n)continue;let b=(h+l-1)%l;for(;!c[b]&&b!==h;)b=(b+l-1)%l;let p=(h+1)%l;for(;!c[p]&&p!==h;)p=(p+1)%l;if(b===h||p===h)break;let g=a[b*2],y=a[b*2+1],v=a[p*2]-g,w=a[p*2+1]-y,x=Math.hypot(v,w);x<1e-6||Math.abs((d-g)*w-(m-y)*v)/x<e&&(c[h]=false,u--);}if(u===l)break;let f=[];for(let h=0;h<l;h++)c[h]&&f.push(a[h*2],a[h*2+1]);f.push(f[0],f[1]),a=f;}return a}function Xh(i,e,t){let o=e.r*.8,r=e.r*1.2,n=(a,s)=>{let l=Math.hypot(a-e.x,s-e.y);return l>=o&&l<=r};for(let a=0;a+3<i.length;a+=2)!n(i[a],i[a+1])||!n(i[a+2],i[a+3])||t.add(kt(i[a],i[a+1],i[a+2],i[a+3]));}var Et=8;function hl(i){return i?Qe(i.color)||Qe(i.opacity)||Qe(i.width):false}var $r=class{constructor(e,t){this.spec=e;this.zoom=t;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*Et),this.view=new DataView(this.buffer),this.base=e.base!==void 0?Fe(e.base,t,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0);}setFeature(e,t,o){let r={zoom:this.zoom,properties:e,id:t,geometryType:o},n=this.spec.color!==void 0?Eo(this.spec.color,r):null,[a,s,l,c]=n??this.base,u=this.spec.opacity!==void 0?fl(St(this.spec.opacity,r),1):1;this.r=Kr(a),this.g=Kr(s),this.b=Kr(l),this.a=Kr(c*u),this.width=this.spec.width!==void 0?Math.max(fl(St(this.spec.width,r),0),0):0;}advanceTo(e){if(!(e<=this.filled)){this.ensure(e);for(let t=this.filled;t<e;t++){let o=t*Et;this.view.setUint8(o,Math.round(this.r*255)),this.view.setUint8(o+1,Math.round(this.g*255)),this.view.setUint8(o+2,Math.round(this.b*255)),this.view.setUint8(o+3,Math.round(this.a*255)),this.view.setFloat32(o+4,this.width,true);}this.filled=e;}}take(e){return this.advanceTo(e),this.buffer.slice(0,e*Et)}ensure(e){if(e<=this.capacity)return;this.capacity=Math.max(this.capacity*2,e);let t=new ArrayBuffer(this.capacity*Et);new Uint8Array(t).set(new Uint8Array(this.buffer,0,this.filled*Et)),this.buffer=t,this.view=new DataView(t);}};function Do(i,e){return hl(i)?new $r(i,e):void 0}var Kr=i=>i<0?0:i>1?1:i;function fl(i,e){let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e}var Yh=100;function bi(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function gi(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,s=1/0,l=-1/0,c=-1/0;for(let u=0;u<n.length;u+=2)n[u]<a&&(a=n[u]),n[u]>l&&(l=n[u]),n[u+1]<s&&(s=n[u+1]),n[u+1]>c&&(c=n[u+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}i.cells=[];}}function Kh(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=to(Math.floor(o.minX/e)),n=to(Math.floor(o.maxX/e)),a=to(Math.floor(o.minY/e)),s=to(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=n;c++)i.cells[l*32+c].push(t);}}var ml=i=>i.shapes.length===0;function qr(i,e,t){!i.cells.length&&i.shapes.length&&Kh(i);let o=i.extent/32,r=i.cells[to(Math.floor(t/o))*32+to(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let s=i.shapes[a];if(s.level<=n||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!dl(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(dl(c,e,t)){l=true;break}l||(n=s.level);}return Math.min(Math.round(n*100),127)}function yi(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=qr(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let s=0;s+3<e.length;s+=2){let l=e[s],c=e[s+1],u=e[s+2],f=e[s+3],h=qr(i,u,f);if(h!==a&&n>0){let d=Math.hypot(u-l,f-c),m=Math.min(Math.ceil(d/n),64),b=a;for(let p=1;p<m;p++){let g=p/m,y=l+(u-l)*g,v=c+(f-c)*g,w=qr(i,y,v);w!==b&&(t.push(y,v),o.push(w),b=w);}}t.push(u,f),o.push(h),a=h;}return {pts:t,levels:o}}var to=i=>i<0?0:i>31?31:i;function dl(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let s=i[n*2],l=i[n*2+1],c=i[a*2],u=i[a*2+1];l>t!=u>t&&e<(c-s)*(t-l)/(u-l)+s&&(o=!o);}return o}var Ve=24;function vi(i,e,t=0,o,r=0,n={}){let{level:a,paint:s}=n,l=Math.max(256,i.length*24),c=new ArrayBuffer(l*Ve),u=new DataView(c),f=0,h=[],d=[],m=_=>{if(f+_<=l)return;l=Math.max(l*2,f+_);let M=new ArrayBuffer(l*Ve);new Uint8Array(M).set(new Uint8Array(c,0,f*Ve)),c=M,u=new DataView(M);},b=(_,M,S,C,k,T,P,L=0,A=0,R=0,I=0,H=0)=>{let z=f*Ve;return u.setInt16(z,_,true),u.setInt16(z+2,M,true),u.setInt16(z+4,S,true),u.setInt16(z+6,C,true),u.setInt8(z+8,k),u.setInt8(z+9,T),u.setInt8(z+10,L),u.setInt8(z+11,A),u.setFloat32(z+12,P,true),u.setFloat32(z+16,R,true),u.setInt16(z+20,I,true),u.setInt16(z+22,H,true),f++},p=0,g=0,y=r>0?Lo/r:0,v=y>0?Io(i):null;for(let _ of i.features()){if(_.type!==2&&_.type!==3||!we(e,_.properties)||a!==void 0&&Ye(_.properties)!==a)continue;let M=_.properties.osm_id,S=typeof M=="number"?M:typeof M=="string"?Number(M):NaN;g=Number.isFinite(S)?S:Number(_.id??0);let C=_.properties.width;p=typeof C=="number"&&C>.5&&C<100?C:0;let k=n.liftAt?.(_.properties)??null;s?.setFeature(_.properties,_.id??null,_.type===3?"Polygon":"LineString");let T=_.type===3;for(let P of _.loadGeometry()){let L=t>0?qh(bl(P),t):bl(P);if(L.length<4)continue;let A=o&&!ml(o)?yi(o,L):null,R=A?A.pts:L,I=A?.levels,H=R.length/2;if(H<2)continue;let z=Ye(_.properties),E=null,F=p;if(v&&p>0&&!T){let O=Po(R,{junctions:v,width:p,level:z,taper:y});if(F=O.width,O.at){E=O.at;let W=O.knots;if(W.length){let V=$h(R,I,W);R=V.pts,I=V.levels,H=R.length/2;}}}m((H-1)*4);let B=0;for(let O=0;O<H-1;O++){let W=R[O*2],V=R[O*2+1],j=R[O*2+2],G=R[O*2+3],ee=Math.hypot(j-W,G-V);if(T&&Qh(W,V,j,G,i.extent)){B+=ee;continue}let le=Zh(W,V,j,G,i.extent);if(!le){B+=ee;continue}let[K,U,ne,te]=le,Z=Math.hypot(K-W,U-V),se=Math.hypot(ne-K,te-U),me=Math.hypot(j-ne,G-te),ge=B+Z,Ce=I?I[O]:0,Se=I?I[O+1]:0,_e=k?pl(k(K,U)):0,Me=k?pl(k(ne,te)):0,Te=E?E(ge):F,Ne=E?E(ge+se):F,st=b(K,U,ne,te,0,-1,ge,Ce,Se,Te,_e,Me),lt=b(K,U,ne,te,0,1,ge,Ce,Se,Te,_e,Me),Be=b(K,U,ne,te,1,1,ge,Ce,Se,Ne,_e,Me),tt=b(K,U,ne,te,1,-1,ge,Ce,Se,Ne,_e,Me);B+=Z+se+me,h.push(st,lt,Be,st,Be,tt),d.push(g,g);}}s?.advanceTo(f);}if(!h.length)return null;let w=new Uint32Array(h),x=new Float64Array(d);return {vertices:c.slice(0,f*Ve),indices:w.buffer,vertexCount:f,indexCount:w.length,featureIds:x.buffer,...s?{dataPaint:s.take(f)}:{}}}function pl(i){return Math.max(-32768,Math.min(32767,Math.round(i*100)))}function $h(i,e,t){let o=[...t].sort((l,c)=>l-c),r=[i[0],i[1]],n=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<i.length;l+=2){let c=i[l],u=i[l+1],f=i[l+2],h=i[l+3],d=Math.hypot(f-c,h-u);for(;s<o.length&&o[s]<=a+.01;)s++;for(;s<o.length&&o[s]<a+d-.01;){let m=(o[s]-a)/d;r.push(c+(f-c)*m,u+(h-u)*m),n&&e&&n.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*m)),s++;}a+=d,r.push(f,h),n&&e&&n.push(e[l/2+1]);}return {pts:r,levels:n}}function qh(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],s=i[o+3];t.push(r,n);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-n)/e));for(let c=1;c<l;c++){let u=c/l;t.push(r+(a-r)*u,n+(s-n)*u);}}return t.push(i[i.length-2],i[i.length-1]),t}function bl(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 Zh(i,e,t,o,r){let n=t-i,a=o-e,s=0,l=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[u,f]of c){if(u===0){if(f<0)return null;continue}let h=f/u;if(u<0){if(h>l)return null;h>s&&(s=h);}else {if(h<s)return null;h<l&&(l=h);}}return l-s<1e-6?null:[Math.round(i+n*s),Math.round(e+a*s),Math.round(i+n*l),Math.round(e+a*l)]}function Qh(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}function wi(i,e=0){if(!i.length)return null;for(let r of i)if(!r.cut.some(Boolean))return [{outer:r.ring,holes:r.holes??[]}];if(i.length<2)return null;let t=eo(i.map(r=>({outer:r.ring,holes:r.holes??[]}))),o=e>0?t.filter(r=>gl(r.outer,e)):t;return o.length?e>0?o.map(r=>({outer:r.outer,holes:r.holes.filter(n=>gl(n,e))})):o:null}function gl(i,e){let t=0,o=0;for(let r=0;r+3<i.length;r+=2)t+=i[r]*i[r+3]-i[r+2]*i[r+1],o+=Math.hypot(i[r+2]-i[r],i[r+3]-i[r+1]);return o<=0?false:Math.abs(t)/o>=e}var At=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}};var Zr=class{constructor(){this.meshes=new D;this.stitched=new ae;this.hiddenByTile=new D;this.changed=new ae;this.signature="";this.meshSig=new D;this.cache=new D;}update(e,t,o){let r=new D,n=0,a="";for(let[f,h]of e.loadedTiles()){if(h.id.z!==o.zoom)continue;let d=h.data?.seams;if(d?.length){a+=f+";",n=h.data?.buckets?.[t]?.extent??n;for(let m of d){let b=r.get(m.osmId);b?b.push({seam:m,tile:h.id}):r.set(m.osmId,[{seam:m,tile:h.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!n||!r.size){for(let f of this.meshes.keys())this.changed.add(f);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let s=new D,l=new D,c=new D,u=new ae;for(let[f,h]of r){u.add(f);let d=h.map(g=>g.tile.dataKey).sort().join(","),m=this.cache.get(f);if(!m||m.sig!==d){let g=h[0].tile,y=h.map(({seam:x,tile:_})=>({ring:yl(x.outer,_,g,n),holes:x.holes.map(M=>yl(M,_,g,n)),cut:x.outerCut})),v=o.metersPerTile>0?.5*n/o.metersPerTile:0,w=wi(y,v);if(w?.length){let x=Jh(w,g,n);m={sig:d,shapes:w,owner:x,seam:h[0].seam,tiles:h.map(_=>_.tile.dataKey)},this.cache.set(f,m);}else if(!m)continue}let b=m.owner.dataKey;l.set(b,m.owner);let p=s.get(b)??[];for(let g of m.shapes)p.push({rings:{outer:g.outer,holes:g.holes},seam:m.seam});s.set(b,p),c.set(b,(c.get(b)??"")+f+":"+m.sig+";"),this.stitched.add(f);for(let g of [...m.tiles,...h.map(y=>y.tile.dataKey)]){let y=this.hiddenByTile.get(g);y?y.add(f):this.hiddenByTile.set(g,new Set([f]));}}for(let f of [...this.cache.keys()])u.has(f)||this.cache.delete(f);for(let[f,h]of s){let d=c.get(f);if(this.meshSig.get(f)===d&&this.meshes.has(f))continue;let m=Ns(h,n,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/n:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(f),m?(this.meshes.set(f,{tile:l.get(f),mesh:m}),this.meshSig.set(f,d)):(this.meshes.delete(f),this.meshSig.delete(f));}for(let f of [...this.meshes.keys()])s.has(f)||(this.meshes.delete(f),this.meshSig.delete(f),this.changed.add(f));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}};function Jh(i,e,t){let o=-1/0,r=-1/0;for(let c of i)for(let u=0;u<c.outer.length;u+=2)c.outer[u]>o&&(o=c.outer[u]),c.outer[u+1]>r&&(r=c.outer[u+1]);if(!Number.isFinite(o))return e;let n=Math.ceil(o/t)-1,a=Math.ceil(r/t)-1;if(n===0&&a===0)return e;let s=n*t,l=a*t;for(let c of i)for(let u of [c.outer,...c.holes])for(let f=0;f<u.length;f+=2)u[f]-=s,u[f+1]-=l;return new At(e.z,e.x+n,e.y+a,e.wrap)}function yl(i,e,t,o){let r=(e.x-t.x)*o,n=(e.y-t.y)*o,a=new Array(i.length);for(let s=0;s<i.length;s+=2)a[s]=i[s]+r,a[s+1]=i[s+1]+n;return a}var xi={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},_i={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var vl={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],elevation:.09,bevel:.12,bevelDrop:.09,paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"}},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"}},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#f2e7c8",material:"flat"}},{id:"landcover-ice",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#cfe0d4",material:"flat"}},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],elevation:.01,bevel:.08,bevelDrop:.01,paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],elevation:.02,bevel:.08,bevelDrop:.02,paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],elevation:.03,bevel:.08,bevelDrop:.03,paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],elevation:.07,bevel:.1,bevelDrop:.07,paint:{color:"#cfe3c4",material:"flat"}},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d6dfc8",material:"flat"}},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],elevation:.05,bevel:.1,bevelDrop:.05,paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",elevation:.08,bevel:.12,bevelDrop:.08,paint:{color:"#cfe5bd",opacity:.75,material:"flat"}},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],elevation:.04,bevel:.1,bevelDrop:.04,paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],elevation:-0.22,bevel:.6,paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],elevation:-0.12,bevel:.3,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:"flat"}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:16,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.9,deck:.5,elevation:.11,bevel:.12,bevelDrop:.11,weld:.6,paint:{color:{from:"road-casing-minor",darken:.07},sideShade:.24}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:16.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.16,bevel:.08,bevelDrop:.16,weld:.4,paint:{color:{from:"road-path"},sideShade:.2}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,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",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{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,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",elevation:.12,bevel:.04,bevelDrop:.02,paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:"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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:"#57544e",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 wl={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",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:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat"},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",minzoom:7,"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:"flat"}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",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"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",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",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",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",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{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,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:"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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:"#57544e",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 xl={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",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:"#d3d0cb",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:"flat",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:"flat",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:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",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",minzoom:7,"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,weld:0,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:"flat",elevation:.08}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:15,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.8,deck:.5,elevation:.12,bevel:.14,bevelDrop:.12,weld:.6,paint:{color:"#c9c3b7",material:"flat",sideShade:.18}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:15.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.2,bevel:.09,bevelDrop:.2,weld:.4,paint:{color:"#ddd6c7",material:"flat",sideShade:.2}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",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:.22}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",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:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",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:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{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,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",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:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:"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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:"#57544e",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 _l={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5",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",minzoom:7,"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,weld:0,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-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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-casing",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:{from:"road-casing-minor"},width:{stops:[[14,2.8],[17,4],[19,6],[20,10],[21,18],[22,34]]},material:"flat",elevation:.011}},{id:"road-path",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},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",network:"roads",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",network:"roads",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",network:"roads",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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{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,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",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:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:"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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:"#57544e",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Ml={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444\u043D\u0430\u044F",background:"#dbd8d4",levelHeight:.5,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]}}},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]}}},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8"}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4"}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",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"}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8"}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill",minzoom:7,"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]]}}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},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:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},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",network:"roads",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",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3]}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"boundary",type:"line",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60,placementGroup:"background-labels"},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true,placementGroup:"background-labels"},paint:{color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true,placementGroup:"background-labels"},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{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,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",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,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,11],[18,13]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:"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,filter:["any",["!has","rank"],["<=","rank",10]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,11],[12,13],[16,15]]},maxLineChars:16,priority:90},paint:{color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:10.5,filter:["all",[">","rank",10],["<=","rank",13]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,11],[16,12.5]]},maxLineChars:16,priority:70},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:13.5,filter:[">","rank",13],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[13.5,10.5],[17,12]]},maxLineChars:16,priority:55},paint:{color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{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:"#57544e",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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},terrain:{url:"/tileserver/data/terrain/{z}/{x}/{y}.webp",type:"raster-dem",encoding:"mapbox",minzoom:0,maxzoom:10}},terrain:{source:"terrain",exaggeration:1,tint:{low:"#bcd6ea",mid:"#cde0ab",high:"#ffd24a",range:[600,4600],tint:.7,shade:.85}}};var Cl={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:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"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:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",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:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var Sl={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:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"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:"#545454",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:"#545454",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Tl={name:"\u0420\u203A\u0420\xB5\u0420\u0491\u0421\u040F\u0420\u0405\u0420\xB0\u0421\u040F",background:"#f5f3f0",light:{ambientColor:"#eaf6fb",ambientIntensity:.72,keyAzimuth:120,keyAltitude:45,keyColor:"#ffffff",keyIntensity:.36,fillAzimuth:300,fillAltitude:25,fillColor:"#cfe6f2",fillIntensity:.22},paint:{"landcover-wood":{color:"#b4ebb8"},"landcover-grass":{color:"#c2f0c3"},"landcover-sand":{color:"#f7efd6"},"landcover-ice":{color:"#eaf6fb"},"landcover-wetland":{color:"#d8eef0"},"landuse-residential":{color:"#ecf1fb"},"landuse-industrial":{color:"#eceef1"},"landuse-civic":{color:"#f6ecf9"},"landuse-sport":{color:"#c2f0c3"},"landuse-cemetery":{color:"#cdeccf"},"landuse-parking":{color:"#e6e7e9"},park:{color:"#c2f0c3"},"aeroway-area":{color:"#e6e9f2"},water:{color:"#90ddf6"},waterway:{color:"#90ddf6"},"aeroway-line":{color:"#f3f1ee"},"road-casing-major":{color:"#f0c24f"},"road-casing-secondary":{color:"#e8d7a4"},"road-casing-minor":{color:"#dbdbdd"},"road-rail":{color:"#c9c9cd"},"road-path":{color:"#ffffff",dashArray:null},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffecba"},"road-ramp":{color:"#ffe49a"},"road-major":{color:"#ffd86b"},boundary:{color:"#c9a7d8"},building:{color:"#d5e4ef",roofColor:"#e9f0f6",aoStrength:0,tintVariation:0,seamStrength:0,windowColor:"#8fbcd8",windowFrameColor:"#d5e4ef",windowVariation:.6,windowGlow:0,ice:1},housenumber:{color:"#6f7a88",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#626e7e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#90ddf6"},"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:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"},"road-bridge-outline":{opacity:0},"road-bridge-outline-thin":{opacity:0},"road-lane-divider-major":{opacity:0},"road-lane-divider-secondary":{opacity:0},"road-path-casing":{color:"#dbdbdd"},crossing:{sideColor:"#c9c9cd",sideShade:.45}},sky:{skyColor:"#a9d8ee",horizonColor:"#eef4f7",fogRange:[2.6,12],fogIntensity:.82,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.4}};var kl={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:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"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:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var El={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",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:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",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:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Al={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:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var Rl={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:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"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:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Il={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:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Ll={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:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var Pl={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:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Fl={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:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var zl={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:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ol={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:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Hl={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:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var Dl={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:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"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:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var Bl={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:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"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:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Wl={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:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Vl={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:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"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:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Nl={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:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"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:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Gl={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:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"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:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Ul={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:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var jl={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:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"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:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Xl={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:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"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:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Yl={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:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"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:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Kl={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:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"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:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var $l={"3d":El,cartoon:Al,cyberpunk:Rl,dawn:Il,dusk:Ll,earth:Pl,future:Fl,"glass-refined":zl,glass:Ol,"harmony-black":Hl,"harmony-blue":Dl,"harmony-green":Bl,lunar:Wl,matte:Vl,minimal:Nl,ocean:Gl,premium:Ul,realistic:jl,space:Xl,volcano:Yl,white:Kl};function Qr(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",ql="\u241F",at=(i,e)=>i+"\u241F"+String(e);var oo=class{constructor(e=Jr){this.splitValues={};this.spec=e,this.light={..._i,...e.light??{}},this.sky={...xi,...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 n=e.paint?.color;if(n&&typeof n=="object"&&"from"in n){let s=this.layers.find(u=>u.id===n.from)?.paint?.color,l=Fe(s,t,o),c=1-Math.min(Math.max(n.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return Fe(n,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.type==="line"&&t.network?{network:t.network}:{},...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.groundField===false?{groundField:false}:{},levelHeight:this.spec.levelHeight,...t.deck?{deck:t.deck}:{},...t.fromLines?{fromLines:true,width:t.width,widthExtra:t.widthExtra}:{}}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...Rd(t),...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:at(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}};function gt(i){if(i.type!=="fill"&&i.type!=="line"&&i.type!=="fill-extrusion")return null;let e=i.paint;if(!e)return null;let t=Qe(e.color)?e.color:void 0,o=Qe(e.opacity)?e.opacity:void 0,r=i.type==="line"&&Qe(e.width)?e.width:void 0;return t===void 0&&o===void 0&&r===void 0?null:(Br(t),Br(o),Br(r),{...t!==void 0?{color:t}:{},...o!==void 0?{opacity:o}:{},...r!==void 0?{width:r}:{},...t===void 0&&Id(e.color)?{base:e.color}:{}})}function Rd(i){let e=gt(i);return e?{dataPaint:e}:{}}function Id(i){return i===void 0?false:typeof i=="string"||Array.isArray(i)?true:typeof i=="object"&&i!==null&&"stops"in i}var Jr=vl,Ld=Ml,Pd=wl,Fd=xl,zd=_l;function Od(i,e,t){let o=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;if(typeof i!="string"||typeof e!="string")return i;let r=o.exec(i),n=o.exec(e);if(!r||!n)return i;let a=s=>{let l=Math.round(parseInt(r[s],16)*(1-t)+parseInt(n[s],16)*t);return Math.max(0,Math.min(255,l)).toString(16).padStart(2,"0")};return `#${a(1)}${a(2)}${a(3)}`}function en(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function Mi(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:en(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Ql=.93;function Hd(i){let e=i.paint?.building;return e?{...i,paint:{...i.paint,building:{...e,windowFrameColor:en(e.color,Ql)}}}:i}function Dd(i){let e=i.paint,t=e?.building;if(!e||!t)return i;let o=t.color;if(typeof o!="string")return i;let r={ice:t.ice,aoStrength:t.aoStrength,tintVariation:t.tintVariation,seamStrength:t.seamStrength,roofVariation:t.roofVariation,windowFrameColor:t.windowFrameColor,facadeDetail:0},n=Vd(i.background),a=(m,b)=>b<=1?en(m,b):Od(m,"#ffffff",b-1),s=o,l=a(o,n?1.05:.97),c=a(o,n?1.08:.96),u=a(c,n?1.18:1.1),f=a(o,n?.82:.94),h={...e};h["indoor-venue"]={...e["indoor-venue"]??{},...t},h["indoor-shell"]={...e["indoor-shell"]??{},color:f},h["indoor-wall"]={...e["indoor-wall"]??{},...r,color:c,roofColor:u},h["indoor-room"]={...e["indoor-room"]??{},...r,color:s},h["indoor-corridor"]={...e["indoor-corridor"]??{},...r,color:l},h["indoor-transportation"]={...e["indoor-transportation"]??{},...r,color:a(o,n?1.14:.93)};let d=Zl("indoor-room");for(let m of ["indoor-shop","indoor-food","indoor-wc","indoor-service"]){let b=e[m]??{},{roofColor:p,...g}={...b,...r},y=Zl(m);h[m]={...g,color:d&&y?Wd(s,d,y,Bd):s};}return {...i,paint:h}}var Bd=.85;function Zl(i){let e=Jr.layers.find(t=>t.id===i)?.paint;return typeof e?.color=="string"?e.color:void 0}function Wd(i,e,t,o){let r=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,n=r.exec(typeof i=="string"?i:""),a=r.exec(e),s=r.exec(t);if(!n||!a||!s)return i;let l=c=>{let u=Math.round(parseInt(n[c],16)+(parseInt(s[c],16)-parseInt(a[c],16))*o);return Math.max(0,Math.min(255,u)).toString(16).padStart(2,"0")};return `#${l(1)}${l(2)}${l(3)}`}function Vd(i){let e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(typeof i=="string"?i:"");if(!e)return false;let[t,o,r]=[1,2,3].map(n=>parseInt(e[n],16)/255);return .2126*t+.7152*o+.0722*r<.45}function Jl(i){let e=i.paint?.building;return e?{...i,paint:{...i.paint,building:{...e,ice:1,seamStrength:0,windowFrameColor:en(e.color,Ql)}}}:i}var ye={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Cl,mono:Sl,pale:kl,ice:Tl,...$l};ye["3d"]=Jl(ye["3d"]);ye.night=Jl(ye.night);ye.ice=Hd(ye.ice);ye["3d-tone"]=Mi(ye["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});ye["night-tone"]=Mi(ye.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});ye["ice-tone"]=Mi(ye.ice,"\u041B\u0435\u0434\u044F\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});for(let i of Object.keys(ye))ye[i]=Dd(ye[i]);function Bo(i,e=Jr){if(typeof i!="string")return Qr(e,i);if(i==="day")return e;let t=ye[i];return t?Qr(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(ye).join(", ")}`),e)}var Wo=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 ec(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 Vo=`
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
- `,Kt=`
71
+ `,No=`
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
- `,Xr=`
132
+ `,Ci=`
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
- `,Ra=`
241
+ `,tc=`
242
242
  uniform vec3 u_globe_sun; // \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u043E\u0441\u044F\u0445, \u0447\u0442\u043E \u0438 \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0448\u0430\u0440\u0430
243
243
  uniform vec2 u_globe_light; // x: \u0441\u0438\u043B\u0430 \u0441\u043E\u043B\u043D\u0435\u0447\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B, y: \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u0435 \u043A \u043A\u0440\u0430\u044E \u0434\u0438\u0441\u043A\u0430
244
244
 
@@ -266,8 +266,49 @@ float globeShade() {
266
266
  return sun * limb;
267
267
  }
268
268
 
269
- `,Kr=`
270
- ${Ra}
269
+ `,Bt=`
270
+ /**
271
+ * \u0412\u042B\u0421\u041E\u0422\u0410 \u0420\u0415\u041B\u042C\u0415\u0424\u0410 \u0412 \u0412\u0415\u0420\u0428\u0418\u041D\u0415.
272
+ *
273
+ * \u0422\u0430\u0439\u043B \u0432\u044B\u0441\u043E\u0442 \u043F\u0440\u0438\u0435\u0437\u0436\u0430\u0435\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u043E\u0439: \u0432\u044B\u0441\u043E\u0442\u0430 \u0440\u0430\u0437\u043B\u043E\u0436\u0435\u043D\u0430 \u043F\u043E \u043A\u0430\u043D\u0430\u043B\u0430\u043C (\u0441\u043C. \xABsource/dem.ts\xBB).
274
+ * \u0420\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u044B\u0432\u0430\u0435\u043C \u0435\u0451 \u0417\u0414\u0415\u0421\u042C, \u0430 \u043D\u0435 \u043D\u0430 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0435, \u043F\u043E \u0442\u043E\u0439 \u0436\u0435 \u043F\u0440\u0438\u0447\u0438\u043D\u0435, \u043F\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0442\u0430\u043A \u0434\u0435\u043B\u0430\u044E\u0442 MapLibre
275
+ * \u0438 Mapbox, \u2014 \u0432\u044B\u0431\u043E\u0440\u043A\u0430 \u043D\u0443\u0436\u043D\u0430 \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0432\u0435\u0440\u0448\u0438\u043D\u0435 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043A\u0430\u0434\u0440\u0430, \u0430 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u0430 \u0443\u0436\u0435 \u043B\u0435\u0436\u0438\u0442 \u0432 \u043F\u0430\u043C\u044F\u0442\u0438 GPU.
276
+ *
277
+ * \xABu_terrain_uv\xBB \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u0442 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0443 \u0442\u0430\u0439\u043B\u0430 \u043A\u0430\u0440\u0442\u044B \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0443 \u0432\u043D\u0443\u0442\u0440\u0438 \u0442\u0430\u0439\u043B\u0430 \u0432\u044B\u0441\u043E\u0442: \u0440\u0435\u043B\u044C\u0435\u0444 \u0441\u043E\u0431\u0440\u0430\u043D
278
+ * \u0434\u043E z10, \u043A\u0430\u0440\u0442\u0430 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u043D\u0430 z18\u201322, \u0438 \u043E\u0434\u0438\u043D \u0442\u0430\u0439\u043B \u0432\u044B\u0441\u043E\u0442 \u043D\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0442\u044B\u0441\u044F\u0447\u0438 \u043D\u0430\u0448\u0438\u0445.
279
+ *
280
+ * \u0421\u043C\u0435\u0441\u044C \u043F\u043E \u0447\u0435\u0442\u044B\u0440\u0451\u043C \u0441\u043E\u0441\u0435\u0434\u044F\u043C \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u0430: \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u2014 \u044F\u0447\u0435\u0439\u043A\u0430 30\u201360 \u043C, \u0438 \u043D\u0430 \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u043C \u0441\u043E\u0441\u0435\u0434\u0435
281
+ * \u0441\u043A\u043B\u043E\u043D \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u0432 \u043B\u0435\u0441\u0442\u043D\u0438\u0446\u0443 \u0441\u043E \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u044E \u0432 \u044D\u0442\u0430\u0436. \u041F\u043E\u043B\u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0441\u0434\u0432\u0438\u0433\u0430 \u2014 \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u043F\u0438\u043A\u0441\u0435\u043B\u044C
282
+ * \u043E\u043F\u0438\u0441\u044B\u0432\u0430\u0435\u0442 \u0426\u0415\u041D\u0422\u0420 \u0441\u0432\u043E\u0435\u0439 \u044F\u0447\u0435\u0439\u043A\u0438; \u0442\u0430 \u0436\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0451\u043D\u043D\u043E\u0441\u0442\u044C \u0432 \xABDemTile.heightAt\xBB, \u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u0438\u0442\u044C\u0441\u044F \u0438\u043C
283
+ * \u043D\u0435\u043B\u044C\u0437\u044F, \u0438\u043D\u0430\u0447\u0435 \u043F\u043E\u0434\u043F\u0438\u0441\u044C \u0441\u0442\u043E\u0438\u0442 \u043D\u0430 \u043E\u0434\u043D\u043E\u0439 \u0432\u044B\u0441\u043E\u0442\u0435, \u0430 \u0441\u043A\u043B\u043E\u043D \u043F\u043E\u0434 \u043D\u0435\u0439 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u0439.
284
+ */
285
+ uniform sampler2D u_terrain;
286
+ uniform vec4 u_terrain_uv; // sx, sy, tx, ty
287
+ uniform vec4 u_terrain_unpack; // R, G, B, \u0441\u0434\u0432\u0438\u0433
288
+ uniform float u_terrain_dim; // \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u0442\u0430\u0439\u043B\u0430 \u0432\u044B\u0441\u043E\u0442 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445
289
+ uniform float u_terrain_exaggeration;
290
+
291
+ float terrainSample(vec2 px) {
292
+ vec2 uv = (px + 0.5) / u_terrain_dim;
293
+ vec4 rgb = texture(u_terrain, uv) * 255.0;
294
+ return dot(rgb.rgb, u_terrain_unpack.rgb) - u_terrain_unpack.a;
295
+ }
296
+
297
+ /** \u0412\u044B\u0441\u043E\u0442\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u0434\u043B\u044F \u0442\u043E\u0447\u043A\u0438 \u0442\u0430\u0439\u043B\u0430, \u0437\u0430\u0434\u0430\u043D\u043D\u043E\u0439 \u0432 \u0434\u043E\u043B\u044F\u0445 0..1. */
298
+ float terrainHeight(vec2 unit) {
299
+ if (u_terrain_exaggeration == 0.0) return 0.0;
300
+ vec2 demUnit = clamp(unit, 0.0, 1.0) * u_terrain_uv.xy + u_terrain_uv.zw;
301
+ vec2 px = demUnit * u_terrain_dim - 0.5;
302
+ vec2 base = floor(px);
303
+ vec2 f = px - base;
304
+ float tl = terrainSample(base);
305
+ float tr = terrainSample(base + vec2(1.0, 0.0));
306
+ float bl = terrainSample(base + vec2(0.0, 1.0));
307
+ float br = terrainSample(base + vec2(1.0, 1.0));
308
+ return mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y) * u_terrain_exaggeration;
309
+ }
310
+ `,Si=`
311
+ ${tc}
271
312
  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
272
313
  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
273
314
  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
@@ -321,10 +362,10 @@ vec3 globeLocal(vec2 tilePos) {
321
362
 
322
363
  return mix(sphere, flat_pos, u_globe.y);
323
364
  }
324
- `,Fa=`#version 300 es
365
+ `,oc=`#version 300 es
325
366
  precision highp float;
326
367
 
327
- ${Ra}
368
+ ${tc}
328
369
 
329
370
  in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
330
371
 
@@ -352,7 +393,7 @@ void main() {
352
393
  g_globe_normal = n;
353
394
  v_shade = globeShade();
354
395
  }
355
- `,za=`#version 300 es
396
+ `,rc=`#version 300 es
356
397
  precision highp float;
357
398
 
358
399
  in float v_rim;
@@ -370,29 +411,45 @@ void main() {
370
411
  vec3 body = u_body_color * v_shade;
371
412
  fragColor = vec4(mix(body, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
372
413
  }
373
- `,Pa=`#version 300 es
414
+ `,nc=`#version 300 es
374
415
  precision highp float;
375
416
  in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
376
417
  uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
377
418
  void main() {
378
419
  gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
379
420
  }
380
- `,Ha=`#version 300 es
421
+ `,ic=`#version 300 es
381
422
  precision highp float;
382
423
  void main() {}
383
- `,Oa=`#version 300 es
424
+ `,ac=`#version 300 es
384
425
  precision highp float;
426
+
427
+ ${Bt}
428
+
385
429
  in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \xD7 8, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_POS_SCALE)
386
430
  in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 32, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_HEIGHT_SCALE)
387
431
  uniform mat4 u_matrix;
388
432
  uniform float u_height_scale;
433
+ uniform float u_extent;
389
434
  void main() {
390
- gl_Position = u_matrix * vec4(a_pos / 8.0, (a_height / 32.0) * u_height_scale, 1.0);
435
+ /*
436
+ * \u0414\u041E\u041C \u0411\u0420\u041E\u0421\u0410\u0415\u0422 \u0422\u0415\u041D\u042C \u0421 \u0422\u041E\u0419 \u0412\u042B\u0421\u041E\u0422\u042B, \u041D\u0410 \u041A\u041E\u0422\u041E\u0420\u041E\u0419 \u0421\u0422\u041E\u0418\u0422.
437
+ *
438
+ * \u0417\u0434\u0435\u0441\u044C \u0441\u0442\u0440\u043E\u0438\u0442\u0441\u044F \u043A\u0430\u0440\u0442\u0430 \u0442\u0435\u043D\u0435\u0439, \u0438 \u0432\u044B\u0441\u043E\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u043D\u0430 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0442\u044C \u0441 \u0442\u043E\u0439, \u043F\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0434\u043E\u043C \u0420\u0418\u0421\u0423\u0415\u0422\u0421\u042F
439
+ * (\u0441\u043C. BUILDINGS_VERT) \u2014 \u0432\u043F\u043B\u043E\u0442\u044C \u0434\u043E \u0446\u043E\u043A\u043E\u043B\u044F. \u0421\u0442\u043E\u044F\u043B\u043E \u043D\u043E\u043B\u044C: \u043D\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0435 \u0434\u043E\u043C \u0431\u0440\u043E\u0441\u0430\u043B \u0442\u0435\u043D\u044C \u0441 \u0443\u0440\u043E\u0432\u043D\u044F \u043C\u043E\u0440\u044F,
440
+ * \u0442\u043E \u0435\u0441\u0442\u044C \u043D\u0430 \u0441\u043E\u0442\u043D\u0438 \u043C\u0435\u0442\u0440\u043E\u0432 \u043D\u0438\u0436\u0435 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0433\u043E \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F, \u0438 \u0442\u0435\u043D\u0438 \u043D\u0430 \u043A\u0430\u0440\u0442\u0435 \u043D\u0435 \u0431\u044B\u043B\u043E \u0432\u043E\u0432\u0441\u0435.
441
+ */
442
+ vec2 pos = a_pos / 8.0;
443
+ const float BASEMENT = 12.0;
444
+ float ground = terrainHeight(pos / u_extent);
445
+ float wall = a_height / 32.0;
446
+ float h = wall > 0.0 ? (wall * u_height_scale + ground) : (ground - BASEMENT);
447
+ gl_Position = u_matrix * vec4(pos, h, 1.0);
391
448
  }
392
- `,Yr=`#version 300 es
449
+ `,Ti=`#version 300 es
393
450
  precision highp float;
394
451
  void main() {}
395
- `,Ba=`
452
+ `,sc=`
396
453
  uniform vec3 u_cam_ray; // x: \u043D\u0430\u043A\u043B\u043E\u043D \u043E\u0441\u0438 \u043A\u0430\u043C\u0435\u0440\u044B \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C (\u0440\u0430\u0434), y: \u0444\u043E\u043A\u0443\u0441 (\u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0431\u0443\u0444\u0435\u0440\u0430), z: Y \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0434\u0440\u0430 \u0441\u043D\u0438\u0437\u0443
397
454
  uniform float u_haze_exp; // \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C \u043F\u043E\u043B\u043E\u0441\u044B \u043C\u0433\u043B\u044B: \u0431\u043E\u043B\u044C\u0448\u0435 \u2014 \u0443\u0436\u0435 \u043F\u043E\u043B\u043E\u0441\u0430
398
455
 
@@ -411,14 +468,14 @@ float airMass(float sinE) {
411
468
  float hazeMix(float sinE) {
412
469
  return pow(clamp(1.0 - 1.0 / airMass(sinE), 0.0, 1.0), u_haze_exp);
413
470
  }
414
- `,$r=`
471
+ `,ki=`
415
472
  uniform vec4 u_tile_tint;
416
473
  vec4 tileTint(vec4 c) {
417
474
  if (u_tile_tint.a <= 0.0) return c;
418
475
  return vec4(mix(c.rgb, u_tile_tint.rgb * c.a, u_tile_tint.a), c.a);
419
476
  }
420
- `,rt=`
421
- ${Ba}
477
+ `,yt=`
478
+ ${sc}
422
479
  uniform vec3 u_fog_color;
423
480
  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
424
481
  /** \u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u044B\u043C\u043A\u0438 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0433\u0434\u0435 \u043E\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044E \u0438 \u0433\u0434\u0435 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0441\u043E\u0432\u0441\u0435\u043C. */
@@ -471,7 +528,7 @@ vec3 applyFog(vec3 color) {
471
528
  vec3 applyFogAt(vec3 color, float heightMeters) {
472
529
  return mix(color, u_fog_color, fogAmountAt(heightMeters));
473
530
  }
474
- `,Wa=`#version 300 es
531
+ `,lc=`#version 300 es
475
532
  precision highp float;
476
533
 
477
534
  in vec3 a_pos;
@@ -544,7 +601,7 @@ void main() {
544
601
  // \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.
545
602
  v_view = u_normal_matrix * (u_camera_model - a_pos);
546
603
  }
547
- `,Va=`#version 300 es
604
+ `,cc=`#version 300 es
548
605
  precision highp float;
549
606
 
550
607
  in vec3 a_pos;
@@ -608,12 +665,12 @@ void main() {
608
665
  v_nmodel = a_normal;
609
666
  v_view = n * (u_camera_model - a_pos);
610
667
  }
611
- `,qr=`#version 300 es
668
+ `,Ei=`#version 300 es
612
669
  precision highp float;
613
670
 
614
- ${Xt}
615
- ${Kt}
616
- ${rt}
671
+ ${Vo}
672
+ ${No}
673
+ ${yt}
617
674
 
618
675
  in vec3 v_normal;
619
676
  in vec2 v_tex;
@@ -892,14 +949,14 @@ void main() {
892
949
  float alpha = albedo.a * u_opacity;
893
950
  fragColor = vec4(applyFog(color) * alpha, alpha);
894
951
  }
895
- `,Da=`#version 300 es
952
+ `,uc=`#version 300 es
896
953
  precision highp float;
897
954
  in vec3 a_pos;
898
955
  uniform mat4 u_matrix;
899
956
  void main() {
900
957
  gl_Position = u_matrix * vec4(a_pos, 1.0);
901
958
  }
902
- `,Na=`#version 300 es
959
+ `,fc=`#version 300 es
903
960
  precision highp float;
904
961
  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
905
962
 
@@ -918,7 +975,7 @@ void main() {
918
975
  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);
919
976
  gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
920
977
  }
921
- `,Ga=`#version 300 es
978
+ `,hc=`#version 300 es
922
979
  precision highp float;
923
980
 
924
981
  in vec2 v_uv;
@@ -939,7 +996,7 @@ uniform vec3 u_cam_up;
939
996
  uniform vec3 u_cam_fwd;
940
997
  uniform vec2 u_cam_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0434\u0440\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0431\u0443\u0444\u0435\u0440\u0430
941
998
 
942
- ${Ba}
999
+ ${sc}
943
1000
 
944
1001
  // \u041A\u043E\u0441\u043C\u043E\u0441: \u0432\u043A\u043B\u044E\u0447\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435.
945
1002
  uniform vec3 u_space_color;
@@ -1063,7 +1120,35 @@ void main() {
1063
1120
 
1064
1121
  fragColor = vec4(sky * alpha, alpha);
1065
1122
  }
1066
- `,Ua=`#version 300 es
1123
+ `,dc=`#version 300 es
1124
+ precision highp float;
1125
+
1126
+ in vec2 a_pos; // \u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440 \u041E\u0422\u041D\u041E\u0421\u0418\u0422\u0415\u041B\u042C\u041D\u041E \u043D\u0430\u0447\u0430\u043B\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438
1127
+ in vec2 a_uv;
1128
+
1129
+ uniform mat4 u_matrix;
1130
+
1131
+ out vec2 v_uv;
1132
+
1133
+ void main() {
1134
+ v_uv = a_uv;
1135
+ gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1136
+ }
1137
+ `,mc=`#version 300 es
1138
+ precision highp float;
1139
+
1140
+ in vec2 v_uv;
1141
+
1142
+ uniform sampler2D u_image;
1143
+ uniform float u_opacity;
1144
+
1145
+ out vec4 fragColor;
1146
+
1147
+ void main() {
1148
+ // \u0422\u0435\u043A\u0441\u0442\u0443\u0440\u0430 \u0437\u0430\u043B\u0438\u0442\u0430 \u0441 \u043F\u0440\u0435\u0434\u0443\u043C\u043D\u043E\u0436\u0435\u043D\u0438\u0435\u043C \u0430\u043B\u044C\u0444\u044B \u2014 \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0438 \u0437\u0434\u0435\u0441\u044C \u043F\u0440\u043E\u0441\u0442\u043E \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u043C \u043D\u0430 \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C.
1149
+ fragColor = texture(u_image, v_uv) * u_opacity;
1150
+ }
1151
+ `,pc=`#version 300 es
1067
1152
  precision highp float;
1068
1153
 
1069
1154
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
@@ -1081,10 +1166,10 @@ void main() {
1081
1166
  v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
1082
1167
  gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1083
1168
  }
1084
- `,ja=`#version 300 es
1169
+ `,bc=`#version 300 es
1085
1170
  precision highp float;
1086
1171
 
1087
- ${rt}
1172
+ ${yt}
1088
1173
 
1089
1174
  in vec2 v_uv;
1090
1175
 
@@ -1099,22 +1184,33 @@ void main() {
1099
1184
  // \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.
1100
1185
  fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
1101
1186
  }
1102
- `,Xa=`#version 300 es
1187
+ `,gc=`#version 300 es
1103
1188
  precision highp float;
1189
+
1190
+ ${Bt}
1191
+
1104
1192
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
1105
1193
  uniform mat4 u_matrix;
1106
1194
  uniform mat4 u_shadow_matrix;
1107
1195
  out vec4 v_shadow;
1108
1196
  void main() {
1109
- vec4 local = vec4(a_pos, 0.0, 1.0);
1110
- gl_Position = u_matrix * local;
1111
- v_shadow = u_shadow_matrix * local;
1197
+ /*
1198
+ * \u0422\u0415\u041D\u042C \u0418\u0429\u0415\u0422\u0421\u042F \u041F\u041E \u041C\u0415\u0421\u0422\u0423 \u041D\u0410 \u0417\u0415\u041C\u041B\u0415, \u0410 \u0417\u0415\u041C\u041B\u042F \u041D\u0410 \u0420\u0415\u041B\u042C\u0415\u0424\u0415 \u041F\u041E\u0414\u041D\u042F\u0422\u0410.
1199
+ *
1200
+ * \u0412 \u043A\u0430\u0440\u0442\u0435 \u0442\u0435\u043D\u0435\u0439 \u0434\u043E\u043C \u0441\u0442\u043E\u0438\u0442 \u043D\u0430 \u0441\u043A\u043B\u043E\u043D\u0435, \u043D\u0430 \u0441\u0432\u043E\u0435\u0439 \u0432\u044B\u0441\u043E\u0442\u0435. \u0421\u043F\u0440\u043E\u0441\u0438 \u043C\u044B \u0442\u0435\u043D\u044C \u0434\u043B\u044F \u0442\u043E\u0439 \u0436\u0435 \u0442\u043E\u0447\u043A\u0438, \u043D\u043E \u043D\u0430
1201
+ * \u043D\u0443\u043B\u0435, \u2014 \u043F\u043E\u043F\u0430\u0434\u0451\u043C \u0432 \u0441\u043E\u0432\u0441\u0435\u043C \u0434\u0440\u0443\u0433\u043E\u0435 \u043C\u0435\u0441\u0442\u043E \u043A\u0430\u0440\u0442\u044B: \u043D\u0430 \u0441\u043A\u043B\u043E\u043D\u0435 \u043E\u0448\u0438\u0431\u043A\u0430 \u0440\u0430\u0432\u043D\u0430 \u0441\u0434\u0432\u0438\u0433\u0443 \u043B\u0443\u0447\u0430 \u0437\u0430 \u044D\u0442\u0438 \u0441\u043E\u0442\u043D\u0438
1202
+ * \u043C\u0435\u0442\u0440\u043E\u0432, \u0438 \u0442\u0435\u043D\u044C \u043F\u0440\u043E\u0441\u0442\u043E \u043D\u0435 \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432 \u043C\u0430\u0442\u0440\u0438\u0446\u0443 \u0442\u0435\u043D\u0438 \u0442\u043E\u0447\u043A\u0430 \u0443\u0445\u043E\u0434\u0438\u0442 \u0441 \u0432\u044B\u0441\u043E\u0442\u043E\u0439 \u0440\u0435\u043B\u044C\u0435\u0444\u0430,
1203
+ * \u0430 \u043D\u0430 \u044D\u043A\u0440\u0430\u043D (\u0432 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u0443 \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430) \u2014 \u043F\u043B\u043E\u0441\u043A\u043E\u0439, \u043A\u0430\u043A \u0438 \u0432\u0441\u044F \u0434\u0440\u0430\u043F\u0438\u0440\u043E\u0432\u043A\u0430.
1204
+ */
1205
+ float h = terrainHeight(a_pos);
1206
+ gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1207
+ v_shadow = u_shadow_matrix * vec4(a_pos, h, 1.0);
1112
1208
  }
1113
- `,Ka=`#version 300 es
1209
+ `,yc=`#version 300 es
1114
1210
  precision highp float;
1115
1211
 
1116
- ${Kt}
1117
- ${rt}
1212
+ ${No}
1213
+ ${yt}
1118
1214
 
1119
1215
  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
1120
1216
  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
@@ -1126,12 +1222,140 @@ void main() {
1126
1222
  float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
1127
1223
  fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
1128
1224
  }
1129
- `,Ya=`#version 300 es
1225
+ `,vc=`#version 300 es
1226
+ precision highp float;
1227
+
1228
+ ${Bt}
1229
+
1230
+ in vec2 a_pos; // \u0434\u043E\u043B\u0438 \u0442\u0430\u0439\u043B\u0430, 0..1
1231
+ in float a_skirt; // 1 \u2014 \u0432\u0435\u0440\u0448\u0438\u043D\u0430 \u044E\u0431\u043A\u0438 \u043F\u043E \u043A\u0440\u0430\u044E \u0442\u0430\u0439\u043B\u0430
1232
+
1233
+ uniform mat4 u_matrix;
1234
+ /**
1235
+ * \u041D\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u044E\u0431\u043A\u0430, \u043C\u0435\u0442\u0440\u044B.
1236
+ *
1237
+ * \u0421\u043E\u0441\u0435\u0434\u043D\u0438\u0435 \u0442\u0430\u0439\u043B\u044B \u0431\u0435\u0440\u0443\u0442 \u0432\u044B\u0441\u043E\u0442\u0443 \u0448\u0432\u0430 \u0438\u0437 \u0440\u0430\u0437\u043D\u044B\u0445 \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439 DEM \u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u043D\u0430 \u0434\u043E\u043B\u0438 \u043C\u0435\u0442\u0440\u0430 \u2014 \u0441\u043A\u0432\u043E\u0437\u044C \u0449\u0435\u043B\u044C
1238
+ * \u0432\u0438\u0434\u043D\u043E \u043D\u0435\u0431\u043E. \u042E\u0431\u043A\u0430 \u2014 \u043F\u043E\u043B\u043E\u0441\u0430 \u043F\u043E \u043A\u0440\u0430\u044E \u0442\u0430\u0439\u043B\u0430, \u043E\u043F\u0443\u0449\u0435\u043D\u043D\u0430\u044F \u0432\u043D\u0438\u0437: \u043E\u043D\u0430 \u044D\u0442\u0443 \u0449\u0435\u043B\u044C \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0438 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435
1239
+ * \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u043A \u0441\u0438\u043B\u0443\u044D\u0442\u0443, \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u043D\u0443\u0442\u0440\u044C \u0441\u043A\u043B\u043E\u043D\u0430. \u0422\u0430\u043A \u0436\u0435 \u0441\u0434\u0435\u043B\u0430\u043D\u043E \u0443 MapLibre.
1240
+ */
1241
+ uniform float u_skirt;
1242
+
1243
+ out vec2 v_uv;
1244
+
1245
+ void main() {
1246
+ float h = terrainHeight(a_pos) - a_skirt * u_skirt;
1247
+ v_uv = a_pos;
1248
+ gl_Position = u_matrix * vec4(a_pos, h, 1.0);
1249
+ }
1250
+ `,wc=`#version 300 es
1251
+ precision highp float;
1252
+
1253
+ ${Bt}
1254
+ ${yt}
1255
+
1256
+ uniform sampler2D u_texture;
1257
+ /** \u0422\u043E\u043D \u043D\u0438\u0437\u0438\u043D \u0438 \u0442\u043E\u043D \u0432\u0435\u0440\u0448\u0438\u043D: \u0433\u0438\u043F\u0441\u043E\u043C\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u043E\u043A\u0440\u0430\u0441\u043A\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0442\u0435\u043C\u044B, \u0430 \u043D\u0435 \u0438\u0437 \u0430\u0442\u043B\u0430\u0441\u0430 \u0446\u0432\u0435\u0442\u043E\u0432. */
1258
+ uniform vec3 u_relief_low;
1259
+ /** \u0422\u043E\u043D \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u044B \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0437\u0435\u043B\u0435\u043D\u044C \u0434\u043E\u043B\u0438\u043D \u043F\u0435\u0440\u0435\u0442\u0435\u043A\u0430\u043B\u0430 \u0431\u044B \u0432 \u0441\u043D\u0435\u0433 \u043D\u0430\u043F\u0440\u044F\u043C\u0443\u044E, \u043C\u0438\u043D\u0443\u044F \u0441\u043A\u043B\u043E\u043D\u044B. */
1260
+ uniform vec3 u_relief_mid;
1261
+ uniform vec3 u_relief_high;
1262
+ /** \u041E\u0442 \u043A\u0430\u043A\u043E\u0439 \u0432\u044B\u0441\u043E\u0442\u044B \u0434\u043E \u043A\u0430\u043A\u043E\u0439 \u0440\u0430\u0441\u0442\u044F\u043D\u0443\u0442 \u043F\u0435\u0440\u0435\u0445\u043E\u0434, \u043C\u0435\u0442\u0440\u044B. */
1263
+ uniform vec2 u_relief_range;
1264
+ /**
1265
+ * \u0421\u0438\u043B\u0430 \u043E\u043A\u0440\u0430\u0441\u043A\u0438, \u0441\u0438\u043B\u0430 \u0441\u0432\u0435\u0442\u043E\u0442\u0435\u043D\u0438 \u0438 \u043F\u0440\u0438\u0437\u043D\u0430\u043A \xAB\u043E\u043A\u0440\u0430\u0441\u043A\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u043A \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C\xBB, 0..1.
1266
+ *
1267
+ * \u0422\u0440\u0435\u0442\u044C\u044F \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0430 \u043D\u0443\u0436\u043D\u0430 \u0442\u0435\u043C\u0430\u043C, \u0433\u0434\u0435 \u043D\u0438\u0437\u0438\u043D\u044B \u0434\u043E\u043B\u0436\u043D\u044B \u043E\u0441\u0442\u0430\u0442\u044C\u0441\u044F \u0432 \u0446\u0432\u0435\u0442\u0430\u0445 \u0441\u0430\u043C\u043E\u0439 \u043A\u0430\u0440\u0442\u044B: \u0442\u043E\u043D \u0432\u044B\u0441\u043E\u0442\u044B
1268
+ * \u0442\u043E\u0433\u0434\u0430 \u043D\u0435 \u0437\u0430\u043B\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u043F\u043E\u043B\u043E\u0442\u043D\u043E, \u0430 \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u0435\u0442 \u0442\u0430\u043C, \u0433\u0434\u0435 \u0433\u043E\u0440\u044B \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0432\u044B\u0441\u043E\u043A\u0438\u0435.
1269
+ */
1270
+ uniform vec3 u_relief_mix;
1271
+ /** \u0421\u0442\u043E\u0440\u043E\u043D\u0430 \u0442\u0430\u0439\u043B\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u2014 \u043F\u043E \u043D\u0435\u0439 \u0441\u043A\u043B\u043E\u043D \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0432 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0445 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445, \u0430 \u043D\u0435 \u0432 \u0434\u043E\u043B\u044F\u0445 \u0442\u0430\u0439\u043B\u0430. */
1272
+ uniform float u_tile_meters;
1273
+ /** \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u0432\u0435\u0442: \u0438\u043C \u043E\u0442\u043C\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441\u043A\u043B\u043E\u043D. */
1274
+ uniform vec3 u_relief_light;
1275
+
1276
+ in vec2 v_uv;
1277
+ out vec4 fragColor;
1278
+
1279
+ void main() {
1280
+ // \u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u0442\u0430\u0439\u043B\u0430 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D\u0430 \u0432 \u043A\u0430\u0434\u0440\u043E\u0432\u044B\u0439 \u0431\u0443\u0444\u0435\u0440, \u0430 \u043E\u043D \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u043E\u043A\u0438 \u0441\u043D\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445 \u2014 \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u043C.
1281
+ vec4 map = texture(u_texture, vec2(v_uv.x, 1.0 - v_uv.y));
1282
+
1283
+ /*
1284
+ * \u0420\u0415\u041B\u042C\u0415\u0424 \u041D\u0410\u0414\u041E \u0412\u0418\u0414\u0415\u0422\u042C, \u0410 \u041D\u0415 \u0414\u041E\u0413\u0410\u0414\u042B\u0412\u0410\u0422\u042C\u0421\u042F \u041E \u041D\u0401\u041C.
1285
+ *
1286
+ * \u0421\u0432\u0435\u0440\u0445\u0443 \u043A\u0430\u0440\u0442\u0430 \u043F\u043E\u0447\u0442\u0438 \u043F\u043B\u043E\u0441\u043A\u0430\u044F: \u0441\u043A\u043B\u043E\u043D \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E \u0438\u0441\u043A\u0430\u0436\u0435\u043D\u0438\u044E \u0443\u043B\u0438\u0446, \u0430 \u043D\u0430 \u043E\u0431\u0437\u043E\u0440\u043D\u043E\u043C \u0437\u0443\u043C\u0435 \u0438 \u0442\u043E\u0433\u043E
1287
+ * \u043D\u0435\u0442. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u043A \u0434\u0440\u0430\u043F\u0438\u0440\u043E\u0432\u043A\u0435 \u043F\u043E\u0434\u043C\u0435\u0448\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u0434\u0432\u0435 \u0432\u0435\u0449\u0438, \u043E\u0431\u0435 \u2014 \u043A\u0430\u043A \u043D\u0430 \u0431\u0443\u043C\u0430\u0436\u043D\u044B\u0445 \u043A\u0430\u0440\u0442\u0430\u0445:
1288
+ * \u0433\u0438\u043F\u0441\u043E\u043C\u0435\u0442\u0440\u0438\u044F \u2014 \u0442\u043E\u043D \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435, \u043E\u0442 \u043D\u0438\u0437\u0438\u043D \u043A \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C;
1289
+ * \u043E\u0442\u043C\u044B\u0432\u043A\u0430 \u2014 \u0437\u0430\u0442\u0435\u043D\u0435\u043D\u0438\u0435 \u0441\u043A\u043B\u043E\u043D\u043E\u0432, \u043E\u0442\u0432\u0451\u0440\u043D\u0443\u0442\u044B\u0445 \u043E\u0442 \u0441\u0432\u0435\u0442\u0430.
1290
+ * \u041E\u0431\u0430 \u0442\u043E\u043D\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442 \u0438\u0437 \u0422\u0415\u041C\u042B (terrain.tint \u0432 \u0441\u0442\u0438\u043B\u0435), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043B\u0435\u0434\u044F\u043D\u0430\u044F \u043A\u0430\u0440\u0442\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043B\u0435\u0434\u044F\u043D\u043E\u0439,
1291
+ * \u0430 \u043D\u043E\u0447\u043D\u0430\u044F \u2014 \u043D\u043E\u0447\u043D\u043E\u0439.
1292
+ */
1293
+ float h = terrainHeight(v_uv);
1294
+ float t = clamp((h - u_relief_range.x) / max(u_relief_range.y - u_relief_range.x, 1.0), 0.0, 1.0);
1295
+ // \u0422\u0440\u0438 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438, \u043A\u0430\u043A \u043D\u0430 \u0433\u0438\u043F\u0441\u043E\u043C\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u0448\u043A\u0430\u043B\u0435: \u0434\u043E\u043B\u0438\u043D\u0430 \u2014 \u0441\u043A\u043B\u043E\u043D \u2014 \u0432\u0435\u0440\u0448\u0438\u043D\u0430.
1296
+ vec3 tint = t < 0.5 ? mix(u_relief_low, u_relief_mid, t * 2.0) : mix(u_relief_mid, u_relief_high, t * 2.0 - 1.0);
1297
+
1298
+ // \u0421\u043A\u043B\u043E\u043D: \u0440\u0430\u0437\u043D\u0438\u0446\u0430 \u0432\u044B\u0441\u043E\u0442 \u043F\u043E \u0434\u0432\u0443\u043C \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043C, \u043F\u0440\u0438\u0432\u0435\u0434\u0451\u043D\u043D\u0430\u044F \u043A \u043C\u0435\u0442\u0440\u0430\u043C. \u0428\u0430\u0433 \u0432\u0437\u044F\u0442 \u0448\u0438\u0440\u0435 \u043E\u0434\u043D\u043E\u0439 \u044F\u0447\u0435\u0439\u043A\u0438
1299
+ // DEM: \u043F\u043E \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u043C \u043E\u0442\u0441\u0447\u0451\u0442\u0430\u043C \u043E\u0442\u043C\u044B\u0432\u043A\u0430 \u0438\u0434\u0451\u0442 \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0430\u043C\u0438, \u0430 \u043F\u043E \u0448\u0438\u0440\u043E\u043A\u043E\u0439 \u0431\u0430\u0437\u0435 \u0441\u043A\u043B\u043E\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u043F\u043B\u0430\u0432\u043D\u044B\u043C.
1300
+ float step = 1.0 / 96.0;
1301
+ float dx = terrainHeight(v_uv + vec2(step, 0.0)) - terrainHeight(v_uv - vec2(step, 0.0));
1302
+ float dy = terrainHeight(v_uv + vec2(0.0, step)) - terrainHeight(v_uv - vec2(0.0, step));
1303
+ float span = max(u_tile_meters * step * 2.0, 1.0);
1304
+ vec3 n = normalize(vec3(-dx / span, -dy / span, 1.0));
1305
+ float lit = clamp(dot(n, normalize(u_relief_light)), 0.0, 1.0);
1306
+ /*
1307
+ * \u0415\u0434\u0438\u043D\u0438\u0446\u0430 \u0432 \u0442\u0435\u043D\u0438 \u2014 \u044D\u0442\u043E \u0447\u0451\u0440\u043D\u044B\u0439 \u043F\u0440\u043E\u0432\u0430\u043B, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u0442\u043C\u044B\u0432\u043A\u0430 \u0445\u043E\u0434\u0438\u0442 \u0432\u043E\u043A\u0440\u0443\u0433 \u0435\u0434\u0438\u043D\u0438\u0446\u044B, \u0430 \u043D\u0435 \u043E\u0442 \u043D\u0443\u043B\u044F.
1308
+ * \u0420\u0430\u0437\u043C\u0430\u0445 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E \u043D\u0435\u0431\u043E\u043B\u044C\u0448\u043E\u0439: \u0437\u0430\u0434\u0430\u0447\u0430 \u043E\u0442\u043C\u044B\u0432\u043A\u0438 \u2014 \u0434\u0430\u0442\u044C \u0444\u043E\u0440\u043C\u0443 \u0441\u043A\u043B\u043E\u043D\u0430, \u0430 \u043D\u0435 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043D\u043E\u0447\u044C \u043D\u0430
1309
+ * \u0442\u0435\u043D\u0435\u0432\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435. \u0428\u0438\u0440\u043E\u043A\u0438\u0439 \u0440\u0430\u0437\u043C\u0430\u0445 \u0441\u044A\u0435\u0434\u0430\u043B \u0446\u0432\u0435\u0442\u0430 \u043A\u0430\u0440\u0442\u044B \u0438 \u0434\u0435\u043B\u0430\u043B \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u0432 \u0442\u0435\u043D\u0438 \u043D\u0435\u0447\u0438\u0442\u0430\u0435\u043C\u044B\u043C\u0438.
1310
+ */
1311
+ float shade = mix(1.0, 0.74 + 0.42 * lit, u_relief_mix.y);
1312
+
1313
+ /*
1314
+ * \u041E\u043A\u0440\u0430\u0441\u043A\u0430 \u041F\u041E\u0414\u041C\u0415\u0428\u0418\u0412\u0410\u0415\u0422\u0421\u042F \u043A \u043A\u0430\u0440\u0442\u0435, \u0430 \u043D\u0435 \u0443\u043C\u043D\u043E\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0451.
1315
+ *
1316
+ * \u0423\u043C\u043D\u043E\u0436\u0435\u043D\u0438\u0435 \u043D\u0430 \u0441\u0432\u0435\u0442\u043B\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u0443\u0432\u043E\u0434\u0438\u043B\u043E \u0432\u0441\u0451 \u0432 \u0431\u0435\u043B\u044B\u0439: \u0447\u0435\u043C \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0437\u0435\u043C\u043B\u044F, \u0442\u0435\u043C \u043C\u0435\u043D\u044C\u0448\u0435 \u043E\u0442 \u0442\u043E\u043D\u0430
1317
+ * \u043E\u0441\u0442\u0430\u0432\u0430\u043B\u043E\u0441\u044C, \u0438 \u0433\u0438\u043F\u0441\u043E\u043C\u0435\u0442\u0440\u0438\u044F \u043F\u0440\u043E\u043F\u0430\u0434\u0430\u043B\u0430 \u0440\u043E\u0432\u043D\u043E \u0442\u0430\u043C, \u0433\u0434\u0435 \u0435\u0451 \u0438 \u043D\u0430\u0434\u043E \u0432\u0438\u0434\u0435\u0442\u044C. \u0421\u043C\u0435\u0441\u044C \u0436\u0435 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442
1318
+ * \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u043D\u0430 \u043B\u044E\u0431\u043E\u0439 \u043F\u0430\u043B\u0438\u0442\u0440\u0435, \u0430 \u0434\u043E\u0440\u043E\u0433\u0438 \u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043F\u043E\u0432\u0435\u0440\u0445 \u043D\u0435\u0451 \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0447\u0438\u0442\u0430\u0435\u043C\u044B\u043C\u0438 \u2014 \u043E\u043D\u0438 \u0442\u043E\u043D\u043A\u0438\u0435.
1319
+ */
1320
+ // \u041E\u043A\u0440\u0430\u0441\u043A\u0430 \u043B\u0438\u0431\u043E \u0440\u043E\u0432\u043D\u0430\u044F \u043F\u043E \u0432\u0441\u0435\u0439 \u0448\u043A\u0430\u043B\u0435, \u043B\u0438\u0431\u043E \u043D\u0430\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u043A \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C \u2014 \u043F\u043E \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0443, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043D\u043E\u0436\u044C\u0435
1321
+ // \u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C \u0446\u0432\u0435\u0442\u043E\u043C \u043A\u0430\u0440\u0442\u044B, \u0430 \u0442\u043E\u043D \u0432\u044B\u0441\u043E\u0442\u044B \u043D\u0430\u0431\u0438\u0440\u0430\u043B \u0441\u0438\u043B\u0443 \u0443\u0436\u0435 \u043D\u0430 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0445 \u0433\u043E\u0440\u0430\u0445.
1322
+ float amount = u_relief_mix.x * mix(1.0, t * t, u_relief_mix.z);
1323
+ vec3 color = mix(map.rgb, tint, amount);
1324
+ /*
1325
+ * \u0414\u042B\u041C\u041A\u0410 \u2014 \u0417\u0414\u0415\u0421\u042C, \u0410 \u041D\u0415 \u0412 \u0414\u0420\u0410\u041F\u0418\u0420\u041E\u0412\u041A\u0415.
1326
+ *
1327
+ * \u0412 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u0443 \u0442\u0430\u0439\u043B \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u0431\u0435\u0437 \u043A\u0430\u043C\u0435\u0440\u044B, \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043C\u0430\u0442\u0440\u0438\u0446\u0435\u0439: \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u0442\u0430\u043C \u043D\u0435\u0442, \u0438 \u0434\u044B\u043C\u043A\u0435 \u0432\u0437\u044F\u0442\u044C\u0441\u044F
1328
+ * \u043D\u0435\u043E\u0442\u043A\u0443\u0434\u0430. \u0410 \u043D\u0430 \u044D\u043A\u0440\u0430\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0443\u0436\u0435 \u0440\u0435\u0448\u0451\u0442\u043A\u0430, \u0443 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F, \u2014 \u043D\u0430 \u043D\u0435\u0439 \u0434\u0430\u043B\u044C \u0438
1329
+ * \u0440\u0430\u0441\u0442\u0432\u043E\u0440\u044F\u0435\u0442\u0441\u044F, \u0432 \u043E\u0434\u0438\u043D \u0446\u0432\u0435\u0442 \u0441 \u043D\u0435\u0431\u043E\u043C \u0438 \u0441 \u0434\u043E\u043C\u0430\u043C\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0434\u044B\u043C\u043A\u0443 \u0441\u0447\u0438\u0442\u0430\u044E\u0442 \u0442\u0430\u043A \u0436\u0435.
1330
+ */
1331
+ fragColor = vec4(applyFog(clamp(color * shade, 0.0, 1.0)), map.a);
1332
+ }
1333
+ `,xc=`#version 300 es
1130
1334
  precision highp float;
1131
1335
 
1132
- ${Kr}
1336
+ ${Si}
1133
1337
 
1134
1338
  in vec2 a_pos;
1339
+ /**
1340
+ * \u0412\u044B\u0441\u043E\u0442\u0430 \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u0432\u0435\u0440\u0448\u0438\u043D\u043E\u0439, \u043C\u0435\u0442\u0440\u044B. \u0415\u0441\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0443 \u0440\u0430\u043D\u0442\u0430\u0439\u043C-\u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 (\u0437\u043E\u043D\u0430, \u043C\u0430\u0440\u0448\u0440\u0443\u0442) \u043D\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0435:
1341
+ * \u0443 \u0442\u0430\u0439\u043B\u043E\u0432\u043E\u0439 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D, \u0438 GL \u043E\u0442\u0434\u0430\u0451\u0442 \u043D\u043E\u043B\u044C \u2014 \u0440\u043E\u0432\u043D\u043E \u043F\u0440\u0435\u0436\u043D\u0435\u0435 \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435.
1342
+ */
1343
+ in float a_ground;
1344
+ /**
1345
+ * \u041F\u041E\u041A\u0420\u0410\u0421\u041A\u0410, \u041F\u0420\u0418\u0428\u0415\u0414\u0428\u0410\u042F \u0418\u0417 \u0412\u0415\u0420\u0428\u0418\u041D\u042B (data-driven paint).
1346
+ *
1347
+ * \u0426\u0432\u0435\u0442 \u0441\u043B\u043E\u044F \u043E\u0431\u044B\u0447\u043D\u043E \u043E\u0434\u0438\u043D \u043D\u0430 \u0432\u0435\u0441\u044C \u0441\u043B\u043E\u0439 \u0438 \u043B\u0435\u0436\u0438\u0442 \u0432 \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u0435. \u041D\u043E \u0441\u0442\u0438\u043B\u044C \u0432\u043F\u0440\u0430\u0432\u0435 \u043D\u0430\u043F\u0438\u0441\u0430\u0442\u044C
1348
+ * ['match', ['get', 'class'], \u2026] \u2014 \u0438 \u0442\u043E\u0433\u0434\u0430 \u0443 \u043A\u0430\u0436\u0434\u043E\u0439 \u0444\u0438\u0447\u0438 \u043E\u043D \u0441\u0432\u043E\u0439; \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D \u043E\u043D \u0432 \u0432\u043E\u0440\u043A\u0435\u0440\u0435 \u0438
1349
+ * \u043F\u0440\u0438\u0435\u0445\u0430\u043B \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u043C (\u0441\u043C. generators/data-paint.ts).
1350
+ *
1351
+ * \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u043E\u043C, \u0430 \u043D\u0435 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u043E\u0439: \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0443 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F \u043F\u0440\u043E\u0441\u0442\u043E \u041E\u0422\u041A\u041B\u042E\u0427\u0401\u041D, GL
1352
+ * \u043E\u0442\u0434\u0430\u0451\u0442 \u0432 \u043D\u0435\u0433\u043E (0,0,0,1), \u0438 \u0432\u0435\u0442\u043A\u0430 \u0441 \u043D\u0438\u043C \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F. \u0410\u043B\u044C\u0444\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u041D\u0415 \u0434\u043E\u043C\u043D\u043E\u0436\u0435\u043D\u043D\u043E\u0439 \u043D\u0430 \u0446\u0432\u0435\u0442 \u2014
1353
+ * \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u043C \u0437\u0434\u0435\u0441\u044C, \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433 \u0443 \u043D\u0430\u0441 premultiplied.
1354
+ */
1355
+ in vec4 a_dcolor;
1356
+ uniform float u_data_color; // 1 \u2014 \u0446\u0432\u0435\u0442 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B
1357
+ uniform float u_opacity; // \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u0441\u043B\u043E\u044F: \u0432 \u044E\u043D\u0438\u0444\u043E\u0440\u043C-\u0446\u0432\u0435\u0442 \u043E\u043D\u0430 \u0443\u0436\u0435 \u0432\u043E\u0448\u043B\u0430, \u0432 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u044B\u0439 \u043D\u0435\u0442
1358
+ out vec4 v_dcolor;
1135
1359
  uniform mat4 u_matrix;
1136
1360
  uniform float u_meters_per_unit; // \u0435\u0434\u0438\u043D\u0438\u0446\u0430 \u0442\u0430\u0439\u043B\u0430 \u2192 \u043C\u0435\u0442\u0440\u044B, \u0434\u043B\u044F \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430
1137
1361
  /** \u041D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0437\u0430\u043D\u043E\u0432\u043E \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u043C \u0448\u0432\u0435. */
@@ -1149,25 +1373,32 @@ void main() {
1149
1373
  gl_Position = u_matrix * vec4(globeLocal(a_pos), 1.0);
1150
1374
  v_globe_shade = globeShade();
1151
1375
  } else {
1152
- gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1376
+ gl_Position = u_matrix * vec4(a_pos, a_ground, 1.0);
1153
1377
  }
1154
1378
 
1155
1379
  // \u041D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u041E\u0411\u042F\u0417\u0410\u0422\u0415\u041B\u042C\u041D\u041E: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0437\u0430\u043D\u043E\u0432\u043E \u043D\u0430
1156
1380
  // \u043A\u0430\u0436\u0434\u043E\u0439 \u0433\u0440\u0430\u043D\u0438\u0446\u0435, \u0438 \u043F\u043E \u0448\u0432\u0430\u043C \u0438\u0434\u0443\u0442 \u043F\u043E\u043B\u043E\u0441\u044B. \u042E\u043D\u0438\u0444\u043E\u0440\u043C \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0431\u044B\u043B, \u0430 \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0443
1157
1381
  // \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.
1158
1382
  v_world = u_world_origin + a_pos * u_meters_per_unit;
1383
+
1384
+ // \u0426\u0432\u0435\u0442 \u0444\u0438\u0447\u0438: premultiplied, \u043A\u0430\u043A \u0438 \u044E\u043D\u0438\u0444\u043E\u0440\u043C-\u0446\u0432\u0435\u0442, \u2014 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442 \u043C\u0435\u0436\u0434\u0443 \u043D\u0438\u043C\u0438 \u043E\u0434\u043D\u0438\u043C mix.
1385
+ float da = a_dcolor.a * u_opacity;
1386
+ v_dcolor = vec4(a_dcolor.rgb * da, da);
1159
1387
  }
1160
- `,$a=`#version 300 es
1388
+ `,_c=`#version 300 es
1161
1389
  precision highp float;
1162
1390
 
1163
- ${$r}
1391
+ ${ki}
1164
1392
 
1165
- ${rt}
1166
- ${Xt}
1167
- ${Xr}
1393
+ ${yt}
1394
+ ${Vo}
1395
+ ${Ci}
1168
1396
 
1169
1397
  in vec2 v_world;
1170
1398
  in float v_globe_shade;
1399
+ /** \u0426\u0432\u0435\u0442 \u0444\u0438\u0447\u0438 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B; \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442, \u0442\u043E\u043B\u044C\u043A\u043E \u043A\u043E\u0433\u0434\u0430 u_data_color = 1 (\u0441\u043C. FILL_VERT). */
1400
+ in vec4 v_dcolor;
1401
+ uniform float u_data_color;
1171
1402
 
1172
1403
  uniform vec4 u_color;
1173
1404
  out vec4 fragColor;
@@ -1178,16 +1409,17 @@ void main() {
1178
1409
  // \u043F\u0435\u0440\u0435\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F. \u041F\u0440\u0438\u0451\u043C \u0432\u0437\u044F\u0442 \u0443 Mapbox (ground_shadow + \u0443\u043C\u043D\u043E\u0436\u0430\u044E\u0449\u0438\u0439 \u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433).
1179
1410
  // \u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B (\u0432\u043E\u0434\u0430, \u0437\u0435\u043B\u0435\u043D\u044C, \u043F\u0435\u0441\u043E\u043A, \u0430\u0441\u0444\u0430\u043B\u044C\u0442) \u043F\u0440\u0430\u0432\u0438\u0442 \u0422\u041E\u041B\u042C\u041A\u041E \u0446\u0432\u0435\u0442: \u0430\u043B\u044C\u0444\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F
1180
1411
  // \u043F\u0440\u0435\u0436\u043D\u0435\u0439, \u0438\u043D\u0430\u0447\u0435 premultiplied-\u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433 \u0440\u0430\u0437\u043E\u0448\u0451\u043B\u0441\u044F \u0431\u044B \u0441 \u043D\u0435\u0439.
1181
- vec4 c = u_color;
1412
+ vec4 c = mix(u_color, v_dcolor, u_data_color);
1182
1413
  if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
1183
1414
  // \u0421\u0432\u0435\u0442 \u0448\u0430\u0440\u0430. \u041D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0440\u0430\u0432\u0435\u043D \u0435\u0434\u0438\u043D\u0438\u0446\u0435 \u0438 \u043D\u0435 \u0441\u0442\u043E\u0438\u0442 \u043D\u0438\u0447\u0435\u0433\u043E.
1184
1415
  c.rgb *= v_globe_shade;
1185
1416
  fragColor = tileTint(applyFogPremultiplied(c));
1186
1417
  }
1187
- `,qa=`#version 300 es
1418
+ `,Mc=`#version 300 es
1188
1419
  precision highp float;
1189
1420
 
1190
- ${Kr}
1421
+ ${Si}
1422
+ ${Bt}
1191
1423
 
1192
1424
  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)
1193
1425
  in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
@@ -1200,8 +1432,32 @@ in vec2 a_corner; // x: 0 \u2014 \u0432\u0435\u0440\u0448\u0438\u043D\u0430 \u
1200
1432
  * \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u2014 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u043D\u0434\u0443\u0441, \u0430 \u043D\u0435 \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0430.
1201
1433
  */
1202
1434
  in vec2 a_ground;
1435
+ /**
1436
+ * \u041F\u043E\u0434\u044A\u0451\u043C \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u043F\u043E\u0434 \u043E\u0431\u043E\u0438\u043C\u0438 \u043A\u043E\u043D\u0446\u0430\u043C\u0438 \u043E\u0442\u0440\u0435\u0437\u043A\u0430, \u0441\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u044B (\u0441\u043C. generators/lift).
1437
+ *
1438
+ * \u041E\u0442\u0434\u0435\u043B\u044C\u043D\u043E \u043E\u0442 a_ground: \u0442\u043E\u0442 \u0431\u0430\u0439\u0442 \u043C\u0435\u0440\u0438\u0442 \u0440\u0430\u0437\u043D\u0438\u0446\u0443 \u0443\u0440\u043E\u0432\u043D\u0435\u0439 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u0438 \u0434\u0430\u043B\u044C\u0448\u0435 \u043C\u0435\u0442\u0440\u0430 \u0441 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044C\u044E \u043D\u0435
1439
+ * \u0431\u0435\u0440\u0451\u0442, \u0430 \u043F\u043E\u0434\u0445\u043E\u0434 \u043A \u044D\u0441\u0442\u0430\u043A\u0430\u0434\u0435 \u043F\u043E\u0434\u043D\u0438\u043C\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u0432\u043E\u0441\u0435\u043C\u044C \u043C\u0435\u0442\u0440\u043E\u0432. \u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u044F \u0435\u043C\u0443 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u043D\u0430 \u0440\u0430\u043C\u043F\u0435 \u0435\u0434\u0435\u0442
1440
+ * \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u0430\u0441\u0444\u0430\u043B\u044C\u0442\u043E\u043C, \u0430 \u043D\u0435 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043B\u0435\u0436\u0430\u0442\u044C \u043D\u0430 \u0437\u0435\u043C\u043B\u0435 \u043F\u043E\u0434 \u043D\u0438\u043C.
1441
+ */
1442
+ in vec2 a_lift;
1203
1443
  in float a_dist; // \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043E\u0442 \u043D\u0430\u0447\u0430\u043B\u0430 \u043B\u0438\u043D\u0438\u0438 \u0434\u043E p0, \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430
1204
1444
 
1445
+ /**
1446
+ * \u041F\u041E\u041A\u0420\u0410\u0421\u041A\u0410 \u0418 \u0428\u0418\u0420\u0418\u041D\u0410, \u041F\u0420\u0418\u0428\u0415\u0414\u0428\u0418\u0415 \u0418\u0417 \u0412\u0415\u0420\u0428\u0418\u041D\u042B (data-driven paint).
1447
+ *
1448
+ * \u0421\u0447\u0438\u0442\u0430\u043D\u044B \u0432 \u0432\u043E\u0440\u043A\u0435\u0440\u0435 \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u0439 \u0444\u0438\u0447\u0435 (\u0441\u043C. generators/data-paint.ts): \u0441\u0442\u0438\u043B\u044C \u0432\u043F\u0440\u0430\u0432\u0435 \u043D\u0430\u043F\u0438\u0441\u0430\u0442\u044C
1449
+ * ['match', ['get', 'class'], \u2026] \u0438 \u0432 \u0446\u0432\u0435\u0442\u0435, \u0438 \u0432 \u0448\u0438\u0440\u0438\u043D\u0435. \u0423 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044B \u041E\u0422\u041A\u041B\u042E\u0427\u0415\u041D\u042B, \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u044B
1450
+ * \u0441\u0442\u043E\u044F\u0442 \u0432 \u043D\u0443\u043B\u0435, \u0438 \u043D\u0438 \u043E\u0434\u043D\u0430 \u0432\u0435\u0442\u043A\u0430 \u043D\u0438\u0436\u0435 \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F.
1451
+ */
1452
+ in vec4 a_dcolor;
1453
+ in float a_dwidth; // \u0448\u0438\u0440\u0438\u043D\u0430 \u0444\u0438\u0447\u0438 \u0432 CSS-\u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445
1454
+ uniform float u_data_color; // 1 \u2014 \u0446\u0432\u0435\u0442 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B
1455
+ uniform float u_data_width; // 1 \u2014 \u0448\u0438\u0440\u0438\u043D\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B
1456
+ uniform float u_opacity; // \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u0441\u043B\u043E\u044F: \u0432 \u044E\u043D\u0438\u0444\u043E\u0440\u043C-\u0446\u0432\u0435\u0442 \u043E\u043D\u0430 \u0443\u0436\u0435 \u0432\u043E\u0448\u043B\u0430, \u0432 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u044B\u0439 \u043D\u0435\u0442
1457
+ /** CSS-\u043F\u0438\u043A\u0441\u0435\u043B\u044C \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430: \u0448\u0438\u0440\u0438\u043D\u0430 \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0434\u0430\u043D\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445, \u044D\u043A\u0441\u0442\u0440\u0443\u0437\u0438\u044F \u0438\u0434\u0451\u0442 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435. */
1458
+ uniform float u_px_to_units;
1459
+ out vec4 v_dcolor;
1460
+
1205
1461
  uniform mat4 u_matrix;
1206
1462
  /** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0441\u0434\u0432\u0438\u0433 \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410 \u2014 \u0442\u043E \u0435\u0441\u0442\u044C \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0437\u0435\u043C\u043B\u0438. */
1207
1463
  uniform float u_half_width;
@@ -1225,6 +1481,8 @@ uniform vec2 u_world_origin; // \u043D\u0430\u0447\u0430\u043B\u043E \u044
1225
1481
  uniform float u_elevation;
1226
1482
  /** \u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0440\u0435\u043B\u044C\u0435\u0444\u0430: \u0438\u043C \u0436\u0435 \u043F\u0440\u0438\u0436\u0438\u043C\u0430\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439, \u0438 \u043F\u043E\u0434\u044A\u0451\u043C \u0434\u043E\u0440\u043E\u0433\u0438 \u043E\u0431\u044F\u0437\u0430\u043D \u0438\u0434\u0442\u0438 \u0441 \u043D\u0438\u043C\u0438. */
1227
1483
  uniform float u_relief;
1484
+ /** \u0421\u0442\u043E\u0440\u043E\u043D\u0430 \u0442\u0430\u0439\u043B\u0430 \u0432 \u0435\u0433\u043E \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u2014 \u043F\u043E \u043D\u0435\u0439 \u0438\u0449\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u0434\u043E\u0440\u043E\u0433\u043E\u0439. */
1485
+ uniform float u_extent;
1228
1486
 
1229
1487
  /** \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0430 \u0438 \u043A\u043E\u043D\u0446\u044B \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u2014 \u0432\u0441\u0451 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430. */
1230
1488
  out vec2 v_pos;
@@ -1262,8 +1520,17 @@ void main() {
1262
1520
  vec2 base = atEnd ? a_p1 : a_p0;
1263
1521
  float alongSign = atEnd ? 1.0 : -1.0; // \u043D\u0430\u0440\u0443\u0436\u0443 \u043E\u0442 \u0441\u0432\u043E\u0435\u0433\u043E \u043A\u043E\u043D\u0446\u0430
1264
1522
 
1265
- // \u0412\u044B\u0441\u043E\u0442\u0430 = \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u044D\u0442\u0438\u043C \u043A\u043E\u043D\u0446\u043E\u043C \u043F\u043B\u044E\u0441 \u043F\u0440\u0438\u0431\u0430\u0432\u043A\u0430 \u0441\u043B\u043E\u044F. \u0421\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u044B \u2192 \u043C\u0435\u0442\u0440\u044B.
1266
- float height = (atEnd ? a_ground.y : a_ground.x) * 0.01 * u_relief + u_elevation;
1523
+ /*
1524
+ * \u0412\u044B\u0441\u043E\u0442\u0430 = \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u044D\u0442\u0438\u043C \u043A\u043E\u043D\u0446\u043E\u043C \u043F\u043B\u044E\u0441 \u043F\u0440\u0438\u0431\u0430\u0432\u043A\u0430 \u0441\u043B\u043E\u044F. \u0421\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u044B \u2192 \u043C\u0435\u0442\u0440\u044B.
1525
+ *
1526
+ * \u0418 \u043F\u043B\u044E\u0441 \u0420\u0415\u041B\u042C\u0415\u0424. \u0412 \u0434\u0440\u0430\u043F\u0438\u0440\u043E\u0432\u043A\u0435 \u043E\u043D \u043D\u0438\u043A\u0443\u0434\u0430 \u043D\u0435 \u0438\u0434\u0451\u0442 \u2014 \u0442\u0430\u043C \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043F\u043B\u043E\u0441\u043A\u0430\u044F, \u2014 \u043D\u043E \u043D\u0430 \u044D\u043A\u0440\u0430\u043D\u0435 \u044D\u0442\u0438\u043C \u0436\u0435
1527
+ * \u0448\u0435\u0439\u0434\u0435\u0440\u043E\u043C \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u043F\u0440\u0438\u0437\u0440\u0430\u043A \u043B\u0435\u043D\u0442\u044B \u043F\u0440\u043E\u0431\u043E\u043A (\u0442\u043E\u0442, \u0447\u0442\u043E \u043F\u0440\u043E\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0437\u0430 \u0434\u043E\u043C\u0430\u043C\u0438). \u0411\u0435\u0437 \u0432\u044B\u0441\u043E\u0442\u044B \u043E\u043D \u043B\u043E\u0436\u0438\u043B\u0441\u044F
1528
+ * \u043D\u0430 \u043D\u0443\u043B\u0435\u0432\u0443\u044E \u043E\u0442\u043C\u0435\u0442\u043A\u0443, \u0442\u043E \u0435\u0441\u0442\u044C \u043F\u043E\u0434 \u0433\u043E\u0440\u0443, \u0438 \u043D\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u0441\u043A\u0432\u043E\u0437\u044C \u0437\u0435\u043C\u043B\u044E \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u043B\u0430 \u0432\u0442\u043E\u0440\u0430\u044F,
1529
+ * \u0431\u043B\u0435\u0434\u043D\u0430\u044F \u0441\u0435\u0442\u043A\u0430 \u0443\u043B\u0438\u0446. \u0420\u043E\u0432\u043D\u043E \u044D\u0442\u043E \u0438 \u0431\u044B\u043B\u043E \u0432\u0438\u0434\u043D\u043E.
1530
+ */
1531
+ float height = (atEnd ? a_ground.y : a_ground.x) * 0.01 * u_relief + u_elevation
1532
+ + (atEnd ? a_lift.y : a_lift.x) * 0.01 * u_relief
1533
+ + terrainHeight(base / u_extent);
1267
1534
 
1268
1535
  // \u0417\u0430\u043F\u0430\u0441 \u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430, \u043D\u043E \u041D\u0410 \u0422\u041E\u0419 \u0416\u0415 \u0413\u041B\u0423\u0411\u0418\u041D\u0415: \u0434\u0430\u043B\u044C\u043D\u0438\u0439
1269
1536
  // \u043A\u043E\u043D\u0435\u0446 \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u043C\u0435\u043D\u044C\u0448\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439, \u0438 \u043F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u044B\u0439 \u0437\u0430\u043F\u0430\u0441 \u0442\u0430\u043C \u0431\u044B\u043B \u0431\u044B \u0432\u043F\u0443\u0441\u0442\u0443\u044E, \u0430
@@ -1287,6 +1554,11 @@ void main() {
1287
1554
  float halfWidth = (u_width_from_data > 0.5 && a_width > 0.0)
1288
1555
  ? a_width * 0.5 * u_meters_to_units + u_width_extra
1289
1556
  : u_half_width;
1557
+ // \u0428\u0438\u0440\u0438\u043D\u0430 \u0438\u0437 \u0421\u0422\u0418\u041B\u042F, \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u0430\u044F \u043D\u0430 \u0444\u0438\u0447\u0435, \u0433\u043B\u0430\u0432\u043D\u0435\u0435 \u0448\u0438\u0440\u0438\u043D\u044B \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445: \u0435\u0451 \u043D\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u044F\u0432\u043D\u043E \u043F\u0440\u043E \u044D\u0442\u043E\u0442 \u0441\u043B\u043E\u0439.
1558
+ if (u_data_width > 0.5) halfWidth = a_dwidth * 0.5 * u_px_to_units;
1559
+ // \u0426\u0432\u0435\u0442 \u0444\u0438\u0447\u0438: premultiplied, \u043A\u0430\u043A \u0438 \u044E\u043D\u0438\u0444\u043E\u0440\u043C-\u0446\u0432\u0435\u0442, \u2014 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442 \u043C\u0435\u0436\u0434\u0443 \u043D\u0438\u043C\u0438 \u043E\u0434\u043D\u0438\u043C mix.
1560
+ float da = a_dcolor.a * u_opacity;
1561
+ v_dcolor = vec4(a_dcolor.rgb * da, da);
1290
1562
  v_half_width = halfWidth;
1291
1563
  float r = halfWidth + aa;
1292
1564
  vec2 pos = base + dir * (alongSign * r) + perp * (a_corner.y * r + u_offset);
@@ -1312,13 +1584,13 @@ void main() {
1312
1584
  v_dist0 = a_dist * u_tile_to_px;
1313
1585
  v_seg_len = len * u_tile_to_px;
1314
1586
  }
1315
- `,Za=`#version 300 es
1587
+ `,Cc=`#version 300 es
1316
1588
  precision highp float;
1317
1589
 
1318
- ${rt}
1319
- ${Xt}
1320
- ${Kt}
1321
- ${Xr}
1590
+ ${yt}
1591
+ ${Vo}
1592
+ ${No}
1593
+ ${Ci}
1322
1594
 
1323
1595
  in vec2 v_pos;
1324
1596
  in vec2 v_p0;
@@ -1329,6 +1601,9 @@ in vec2 v_world0;
1329
1601
  in vec2 v_world1;
1330
1602
 
1331
1603
  uniform vec4 u_color; // premultiplied
1604
+ /** \u0426\u0432\u0435\u0442 \u0444\u0438\u0447\u0438 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B; \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442, \u0442\u043E\u043B\u044C\u043A\u043E \u043A\u043E\u0433\u0434\u0430 u_data_color = 1 (\u0441\u043C. LINE_VERT). */
1605
+ in vec4 v_dcolor;
1606
+ uniform float u_data_color;
1332
1607
  /** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410: \u043A\u0430\u043F\u0441\u0443\u043B\u0430 \u0436\u0438\u0432\u0451\u0442 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435, \u0430 \u043D\u0435 \u043D\u0430 \u044D\u043A\u0440\u0430\u043D\u0435. */
1333
1608
  uniform float u_half_width;
1334
1609
  // \u0422\u043E\u043B\u0449\u0438\u043D\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u043E\u0433\u043E \u0448\u0435\u0439\u0434\u0435\u0440\u0430: \u043E\u043D\u0430 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u0432\u043E\u0435\u0439 \u0443 \u043A\u0430\u0436\u0434\u043E\u0439 \u0434\u043E\u0440\u043E\u0433\u0438, \u0438 \u043F\u0443\u043D\u043A\u0442\u0438\u0440 \u0441\u043E
@@ -1547,7 +1822,7 @@ void main() {
1547
1822
  float distPx = dist * u_tile_to_px;
1548
1823
 
1549
1824
  float along = v_dist0 + t * v_seg_len;
1550
- vec4 color = u_color;
1825
+ vec4 color = mix(u_color, v_dcolor, u_data_color);
1551
1826
 
1552
1827
  // \u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u043F\u043E\u043B\u043E\u0442\u043D\u0430 (\u0430\u0441\u0444\u0430\u043B\u044C\u0442 \u0438 \u043F\u0440\u043E\u0447\u0435\u0435). \u041C\u0438\u0440\u043E\u0432\u0430\u044F \u0442\u043E\u0447\u043A\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0442\u0435\u043C \u0436\u0435
1553
1828
  // \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u043C t, \u0447\u0442\u043E \u0438 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438: \u043F\u0435\u0440\u0441\u043F\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0435 \u0438\u0441\u043A\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C
@@ -1597,13 +1872,21 @@ void main() {
1597
1872
 
1598
1873
  fragColor = applyFogPremultiplied(color) * alpha;
1599
1874
  }
1600
- `,Qa=`#version 300 es
1875
+ `,Sc=`#version 300 es
1601
1876
  precision highp float;
1602
1877
 
1603
1878
  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
1604
1879
  in vec2 a_extrude; // \u043A\u0443\u0434\u0430 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044C: \u0435\u0434\u0438\u043D\u0438\u0447\u043D\u044B\u0439 \u0432\u0435\u043A\u0442\u043E\u0440 (\u0432 \u0441\u0442\u044B\u043A\u0435 \u0434\u043B\u0438\u043D\u043D\u0435\u0435 \u2014 \u043C\u0438\u0442\u0440\u0430)
1605
1880
  in float a_side; // \u22121 | 0 | +1 \u2014 \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u043F\u043E\u043B\u043E\u0442\u043D\u0430, 0 \u0432 \u0446\u0435\u043D\u0442\u0440\u0435 \u0441\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u044F
1606
1881
  in float a_dist; // \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438, \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u043E\u0431\u044A\u0435\u043A\u0442\u0430
1882
+ /**
1883
+ * \u0412\u044B\u0441\u043E\u0442\u0430 \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u0432\u0435\u0440\u0448\u0438\u043D\u043E\u0439, \u043C\u0435\u0442\u0440\u044B: \u043C\u0430\u0440\u0448\u0440\u0443\u0442 \u0438\u0434\u0451\u0442 \u041F\u041E \u0421\u041A\u041B\u041E\u041D\u0423, \u0430 \u043D\u0435 \u043F\u043E \u043D\u0443\u043B\u044E.
1884
+ *
1885
+ * \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0435 \u043F\u0440\u0438 \u0441\u0431\u043E\u0440\u043A\u0435 \u043B\u0435\u043D\u0442\u044B (ObjectManager.groundOf) \u0438 \u043B\u0435\u0436\u0438\u0442 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u043C \u0431\u0443\u0444\u0435\u0440\u043E\u043C.
1886
+ * \u0411\u0435\u0437 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u043D\u0435\u0442, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D, GL \u043E\u0442\u0434\u0430\u0451\u0442 \u043D\u043E\u043B\u044C \u2014 \u0442\u0440\u0430\u0441\u0441\u0430 \u043B\u0435\u0436\u0438\u0442 \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u0437\u0435\u043C\u043B\u0435, \u043A\u0430\u043A \u0438
1887
+ * \u043B\u0435\u0436\u0430\u043B\u0430.
1888
+ */
1889
+ in float a_ground;
1607
1890
 
1608
1891
  uniform mat4 u_matrix;
1609
1892
  /** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430, \u0441\u0434\u0432\u0438\u0433 \u0438 \u0437\u0430\u043F\u0430\u0441 \u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 \u0412 \u041F\u0418\u041A\u0421\u0415\u041B\u042F\u0425. */
@@ -1624,17 +1907,17 @@ void main() {
1624
1907
  // \u0421\u0434\u0432\u0438\u0433 \u043F\u043E\u043F\u0435\u0440\u0451\u043A \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u0438\u0434\u0451\u0442 \u043F\u043E \u0442\u043E\u0439 \u0436\u0435 \u0431\u0438\u0441\u0441\u0435\u043A\u0442\u0440\u0438\u0441\u0435 \u2014 \u043F\u0430\u0440\u0430\u043B\u043B\u0435\u043B\u044C\u043D\u0430\u044F \u043B\u0438\u043D\u0438\u044F
1625
1908
  // \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0430\u0440\u0430\u043B\u043B\u0435\u043B\u044C\u043D\u043E\u0439 \u0438 \u043D\u0430 \u0438\u0437\u043B\u043E\u043C\u0430\u0445.
1626
1909
  vec2 shift = a_extrude * (outset + u_offset * a_side) * u_units_per_px;
1627
- gl_Position = u_matrix * vec4(a_pos + shift, 0.0, 1.0);
1910
+ gl_Position = u_matrix * vec4(a_pos + shift, a_ground, 1.0);
1628
1911
 
1629
1912
  v_side = a_side;
1630
1913
  v_outset = outset;
1631
1914
  v_half = u_half_width;
1632
1915
  v_dist = a_dist * u_units_to_px;
1633
1916
  }
1634
- `,Ja=`#version 300 es
1917
+ `,Tc=`#version 300 es
1635
1918
  precision highp float;
1636
1919
 
1637
- ${rt}
1920
+ ${yt}
1638
1921
 
1639
1922
  in float v_side;
1640
1923
  in float v_outset;
@@ -1680,9 +1963,13 @@ void main() {
1680
1963
  if (alpha <= 0.003) discard;
1681
1964
  fragColor = applyFogPremultiplied(color) * alpha;
1682
1965
  }
1683
- `,el=`#version 300 es
1966
+ `,kc=`#version 300 es
1684
1967
  precision highp float;
1685
1968
 
1969
+ ${Bt}
1970
+
1971
+ uniform float u_extent; // \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u0442\u0430\u0439\u043B\u0430 \u0432 \u0435\u0433\u043E \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u2014 \u043F\u043E \u043D\u0435\u0439 \u0438\u0449\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0430
1972
+
1686
1973
  in vec2 a_pos;
1687
1974
  in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 4 (\u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u0430, \u0434\u0435\u043B\u0438\u043C \u0441\u0430\u043C\u0438)
1688
1975
  in float a_tint;
@@ -1691,6 +1978,17 @@ in vec3 a_normal;
1691
1978
  in float a_kind; // \u043C\u043B\u0430\u0434\u0448\u0438\u0435 2 \u0431\u0438\u0442\u0430 \u2014 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u044C, \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u2014 \u043A\u043B\u0430\u0441\u0441 \u0444\u0430\u0441\u0430\u0434\u0430
1692
1979
  in vec3 a_wall; // \u043C\u0435\u0442\u0440\u044B \xD7 4: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u0433\u0440\u0430\u043D\u0438, \u0448\u0438\u0440\u0438\u043D\u0430 \u0433\u0440\u0430\u043D\u0438, \u0435\u0451 \u0432\u044B\u0441\u043E\u0442\u0430
1693
1980
 
1981
+ /**
1982
+ * \u0426\u0412\u0415\u0422 \u0417\u0414\u0410\u041D\u0418\u042F, \u041F\u0420\u0418\u0428\u0415\u0414\u0428\u0418\u0419 \u0418\u0417 \u0412\u0415\u0420\u0428\u0418\u041D\u042B (data-driven paint).
1983
+ *
1984
+ * \u041F\u043E\u0441\u0447\u0438\u0442\u0430\u043D \u0432 \u0432\u043E\u0440\u043A\u0435\u0440\u0435 \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u0439 \u0444\u0438\u0447\u0435 (\u0441\u043C. generators/data-paint.ts): \u0441\u0442\u0438\u043B\u044C \u0432\u043F\u0440\u0430\u0432\u0435 \u043F\u043E\u043A\u0440\u0430\u0441\u0438\u0442\u044C \u0434\u043E\u043C\u0430
1985
+ * \u043F\u043E \u044D\u0442\u0430\u0436\u043D\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u043F\u043E \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044E. \u0423 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u041E\u0422\u041A\u041B\u042E\u0427\u0401\u041D, \u044E\u043D\u0438\u0444\u043E\u0440\u043C \u0441\u0442\u043E\u0438\u0442 \u0432 \u043D\u0443\u043B\u0435, \u0438 \u0446\u0432\u0435\u0442
1986
+ * \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0441\u0442\u0438\u043B\u044F, \u043A\u0430\u043A \u0440\u0430\u043D\u044C\u0448\u0435. \u0426\u0432\u0435\u0442 \u041D\u0415 \u0434\u043E\u043C\u043D\u043E\u0436\u0435\u043D \u043D\u0430 \u0430\u043B\u044C\u0444\u0443: \u0437\u0434\u0430\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0432 \u043F\u0440\u044F\u043C\u043E\u043C \u0446\u0432\u0435\u0442\u0435 \u0438
1987
+ * \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u0442 \u0435\u0433\u043E \u0432 \u0441\u0430\u043C\u043E\u043C \u043A\u043E\u043D\u0446\u0435.
1988
+ */
1989
+ in vec4 a_dcolor;
1990
+ flat out vec4 v_dcolor;
1991
+
1694
1992
  uniform mat4 u_matrix;
1695
1993
  uniform float u_height_scale; // 0..1 \u2014 \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u044F \xAB\u0432\u044B\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044F\xBB \u043F\u0440\u0438 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0438
1696
1994
  uniform mat4 u_shadow_matrix;
@@ -1725,10 +2023,34 @@ out vec3 v_wall;
1725
2023
  out vec3 v_view;
1726
2024
 
1727
2025
  void main() {
2026
+ v_dcolor = a_dcolor;
1728
2027
  // \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430 \xD7 8 (BUILDING_POS_SCALE): \u0446\u0435\u043B\u044B\u0445 \u0435\u0434\u0438\u043D\u0438\u0446 \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u043B\u043E
1729
2028
  // \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u044B\u043C \u0443\u0433\u043B\u0430\u043C \u2014 \u0434\u0443\u0433\u0430 \u0441\u0430\u0434\u0438\u043B\u0430\u0441\u044C \u043D\u0430 \u043F\u043E\u043B\u0443\u043C\u0435\u0442\u0440\u043E\u0432\u0443\u044E \u0441\u0435\u0442\u043A\u0443 \u0438 \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u043B\u0435\u0441\u0435\u043D\u043A\u043E\u0439.
1730
2029
  vec2 pos = a_pos / 8.0;
1731
- float h = (a_height / 32.0) * u_height_scale;
2030
+ /*
2031
+ * \u0414\u041E\u041C \u0421\u0422\u041E\u0418\u0422 \u041D\u0410 \u0421\u041A\u041B\u041E\u041D\u0415, \u0410 \u041D\u0415 \u041D\u0410 \u041D\u0423\u041B\u0415.
2032
+ *
2033
+ * \u0412\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043F\u0440\u0438\u0431\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0438 \u0446\u043E\u043A\u043E\u043B\u044E, \u0438 \u043A\u0440\u043E\u0432\u043B\u0435: \u0434\u043E\u043C \u0435\u0434\u0435\u0442 \u0432\u0432\u0435\u0440\u0445 \u0446\u0435\u043B\u0438\u043A\u043E\u043C, \u0441\u0432\u043E\u0435\u0439 \u0432\u044B\u0441\u043E\u0442\u044B \u043D\u0435 \u043C\u0435\u043D\u044F\u044F.
2034
+ * \u0412\u0435\u0440\u0448\u0438\u043D\u044B \u0431\u0435\u0440\u0443\u0442 \u0432\u044B\u0441\u043E\u0442\u0443 \u043A\u0430\u0436\u0434\u0430\u044F \u0441\u0432\u043E\u044E, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043D\u0430 \u0441\u043A\u043B\u043E\u043D\u0435 \u0446\u043E\u043A\u043E\u043B\u044C \u043D\u0430\u043A\u043B\u043E\u043D\u044F\u0435\u0442\u0441\u044F \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u0437\u0435\u043C\u043B\u0451\u0439 \u2014 \u044D\u0442\u043E
2035
+ * \u0434\u0435\u0448\u0435\u0432\u043B\u0435, \u0447\u0435\u043C \u0438\u0441\u043A\u0430\u0442\u044C \u043E\u0434\u043D\u0443 \u043E\u0442\u043C\u0435\u0442\u043A\u0443 \u043D\u0430 \u0437\u0434\u0430\u043D\u0438\u0435, \u0438 \u043D\u0430 \u043D\u0430\u0448\u0438\u0445 \u0440\u0430\u0437\u043C\u0435\u0440\u0430\u0445 (\u043F\u0438\u043A\u0441\u0435\u043B\u044C \u0440\u0435\u043B\u044C\u0435\u0444\u0430 30\u201360 \u043C,
2036
+ * \u0434\u043E\u043C \u2014 \u0434\u0435\u0441\u044F\u0442\u043A\u0438 \u043C\u0435\u0442\u0440\u043E\u0432) \u0440\u0430\u0437\u043D\u0438\u0446\u0430 \u0432 \u043F\u0430\u0440\u0443 \u0441\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u043E\u0432.
2037
+ *
2038
+ * \u0411\u0435\u0437 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 (\u043D\u0443\u043B\u0435\u0432\u043E\u0435 \u043F\u0440\u0435\u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u0435) \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u043D\u0435 \u043F\u0440\u043E\u0438\u0441\u0445\u043E\u0434\u0438\u0442 \u0432\u043E\u0432\u0441\u0435, \u0438 \u0432\u0441\u0451 \u043A\u0430\u043A \u0431\u044B\u043B\u043E.
2039
+ */
2040
+ /*
2041
+ * \u0426\u041E\u041A\u041E\u041B\u042C \u0423\u0425\u041E\u0414\u0418\u0422 \u0412 \u0417\u0415\u041C\u041B\u042E, \u0410 \u041D\u0415 \u0421\u0410\u0414\u0418\u0422\u0421\u042F \u041D\u0410 \u041D\u0415\u0401.
2042
+ *
2043
+ * \u0412\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043F\u043E\u0434 \u0434\u043E\u043C\u043E\u043C \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0432\u0435\u0440\u0448\u0438\u043D\u0435, \u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u2014 30\u201360 \u043C: \u0443 \u0434\u043E\u043C\u0430 \u043D\u0430
2044
+ * \u0441\u043A\u043B\u043E\u043D\u0435 \u0443\u0433\u043B\u044B \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043D\u0430 \u0440\u0430\u0437\u043D\u044B\u0445 \u043E\u0442\u043C\u0435\u0442\u043A\u0430\u0445, \u0438 \u043F\u043E\u0441\u0442\u0430\u0432\u044C \u043C\u044B \u0446\u043E\u043A\u043E\u043B\u044C \u0440\u043E\u0432\u043D\u043E \u043D\u0430 \u043D\u0438\u0445, \u0447\u0430\u0441\u0442\u044C \u0434\u043E\u043C\u0430
2045
+ * \u043F\u043E\u0432\u0438\u0441\u043B\u0430 \u0431\u044B \u0432 \u0432\u043E\u0437\u0434\u0443\u0445\u0435. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u043D\u0438\u0436\u0435 \u0437\u0435\u043C\u043B\u0438 \u043D\u0430 BASEMENT: \u043F\u043E\u0434\u0432\u0430\u043B \u043D\u0435 \u0432\u0438\u0434\u043D\u043E,
2046
+ * \u0430 \u0434\u043E\u043C \u0441\u0442\u043E\u0438\u0442 \u043F\u0440\u0438 \u043B\u044E\u0431\u043E\u043C \u043D\u0430\u043A\u043B\u043E\u043D\u0435 \u0441\u043A\u043B\u043E\u043D\u0430 \u0438 \u043F\u0440\u0438 \u043B\u044E\u0431\u043E\u0439 \u043F\u043E\u0433\u0440\u0435\u0448\u043D\u043E\u0441\u0442\u0438 DEM. \u0422\u043E\u0442 \u0436\u0435 \u043F\u0440\u0438\u0451\u043C \u0443 MapLibre
2047
+ * (base_terrain3d_offset \u0441 \u0437\u0430\u043F\u0430\u0441\u043E\u043C \u0432 10 \u043C).
2048
+ */
2049
+ const float BASEMENT = 12.0;
2050
+ float ground = terrainHeight(pos / u_extent);
2051
+ float wall = a_height / 32.0;
2052
+ // \u041D\u043E\u043B\u044C \u2014 \u044D\u0442\u043E \u0446\u043E\u043A\u043E\u043B\u044C: \u0435\u043C\u0443 \u0438 \u0443\u0445\u043E\u0434\u0438\u0442\u044C \u0432\u043D\u0438\u0437. \u041A\u0440\u044B\u0448\u0430 \u043F\u043E\u0434\u043D\u0438\u043C\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u0441\u0432\u043E\u044E \u0432\u044B\u0441\u043E\u0442\u0443 \u043E\u0442 \u0437\u0435\u043C\u043B\u0438.
2053
+ float h = wall > 0.0 ? (wall * u_height_scale + ground) : (ground - BASEMENT);
1732
2054
  vec4 local = vec4(pos, h, 1.0);
1733
2055
  gl_Position = u_matrix * local;
1734
2056
 
@@ -1744,7 +2066,7 @@ void main() {
1744
2066
  v_wall = a_wall / 32.0;
1745
2067
  v_view = u_camera_local - vec3(pos * u_meters_per_unit, h);
1746
2068
  }
1747
- `,rf=`
2069
+ `,Nd=`
1748
2070
  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
1749
2071
  uniform vec3 u_window_color;
1750
2072
  uniform vec3 u_window_frame;
@@ -2009,15 +2331,15 @@ vec3 roofHue(vec3 base, float seed) {
2009
2331
  float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
2010
2332
  return hue * (baseLum / hueLum);
2011
2333
  }
2012
- `,tl=`#version 300 es
2334
+ `,Ec=`#version 300 es
2013
2335
  precision highp float;
2014
2336
 
2015
- ${$r}
2337
+ ${ki}
2016
2338
 
2017
- ${Xt}
2018
- ${Kt}
2019
- ${rt}
2020
- ${rf}
2339
+ ${Vo}
2340
+ ${No}
2341
+ ${yt}
2342
+ ${Nd}
2021
2343
 
2022
2344
  in vec3 v_normal;
2023
2345
  in float v_ao;
@@ -2030,6 +2352,9 @@ in vec3 v_wall;
2030
2352
 
2031
2353
  uniform vec4 u_wall_color;
2032
2354
  uniform vec4 u_roof_color;
2355
+ /** \u0426\u0432\u0435\u0442 \u0444\u0438\u0447\u0438 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B; \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442, \u0442\u043E\u043B\u044C\u043A\u043E \u043A\u043E\u0433\u0434\u0430 u_data_color = 1 (\u0441\u043C. BUILDINGS_VERT). */
2356
+ flat in vec4 v_dcolor;
2357
+ uniform float u_data_color;
2033
2358
  uniform float u_opacity;
2034
2359
  uniform float u_ao_strength;
2035
2360
  uniform float u_tint_variation;
@@ -2048,6 +2373,9 @@ void main() {
2048
2373
  bool isRoof = surface == 1 || surface == 2;
2049
2374
 
2050
2375
  vec3 albedo = isRoof ? u_roof_color.rgb : u_wall_color.rgb;
2376
+ // \u0426\u0432\u0435\u0442 \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445 \u043A\u0440\u0430\u0441\u0438\u0442 \u0434\u043E\u043C \u0426\u0415\u041B\u0418\u041A\u041E\u041C \u2014 \u0438 \u0441\u0442\u0435\u043D\u0443, \u0438 \u043A\u0440\u043E\u0432\u043B\u044E: \u0432 \u0441\u0442\u0438\u043B\u0435 MapLibre \u0443 \u043E\u0431\u044A\u0451\u043C\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F
2377
+ // \u0446\u0432\u0435\u0442 \u043E\u0434\u0438\u043D (fill-extrusion-color), \u0430 \u0440\u0430\u0437\u0432\u043E\u0434\u0438\u0442 \u0433\u0440\u0430\u043D\u0438 \u0441\u0432\u0435\u0442, \u0430 \u043D\u0435 \u0440\u0430\u0437\u043D\u0430\u044F \u043A\u0440\u0430\u0441\u043A\u0430.
2378
+ albedo = mix(albedo, v_dcolor.rgb, u_data_color);
2051
2379
 
2052
2380
  // \u0440\u0430\u0437\u0431\u0440\u043E\u0441 \u043E\u0442\u0442\u0435\u043D\u043A\u0430 \u043F\u043E \u0437\u0434\u0430\u043D\u0438\u044F\u043C: \u043A\u0432\u0430\u0440\u0442\u0430\u043B \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044B\u0442\u044C \u0441\u043F\u043B\u043E\u0448\u043D\u043E\u0439 \u043C\u0430\u0441\u0441\u043E\u0439
2053
2381
  albedo *= 1.0 + (v_tint - 0.5) * 2.0 * u_tint_variation;
@@ -2208,14 +2536,17 @@ void main() {
2208
2536
  // \u0442\u0435\u043D\u0435\u0432\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u0434\u043E\u043C\u0430 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0432\u0438\u0434\u043D\u043E \u0434\u0430\u0436\u0435 \u044F\u0440\u0447\u0435, \u0447\u0435\u043C \u043D\u0430 \u0441\u043E\u043B\u043D\u0435\u0447\u043D\u043E\u0439.
2209
2537
  color += u_window_color * glow * 0.55;
2210
2538
 
2211
- float alpha = u_opacity * u_wall_color.a;
2539
+ float alpha = u_opacity * mix(u_wall_color.a, v_dcolor.a, u_data_color);
2212
2540
  // \u0412\u044B\u0441\u043E\u0442\u0443 \u0437\u043D\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0434\u0430\u043D\u0438\u0435 \u2014 \u043E\u043D\u043E \u0438 \u043F\u0440\u043E\u0441\u0438\u0442 \u0434\u044B\u043C\u043A\u0443 \u0441 \u0435\u0451 \u0443\u0447\u0451\u0442\u043E\u043C: \u043D\u0438\u0437 \u0432 \u043C\u0433\u043B\u0435, \u0432\u0435\u0440\u0445 \u0447\u0438\u0449\u0435.
2213
2541
  fragColor = tileTint(vec4(applyFogAt(color, v_up) * alpha, alpha));
2214
2542
  }
2215
- `,ol=`#version 300 es
2543
+ `,Ac=`#version 300 es
2216
2544
  precision highp float;
2217
2545
 
2218
- ${Kr}
2546
+ ${Si}
2547
+ ${Bt}
2548
+
2549
+ uniform float u_extent; // \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u0442\u0430\u0439\u043B\u0430 \u0432 \u0435\u0433\u043E \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u2014 \u043F\u043E \u043D\u0435\u0439 \u0438\u0449\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0430
2219
2550
 
2220
2551
  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)
2221
2552
  in float a_level; // \u043C\u0435\u0442\u0440\u044B \xD7 SURFACE_LEVEL_SCALE (64)
@@ -2236,7 +2567,18 @@ out vec2 v_world;
2236
2567
  out vec4 v_shadow;
2237
2568
 
2238
2569
  void main() {
2239
- float level = (a_level / 64.0) * u_relief;
2570
+ /*
2571
+ * \u0421\u0412\u041E\u0419 \u0423\u0420\u041E\u0412\u0415\u041D\u042C \u041F\u041B\u042E\u0421 \u0412\u042B\u0421\u041E\u0422\u0410 \u0417\u0415\u041C\u041B\u0418.
2572
+ *
2573
+ * \u0423\u0442\u043E\u043F\u043B\u0435\u043D\u043D\u0430\u044F \u0432\u043E\u0434\u0430 \u2014 \u044D\u0442\u043E \u0435\u0451 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u0430\u044F \u0444\u043E\u0440\u043C\u0430: \u0440\u0443\u0441\u043B\u043E \u043D\u0438\u0436\u0435 \u0431\u0435\u0440\u0435\u0433\u0430 \u043D\u0430 \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u043E\u0432, \u0438 \u044D\u0442\u0438
2574
+ * \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u043E\u0432 \u043D\u0435 \u0437\u0430\u0432\u0438\u0441\u044F\u0442 \u043E\u0442 \u0442\u043E\u0433\u043E, \u043B\u0435\u0436\u0438\u0442 \u0440\u0435\u043A\u0430 \u0432 \u0434\u043E\u043B\u0438\u043D\u0435 \u0438\u043B\u0438 \u043D\u0430 \u0441\u043A\u043B\u043E\u043D\u0435. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u043A \u0443\u0440\u043E\u0432\u043D\u044E
2575
+ * \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u043F\u0440\u0438\u0431\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043F\u043E\u0434 \u0442\u043E\u0447\u043A\u043E\u0439 \u2014 \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u0440\u0435\u043B\u044C\u0435\u0444\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043E\u0437\u0435\u0440\u043E \u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C
2576
+ * \u0431\u044B \u043D\u0430 \u043D\u0443\u043B\u0435 \u0438 \u0443\u0448\u043B\u043E \u0432\u043D\u0443\u0442\u0440\u044C \u0433\u043E\u0440\u044B.
2577
+ *
2578
+ * \u0411\u0435\u0437 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u043D\u0435 \u043F\u0440\u043E\u0438\u0441\u0445\u043E\u0434\u0438\u0442 \u0432\u043E\u0432\u0441\u0435 (\u043D\u0443\u043B\u0435\u0432\u043E\u0435 \u043F\u0440\u0435\u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u0435), \u0438 \u043E\u0431\u044B\u0447\u043D\u044B\u0435 \u0441\u0442\u0438\u043B\u0438 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442
2579
+ * \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u0440\u0430\u043D\u044C\u0448\u0435.
2580
+ */
2581
+ float level = (a_level / 64.0) * u_relief + terrainHeight(a_pos / u_extent);
2240
2582
 
2241
2583
  // \u041D\u0430\u0445\u043B\u0451\u0441\u0442 \u043F\u043E \u043B\u0438\u043D\u0438\u0438 \u0440\u0430\u0437\u0440\u0435\u0437\u0430: \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u0435 \u0442\u0430\u0439\u043B\u044B \u0441\u0447\u0438\u0442\u0430\u044E\u0442 \u043E\u0431\u0449\u0443\u044E \u0433\u0440\u0430\u043D\u0438\u0446\u0443 \u0440\u0430\u0437\u043D\u044B\u043C\u0438
2242
2584
  // \u043C\u0430\u0442\u0440\u0438\u0446\u0430\u043C\u0438 \u0438 \u0432\u043E Float32 \u0440\u0430\u0441\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u043D\u0430 \u0434\u043E\u043B\u0438 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u2014 \u0441\u043A\u0432\u043E\u0437\u044C \u0432\u043E\u0434\u0443 \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u043B\u0430
@@ -2267,15 +2609,15 @@ void main() {
2267
2609
  v_world = u_world_origin + pos * u_meters_per_unit;
2268
2610
  v_shadow = u_shadow_matrix * local;
2269
2611
  }
2270
- `,rl=`#version 300 es
2612
+ `,Rc=`#version 300 es
2271
2613
  precision highp float;
2272
2614
 
2273
- ${$r}
2615
+ ${ki}
2274
2616
 
2275
- ${Xt}
2276
- ${Kt}
2277
- ${rt}
2278
- ${Xr}
2617
+ ${Vo}
2618
+ ${No}
2619
+ ${yt}
2620
+ ${Ci}
2279
2621
 
2280
2622
  in vec3 v_normal;
2281
2623
  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
@@ -2324,7 +2666,7 @@ void main() {
2324
2666
 
2325
2667
  fragColor = tileTint(vec4(applyFog(color) * alpha, alpha));
2326
2668
  }
2327
- `,nl=`#version 300 es
2669
+ `,Ic=`#version 300 es
2328
2670
  precision highp float;
2329
2671
 
2330
2672
  in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
@@ -2354,7 +2696,7 @@ void main() {
2354
2696
  v_scale = a_scale;
2355
2697
  v_fade = a_fade;
2356
2698
  }
2357
- `,il=`#version 300 es
2699
+ `,Lc=`#version 300 es
2358
2700
  precision highp float;
2359
2701
 
2360
2702
  in vec2 v_tex;
@@ -2362,6 +2704,17 @@ in float v_scale; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0445
2362
2704
  in float v_fade; // 0..1 \u2014 \u043F\u043B\u0430\u0432\u043D\u043E\u0435 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u043E\u0434\u043F\u0438\u0441\u0438
2363
2705
 
2364
2706
  uniform sampler2D u_atlas;
2707
+ /**
2708
+ * \u0426\u0412\u0415\u0422\u041D\u041E\u0419 \u0410\u0422\u041B\u0410\u0421 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F (map.addImage).
2709
+ *
2710
+ * \u041E\u0442\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u0430 \u0438 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0432\u0435\u0442\u043A\u0430, \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u0443 \u043D\u0430\u0448\u0438\u0445 \u0437\u043D\u0430\u0447\u043A\u043E\u0432 \u0438\u0437 \u0430\u0442\u043B\u0430\u0441\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0424\u041E\u0420\u041C\u0410, \u0430
2711
+ * \u0446\u0432\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0442\u0438\u043B\u044C; \u0443 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0446\u0432\u0435\u0442\u0430 \u0441\u0432\u043E\u0438, \u0438 \u043A\u0440\u0430\u0441\u0438\u0442\u044C \u0435\u0451 \u043D\u0435\u0447\u0435\u043C \u2014 \u0435\u0451 \u043D\u0430\u0434\u043E \u043F\u0440\u043E\u0441\u0442\u043E
2712
+ * \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C. \u0412\u0435\u0442\u043A\u0430 \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044F \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u043E\u043C \u043D\u0430 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438: \u0437\u043D\u0430\u0447\u043A\u0438 \u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u0438 \u0442\u0430\u043A \u0440\u0438\u0441\u0443\u044E\u0442\u0441\u044F
2713
+ * \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u043C\u0438 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430\u043C\u0438 (\u0441\u043C. SymbolRenderer.draw), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432\u0435\u0442\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u043D\u0443\u0442\u0440\u0438 \u0431\u0443\u043A\u0432\u044B \u043D\u0435 \u0432\u043E\u0437\u043D\u0438\u043A\u0430\u0435\u0442.
2714
+ */
2715
+ uniform sampler2D u_images;
2716
+ uniform float u_image_mode; // 1 \u2014 \u0440\u0438\u0441\u0443\u0435\u043C \u0446\u0432\u0435\u0442\u043D\u0443\u044E \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0443 \u043A\u0430\u043A \u0435\u0441\u0442\u044C
2717
+ uniform float u_image_opacity;
2365
2718
  uniform vec4 u_color; // premultiplied
2366
2719
  uniform vec4 u_halo_color; // premultiplied
2367
2720
  uniform float u_edge; // \u043A\u0440\u0430\u0439 \u0444\u0438\u0433\u0443\u0440\u044B \u0432 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0445 SDF (0.75)
@@ -2378,6 +2731,13 @@ const float EDGE_GAMMA = 0.105;
2378
2731
  out vec4 fragColor;
2379
2732
 
2380
2733
  void main() {
2734
+ if (u_image_mode > 0.5) {
2735
+ // \u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F: \u0446\u0432\u0435\u0442 \u0435\u0451 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439, \u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u0438 SDF \u0435\u0439 \u043D\u0438 \u043A \u0447\u0435\u043C\u0443.
2736
+ vec4 texel = texture(u_images, v_tex);
2737
+ fragColor = vec4(texel.rgb * texel.a, texel.a) * v_fade * u_image_opacity;
2738
+ return;
2739
+ }
2740
+
2381
2741
  float d = texture(u_atlas, v_tex).r;
2382
2742
 
2383
2743
  // \u0428\u0438\u0440\u0438\u043D\u0443 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F \u0441\u0447\u0438\u0442\u0430\u0435\u043C \u041F\u041E \u041C\u0410\u0421\u0428\u0422\u0410\u0411\u0423 \u043A\u0432\u0430\u0434\u0430, \u0430 \u043D\u0435 \u0447\u0435\u0440\u0435\u0437 fwidth.
@@ -2404,6 +2764,6 @@ void main() {
2404
2764
  if (color.a <= 0.001) discard;
2405
2765
  fragColor = color;
2406
2766
  }
2407
- `;var Vo=i=>i.kind==="symbol",al=i=>i.kind==="placement";function $e(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],u=r[n+5];if(nf(e,t,a,l,s,c,f,u)||o>0&&(Zr(e,t,a,l,s,c)<=o||Zr(e,t,s,c,f,u)<=o||Zr(e,t,f,u,a,l)<=o))return true}return false}function nf(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),u=s<0||c<0||f<0,d=s>0||c>0||f>0;return !(u&&d)}function Zr(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 Qr(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]*et;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 Jr(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]*ze;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var lf={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},sf=40,cf=10.5,ll=2.5,ff=16,uf=4,df=7,Yt=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 u=t.center,d=ne(u.lng),h=ie(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let x=o.get(w.source??j);if(!x)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let T=w.layout?.showFor==="highlight";if(T&&!this.highlightFootprint)continue;let C=m*1.5,E=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,L=D(w.layout?.arrowLength,c,sf)*E,A=D(w.layout?.arrowWidth,c,cf)*E,M=D(w.layout?.arrowOutline,c,ll)*E,R=D(w.layout?.arrowGap,c,ff)*E,I=D(w.layout?.arrowDotRadius,c,uf)*E,k=D(w.layout?.arrowDotGap,c,df)*E,H=tn(L,A,I,R-k),B=M>0?tn(L,A,I,R-k,M).outline:null,F={layer:w,verts:[],shape:H};for(let P of x.visibleTiles){let O=x.getTile(P)?.data?.buckets?.[_];if(!O||!Vo(O))continue;let W=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,N=P.bounds(),K=(N.maxX-N.minX)/O.extent,$=N.minX,Q=N.minY;for(let Z=0;Z<W.length/2;Z++){let X=$+W[Z*2]*K,oe=Q+W[Z*2+1]*K;if(T&&!$e(this.highlightFootprint,X,oe,C))continue;let re=(V?V[Z]:0)*Math.PI/180,se=Math.sin(re),ue=-Math.cos(re),Me=X-d-se*R,de=oe-h-ue*R;B&&on(F,B,Me,de,se,ue),on(F,H.outline,Me,de,se,ue),this.count++;}}F.verts.length&&y.push(F);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let x=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:x,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(d,h,0)),n.setMat4("u_matrix",t.objectMatrix(d,h,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let w of v){let x=w.layer.paint,_=D(x.opacity,c,1),T=L=>L&&typeof L=="object"&&"from"in L?void 0:L,C=He(T(x.color),c,[.18,.45,.76,1]),S=He(T(x.haloColor),c,[1,1,1,1]),E=D(w.layer.layout?.arrowOutline,c,ll)>0;hf(e,n,w,S,C,_,E,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),lf,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 ce(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 hf(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",ke([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)sl(i,t.first+c,l);}e.setVec4v("u_color",ke([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)sl(i,t.first+c,l);}function sl(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var cl=4,en=12;function tn(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,u=[],d=(b,g)=>u.push(b,g);d(0,0),d(-n,a),d(-n+l,c),d(f,s);for(let b=1;b<cl;b++){let g=b/cl*Math.PI;d(f-Math.sin(g)*s,Math.cos(g)*s);}d(f,-s),d(-n+l,-c),d(-n,-a);let h=r>0?mf(u,r):u,m=ki__default.default(u,void 0,2);if(t<=0)return {outline:h,indices:m};let y=h.length/2,p=t+r;for(let b=0;b<en;b++){let g=b/en*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<en-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function mf(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],u=i[(a+1)%t*2],d=i[(a+1)%t*2+1],h=Math.hypot(c-l,f-s)||1,m=Math.hypot(u-c,d-f)||1,y=r*(f-s)/h,p=-r*(c-l)/h,b=r*(d-f)/m,g=-r*(u-c)/m,v=y+b,w=p+g,x=Math.hypot(v,w);if(x<1e-9){n.push(c,f);continue}v/=x,w/=x;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function on(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 pf(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return on(s,tn(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var bf=5;function fl(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var Do=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 u=a.get(f.source);if(!u)continue;let d=D(f.paint?.opacity,l,1);if(!(d<=.001)){r.setFloat("u_opacity",d),o.bind();for(let h of u.visibleTiles){let m=this.patchFor(e,u,h);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(h,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<=bf&&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:fl(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 yf="indoor-",$t=class{constructor(){this.parts=null;this.stamp="";this.cache=new z;this.box=null;this.hidden=new ee;this.collected=new ee;}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 d of t.layers){if(!d.id.startsWith(yf)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??j)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(d=>d.dataKey+(n.getTile(d)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,u=-1/0;for(let d of n.visibleTiles){let h=n.getTile(d)?.data?.buckets;if(h)for(let m of r){let y=h[m];if(!y||y.kind!=="fill")continue;let p=Qr(y,d);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]>u&&(u=p[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,u]: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 z;for(let u=0;u*3<r.length;u++){let d=n[u];if(this.hidden.has(d))continue;let h=f.get(d);h||f.set(d,h=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[u*3+m]*ze,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<h[0]&&(h[0]=p),b<h[1]&&(h[1]=b),p>h[2]&&(h[2]=p),b>h[3]&&(h[3]=b);}}for(let[u,d]of f){let h=l.minX+(d[0]+d[2])/2*s,m=l.minY+(d[1]+d[3])/2*s;c&&(h<c[0]||h>c[2]||m<c[1]||m>c[3])||$e(o,h,m,0)&&this.hidden.add(u);}}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),u=new Float64Array(s.featureIds),d=[];for(let h=0;h*3<f.length;h++)this.hidden.has(u[h])||d.push(f[h*3],f[h*3+1],f[h*3+2]);if(d.length<f.length){let h=new ce(e,new Uint32Array(d));c={vao:new le(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var ul=35,gf=70,vf=.35,wf=.5,xf=1.1;function Mt(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=Ce((i.pitch-ul)/(gf-ul),0,1),n=t.fogRange[0]*(1-vf*r)*o,a=t.fogRange[1]*(1-wf*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*xf:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function rn(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 u=e.getTile(f),d=u&&dl(u,t);if(!d||!Ge(l,i.tileMatrix64(f,d.extent))||(pe(s,l,[r,n,-1,1]),pe(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let h=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-h,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=Cf(d,h,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 nn(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 u=e.getTile(f);if(u)for(let d of t){let h=u.data?.buckets?.[d];if(!h||h.kind!=="fill"||!h.featureIds||!Ge(l,i.tileMatrix64(f,h.extent))||(pe(s,l,[r,n,-1,1]),pe(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,x=_f(h,v,w);x!==null&&(!a||g<a.distance)&&(a={featureId:x,tile:f,layerId:d,distance:g});}}return a}function _f(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*et,true),l=s=>o.getInt16(s*et+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],u=r[s*3+2],d=a(c),h=l(c),m=a(f),y=l(f),p=a(u),b=l(u),g=(e-m)*(h-y)-(d-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),w=(e-d)*(b-h)-(p-d)*(t-h),x=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(x&&_))return n[s]}return null}function dl(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Cf(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*ze,true)/vt,u=y=>l.getInt16(y*ze+2,true)/vt,d=y=>l.getUint16(y*ze+4,true)/wt,h=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=u(p),x=d(p),_=f(b)-v,T=u(b)-w,C=d(b)-x,S=f(g)-v,E=u(g)-w,L=d(g)-x,A=n*L-a*E,M=a*S-r*L,R=r*E-n*S,I=_*A+T*M+C*R;if(I>-1e-9&&I<1e-9)continue;let k=1/I,H=e-v,B=t-w,F=o-x,P=(H*A+B*M+F*R)*k;if(P<0||P>1)continue;let G=B*C-F*T,O=F*_-H*C,W=H*T-B*_,V=(r*G+n*O+a*W)*k;if(V<0||P+V>1)continue;let N=(S*G+E*O+L*W)*k;N<0||N>1||N>=h||(h=N,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function No(i,e,t){let o=dl(i,e);return o?an(o,t):null}function an(i,e){if(!i.featureIds)return null;let t=new Uint32Array(i.indices),o=new Float64Array(i.featureIds),r=[];for(let n=0;n+2<t.length;n+=3)o[n/3]===e&&r.push(t[n],t[n+1],t[n+2]);return r.length?{vertices:i.vertices,indices:new Uint32Array(r)}:null}var Tt=24,ln=8,Mf=2,Tf=12,Go=8,Uo=8;function qt(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(Go+2)*2,o=e*t+i.length*(Uo+2)*2+8,r=e*(Go+2)*6+i.length*Uo*6+24,n=new ArrayBuffer(o*Tt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*Tt;return a.setFloat32(v,h,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++},u=(h,m,y,p)=>{l[c++]=h,l[c++]=m,l[c++]=p,l[c++]=h,l[c++]=p,l[c++]=y;},d=(h,m,y,p,b,g,v)=>{let w=f(h,m,0,0,0,v),x=f(h,m,y,p,1,v);for(let _=1;_<=Uo;_++){let T=Math.PI*_/Uo,C=y*Math.cos(T)+b*Math.sin(T),S=p*Math.cos(T)+g*Math.sin(T),E=f(h,m,C,S,1,v);l[c++]=w,l[c++]=x,l[c++]=E,x=E;}};for(let h of i){let m=kf(h),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 T=m[_*2+2]-m[_*2],C=m[_*2+3]-m[_*2+1],S=Math.hypot(T,C)||1;p[_]=T/S,b[_]=C/S;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let T=m[_*2],C=m[_*2+1];_>0&&(g+=Math.hypot(T-m[_*2-2],C-m[_*2-1]));let S=_>0?_-1:0,E=_<y-1?_:y-2,L=-b[S],A=p[S],M=-b[E],R=p[E],I=L+M,k=A+R,H=Math.hypot(I,k);H>1e-9?(I/=H,k/=H):(I=L,k=A);let B=I*M+k*R,F=B>1e-6?1/B:1/0,P=Math.acos(Math.min(1,Math.max(-1,p[S]*p[E]+b[S]*b[E])));if(!(P>Tf*Math.PI/180)&&F<=Mf){let O=f(T,C,I*F,k*F,1,g),W=f(T,C,-I*F,-k*F,-1,g);v>=0&&u(v,w,O,W),v=O,w=W;}else {let O=Math.max(1,Math.min(Go,Math.ceil(P/(Math.PI/Go)))),V=p[S]*b[E]-b[S]*p[E]>=0?1:-1,N=f(T,C,L,A,1,g),K=f(T,C,-L,-A,-1,g);v>=0&&u(v,w,N,K);for(let $=1;$<=O;$++){let Q=V*P*($/O),Z=Math.cos(Q),X=Math.sin(Q),oe=L*Z-A*X,re=L*X+A*Z,se=f(T,C,oe,re,1,g),ue=f(T,C,-oe,-re,-1,g);u(N,K,se,ue),N=se,K=ue;}v=N,w=K;}}let x=y-2;d(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),d(m[(y-1)*2],m[(y-1)*2+1],-b[x],p[x],p[x],b[x],g);}return c?{vertices:n.slice(0,s*Tt),indices:l.slice(0,c),vertexCount:s}:null}function sn(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=ki__default.default(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 kf(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 Zt=5126,Ef={stride:ln,attribs:[{name:"a_pos",size:2,type:Zt,offset:0}]},fn={stride:Tt,attribs:[{name:"a_pos",size:2,type:Zt,offset:0},{name:"a_extrude",size:2,type:Zt,offset:8},{name:"a_side",size:1,type:Zt,offset:16},{name:"a_dist",size:1,type:Zt,offset:20}]},cn=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();}},Af=(i,e)=>[i[0],i[1],i[2],i[3]*e],Qt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new z;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,u=t.width>0?f/t.width:1,d=t.worldSize*u,h=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:x}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?Af(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",ke(_)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {h!==n&&(n.use(),l?.(n),h=n);let T=v.width/2*u,C=d>1e-9?1/d:1;if(n.setVec4v("u_color",ke(_)),n.setFloat("u_half_width",T),n.setFloat("u_offset",(v.offset??0)*u),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",C),n.setFloat("u_units_to_px",d),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[S,E]=v.dashArray;n.setVec2("u_dash",S*u,(S+E)*u);}if(v.arrow){n.setVec4v("u_arrow_color",ke(v.arrowColor??[1,1,1,1]));let S=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(S*.4,1),Math.min(S,T*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(ne(a)*r,ie(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=te(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"?Ef:fn,f=s.kind==="fill"?o:r,u=new ye(e,new Uint8Array(s.mesh.vertices),c),d=new ce(e,s.mesh.indices),h=new le(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}let l=new cn(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 jo=32,If=1179937895,Lf=1313821514,Rf=5130562,Ff={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},zf={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function un(i){let{json:e,bin:t}=hl(i),o=await Hf(e,t);return pl(e,t,o)}function Pf(i){let{json:e,bin:t}=hl(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 pl(e,t,null)}function hl(i){let e=new DataView(i);if(e.getUint32(0,true)!==If)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===Lf?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===Rf&&(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 Hf(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 ml(i){let e=U();if(i.matrix){for(let C=0;C<16;C++)e[C]=i.matrix[C];return e}Xe(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,u]=i.scale??[1,1,1],d=n+n,h=a+a,m=l+l,y=n*d,p=n*h,b=n*m,g=a*h,v=a*m,w=l*m,x=s*d,_=s*h,T=s*m;return e[0]=(1-(g+w))*c,e[1]=(p+T)*c,e[2]=(b-_)*c,e[4]=(p-T)*f,e[5]=(1-(y+w))*f,e[6]=(v+x)*f,e[8]=(b+_)*u,e[9]=(v-x)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var Of={5120:127,5121:255,5122:32767,5123:65535};function Bf(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 u=1/f;return [(n*c-a*s)*u,(a*l-r*c)*u,(r*s-n*l)*u,(o*s-t*c)*u,(e*c-o*l)*u,(t*l-e*s)*u,(t*a-o*n)*u,(o*r-e*a)*u,(e*n-t*r)*u]}function pl(i,e,t){let o=C=>{let S=t?.get(C);if(S)return S;let E=i.bufferViews?.[C];if(!E)return null;let L=E.byteOffset??0;return e.subarray(L,L+E.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=C=>{if(C===void 0)return null;let S=i.accessors?.[C];if(!S)return null;let E=zf[S.type]??1,L=new Float64Array(S.count*E),A=S.bufferView!==void 0?i.bufferViews?.[S.bufferView]:void 0;if(!A||S.bufferView===void 0)return {data:L,components:E};let M=o(S.bufferView);if(!M)return {data:L,components:E};let R=Ff[S.componentType]??4,I=A.extensions?.EXT_meshopt_compression,k=I?I.byteStride:A.byteStride,H=k&&k>0?k:R*E,B=S.byteOffset??0,F=new DataView(M.buffer,M.byteOffset,M.byteLength),P=S.normalized?Of[S.componentType]??1:1;for(let G=0;G<S.count;G++)for(let O=0;O<E;O++){let W=B+G*H+O*R,V;switch(S.componentType){case 5120:V=F.getInt8(W);break;case 5121:V=F.getUint8(W);break;case 5122:V=F.getInt16(W,true);break;case 5123:V=F.getUint16(W,true);break;case 5125:V=F.getUint32(W,true);break;default:V=F.getFloat32(W,true);}L[G*E+O]=P===1?V:Math.max(V/P,-1);}return {data:L,components:E}},d=(C,S,E=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let L=u(C.attributes.POSITION);if(!L)return;let A=u(C.attributes.NORMAL),M=u(C.attributes.TEXCOORD_0),R=u(C.indices),I=r.length/3,k=L.data.length/3,H=Bf(S),F=(C.material!==void 0?i.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,P=F?{ox:F.offset?.[0]??0,oy:F.offset?.[1]??0,sx:F.scale?.[0]??1,sy:F.scale?.[1]??1,rot:F.rotation??0}:null;for(let X=0;X<k;X++){let oe=L.data[X*3],re=L.data[X*3+1],se=L.data[X*3+2],ue=S[0]*oe+S[4]*re+S[8]*se+S[12],Me=S[1]*oe+S[5]*re+S[9]*se+S[13],de=S[2]*oe+S[6]*re+S[10]*se+S[14];if(r.push(ue,Me,de),ue<c[0]&&(c[0]=ue),Me<c[1]&&(c[1]=Me),de<c[2]&&(c[2]=de),ue>f[0]&&(f[0]=ue),Me>f[1]&&(f[1]=Me),de>f[2]&&(f[2]=de),A){let _e=A.data[X*3],xe=A.data[X*3+1],J=A.data[X*3+2],q=H[0]*_e+H[3]*xe+H[6]*J,Y=H[1]*_e+H[4]*xe+H[7]*J,Te=H[2]*_e+H[5]*xe+H[8]*J,be=Math.hypot(q,Y,Te);be>1e-12?(q/=be,Y/=be,Te/=be):(q=0,Y=1,Te=0),n.push(q,Y,Te);}else n.push(0,1,0);let he=M?M.data[X*2]:0,ae=M?M.data[X*2+1]:0;if(P){if(P.rot!==0){let _e=Math.cos(P.rot),xe=Math.sin(P.rot),J=_e*he+xe*ae,q=-xe*he+_e*ae;he=J,ae=q;}he=he*P.sx+P.ox,ae=ae*P.sy+P.oy;}a.push(he,ae);}let G=l.length;if(R)for(let X=0;X<R.data.length;X++)l.push(I+R.data[X]);else for(let X=0;X<k;X++)l.push(I+X);let O=C.material!==void 0?i.materials?.[C.material]:void 0,W=O?.pbrMetallicRoughness,V=W?.metallicFactor!==void 0||W?.roughnessFactor!==void 0,N=W?.baseColorFactor??[1,1,1,1],K=W?.baseColorTexture?.index,$=K!==void 0?i.textures?.[K]?.source:void 0,Q=O?.emissiveFactor??[0,0,0],Z=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:G,indexCount:l.length-G,baseColor:[N[0],N[1],N[2],N[3]??1],metallic:V?W?.metallicFactor??1:0,roughness:V?W?.roughnessFactor??1:1,emissive:[Q[0]*Z,Q[1]*Z,Q[2]*Z],texture:$??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:E});},h=i.skins?.length?null:Wf(i,u),m=h?h.nodes:null,y=(C,S,E,L)=>{let A=i.nodes?.[C];if(!A)return;let M=ml(A),R=U();Se(R,S,M);let I=U(),k=L,H=m?.get(C);if(H?(H.parentNode=L,H.parent=E.slice(),Xe(I),k=C):Se(I,E,M),A.mesh!==void 0)for(let F of i.meshes?.[A.mesh]?.primitives??[])d(F,I,k);let B=A.extensions?.KHR_lights_punctual?.light;if(B!==void 0){let F=i.extensions?.KHR_lights_punctual?.lights?.[B],P=F?.type;if(F&&(P==="point"||P==="spot"||P==="directional")){let G=-R[8],O=-R[9],W=-R[10],V=Math.hypot(G,O,W)||1,N=F.spot?.innerConeAngle??0,K=F.spot?.outerConeAngle??Math.PI/4;p.push({type:P,color:[F.color?.[0]??1,F.color?.[1]??1,F.color?.[2]??1],intensity:F.intensity??1,range:F.range??0,position:[R[12],R[13],R[14]],direction:[G/V,O/V,W/V],cosInner:Math.cos(N),cosOuter:Math.cos(K)});}}for(let F of A.children??[])y(F,R,I,k);},p=[],b=U();Xe(b);let g=U();Xe(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((C,S)=>S)??[];for(let C of v)y(C,b,g,-1);let w=[];for(let C of i.images??[]){if(C.bufferView===void 0){w.push(new Uint8Array(0));continue}let S=o(C.bufferView);w.push(S?S.slice():new Uint8Array(0));}let x=r.length/3,_=new ArrayBuffer(x*jo),T=new Float32Array(_);for(let C=0;C<x;C++){let S=C*8;T[S]=r[C*3],T[S+1]=r[C*3+1],T[S+2]=r[C*3+2],T[S+3]=n[C*3],T[S+4]=n[C*3+1],T[S+5]=n[C*3+2],T[S+6]=a[C*2],T[S+7]=a[C*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:h,lights:p}}function Wf(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 u=l==="rotation"?4:3,d=s.interpolation==="CUBICSPLINE",h=c.data.length,m=new Float32Array(h*u);for(let p=0;p<h;p++){let b=d?(p*3+1)*u:p*u;for(let g=0;g<u;g++)m[p*u+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:Xe(U()),base:Vf(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[h-1]);}return o.size?{duration:r||1,nodes:o}:null}function Vf(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 dn(i,e,t,o){let r=i.nodes.get(e);if(!r)return Xe(o);let n=U();Df(r,t,n);let a=U();if(Se(a,r.parent,n),r.parentNode<0)return bl(o,a);let l=U();return dn(i,r.parentNode,t,l),Se(o,l,a)}var bl=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Df(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),u=a.times[f]-a.times[c],d=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),h=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[h+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[h+g]*(1-d)+a.values[m+g]*p*d,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[h+p]*(1-d)+a.values[m+p]*d;}}return bl(t,ml({translation:o,rotation:r,scale:n}))}var Pe=5126,Nf=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yl={stride:jo,attribs:[{name:"a_pos",size:3,type:Pe,offset:0},{name:"a_normal",size:3,type:Pe,offset:12},{name:"a_tex",size:2,type:Pe,offset:24}]},mn=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);}},hn=256,Xo=41,gl={stride:Xo*4,attribs:[{name:"a_i_m0",size:4,type:Pe,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Pe,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Pe,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Pe,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Pe,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Pe,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Pe,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Pe,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Pe,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Pe,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Pe,offset:152,divisor:1}]},Jt=2,kt=16,nt=class{constructor(){this.models=[];this.gpu=new z;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(hn*Xo);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",Jt);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 u=c.fade<1;o.setFloat("u_opacity",c.fade);let d=c.matrixFor(t);o.setMat4("u_matrix",d),o.setMat3("u_normal_matrix",c.normalMatrix());let h=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(!(u&&!y))for(let p of c.mesh.primitives){if(!u&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):d),h&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):h);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(Jt,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 z;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.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,gl,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",Jt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=hn){let h=Math.min(hn,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Xo;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):Nf;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,h*Xo)),e.bindVAO(f.instVao.vao);for(let m of u.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(Jt,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,h);}}}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<=kt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,kt),a=new Float32Array(kt*4),l=new Float32Array(kt*4),s=new Float32Array(kt*4),c=new Float32Array(kt*4);n.forEach((f,u)=>{let d=u*4;a[d]=f.position[0],a[d+1]=f.position[1],a[d+2]=f.position[2],a[d+3]=f.range,l[d]=f.color[0]*f.intensity,l[d+1]=f.color[1]*f.intensity,l[d+2]=f.color[2]*f.intensity,l[d+3]=f.type==="spot"?1:0,s[d]=f.direction[0],s[d+1]=f.direction[1],s[d+2]=f.direction[2],c[d]=f.cosInner,c[d+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),yl),l=new ce(e,t.mesh.indices),s=new le(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Jt,d),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),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),d):null}),f=new mn(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return yl}static get instanceLayout(){return gl}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var pn=4,vl=new ee;function Gf(i){vl.has(i)||(vl.add(i),console.warn(`[osmgl] ${i}`));}var Uf=.5,jf=.01,Xf=300,bn=127,Kf=.5,Et=128,eo=5120,Ko=5121,to=5122,wl=5123,oo=5126,Yf={stride:8,attribs:[{name:"a_pos",size:2,type:oo,offset:0}]},yn={stride:et,attribs:[{name:"a_pos",size:2,type:to,offset:0}]},xl={stride:tt,attribs:[{name:"a_p0",size:2,type:to,offset:0},{name:"a_p1",size:2,type:to,offset:4},{name:"a_corner",size:2,type:eo,offset:8},{name:"a_ground",size:2,type:eo,offset:10},{name:"a_dist",size:1,type:oo,offset:12},{name:"a_width",size:1,type:oo,offset:16}]},At={stride:ze,attribs:[{name:"a_pos",size:2,type:to,offset:0},{name:"a_height",size:1,type:wl,offset:4},{name:"a_tint",size:1,type:Ko,normalized:true,offset:6},{name:"a_ao",size:1,type:Ko,normalized:true,offset:7},{name:"a_normal",size:3,type:eo,normalized:true,offset:8},{name:"a_kind",size:1,type:Ko,offset:11},{name:"a_wall",size:3,type:wl,offset:12}]},$f={flat:0,water:1,foliage:2,sand:3,asphalt:4},qf=[1,9,14,26,3],_l={stride:xt,attribs:[{name:"a_pos",size:2,type:oo,offset:0},{name:"a_level",size:1,type:to,offset:8},{name:"a_normal",size:3,type:eo,normalized:true,offset:10},{name:"a_kind",size:1,type:Ko,offset:13},{name:"a_bleed",size:2,type:eo,offset:14}]},Yo=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();}},Cl={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},qo=class qo{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new z;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Do;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new z;this.lineLocs=new z;this.objectLine=null;this.objectLineLocs=new z;this.buildingLocs=new z;this.shadows={...Cl};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new z;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new z;this.highlightKey="";this.groundArrows=new Yt;this.highlightTris=new z;this.fillHighlightGpu=new z;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new $t;this.hiddenBuildings=new Set;this.seams=new Oo;this.seamGpu=new z;this.hiddenWithSeams=new z;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new z;this.hiddenStamp="";this.bucketIdCache=new z;this.surfaceCut=new z;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new nt;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new z;this.modelInstLocs=new z;this.uploadLeft=0;this.uploadDeferred=false;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((n,a)=>n-a).join(","),t="";for(let[r,n]of this.seams.hiddenByTile)t+=`${r}=${e(n)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,n]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let l of n)a.add(l);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.surfaceCut.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!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),d=[],h=0;for(let x=0;x<f.length;h++){let _=f[x++],T=_>0;for(let C=0;C<_;C++)if(!a.has(f[x+C])){T=false;break}x+=_,T&&d.push(h);}if(!d.length)return this.surfaceCut.set(l,null),null;let m=new Uint32Array(c.indices),y=c.capIndexOffset??m.length,p=new Uint8Array(m.length);for(let x of d){for(let _=u[x*4];_<u[x*4+1];_++)p[_]=1;for(let _=u[x*4+2];_<u[x*4+3];_++)p[_]=1;}let b=[];for(let x=0;x<y;x++)p[x]||b.push(m[x]);let g=b.length;for(let x=y;x<m.length;x++)p[x]||b.push(m[x]);let v=new ce(e,new Uint32Array(b)),w={vao:new le(e,[{buffer:n,locations:this.surfaceLocs}],v),ibo:v,vbo:n,mainCount:g,capCount:b.length-g};return this.surfaceCut.set(l,w),w}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let n=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:n,vbo:o}),n}syncSeams(e,t,o){let r=e.get(j);if(!(!r||!r.visibleTiles.length))for(let n of t.layers){if(n.type!=="fill-extrusion"||(n.source??j)!==j||!t.layerVisibleAt(n,o))continue;let a=t.bucketKeyFor(n);if(a===null)continue;let l=n,s=r.visibleTiles[0].z;this.seams.update(r,a,{zoom:s,metersPerTile:So(s),cornerRadius:l.cornerRadius,cornerSegments:l.cornerSegments})&&this.syncSeamGpu();return}}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a,l=this.buildingLocs){if(!a||!a.size)return null;let s=r+"|"+o,c=this.hiddenCut.get(s);if(c!==void 0&&(c===null||c.vbo===n))return c;c&&(c.vao.destroy(),c.ibo.destroy());let f=t.data?.buckets?.[o];if(!f||!("featureIds"in f)||!f.featureIds)return null;let u=this.bucketIds(s,f.featureIds,n),[d,h]=a.size<u.size?[a,u]:[u,a],m=false;for(let v of d)if(h.has(v)){m=true;break}if(!m)return this.hiddenCut.set(s,null),null;let y=new Uint32Array(f.indices),p=new Float64Array(f.featureIds),b=[];for(let v=0;v*3<y.length;v++)a.has(p[v])||b.push(y[v*3],y[v*3+1],y[v*3+2]);let g=null;if(b.length<y.length){let v=new ce(e,new Uint32Array(b));g={vao:new le(e,[{buffer:n,locations:l}],v),ibo:v,count:b.length,vbo:n};}return this.hiddenCut.set(s,g),g}init(e){this.symbols?.init(e),this.fill=new ge(e,"fill",Ya,$a),this.surface=new ge(e,"surface",ol,rl),this.line=new ge(e,"line",qa,Za),this.objectLine=new ge(e,"objectLine",Qa,Ja),this.building=new ge(e,"buildings",el,tl),this.depth=new ge(e,"depth",Oa,Yr),this.groundShadow=new ge(e,"groundShadow",Xa,Ka),this.sky=new ge(e,"sky",Na,Ga),this.raster=new ge(e,"raster",Ua,ja),this.globeBody=new ge(e,"globeBody",Fa,za),this.globeClip=new ge(e,"globeClip",Pa,Ha),this.globeMesh=Zf(e,this.globeBody),this.model=new ge(e,"model",Wa,qr),this.modelInstanced=new ge(e,"model-instanced",Va,qr),this.modelDepth=new ge(e,"modelDepth",Da,Yr);for(let n of nt.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...nt.layout.attribs,...nt.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=La(e);let t=new z([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),Yf),r=new ce(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 yn.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of _l.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of xl.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of fn.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of At.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new z){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.uploadLeft=qo.UPLOAD_BUDGET,this.uploadDeferred=false,this.materialTime=n/1e3,this.materialAnimating=false,this.fog=Mt(t,r),this.patternScale=_o/Math.max(We(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=p=>o.get(p.source??j);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncSeams(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 d=p=>p.type==="line"&&D(p.paint.elevation,l,0)!==0,h=new Set;for(let p of r.layers){if(p.type==="raster"||p.type==="fill-extrusion"||p.type==="symbol"||p.overlay||d(p)||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(h.has(p.network))continue;h.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&!d(g)&&r.layerVisibleAt(g,l));continue}if(p.type==="surface"){if(!this.flattened(b,r,p))continue;this.drawFill(e,t,b,r,p,l);continue}p.type==="fill"?this.drawFill(e,t,b,r,p,l):this.drawLine(e,t,b,r,p,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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 p of r.layers){if(p.type!=="surface"||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.flattened(b,r,p)||this.drawSurface(e,t,b,r,p,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let p of r.layers){if(p.type==="raster"||!d(p)||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(m.has(p.network))continue;m.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&d(g)&&r.layerVisibleAt(g,l));continue}this.drawLine(e,t,b,r,p,l);}}this.drawOverlay(e,t,r,u,l,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.drawBuildings(e,t,b,r,p,l,n)&&(s=true),this.drawHighlight(e,t,b,r,p,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,p=>{this.applyShadowUniforms(p),this.applyFogUniforms(p,t,r),this.applyLight(p,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),this.drawOverlay(e,t,r,u,l,"volume"),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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 y=r.layers.filter(p=>p.type==="line"&&D(p.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(p,l));if(y.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of y){let b=u(p);b&&this.drawLine(e,t,b,r,p,l,D(p.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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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||this.uploadDeferred}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(pn,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(u=>u.type==="fill-extrusion"&&!u.overlay&&r.layerVisibleAt(u,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new jt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(It(l.keyAzimuth,l.keyAltitude),Xf),!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 u of a){let d=o.get(u.source??j);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=D(u.paint.heightScale,t.zoom,1);(u.source??j)===j&&this.indoorMask.prepare(d,h);for(let y of d.visibleTiles){if(!this.drawsTile(t,r,u,y))continue;let p=d.getTile(y),b=p&&this.bucketFor(e,p,h,At,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!d.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(u.source??j)===j,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g,y.dataKey)),w=g?v??this.indoorMask.indicesFor(e,p,h,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));}}if(this.seams.meshes.size){let u=a.find(d=>(d.source??j)===j);if(u){f.setFloat("u_height_scale",D(u.paint.heightScale,t.zoom,1));for(let[d,{tile:h,mesh:m}]of this.seams.meshes){let y=this.seamBucket(e,d,m);f.setMat4("u_matrix",t.shadowTileMatrix(h,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,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(pn),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,o),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),De(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(pe(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);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(Be(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),De(r,"u_sky_color",o.sky.skyColor),De(r,"u_horizon_color",o.sky.horizonColor),Qf(r,o.sky);let[n,a]=this.skyBand(t,o),l=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",n,a,l),this.applyAtmosphere(r,t,o);let s=t.cameraRay();r.setVec3("u_cam_right",s.right[0],s.right[1],s.right[2]),r.setVec3("u_cam_up",s.up[0],s.up[1],s.up[2]),r.setVec3("u_cam_fwd",s.fwd[0],s.fwd[1],s.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=It(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),De(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){De(r,"u_space_color",o.sky.spaceColor),De(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[d,h,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",d[0],d[1],d[2]),r.setVec3("u_ray_tr",h[0],h[1],h[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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,n=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,n),e.setVec2("u_globe_center",t.centerPointPx.x/n,t.centerPointPx.y/n);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let l=It(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-l[0],-l[1],-l[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.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??Mt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}De(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[n,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",n,a),this.applyAtmosphere(e,t,o);}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,D(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Uf/Math.max(t.pixelsPerMeter,1e-9),jf);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,bn);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(j);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>bn)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,bn),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||t.globeActive)return;let n=o.get(j);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 u=0;u<4;u++)s[12+u]+=l*f[8+u];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(j);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=It(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=me(l.ambientColor),u=me(l.keyColor),d=[0,0,0];for(let h=0;h<3;h++){let m=f[h]*l.ambientIntensity,y=u[h]*l.keyIntensity*c;d[h]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",d[0],d[1],d[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 h of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,1)),a.setMat4("u_matrix",t.tileMatrix(h,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",pn),!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=me(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,n,a){let l=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};l();for(let s of o.layers){if(s.type==="raster"||s.type==="symbol"||s.type==="fill-extrusion"||!s.overlay||(s.overlay===true?"volume":s.overlay)!==a||!o.layerVisibleAt(s,n))continue;let c=r(s);if(c){if(s.type==="surface"){this.flattened(c,o,s)?this.drawFill(e,t,c,o,s,n):this.drawSurface(e,t,c,o,s,n),l();continue}s.type==="fill"?this.drawFill(e,t,c,o,s,n):this.drawLine(e,t,c,o,s,n);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=n=>{let a=(n+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o){if(this.debugTiles){let[s,c,f]=this.tileTint(t);e.setVec4("u_tile_tint",s,c,f,Kf);}else e.setVec4("u_tile_tint",0,0,0,0);let r=So(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Zn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*r,l[1]-t.y*r,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:$f[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=D(a.materialStrength,o,1)*this.detailScale,s=D(a.materialScale,o,qf[n]),c=D(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=D(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",ke([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let u of o.visibleTiles){if(!this.drawsTile(t,r,n,u))continue;let d=o.getTile(u),h=d&&this.bucketFor(e,d,f,yn,this.fillLocs,"fill");if(!h)continue;this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),this.applyTileScale(l,u,h.extent),this.applyTileMatrix(l,t,u,h.extent);let m=this.cutHidden(e,d,f,u.dataKey,h.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(h.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,h.indexCount,h.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0,s){let c=this.line,f=r.colorAt(n,a),u=D(n.paint.opacity,a,1)*(l||1),d=D(n.paint.width,a,1);if(u<=.001||d<=.01)return;let h=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,y=t.width>0?h/t.width:1,p=d/2*y;c.use(),this.applyShadowUniforms(c),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",ke([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*y,g=Math.max(D(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);let v=n.paint.dashArray,w=n.paint.arrow===true,x=n.paint.arrowStyle,_=w&&(x==="head"||x==="headOnly"),T=w&&x==="dash";if(c.setInt("u_pattern",T?5:v?1:x==="headOnly"&&w?4:_?3:w?2:0),v){let[S,E]=v;c.setVec2("u_dash",S*y,(S+E)*y);}if(w){let S=He(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",ke(S));let E=D(n.paint.arrowPeriod,a,46)*y,L=D(n.paint.arrowSize,a,5)*y;if(T){let A=D(n.paint.arrowGap,a,24)*y,M=Math.max(E-A,1),R=Math.min(L,M),I=D(n.paint.arrowShaft,a,2)*y,k=D(n.paint.arrowHead,a,4)*y,H=D(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,R,k,M),c.setVec2("u_dash",H,E);}else _?c.setVec4("u_arrow",E,L,p,0):c.setVec4("u_arrow",E,Math.max(L*.4,1),Math.min(L,p*.72),0);}let C=r.bucketKeyFor(n);if(C!==null)for(let S of o.visibleTiles){if(!this.drawsTile(t,r,n,S))continue;let E=o.getTile(S);if(!E)continue;let L=n.network?s!==void 0?[je(n.id,s)]:(E.data?.levels??[]).map(A=>je(n.id,A)):[C];for(let A of L){let M=this.bucketFor(e,E,A,xl,this.lineLocs,"line");if(!M)continue;let R=S.bounds(),I=(R.maxX-R.minX)*t.worldSize/M.extent*y;c.setFloat("u_tile_to_px",I);let k=I>1e-6?1/I:1;c.setFloat("u_half_width",p*k),c.setFloat("u_blur",g*k),c.setFloat("u_meters_to_units",t.pixelsPerMeter*k),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",D(n.paint.widthExtra,a,0)*k),c.setFloat("u_offset",b*k),c.setFloat("u_tile_per_px",k),this.applyTileScale(c,S,M.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(S,M.extent)),this.applyTileMatrix(c,t,S,M.extent);let H=this.cutHidden(e,E,A,S.dataKey,M.buffer,this.replacedIds(),this.lineLocs);H?(H.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,H.count,e.gl.UNSIGNED_INT,0)):(M.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,M.indexCount,M.indexType,0));}}}drawNetwork(e,t,o,r,n,a,l){let s=o.layers.filter(f=>f.type==="line"&&f.network===n&&l(f));if(!s.length)return;let c=new Set;for(let f of s){let u=r(f);if(u)for(let d of u.visibleTiles){let h=u.getTile(d);for(let m of h?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,d)=>u-d))for(let u of s){let d=r(u);d&&this.drawLine(e,t,d,o,u,a,0,f);}}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=me(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",D(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_ice",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",D(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Et,Et),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Et);let d=this.seams.stitched.has(l.featureId);d&&this.drawSeamHighlight(e,t,f,l.featureId);for(let h of d?[]:o.visibleTiles){let m=o.getTile(h);if(!m)continue;let y=m.data?.buckets?.[n.id];if(!y)continue;let p=h.dataKey,b=this.highlightGpu.get(p);if(b===void 0){let g=No(m,n.id,l.featureId);if(g){let v=new ye(e,new Uint8Array(g.vertices),At),w=new ce(e,g.indices);b={vao:new le(e,[{buffer:v,locations:this.buildingLocs}],w),vbo:v,ibo:w,count:g.indices.length};}else b=null;this.highlightGpu.set(p,b);}b&&(this.applyTileScale(f,h,y.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,y.extent)),f.setMat4("u_matrix",t.tileMatrix(h,y.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),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??j);if(!a)return;let l=new ee;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 u=No(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Jr(u,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(d=>d.id===n.layerId),s=l?o.get(l.source??j):void 0;if(!l||!s)return;let c=n.bucketKey,f=me(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",ke([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Et,Et),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Et);for(let d of s.visibleTiles){let h=s.getTile(d),m=h?.data?.buckets?.[c];if(!h||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,d,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(d,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(d=>{d?.vao.destroy(),d?.ibo.destroy(),d?.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 d=0;d*3<s.length;d++)c[d]===r&&f.push(s[d*3],s[d*3+1],s[d*3+2]);let u=null;if(f.length){let d=new ye(e,new Uint8Array(t.vertices),yn),h=new ce(e,new Uint32Array(f));u={vao:new le(e,[{buffer:d,locations:this.fillLocs}],h),vbo:d,ibo:h,count:f.length};}return this.fillHighlightGpu.set(a,u),u}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=D(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(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",D(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?He(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",u[0],u[1],u[2]),l.setFloat("u_side_light",D(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let d=r.bucketKeyFor(n);if(d===null)return;let h=c>=1&&!n.overlay;e.setDepthMask(h),e.setBlend(h?"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,d,_l,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v,cut:g?this.cutSurface(e,g,d,b.dataKey,v.buffer,this.replacedIds()):null});}let y=(b,g,v)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),this.applyTileMatrix(l,t,b,g.extent),(v??g).vao.bind();},p=m.filter(({bucket:b,cut:g})=>g?g.capCount>0:b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g,cut:v}of p){y(b,g,v);let w=v?e.gl.UNSIGNED_INT:g.indexType,x=w===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,v?v.capCount:g.indexCount-g.capIndexOffset,w,(v?v.mainCount:g.capIndexOffset)*x);}e.setColorMask(true),e.setDepthMask(h);}for(let{id:b,bucket:g,cut:v}of m)y(b,g,v),e.gl.drawElements(e.gl.TRIANGLES,v?v.mainCount:g.capIndexOffset,v?e.gl.UNSIGNED_INT: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,u=D(n.paint.opacity,a,1);if(u<=.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",u),s.setFloat("u_ao_strength",D(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",D(n.paint.tintVariation,a,.07));let d=(w,x)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,x):x,h=d("windowColor",[.62,.71,.8,1]),m=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",h[0],h[1],h[2]),s.setVec3("u_window_frame",m[0],m[1],m[2]),s.setFloat("u_facade_detail",D(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",D(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",D(n.paint.floorHeight,a,3.2)),s.setFloat("u_window_variation",D(n.paint.windowVariation,a,1)),s.setFloat("u_seam_strength",D(n.paint.seamStrength,a,1)),s.setFloat("u_ice",D(n.paint.ice,a,0)),s.setFloat("u_window_recess",D(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",D(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",D(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",D(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??j)===j;v&&this.indoorMask.prepare(o,g);for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let x=o.getTile(w),_=x&&this.bucketFor(e,x,g,At,this.buildingLocs,"fill-extrusion");if(!_)continue;let T=this.growScale(_,l,!o.warm);T<1&&(b=true),s.setFloat("u_height_scale",T*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 S=this.cutHidden(e,x,g,w.dataKey,_.buffer,this.hiddenFor(g,v,w.dataKey))??(x&&v?this.indoorMask.indicesFor(e,x,g,w,_.buffer,this.buildingLocs):null);S?(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return v&&this.drawSeams(e,t,s,p),b}drawSeamHighlight(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=`${n}\u241F${r}`,c=this.highlightGpu.get(s);if(c===void 0){let f=an(l,r);if(f){let u=new ye(e,new Uint8Array(f.vertices),At),d=new ce(e,f.indices);c={vao:new le(e,[{buffer:u,locations:this.buildingLocs}],d),vbo:u,ibo:d,count:f.indices.length};}else c=null;this.highlightGpu.set(s,c);}c&&(this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=this.seamBucket(e,n,l);o.setFloat("u_height_scale",r),this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),s.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,0);}}seamBucket(e,t,o){let r=this.seamGpu.get(t);if(!r){let n=new ye(e,new Uint8Array(o.vertices),At),a=new ce(e,new Uint32Array(o.indices)),l=new le(e,[{buffer:n,locations:this.buildingLocs}],a);r=new Yo(l,n,a,o.indexCount,e.gl.UNSIGNED_INT,o.extent),this.seamGpu.set(t,r);}return r}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}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?Jf(Math.max(r,0)):1}applyLight(e,t){let o=t.light;De(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=It(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),De(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=It(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),De(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 Gf(`\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;if(this.uploadLeft<=0)return this.uploadDeferred=true,null;this.uploadLeft-=s.vertices.byteLength+s.indices.byteLength;let c=new ye(e,new Uint8Array(s.vertices),r),f=new ce(e,new Uint32Array(s.indices)),u=new le(e,[{buffer:c,locations:n}],f),d=new Yo(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,d),d}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;}};qo.UPLOAD_BUDGET=15e5;var ro=qo,$o=new z;function Zf(i,e){let r=new Float32Array(66306),n=0;for(let d=0;d<=128;d++){let h=(d/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[n++]=m/256*2*Math.PI-Math.PI,r[n++]=h;}let a=new Uint16Array(256*128*6),l=0;for(let d=0;d<128;d++)for(let h=0;h<256;h++){let m=d*257+h,y=m+256+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:oo,offset:0}]},c=new z([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),u=new ce(i,a);return {vao:new le(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Qf(i,e){if(e.highColor){De(i,"u_high_color",e.highColor);return}let t=$o.get(e.skyColor);t||(t=me(e.skyColor),$o.set(e.skyColor,t)),i.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function De(i,e,t){let o=$o.get(t);o||(o=me(t),$o.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function It(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 Jf(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Zo=1,no=class{constructor(e=1024){this.entries=new z;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+Zo>this.size&&(this.shelfY+=this.shelfHeight+Zo,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Zo>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+Zo,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 gn=.75,ao=8,fe=3,qe=24,Lt=256,Sl=255,io=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new z;this.loaded=new ee;this.inflight=new z;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/Lt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/Lt);if(r<=Sl&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new ee;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/Lt);n>Sl||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*Lt}-${e*Lt+Lt-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 Ml(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 Ml(i){let e=new ys__default.default(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,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((d,h,m)=>{m&&(d===1?u.id=m.readVarint():d===2?u.bitmap=m.readBytes():d===3?u.width=m.readVarint():d===4?u.height=m.readVarint():d===5?u.left=m.readSVarint():d===6?u.top=m.readSVarint():d===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var tu=.25,Rt=1e20;function vn(i,e,t){let o=e+fe*2,r=t+fe*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(Rt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,d=(c+fe)*o+(f+fe);if(u>=1)a[d]=0,l[d]=Rt;else if(u>0){let h=.5-u;a[d]=h>0?h*h:0,l[d]=h<0?h*h:0;}else a[d]=Rt,l[d]=0;}Tl(a,o,r),Tl(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]=ou(Math.round(255-255*(f/ao+tu)));}return {data:s,width:o,height:r}}function Tl(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];kl(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];kl(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function kl(i,e,t,o,r){t[0]=0,o[0]=-Rt,o[1]=Rt;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]=Rt;}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 ou=i=>i<0?0:i>255?255:i;var El=48,lo=class{constructor(e={}){this.defs=e;this.sdfs=new z;this.pending=new ee;this.failed=new ee;}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(El*(n>1?n:1))),l=Math.max(8,Math.round(El/(n<1?n:1))),s=await ru(o,a,l);return this.sdfs.set(e,vn(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 ru(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((u,d)=>{a.onload=()=>u(),a.onerror=()=>d(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 u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(n);}}var dt={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>',"frame-pin":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></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>'},nu={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(nu)){let t=dt[e];t?dt[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 iu=1.2;function wn(i,e,t=16,o=0){let r=au(i,t),n=[],a=[],l=0;for(let f of r){let u=0,d=0;for(let h of f){let m=h.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(u+=y.advance,d++);}d>1&&(u+=o*(d-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=qe*iu,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,d=-c/2+f*s+s/2;for(let h of r[f]){let m=h.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:u,y:d}),u+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function au(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)}var lu=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function xn(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=uu(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,u=[],d=o.spacing??250,h=d>0&&d-t<d*.25?t+d*.25:d;if(o.accept&&o.atList){let y=[];for(let p of o.atList){if(y.length>=24)break;if(p<0||p+t>n)continue;let b=Qo(i,r,e,t,p,c,a,f);if(!b)continue;let g={glyphs:b,path:b.map(v=>({x:v.x,y:v.y})),at:p};o.accept(g)&&y.push(g);}return y}if(o.accept)return su(i,r,e,t,h,c,a,f,o.accept,o.offset??0,o.keepAt??[]);if(h>0&&s>=t+h){let y=Math.min(Math.floor((s-t)/h)+1,24),p=t+h*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=h){let v=b/l,w=Qo(i,r,e,t,v,c,a,f);w&&u.push({glyphs:w,path:w.map(x=>({x:x.x,y:x.y})),at:v});}if(u.length)return u}let m=(n-t)/2;for(let y of lu){let p=m+m*y,b=Qo(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 su(i,e,t,o,r,n,a,l,s,c,f){let u=e[e.length-1],d=Math.max(o/3,r/8,12),h=[],m=[],y=b=>{if(b<0||b+o>u)return false;for(let w of m)if(Math.abs(w-b)<r)return false;let g=Qo(i,e,t,o,b,n,a,l);if(!g)return false;let v={glyphs:g,path:g.map(w=>({x:w.x,y:w.y})),at:b};return s(v)?(h.push(v),m.push(b),true):false};for(let b of f){if(h.length>=24)break;y(b-c);}let p=(-c%d+d)%d;for(let b=p;b+o<=u&&!(h.length>=24);b+=d)y(b);return h}function Qo(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!cu(i,e,r,r+o,n,a))return null;let s=so(i,e,r),c=so(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Al(i,e,t,r,l);let f=e[e.length-1];return Al([...i].reverse(),du(e),t,f-(r+o),l)}function cu(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),u=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),d=Math.abs((u-f)*180/Math.PI+540)%360-180,h=Math.abs(d);for(a.push({at:c,delta:h}),l+=h;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Al(i,e,t,o,r){let n=[];for(let c of t){let f=Il(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 u=Math.abs(fu(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}l=o+t[c].offset+s;let f=Il(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Il(i,e,t,o){let r=so(i,e,t+o/2);if(!r)return null;let n=so(i,e,t),a=so(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 fu(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function uu(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 du(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function so(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 Cn=20,Ll={stride:Cn,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}]},mu=220,pu=.15;function Rl(i,e){if(!Number.isFinite(e.far))return 1;let t=Math.max(e.far-e.near,1),o=e.near+t*pu,r=(i-o)/Math.max(e.far-o,1);return r<=0?1:r>=1?0:1-r*r*(3-2*r)}var co=192,it=64,_n=2,bu=1.22,yu=128,gu=.7;function vu(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*qe;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*gu/(t/qe)}var wu=256,xu=200,_u="frame-circle",Cu="frame-pin",Su=10.29/24;function Mu(i,e,t,o,r){let n=-r,a=-r,l=o.width+r,s=o.height+r,c=[],f=0;for(let u=0;u+1<i.length;u++){let d=i[u],h=i[u+1],m=Math.hypot(h.x-d.x,h.y-d.y);if(Math.max(d.x,h.x)>=n&&Math.min(d.x,h.x)<=l&&Math.max(d.y,h.y)>=a&&Math.min(d.y,h.y)<=s&&m>0){let p=Math.max(0,Math.ceil((f-t)/e)),b=Math.floor((f+m)/e);for(let g=p;g<=b;g++){let v=g*e;if(v>=0&&c[c.length-1]!==v&&c.push(v),c.length>=Tu)return c}}f+=m;}return c}var Tu=32;function ku(i,e){let t=0,o=1/0,r=0;for(let n=0;n+1<i.length;n++){let a=i[n].x,l=i[n].y,s=i[n+1].x-a,c=i[n+1].y-l,f=Math.hypot(s,c);if(f>0){let u=Math.min(Math.max(((e.x-a)*s+(e.y-l)*c)/(f*f),0),1),d=Math.hypot(e.x-(a+s*u),e.y-(l+c*u));d<o&&(o=d,r=t+f*u);}t+=f;}return o<=50?r:null}function Fl(i,e){return e<=0?i:{x1:i.x1+e,y1:i.y1+e,x2:i.x2-e,y2:i.y2-e}}function Eu(i){return i==="circle"?_u:i==="pin"?Cu:null}var Au=["left","right","top"];function Iu(i,e){return !e||i[0]===e||!i.includes(e)?i:[e,...i.filter(t=>t!==e)]}var Ft=class Ft{constructor(e,t){this.shader=null;this.locations=new z;this.atlas=new no(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.lineAnchors=new z;this.lastSide=new z;this.lineAt=new z;this.lineAtNow=new z;this.sideNow=new z;this.fog={near:0,far:1/0,intensity:0,cutoff:1/0};this.tr=null;this.shownAt=new z;this.fading=false;this.styleOrder=new z;this.layersById=new z;this.glyphs=new io(e,t),this.icons=new lo(dt);}init(e){this.shader=new ge(e,"symbol",nl,il);for(let t of Ll.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.text}|${e.mercX.toFixed(6)}|${e.mercY.toFixed(6)}`}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}rememberedAt(e,t,o){let r=this.lineAt.get(e),n=this.tr;if(!r||!r.length||!n)return [];let a=[];for(let l=0;l+1<r.length;l+=Ft.LINE_MARK){let s=n.worldPxToPoint(r[l]*n.worldSize,r[l+1]*n.worldSize);if(!s)continue;let c=ku(t,s);c!==null&&a.push(Math.max(0,c-o/2));}return a}rememberAt(e,t){let o=this.tr;if(!o||!t.length)return;let r=this.lineAtNow.get(e);r||(r=[],this.lineAtNow.set(e,r));for(let n of t){let a=o.pointToWorldPx(n);r.push(a.x/o.worldSize,a.y/o.worldSize);}}withinLayout(e){let t=this.padding;return e.x2>t.left-co&&e.y2>t.top-co&&e.x1<this.viewport.width-t.right+co&&e.y1<this.viewport.height-t.bottom+co}depthFadeAt(e,t){let o=this.tr;if(!o||!Number.isFinite(this.fog.far))return 1;let r=o.pointToWorldPx({x:e,y:t}),[n,a,l]=o.cameraPositionPx;return Rl(Math.hypot(r.x-n,r.y-a,l),this.fog)}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)/mu;return r<1?(this.fading=true,r):1}order(e){let t=e.length,o=new Float64Array(t);for(let a=0;a<t;a++){let l=e[a];o[a]=l.priority+(this.stickyKeys.has(l.key)?xu:0);}let r=new Int32Array(t);for(let a=0;a<t;a++)r[a]=a;r.sort((a,l)=>{let s=o[l]-o[a];if(s!==0)return s;let c=e[a],f=e[l];return c.mercY!==f.mercY?c.mercY-f.mercY:c.mercX-f.mercX});let n=new Array(t);for(let a=0;a<t;a++)n[a]=e[r[a]];for(let a=0;a<t;a++)e[a]=n[a];}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(o=>Ft.keyOf(o)));let e=this.lastSide;this.lastSide=this.sideNow,e.clear(),this.sideNow=e;let t=this.lineAt;this.lineAt=this.lineAtNow,t.clear(),this.lineAtNow=t;for(let o of [...this.shownAt.keys()])this.stickyKeys.has(o)||this.shownAt.delete(o);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},this.tr=t,!n)return;let a=t.zoom,l=r.layers.filter(h=>h.type==="symbol"&&r.layerVisibleAt(h,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.lineAnchors.clear(),this.order(s);let c=new z,f=new z,u=new z;l.forEach((h,m)=>u.set(h.id,m)),this.layersById.clear();for(let h of r.layers)h.type==="symbol"&&this.layersById.set(h.id,h);let d=0;for(let h of s){let m=this.place(h,a,c);if(!m)continue;this.placed.push({layerId:h.layer.id,text:h.text,icon:h.icon,mercX:h.mercX,mercY:h.mercY,box:m.box,order:u.get(h.layer.id)??0});let y=f.get(h.layer.id);y||f.set(h.layer.id,y={layer:h.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),d+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),d&&(this.styleOrder=u,this.draw(e,t,f,d,a));}collect(e,t,o,r){let n=[],a=co,l=this.padding,s=Mt(e,o),c=s.far;this.fog=s;let[f,u,d]=e.cameraPositionPx;for(let h of r){let m=(h.layout?.priority??0)*wu,y=t.get(h.source??j);if(!y)continue;let p=h.layout?.showFor==="highlight",b=h.layout?.placement==="map",{shift:g,drop:v}=b?Ol(h,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let w=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,x=o.bucketKeyFor(h);if(x!==null)for(let _ of y.visibleTiles){let C=y.getTile(_)?.data?.buckets?.[x];if(!C||!Vo(C))continue;let S=new Int16Array(C.anchors),E=new Uint8Array(C.priorities),L=C.rotations?new Int16Array(C.rotations):null,A=C.lines?new Int16Array(C.lines):null,M=C.lineStarts?new Uint32Array(C.lineStarts):null,R=_.bounds(),I=e.worldSize,k=(R.maxX-R.minX)*I/C.extent,H=R.minX*I,B=R.minY*I;for(let F=0;F<E.length;F++){let P=H+S[F*2]*k,G=B+S[F*2+1]*k,O=Math.hypot(P-f,G-u,d);if(c!==1/0&&O>c||p&&!$e(this.highlightFootprint,P/I,G/I,w))continue;let W=P,V=G;if(b&&L){let oe=L[F]*Math.PI/180,re=g;W-=Math.sin(oe)*re,V+=Math.cos(oe)*re;}let N=e.worldPxToPoint(W,V),K=A&&M?Lu(e,A,M,F,H,B,k):void 0,$=h.layout?.textPlacement==="line";if($){if(!K)continue}else if(!N||N.x<l.left-a||N.y<l.top-a||N.x>e.width-l.right+a||N.y>e.height-l.bottom+a)continue;let Q=P/I,Z=G/I,X=C.texts[F]??"";n.push({key:Ft.keyOf({layerId:h.id,text:X,mercX:Q,mercY:Z}),layer:h,screenX:N?N.x:K[0].x,screenY:(N?N.y:K[0].y)+v,text:X,icon:C.icons[F]??"",priority:E[F]+m,rotate:Bl(h,L,F,e.bearing),mercX:Q,mercY:Z,depth:$?1:Rl(O,s),line:K});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=e.key;if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now)*e.depth,l=this.hoverKey!==null&&this.hoverKey===n,s=D(r.textSize,t,13),c=D(r.iconSize,t,16),f=r.iconTextGap??5,[u,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){this.icons.isDefined(e.icon)||(e.icon="dot");let J=`icon:${e.icon}`,q=this.atlas.get(J);if(!q){let Y=this.icons.get(e.icon);Y?q=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(e.icon);}q&&(m=q);}let y=null,p=m?Eu(r.iconFrame):null;if(p){let J=`icon:${p}`,q=this.atlas.get(J);if(!q){let Y=this.icons.get(p);Y?q=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(p);}q&&(y=q);}let b=y?Math.max(r.iconFrameScale??1.6,1):1,g=y?c*b:0,v=y?g*(y.height-fe*2)/Math.max(y.width-fe*2,1):0,w=y&&r.iconFrame==="pin"?Su:.5,x=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),x=wn(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,vu(e.layer,t,s)),!x&&!m)||!x&&!m)return null;let _=s/qe,T=x?x.width*_:0,C=x?x.height*_:0,S=_n+(r.collisionPadding??0),E=this.stickyKeys.has(n)?S-_n:0;if(e.layer.layout?.textPlacement==="line")return x&&e.line?this.placeOnLine(e,x,_,C,o,a,E):null;let L=r.iconPlacement??"top",A=L==="auto"&&m&&x?Iu(Au,this.lastSide.get(n)):[L],M=m?m.width/Math.max(m.height,1):1,R=null;for(let J of A){let q=J==="behind"&&!!m&&!!x,Y=J==="top"&&!!m&&!!x,Te=q?C+f*2:c,be=m?Te*M:0,Oe=Math.max(be,g),Ie=Math.max(Te,v),Le=q?Math.max(be,T+f*2):Y?Math.max(Oe,T):Oe+(m&&x?f:0)+T,Re=q?Math.max(Te,C):Y?Ie+f+C:Math.max(m?Ie:0,C),Ze=w===.5||!m?0:Y?Ie-Re/2:Ie/2,ur=m&&x&&!q&&!Y?(Le/2-Oe/2)*(J==="right"?-1:1):0,mt=e.screenX+u+ur,pt=e.screenY+d-Ze,dr={x1:mt-Le/2-S,y1:pt-Re/2-S,x2:mt+Le/2+S,y2:pt+Re/2+S};if(this.withinLayout(dr)&&!(!r.allowOverlap&&zl(o,Fl(dr,E)))){R={behind:q,stacked:Y,iconFirst:J!=="right",iconW:be,iconH:Te,blockW:Oe,blockH:Ie,totalW:Le,totalH:Re,cx:mt,cy:pt,box:dr},this.sideNow.set(n,J);break}}if(!R)return null;let{behind:I,stacked:k,iconFirst:H,iconW:B,iconH:F,blockW:P,blockH:G,totalW:O,totalH:W,cx:V,cy:N,box:K}=R;r.allowOverlap||Pl(o,K);let $=[],Q=[],Z=[],X=[],oe=[],re=[],se=0,ue=V-O/2,Me=k?(G+f)/2:0,de=G*(w-.5),he=1/0,ae=1/0,_e=-1/0,xe=-1/0;if(x){let J=k||I?V:ue+(m&&H?P+f:0)+T/2;for(let q of x.glyphs){let Y=q.glyph,Te=`g:${Y.id}`,be=this.atlas.get(Te);if(!be&&(!Y.bitmap||(be=this.atlas.add(Te,Y.bitmap,Y.width+fe*2,Y.height+fe*2)??void 0,!be)))continue;let Oe=J+(q.x+Y.left-fe)*_,Ie=N+Me+(q.y-Y.top-fe)*_,Le=be.width*_,Re=be.height*_;Jo($,Q,Oe,Ie,Le,Re,be,0,a),se++;let Ze=fe*_;he=Math.min(he,Oe+Ze),ae=Math.min(ae,Ie+Ze),_e=Math.max(_e,Oe+Le-Ze),xe=Math.max(xe,Ie+Re-Ze);}if(m&&ae<1/0&&!I){let q=k?N-W/2+G+f-ae:N+de-(ae+xe)/2;if(q!==0){for(let Y=1;Y<$.length;Y+=4)$[Y]+=q;ae+=q,xe+=q;}}}if(m){let J=l&&!I?bu:1,q=B*J,Y=F*J,be=(k?V-B/2:ue+(H?0:O-P)+(P-B)/2)-(q-B)/2,Oe=(k?N-W/2+(G-F)/2:N-F/2)+de-(Y-F)/2;if(y){let Le=g*J,Re=v*J,Ze=be+q/2-Le/2,ur=Oe+Y/2-Re*w,mt=fe/Math.max(y.width-fe*2,1)*Le,pt=fe/Math.max(y.height-fe*2,1)*Re;Jo(oe,re,Ze-mt,ur-pt,Le+mt*2,Re+pt*2,y,0,a),se++;}if(I&&_e>he){let Le=f*1.6,Re=f;q=(_e-he+Le*2)*J,Y=(xe-ae+Re*2)*J,be=he-Le,Oe=ae-Re;}let Ie=fe/Math.max(m.height-fe*2,1)*Y;Jo(Z,X,be-Ie,Oe-Ie,q+Ie*2,Y+Ie*2,m,e.rotate,a),se++;}return se?{verts:$,texs:Q,iconVerts:Z,iconTexs:X,frameVerts:oe,frameTexs:re,quads:se,box:K}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(M=>({offset:(M.x+t.width/2)*o,width:Math.max(M.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},d=[],h=[],m=[],y=0,p=r/2+_n,b=Math.max(u.symbolSpacing??250,f+1),g=`${e.layer.id}|${e.text}`,v=M=>{let R=M.path.map(B=>({x1:B.x-p,y1:B.y-p,x2:B.x+p,y2:B.y+p})),I=this.lineAnchors.get(g);if(I&&b>0){let B=M.path[M.path.length>>1];for(let F=0;F+1<I.length;F+=2)if(Math.hypot(B.x-I[F],B.y-I[F+1])<b)return false}for(let B of R)if(!this.withinLayout(B)||!u.allowOverlap&&zl(n,Fl(B,l)))return false;if(!u.allowOverlap)for(let B of R)Pl(n,B);m.push(...R);let k=M.path[M.path.length>>1],H=this.lineAnchors.get(g);return H?H.push(k.x,k.y):this.lineAnchors.set(g,[k.x,k.y]),true},w=-1/0,x=1/0;for(let M of t.glyphs)M.glyph.height<=0||(w=Math.max(w,M.glyph.top),x=Math.min(x,M.glyph.top-M.glyph.height));let _=Number.isFinite(w)?(w+x)/2*o:0,T=Mu(s,b,f,this.viewport,yu);if(!T.length)return null;let C=this.rememberedAt(e.key,s,f),S=xn(s,c,f,{fontSize:qe*o,atList:C.length?C:T,accept:v});if(!S.length)return null;let E=this.lineAt.get(e.key);C.length&&E?this.lineAtNow.set(e.key,E):this.rememberAt(e.key,S.map(M=>M.path[M.path.length>>1]));for(let M of S){let R=M.path[M.path.length>>1]??M.glyphs[0],I=a*this.depthFadeAt(R.x,R.y);for(let k=0;k<t.glyphs.length;k++){let H=t.glyphs[k].glyph,B=M.glyphs[k],F=`g:${H.id}`,P=this.atlas.get(F);if(!P&&(!H.bitmap||(P=this.atlas.add(F,H.bitmap,H.width+fe*2,H.height+fe*2)??void 0,!P)))continue;let G=P.width*o,O=P.height*o,W=(H.height/2-H.top)*o+_,V=B.angle*Math.PI/180;Jo(d,h,B.x-G/2-Math.sin(V)*W,B.y-O/2+Math.cos(V)*W,G,O,P,B.angle,I),y++;}}if(!y)return null;let L=m.map(M=>(M.x1+M.x2)/2),A=m.map(M=>(M.y1+M.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...L)-p,y1:Math.min(...A)-p,x2:Math.max(...L)+p,y2:Math.max(...A)+p}}}colorOf(e,t,o,r){if(e&&typeof e=="object"&&"from"in e){let n=e,a=this.layersById.get(n.from),l=He(a?.paint?.[t],o,r),s=1-Math.min(Math.max(n.darken??0,0),1);return [l[0]*s,l[1]*s,l[2]*s,l[3]]}return He(e,o,r)}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*Cn),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){h.push({layer:g,role:v,first:m/4*6,count:w*6});for(let x=0;x<w*4;x++){let _=m*5;u[_]=p[x*4],u[_+1]=p[x*4+1],d[_*2+4]=b[x*2],d[_*2+5]=b[x*2+1],u[_+3]=p[x*4+2],u[_+4]=p[x*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",gn),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 h){let b=p.layer.paint,g=D(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",x=(A,M,R)=>w?M??A??R:v?A??R:R,_=this.colorOf(w?b.frameColor??b.haloColor??b.color:x(b.iconColor,void 0,b.color),w?"haloColor":"color",n,[.15,.15,.15,1]),T=w?b.frameHaloColor:x(b.iconHaloColor,void 0,b.haloColor),C=T===void 0&&w,S=this.colorOf(T??(w?b.iconColor??b.color:b.haloColor),C?"color":"haloColor",n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(S[3]*=.35),w&&(_[3]*=D(b.frameOpacity,n,1));let E=D(w?b.frameHaloWidth??1.1:x(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),L=D(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",ke([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",ke([S[0],S[1],S[2],S[3]*g])),a.setFloat("u_halo",E/(ao*(L/qe))),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*Cn),Ll,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 ce(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;}};Ft.LINE_MARK=2;var zt=Ft;function Jo(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,u=Math.cos(f),d=Math.sin(f),h=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-h,g=p-m;i.push(h+b*u-g*d,m+b*d+g*u,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 Lu(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 u=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!u)break;c.push(u);}return c.length>=2?c:void 0}var Hl=(i,e)=>i*4096+e;function zl(i,e){let t=Math.floor(e.x1/it),o=Math.floor(e.y1/it),r=Math.floor(e.x2/it),n=Math.floor(e.y2/it);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(Hl(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 Pl(i,e){let t=Math.floor(e.x1/it),o=Math.floor(e.y1/it),r=Math.floor(e.x2/it),n=Math.floor(e.y2/it);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=Hl(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function Ol(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=D(i.layout?.arrowLength,e,50)*r;return {shift:D(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function Bl(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var Pt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new z;}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);}}};function Ru(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 ot(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,d=(f.minY+f.maxY)/2,h=[[u,d],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of h)if(i.isOnGlobeFront(Fe(p),Ee(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of h){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 fo(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 Ru(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new ot(0,0,0,h));let d=0;for(;u.length&&!(++d>2e4||f.length>=n);){let h=u.pop();if(!i.isTileVisible(h))continue;if(h.z>=l){h.z>=o&&f.push(h);continue}if(i.tileScreenSize(h.z,i.distanceToTile(h))<=a&&h.z>=o){f.push(h);continue}for(let y of h.children())u.push(y);}return f.sort((h,m)=>i.distanceToTile(h)-i.distanceToTile(m)),f}var Mn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new z;}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;}},Sn=6,Fu=24,er=class extends Qe{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new Pt(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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=fo(t,this.opts),r=new ee;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let l=this.coverFor(o),s=this.readyFor(o);(this.anyReady(l)||this.visible.length===0||!this.covers(o))&&(this.visible=l,s&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let f=this.cache.peek(c.dataKey);return !!f&&f.state!=="loading"},r=(c,f)=>{let u=f.parent();for(let d=0;u&&d<=Sn;d++){if(u.dataKey===c.dataKey)return true;u=u.parent();}return false},n=new z,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let l=this.descendantsOf(a);for(let c of a){let f=l.get(c.dataKey);if(f&&f.length){for(let m of f)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let u=c.parent(),d=null;for(let m=1;u&&m<=Sn;m++,u=u.parent()){if(!o(u))continue;let y=u;if(m>1&&t.some(p=>p!==c&&o(p)&&r(y,p)))break;d=y;break}let h=d??c;n.set(h.dataKey,h);}let s=[];for(let[,c]of n){let f=c.parent(),u=false;for(let d=0;f&&d<=Sn;d++){if(n.has(f.dataKey)){u=true;break}f=f.parent();}u||(s.push(c),this.cache.get(c.dataKey));}return s}descendantsOf(t){let o=new z;for(let n of t)o.set(n.dataKey,n);let r=new z;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let l=a.id.parent();for(let s=0;l&&s<Fu;s++){let c=o.get(l.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}l=l.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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 ee;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}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new Mn(t);this.cache.set(t.dataKey,r);let n=zu(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:n,zoom:t.z,metersPerTile:qn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},a=>{if(this.cache.peek(t.dataKey)===r){if(a.type==="error"){if(a.aborted)return;r.state="error",r.error=a.message,this.emit("error",{tile:t,message:a.message});}else r.data=a,r.state=Object.keys(a.buckets).length?"loaded":"empty",this.version++,a.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 ${a.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 zu(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var tr=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;}},uo=class extends Qe{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Pt(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=fo(t,this.opts);let o=new ee;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 tr(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Wl(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 Wl(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 Pu="osmgl-assets",Ht="assets";var or=null;function Dl(){return or||(or=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(Pu,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Ht)||t.createObjectStore(Ht,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),or)}function Hu(i){return Dl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Ht,"readonly").objectStore(Ht).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Ou(i){Dl().then(e=>{if(e)try{e.transaction(Ht,"readwrite").objectStore(Ht).put(i);}catch{}});}var Vl=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 Bu(i,e,t){let o=await crypto.subtle.importKey("raw",Vl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Vl(t),tagLength:128},o,i)}var ho=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 Hu(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(),Ou({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 Bu(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 Wu=1,mo=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=U();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-${Wu++}`,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 un(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=te(this.coordinates);return {x:ne(e.lng),y:ie(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/We(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=kn(n(-this.rotation));this.rotationTiltX&&(a=at(Tn(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=at(En(n(this.rotationTiltZ)),a));let l=at(r,a),s=this.matrix;return Xe(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=te(this.coordinates),r=U();for(let a=0;a<16;a++)r[a]=e[a];let n=U();return Se(n,r,this.localMatrix(o.lat)),Ke(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=te(this.coordinates),n=We(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,u=s,d=f,h=c,m=p=>p*Math.PI/180,y=kn(m(-this.rotation));return this.rotationTiltX&&(y=at(Tn(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=at(En(m(this.rotationTiltZ)),y)),[(y[0]*u+y[1]*d+y[2]*h)/t,(y[3]*u+y[4]*d+y[5]*h)/t,(y[6]*u+y[7]*d+y[8]*h)/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=te(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],u=s[8],d=s[9],h=c*d-f*u;if(Math.abs(h)<1e-30)return false;let m=(n*d-a*u)/h,y=(c*a-f*n)/h,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=U();for(let u=0;u<16;u++)a[u]=e[u];let l=te(this.coordinates),s=U();Se(s,a,this.localMatrix(l.lat));let c=U();dn(n,t,n.duration>0?o%n.duration:0,c);let f=U();return Se(f,s,c),Ke(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=kn(e(-this.rotation));this.rotationTiltX&&(t=at(Tn(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=at(En(e(this.rotationTiltZ)),t));let o=at([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 at(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 Tn=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},kn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},En=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var nr=class{constructor(){this.hit=new z;this.miss=new ee;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),u=new Uint32Array(a.indices),d=new Float64Array(a.featureIds),h=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let y=u[m*3]*h,p=u[m*3+1]*h,b=u[m*3+2]*h;if(!Xu(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=d[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="";}},Vu=14,Du=2e3,Nu=4e3,Nl=160,Gu=50,Uu=4e3,An=6,ir=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new z;this.loading=0;this.pending=[];this.known=new z;this.underBuilding=new nr;this.underVenue=new nr;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Nl;this.replacedBuildings=new ee;this.replacedReal=new ee;this.replacedVenues=new ee;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 ho(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??Vu,f=s.loadRadius??Du,u=Math.max(s.keepRadius??Nu,f),d=s.fullBudget===true?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??Nl)*this.budgetScale*d));this.budget=h,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let k of [...this.entries.values()])k.model.retire(),k.model.grow<=0&&this.release(k,n);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let p=o.center,b=s.fullDetail===true?0:this.lodFor(o.zoom,c);this.lod=b;let g="";for(let k of t.visibleTiles)g+=k.dataKey+(t.getTile(k)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let k=new ee;v=0;for(let H of t.visibleTiles){let B=t.getTile(H)?.data?.buckets?.[e.id];if(!B||!al(B))continue;let F=new Int16Array(B.anchors),P=H.bounds(),G=P.maxX-P.minX,O=P.maxY-P.minY;for(let W=0;W<B.props.length;W++){let V=B.props[W],N=ht(V.file,NaN);if(!Number.isFinite(N))continue;let K=String(V.kind??"model"),$=K==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(k.has($))continue;k.add($),K==="rule"&&v++;let Q=P.minX+F[W*2]/B.extent*G,Z=P.minY+F[W*2+1]/B.extent*O,X=ju(Q,Z);this.known.set($,{id:$,fileId:N,lng:X.lng,lat:X.lat,mercX:Q,mercY:Z,altitude:ht(V.alt,0),scale:ht(V.scale,1),rotation:ht(V.rx,0),tiltX:ht(V.rz,0),tiltZ:ht(V.ry,0),kind:K==="rule"?"rule":"model",target:Gl(K==="rule"?V.oid:V.replaces),replaces:m?K==="rule"?rr(V.oid):String(V.anchor??"replace")==="replace"?rr(V.replaces_all).length?rr(V.replaces_all):rr(V.replaces):[]:[]});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,x=new ee;for(let k of w)k.kind==="model"&&k.target!==null&&x.add(k.target);let _=111320,T=Math.cos(p.lat*Math.PI/180),C=k=>Math.hypot((k.lng-p.lng)*_*T,(k.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let S=new ee,E=[],L=0,A=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*T,(p.lat-this.sortedAt.lat)*_)>Gu)&&(w.sort((k,H)=>C(k)-C(H)),this.sortedAt={lng:p.lng,lat:p.lat});let R=0;for(let k of w){let H=C(k);if(H>u){L++;continue}if(k.kind==="rule"&&k.target!==null&&x.has(k.target)){let G=this.entries.get(k.id);G&&G.model.retire();continue}let B=this.entries.get(k.id);if(R>=h){A++,B&&B.model.retire();continue}R++,S.add(k.id);let F=()=>{if(!k.replaces.length)return;for(let W of k.replaces){this.replacedBuildings.add(W),this.replacedReal.add(W);for(let V=0;V<10;V++)this.replacedBuildings.add(W*10+V);}let G=this.underBuilding.find(k,a);G!==null&&this.replacedBuildings.add(G);let O=this.underVenue.find(k,l);O!==null&&this.replacedVenues.add(O);},P=B;if(P){F(),P.distance=H,P.leftAt=0,P.model.revive(),b<P.lod&&!P.upgrading&&this.loading<An&&this.upgrade(P,b,r,n);continue}if(H>f){L++;continue}if(this.loading>=An){E.push(k),F();continue}F(),this.spawn(k,H,b,r);}for(let k of [...this.entries.values()])if(!S.has(k.placement.id)){if(k.leftAt===0){k.leftAt=y;continue}y-k.leftAt>Uu&&k.model.retire();}for(let k of [...this.entries.values()])k.model.growTarget===0&&k.model.grow<=0&&this.release(k,n);if(this.known.size>4e3)for(let[k,H]of [...this.known.entries()])C(H)>u*3&&this.known.delete(k);let I=this.stats;I.found=w.length,I.kept=S.size,I.live=this.entries.size,I.tooFar=L,I.overBudget=A,I.queued=E.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=E.length,I.replaced=this.replacedReal.size,this.pending=E;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<An&&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 mo({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.replacedReal.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},ht=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},rr=i=>{if(i==null)return [];let e=[];for(let t of String(i).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},Gl=i=>{let e=ht(i,NaN);return Number.isFinite(e)?e:null};function ju(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 Xu(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),u=s<0||c<0||f<0,d=s>0||c>0||f>0;return !(u&&d)}var Ku=200,Yu={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},po=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=Yu[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??$u),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=te(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ne(t.lng)*o,ie(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Ku;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";}},$u='<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 bo=class extends po{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 qu=[["\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."]],Ul=new Map(qu);function In(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=Ul.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=>Ul.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 u of i.features()){if(!ve(e.filter,u.properties))continue;let d=u.loadGeometry(),h=Ju(u.type,d);if(!h)continue;let m=e.textField?Ln(e.textField,u.properties):"",y=m&&e.abbreviate?In(m):m,p=e.iconImage?Ln(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=Qu(u.type,d);if(!b)continue;f.push({text:y,line:b});continue}t.push(h[0],h[1]),o.push(y),r.push(p),n.push(ed(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of Zu(f)){c.push(s.length/2);for(let h of d)s.push(h);t.push(Math.round(d[0]),Math.round(d[1])),o.push(u),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 Zu(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 u=e[f];if(u.line.push(...a.slice(2)),o.delete(l),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let d=e[c];u.line.push(...d.line.slice(2)),d.line=[],t.delete(s),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,u.line[0],u.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 Qu(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 Ju(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 u=c[f+2]-c[f],d=c[f+3]-c[f+1],h=u*u+d*d;h>a&&(a=h,l=c[f]+u/2,s=c[f+1]+d/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 ed(i){let e=i.importance;if(typeof e=="number"&&isFinite(e))return Math.max(0,255-Math.min(Math.max(e,1),9)*20);let t=i.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function Ln(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 jl(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&ve(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 td(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Xl(i,e){let t=performance.now(),o=td(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(g,v,w,x,_=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:_},diag:{status:g,bytes:v,layers:w,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 Dt(a),f=Object.keys(c.layers),u={},d=[],h={},m=new Set,y=[],b=i.plan.some(g=>g.type==="surface"&&(g.elevation??0)>0)&&i.plan.some(g=>g.type==="line"&&g.ground)?Hr(i.metersPerTile):void 0;for(let g of i.plan){if(!rd(g,i.zoom,i.sourceMaxZoom))continue;let v=c.layers[g.sourceLayer];if(!v)continue;let w=nd(i.zoom,v.extent);try{if(g.splitBy){let _=id(v,g.splitBy,g.filter);if(!_.length)continue;let T=h[g.splitBy]??(h[g.splitBy]=[]);for(let C of _){T.includes(C)||T.push(C);let S={...g,splitBy:void 0,filter:ld(g.filter,g.splitBy,C)},E=Fn(S,v,w,i.metersPerTile,b,void 0,d);E&&(u[je(g.id,C)]=E);}continue}if(g.network&&g.type==="line"){for(let _ of ad(v,g.filter)){let T=Fn(g,v,w,i.metersPerTile,b,_,d);T&&(u[je(g.id,_)]=T,m.add(_));}continue}let x=Fn(g,v,w,i.metersPerTile,b,void 0,d);x&&(u[g.id]=x);}catch(x){y.push(`${g.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...d.length?{seams:d}:{},...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((g,v)=>g-v)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...y.length?{failed:y}:{}}}}function od(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 rd(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function nd(i,e){return i<=6?Math.max(64,e/24):0}function Fn(i,e,t,o,r,n,a){{if(i.type==="fill"){let s=o>0?o/e.extent:0,c=i.cornerRadius&&s>0?{radius:i.cornerRadius/s,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:yi/s}:void 0,f=Er(e,i.filter,t,c,i.clipToTile===true,e.extent);return f?{kind:"fill",...f,extent:e.extent}:null}if(i.type==="surface"){let s=Pr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:c=>Or(r,c,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:od(i.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(i.type==="line"){let s=Wr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return s?{kind:"line",...s,extent:e.extent}:null}if(i.type==="model"){let s=jl(e,i.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(i.type==="symbol"){let s=Rn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let l=Mr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments},a);return l?{kind:"fill-extrusion",vertices:l.vertices,indices:l.indices,featureIds:l.featureIds,vertexCount:l.vertexCount,indexCount:l.indexCount,extent:l.extent}:null}}function id(i,e,t){let o=[];for(let r of i.features()){if(!ve(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 ad(i,e){let t=[];for(let o of i.features()){if(!ve(e,o.properties))continue;let r=ut(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function ld(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var zn='"use strict";(()=>{var pr=Object.create;var tn=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var xr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dr(t))!gr.call(e,i)&&i!==n&&tn(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var wr=(e,t,n)=>(n=e!=null?pr(xr(e)):{},br(t||!e||!e.__esModule?tn(n,"default",{value:e,enumerable:!0}):n,e));var Un=yr((zt,jt)=>{(function(e,t){typeof zt=="object"&&typeof jt<"u"?jt.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(zt,function(){"use strict";function e(y,s){var l={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,d,p,M;return M={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function w(E){return function(C){return R([E,C])}}function R(E){if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,d&&(p=E[0]&2?d.return:E[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,E[1])).done)return p;switch(d=0,p&&(E=[E[0]&2,p.value]),E[0]){case 0:case 1:p=E;break;case 4:return l.label++,{value:E[1],done:!1};case 5:l.label++,d=E[1],E=[0];continue;case 7:E=l.ops.pop(),l.trys.pop();continue;default:if(p=l.trys,!(p=p.length>0&&p[p.length-1])&&(E[0]===6||E[0]===2)){l=0;continue}if(E[0]===3&&(!p||E[1]>p[0]&&E[1]<p[3])){l.label=E[1];break}if(E[0]===6&&l.label<p[1]){l.label=p[1],p=E;break}if(p&&l.label<p[2]){l.label=p[2],l.ops.push(E);break}p[2]&&l.ops.pop(),l.trys.pop();continue}E=s.call(y,l)}catch(C){E=[6,C],d=0}finally{a=p=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}}var t=function(){function y(s,l){this.next=null,this.key=s,this.data=l,this.left=null,this.right=null}return y}();function n(y,s){return y>s?1:y<s?-1:0}function r(y,s,l){for(var a=new t(null,null),d=a,p=a;;){var M=l(y,s.key);if(M<0){if(s.left===null)break;if(l(y,s.left.key)<0){var w=s.left;if(s.left=w.right,w.right=s,s=w,s.left===null)break}p.left=s,p=s,s=s.left}else if(M>0){if(s.right===null)break;if(l(y,s.right.key)>0){var w=s.right;if(s.right=w.left,w.left=s,s=w,s.right===null)break}d.right=s,d=s,s=s.right}else break}return d.right=s.left,p.left=s.right,s.left=a.right,s.right=a.left,s}function i(y,s,l,a){var d=new t(y,s);if(l===null)return d.left=d.right=null,d;l=r(y,l,a);var p=a(y,l.key);return p<0?(d.left=l.left,d.right=l,l.left=null):p>=0&&(d.right=l.right,d.left=l,l.right=null),d}function o(y,s,l){var a=null,d=null;if(s){s=r(y,s,l);var p=l(s.key,y);p===0?(a=s.left,d=s.right):p<0?(d=s.right,s.right=null,a=s):(a=s.left,s.left=null,d=s)}return{left:a,right:d}}function u(y,s,l){return s===null?y:(y===null||(s=r(y.key,s,l),s.left=y),s)}function c(y,s,l,a,d){if(y){a(""+s+(l?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+d(y)+`\n`);var p=s+(l?" ":"\\u2502 ");y.left&&c(y.left,p,!1,a,d),y.right&&c(y.right,p,!0,a,d)}}var f=function(){function y(s){s===void 0&&(s=n),this._root=null,this._size=0,this._comparator=s}return y.prototype.insert=function(s,l){return this._size++,this._root=i(s,l,this._root,this._comparator)},y.prototype.add=function(s,l){var a=new t(s,l);this._root===null&&(a.left=a.right=null,this._size++,this._root=a);var d=this._comparator,p=r(s,this._root,d),M=d(s,p.key);return M===0?this._root=p:(M<0?(a.left=p.left,a.right=p,p.left=null):M>0&&(a.right=p.right,a.left=p,p.right=null),this._size++,this._root=a),this._root},y.prototype.remove=function(s){this._root=this._remove(s,this._root,this._comparator)},y.prototype._remove=function(s,l,a){var d;if(l===null)return null;l=r(s,l,a);var p=a(s,l.key);return p===0?(l.left===null?d=l.right:(d=r(s,l.left,a),d.right=l.right),this._size--,d):l},y.prototype.pop=function(){var s=this._root;if(s){for(;s.left;)s=s.left;return this._root=r(s.key,this._root,this._comparator),this._root=this._remove(s.key,this._root,this._comparator),{key:s.key,data:s.data}}return null},y.prototype.findStatic=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return l;d<0?l=l.left:l=l.right}return null},y.prototype.find=function(s){return this._root&&(this._root=r(s,this._root,this._comparator),this._comparator(s,this._root.key)!==0)?null:this._root},y.prototype.contains=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return!0;d<0?l=l.left:l=l.right}return!1},y.prototype.forEach=function(s,l){for(var a=this._root,d=[],p=!1;!p;)a!==null?(d.push(a),a=a.left):d.length!==0?(a=d.pop(),s.call(l,a),a=a.right):p=!0;return this},y.prototype.range=function(s,l,a,d){for(var p=[],M=this._comparator,w=this._root,R;p.length!==0||w;)if(w)p.push(w),w=w.left;else{if(w=p.pop(),R=M(w.key,l),R>0)break;if(M(w.key,s)>=0&&a.call(d,w))return this;w=w.right}return this},y.prototype.keys=function(){var s=[];return this.forEach(function(l){var a=l.key;return s.push(a)}),s},y.prototype.values=function(){var s=[];return this.forEach(function(l){var a=l.data;return s.push(a)}),s},y.prototype.min=function(){return this._root?this.minNode(this._root).key:null},y.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},y.prototype.minNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.left;)s=s.left;return s},y.prototype.maxNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.right;)s=s.right;return s},y.prototype.at=function(s){for(var l=this._root,a=!1,d=0,p=[];!a;)if(l)p.push(l),l=l.left;else if(p.length>0){if(l=p.pop(),d===s)return l;d++,l=l.right}else a=!0;return null},y.prototype.next=function(s){var l=this._root,a=null;if(s.right){for(a=s.right;a.left;)a=a.left;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?(a=l,l=l.left):l=l.right}return a},y.prototype.prev=function(s){var l=this._root,a=null;if(s.left!==null){for(a=s.left;a.right;)a=a.right;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?l=l.left:(a=l,l=l.right)}return a},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(s,l,a){l===void 0&&(l=[]),a===void 0&&(a=!1);var d=s.length,p=this._comparator;if(a&&S(s,l,0,d-1,p),this._root===null)this._root=h(s,l,0,d),this._size=d;else{var M=v(this.toList(),m(s,l),p);d=this._size+d,this._root=x({head:M},0,d)}return this},y.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),y.prototype.toString=function(s){s===void 0&&(s=function(a){return String(a.key)});var l=[];return c(this._root,"",!0,function(a){return l.push(a)},s),l.join("")},y.prototype.update=function(s,l,a){var d=this._comparator,p=o(s,this._root,d),M=p.left,w=p.right;d(s,l)<0?w=i(l,a,w,d):M=i(l,a,M,d),this._root=u(M,w,d)},y.prototype.split=function(s){return o(s,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var s,l,a;return e(this,function(d){switch(d.label){case 0:s=this._root,l=[],a=!1,d.label=1;case 1:return a?[3,6]:s===null?[3,2]:(l.push(s),s=s.left,[3,5]);case 2:return l.length===0?[3,4]:(s=l.pop(),[4,s]);case 3:return d.sent(),s=s.right,[3,5];case 4:a=!0,d.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function h(y,s,l,a){var d=a-l;if(d>0){var p=l+Math.floor(d/2),M=y[p],w=s[p],R=new t(M,w);return R.left=h(y,s,l,p),R.right=h(y,s,p+1,a),R}return null}function m(y,s){for(var l=new t(null,null),a=l,d=0;d<y.length;d++)a=a.next=new t(y[d],s[d]);return a.next=null,l.next}function g(y){for(var s=y,l=[],a=!1,d=new t(null,null),p=d;!a;)s?(l.push(s),s=s.left):l.length>0?(s=p=p.next=l.pop(),s=s.right):a=!0;return p.next=null,d.next}function x(y,s,l){var a=l-s;if(a>0){var d=s+Math.floor(a/2),p=x(y,s,d),M=y.head;return M.left=p,y.head=y.head.next,M.right=x(y,d+1,l),M}return null}function v(y,s,l){for(var a=new t(null,null),d=a,p=y,M=s;p!==null&&M!==null;)l(p.key,M.key)<0?(d.next=p,p=p.next):(d.next=M,M=M.next),d=d.next;return p!==null?d.next=p:M!==null&&(d.next=M),a.next}function S(y,s,l,a,d){if(!(l>=a)){for(var p=y[l+a>>1],M=l-1,w=a+1;;){do M++;while(d(y[M],p)<0);do w--;while(d(y[w],p)>0);if(M>=w)break;var R=y[M];y[M]=y[w],y[w]=R,R=s[M],s[M]=s[w],s[w]=R}S(y,s,l,w,d),S(y,s,w+1,a,d)}}let P=(y,s)=>y.ll.x<=s.x&&s.x<=y.ur.x&&y.ll.y<=s.y&&s.y<=y.ur.y,_=(y,s)=>{if(s.ur.x<y.ll.x||y.ur.x<s.ll.x||s.ur.y<y.ll.y||y.ur.y<s.ll.y)return null;let l=y.ll.x<s.ll.x?s.ll.x:y.ll.x,a=y.ur.x<s.ur.x?y.ur.x:s.ur.x,d=y.ll.y<s.ll.y?s.ll.y:y.ll.y,p=y.ur.y<s.ur.y?y.ur.y:s.ur.y;return{ll:{x:l,y:d},ur:{x:a,y:p}}},I=Number.EPSILON;I===void 0&&(I=Math.pow(2,-52));let A=I*I,k=(y,s)=>{if(-I<y&&y<I&&-I<s&&s<I)return 0;let l=y-s;return l*l<A*y*s?0:y<s?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(s,l){return{x:this.xRounder.round(s),y:this.yRounder.round(l)}}}class V{constructor(){this.tree=new f,this.round(0)}round(s){let l=this.tree.add(s),a=this.tree.prev(l);if(a!==null&&k(l.key,a.key)===0)return this.tree.remove(s),a.key;let d=this.tree.next(l);return d!==null&&k(l.key,d.key)===0?(this.tree.remove(s),d.key):s}}let U=new L,N=11102230246251565e-32,T=134217729,j=(3+8*N)*N;function Y(y,s,l,a,d){let p,M,w,R,E=s[0],C=a[0],b=0,F=0;C>E==C>-E?(p=E,E=s[++b]):(p=C,C=a[++F]);let B=0;if(b<y&&F<l)for(C>E==C>-E?(M=E+p,w=p-(M-E),E=s[++b]):(M=C+p,w=p-(M-C),C=a[++F]),p=M,w!==0&&(d[B++]=w);b<y&&F<l;)C>E==C>-E?(M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b]):(M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F]),p=M,w!==0&&(d[B++]=w);for(;b<y;)M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b],p=M,w!==0&&(d[B++]=w);for(;F<l;)M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F],p=M,w!==0&&(d[B++]=w);return(p!==0||B===0)&&(d[B++]=p),B}function X(y,s){let l=s[0];for(let a=1;a<y;a++)l+=s[a];return l}function O(y){return new Float64Array(y)}let G=(3+16*N)*N,W=(2+12*N)*N,D=(9+64*N)*N*N,Q=O(4),oe=O(8),ee=O(12),ne=O(16),Z=O(4);function le(y,s,l,a,d,p,M){let w,R,E,C,b,F,B,z,H,J,$,te,xe,se,ge,ye,Ee,be,ke=y-d,_e=l-d,Ae=s-p,Be=a-p;se=ke*Be,F=T*ke,B=F-(F-ke),z=ke-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*_e,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),$=ge-Ee,b=ge-$,Q[0]=ge-($+b)+(b-Ee),te=se+$,b=te-se,xe=se-(te-b)+($-b),$=xe-ye,b=xe-$,Q[1]=xe-($+b)+(b-ye),be=te+$,b=be-te,Q[2]=te-(be-b)+($-b),Q[3]=be;let Te=X(4,Q),et=W*M;if(Te>=et||-Te>=et||(b=y-ke,w=y-(ke+b)+(b-d),b=l-_e,E=l-(_e+b)+(b-d),b=s-Ae,R=s-(Ae+b)+(b-p),b=a-Be,C=a-(Be+b)+(b-p),w===0&&R===0&&E===0&&C===0)||(et=D*M+j*Math.abs(Te),Te+=ke*C+Be*w-(Ae*E+_e*R),Te>=et||-Te>=et))return Te;se=w*Be,F=T*w,B=F-(F-w),z=w-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*_e,F=T*R,B=F-(F-R),z=R-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),$=ge-Ee,b=ge-$,Z[0]=ge-($+b)+(b-Ee),te=se+$,b=te-se,xe=se-(te-b)+($-b),$=xe-ye,b=xe-$,Z[1]=xe-($+b)+(b-ye),be=te+$,b=be-te,Z[2]=te-(be-b)+($-b),Z[3]=be;let fr=Y(4,Q,4,Z,oe);se=ke*C,F=T*ke,B=F-(F-ke),z=ke-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*E,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),$=ge-Ee,b=ge-$,Z[0]=ge-($+b)+(b-Ee),te=se+$,b=te-se,xe=se-(te-b)+($-b),$=xe-ye,b=xe-$,Z[1]=xe-($+b)+(b-ye),be=te+$,b=be-te,Z[2]=te-(be-b)+($-b),Z[3]=be;let ar=Y(fr,oe,4,Z,ee);se=w*C,F=T*w,B=F-(F-w),z=w-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*E,F=T*R,B=F-(F-R),z=R-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),$=ge-Ee,b=ge-$,Z[0]=ge-($+b)+(b-Ee),te=se+$,b=te-se,xe=se-(te-b)+($-b),$=xe-ye,b=xe-$,Z[1]=xe-($+b)+(b-ye),be=te+$,b=be-te,Z[2]=te-(be-b)+($-b),Z[3]=be;let hr=Y(ar,ee,4,Z,ne);return ne[hr-1]}function K(y,s,l,a,d,p){let M=(s-p)*(l-d),w=(y-d)*(a-p),R=M-w,E=Math.abs(M+w);return Math.abs(R)>=G*E?R:-le(y,s,l,a,d,p,E)}let q=(y,s)=>y.x*s.y-y.y*s.x,he=(y,s)=>y.x*s.x+y.y*s.y,me=(y,s,l)=>{let a=K(y.x,y.y,s.x,s.y,l.x,l.y);return a>0?-1:a<0?1:0},ce=y=>Math.sqrt(he(y,y)),fe=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return q(d,a)/ce(d)/ce(a)},ae=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return he(d,a)/ce(d)/ce(a)},de=(y,s,l)=>s.y===0?null:{x:y.x+s.x/s.y*(l-y.y),y:l},Se=(y,s,l)=>s.x===0?null:{x:l,y:y.y+s.y/s.x*(l-y.x)},Fe=(y,s,l,a)=>{if(s.x===0)return Se(l,a,y.x);if(a.x===0)return Se(y,s,l.x);if(s.y===0)return de(l,a,y.y);if(a.y===0)return de(y,s,l.y);let d=q(s,a);if(d==0)return null;let p={x:l.x-y.x,y:l.y-y.y},M=q(p,s)/d,w=q(p,a)/d,R=y.x+w*s.x,E=l.x+M*a.x,C=y.y+w*s.y,b=l.y+M*a.y,F=(R+E)/2,B=(C+b)/2;return{x:F,y:B}};class re{static compare(s,l){let a=re.comparePoints(s.point,l.point);return a!==0?a:(s.point!==l.point&&s.link(l),s.isLeft!==l.isLeft?s.isLeft?1:-1:ve.compare(s.segment,l.segment))}static comparePoints(s,l){return s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0}constructor(s,l){s.events===void 0?s.events=[this]:s.events.push(this),this.point=s,this.isLeft=l}link(s){if(s.point===this.point)throw new Error("Tried to link already linked events");let l=s.point.events;for(let a=0,d=l.length;a<d;a++){let p=l[a];this.point.events.push(p),p.point=this.point}this.checkForConsuming()}checkForConsuming(){let s=this.point.events.length;for(let l=0;l<s;l++){let a=this.point.events[l];if(a.segment.consumedBy===void 0)for(let d=l+1;d<s;d++){let p=this.point.events[d];p.consumedBy===void 0&&a.otherSE.point.events===p.otherSE.point.events&&a.segment.consume(p.segment)}}}getAvailableLinkedEvents(){let s=[];for(let l=0,a=this.point.events.length;l<a;l++){let d=this.point.events[l];d!==this&&!d.segment.ringOut&&d.segment.isInResult()&&s.push(d)}return s}getLeftmostComparator(s){let l=new Map,a=d=>{let p=d.otherSE;l.set(d,{sine:fe(this.point,s.point,p.point),cosine:ae(this.point,s.point,p.point)})};return(d,p)=>{l.has(d)||a(d),l.has(p)||a(p);let{sine:M,cosine:w}=l.get(d),{sine:R,cosine:E}=l.get(p);return M>=0&&R>=0?w<E?1:w>E?-1:0:M<0&&R<0?w<E?-1:w>E?1:0:R<M?-1:R>M?1:0}}}let Ue=0;class ve{static compare(s,l){let a=s.leftSE.point.x,d=l.leftSE.point.x,p=s.rightSE.point.x,M=l.rightSE.point.x;if(M<a)return 1;if(p<d)return-1;let w=s.leftSE.point.y,R=l.leftSE.point.y,E=s.rightSE.point.y,C=l.rightSE.point.y;if(a<d){if(R<w&&R<E)return 1;if(R>w&&R>E)return-1;let b=s.comparePoint(l.leftSE.point);if(b<0)return 1;if(b>0)return-1;let F=l.comparePoint(s.rightSE.point);return F!==0?F:-1}if(a>d){if(w<R&&w<C)return-1;if(w>R&&w>C)return 1;let b=l.comparePoint(s.leftSE.point);if(b!==0)return b;let F=s.comparePoint(l.rightSE.point);return F<0?1:F>0?-1:1}if(w<R)return-1;if(w>R)return 1;if(p<M){let b=l.comparePoint(s.rightSE.point);if(b!==0)return b}if(p>M){let b=s.comparePoint(l.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(p!==M){let b=E-w,F=p-a,B=C-R,z=M-d;if(b>F&&B<z)return 1;if(b<F&&B>z)return-1}return p>M?1:p<M||E<C?-1:E>C?1:s.id<l.id?-1:s.id>l.id?1:0}constructor(s,l,a,d){this.id=++Ue,this.leftSE=s,s.segment=this,s.otherSE=l,this.rightSE=l,l.segment=this,l.otherSE=s,this.rings=a,this.windings=d}static fromRing(s,l,a){let d,p,M,w=re.comparePoints(s,l);if(w<0)d=s,p=l,M=1;else if(w>0)d=l,p=s,M=-1;else throw new Error(`Tried to create degenerate segment at [${s.x}, ${s.y}]`);let R=new re(d,!0),E=new re(p,!1);return new ve(R,E,[a],[M])}replaceRightSE(s){this.rightSE=s,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let s=this.leftSE.point.y,l=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:s<l?s:l},ur:{x:this.rightSE.point.x,y:s>l?s:l}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(s){return s.x===this.leftSE.point.x&&s.y===this.leftSE.point.y||s.x===this.rightSE.point.x&&s.y===this.rightSE.point.y}comparePoint(s){if(this.isAnEndpoint(s))return 0;let l=this.leftSE.point,a=this.rightSE.point,d=this.vector();if(l.x===a.x)return s.x===l.x?0:s.x<l.x?1:-1;let p=(s.y-l.y)/d.y,M=l.x+p*d.x;if(s.x===M)return 0;let w=(s.x-l.x)/d.x,R=l.y+w*d.y;return s.y===R?0:s.y<R?-1:1}getIntersection(s){let l=this.bbox(),a=s.bbox(),d=_(l,a);if(d===null)return null;let p=this.leftSE.point,M=this.rightSE.point,w=s.leftSE.point,R=s.rightSE.point,E=P(l,w)&&this.comparePoint(w)===0,C=P(a,p)&&s.comparePoint(p)===0,b=P(l,R)&&this.comparePoint(R)===0,F=P(a,M)&&s.comparePoint(M)===0;if(C&&E)return F&&!b?M:!F&&b?R:null;if(C)return b&&p.x===R.x&&p.y===R.y?null:p;if(E)return F&&M.x===w.x&&M.y===w.y?null:w;if(F&&b)return null;if(F)return M;if(b)return R;let B=Fe(p,this.vector(),w,s.vector());return B===null||!P(d,B)?null:U.round(B.x,B.y)}split(s){let l=[],a=s.events!==void 0,d=new re(s,!0),p=new re(s,!1),M=this.rightSE;this.replaceRightSE(p),l.push(p),l.push(d);let w=new ve(d,M,this.rings.slice(),this.windings.slice());return re.comparePoints(w.leftSE.point,w.rightSE.point)>0&&w.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),a&&(d.checkForConsuming(),p.checkForConsuming()),l}swapEvents(){let s=this.rightSE;this.rightSE=this.leftSE,this.leftSE=s,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let l=0,a=this.windings.length;l<a;l++)this.windings[l]*=-1}consume(s){let l=this,a=s;for(;l.consumedBy;)l=l.consumedBy;for(;a.consumedBy;)a=a.consumedBy;let d=ve.compare(l,a);if(d!==0){if(d>0){let p=l;l=a,a=p}if(l.prev===a){let p=l;l=a,a=p}for(let p=0,M=a.rings.length;p<M;p++){let w=a.rings[p],R=a.windings[p],E=l.rings.indexOf(w);E===-1?(l.rings.push(w),l.windings.push(R)):l.windings[E]+=R}a.rings=null,a.windings=null,a.consumedBy=l,a.leftSE.consumedBy=l.leftSE,a.rightSE.consumedBy=l.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 s=this.prev.consumedBy||this.prev;this._beforeState=s.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let s=this.beforeState();this._afterState={rings:s.rings.slice(0),windings:s.windings.slice(0),multiPolys:[]};let l=this._afterState.rings,a=this._afterState.windings,d=this._afterState.multiPolys;for(let w=0,R=this.rings.length;w<R;w++){let E=this.rings[w],C=this.windings[w],b=l.indexOf(E);b===-1?(l.push(E),a.push(C)):a[b]+=C}let p=[],M=[];for(let w=0,R=l.length;w<R;w++){if(a[w]===0)continue;let E=l[w],C=E.poly;if(M.indexOf(C)===-1)if(E.isExterior)p.push(C);else{M.indexOf(C)===-1&&M.push(C);let b=p.indexOf(E.poly);b!==-1&&p.splice(b,1)}}for(let w=0,R=p.length;w<R;w++){let E=p[w].multiPoly;d.indexOf(E)===-1&&d.push(E)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let s=this.beforeState().multiPolys,l=this.afterState().multiPolys;switch(Pe.type){case"union":{let a=s.length===0,d=l.length===0;this._isInResult=a!==d;break}case"intersection":{let a,d;s.length<l.length?(a=s.length,d=l.length):(a=l.length,d=s.length),this._isInResult=d===Pe.numMultiPolys&&a<d;break}case"xor":{let a=Math.abs(s.length-l.length);this._isInResult=a%2===1;break}case"difference":{let a=d=>d.length===1&&d[0].isSubject;this._isInResult=a(s)!==a(l);break}default:throw new Error(`Unrecognized operation type found ${Pe.type}`)}return this._isInResult}}class De{constructor(s,l,a){if(!Array.isArray(s)||s.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=l,this.isExterior=a,this.segments=[],typeof s[0][0]!="number"||typeof s[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let d=U.round(s[0][0],s[0][1]);this.bbox={ll:{x:d.x,y:d.y},ur:{x:d.x,y:d.y}};let p=d;for(let M=1,w=s.length;M<w;M++){if(typeof s[M][0]!="number"||typeof s[M][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let R=U.round(s[M][0],s[M][1]);R.x===p.x&&R.y===p.y||(this.segments.push(ve.fromRing(p,R,this)),R.x<this.bbox.ll.x&&(this.bbox.ll.x=R.x),R.y<this.bbox.ll.y&&(this.bbox.ll.y=R.y),R.x>this.bbox.ur.x&&(this.bbox.ur.x=R.x),R.y>this.bbox.ur.y&&(this.bbox.ur.y=R.y),p=R)}(d.x!==p.x||d.y!==p.y)&&this.segments.push(ve.fromRing(p,d,this))}getSweepEvents(){let s=[];for(let l=0,a=this.segments.length;l<a;l++){let d=this.segments[l];s.push(d.leftSE),s.push(d.rightSE)}return s}}class Ie{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new De(s[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 a=1,d=s.length;a<d;a++){let p=new De(s[a],this,!1);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.interiorRings.push(p)}this.multiPoly=l}getSweepEvents(){let s=this.exteriorRing.getSweepEvents();for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Le{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof s[0][0][0]=="number"&&(s=[s])}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 a=0,d=s.length;a<d;a++){let p=new Ie(s[a],this);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.polys.push(p)}this.isSubject=l}getSweepEvents(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Me{static factory(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.isInResult()||p.ringOut)continue;let M=null,w=p.leftSE,R=p.rightSE,E=[w],C=w.point,b=[];for(;M=w,w=R,E.push(w),w.point!==C;)for(;;){let F=w.getAvailableLinkedEvents();if(F.length===0){let H=E[0].point,J=E[E.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${J.x}, ${J.y}].`)}if(F.length===1){R=F[0].otherSE;break}let B=null;for(let H=0,J=b.length;H<J;H++)if(b[H].point===w.point){B=H;break}if(B!==null){let H=b.splice(B)[0],J=E.splice(H.index);J.unshift(J[0].otherSE),l.push(new Me(J.reverse()));continue}b.push({index:E.length,point:w.point});let z=w.getLeftmostComparator(M);R=F.sort(z)[0].otherSE;break}l.push(new Me(E))}return l}constructor(s){this.events=s;for(let l=0,a=s.length;l<a;l++)s[l].segment.ringOut=this;this.poly=null}getGeom(){let s=this.events[0].point,l=[s];for(let E=1,C=this.events.length-1;E<C;E++){let b=this.events[E].point,F=this.events[E+1].point;me(b,s,F)!==0&&(l.push(b),s=b)}if(l.length===1)return null;let a=l[0],d=l[1];me(a,s,d)===0&&l.shift(),l.push(l[0]);let p=this.isExteriorRing()?1:-1,M=this.isExteriorRing()?0:l.length-1,w=this.isExteriorRing()?l.length:-1,R=[];for(let E=M;E!=w;E+=p)R.push([l[E].x,l[E].y]);return R}isExteriorRing(){if(this._isExteriorRing===void 0){let s=this.enclosingRing();this._isExteriorRing=s?!s.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let s=this.events[0];for(let d=1,p=this.events.length;d<p;d++){let M=this.events[d];re.compare(s,M)>0&&(s=M)}let l=s.segment.prevInResult(),a=l?l.prevInResult():null;for(;;){if(!l)return null;if(!a)return l.ringOut;if(a.ringOut!==l.ringOut)return a.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=a.prevInResult(),a=l?l.prevInResult():null}}}class Ge{constructor(s){this.exteriorRing=s,s.poly=this,this.interiorRings=[]}addInterior(s){this.interiorRings.push(s),s.poly=this}getGeom(){let s=[this.exteriorRing.getGeom()];if(s[0]===null)return null;for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getGeom();d!==null&&s.push(d)}return s}}class Xe{constructor(s){this.rings=s,this.polys=this._composePolys(s)}getGeom(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getGeom();d!==null&&s.push(d)}return s}_composePolys(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.poly)if(p.isExteriorRing())l.push(new Ge(p));else{let M=p.enclosingRing();M.poly||l.push(new Ge(M)),M.poly.addInterior(p)}}return l}}class Ne{constructor(s){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ve.compare;this.queue=s,this.tree=new f(l),this.segments=[]}process(s){let l=s.segment,a=[];if(s.consumedBy)return s.isLeft?this.queue.remove(s.otherSE):this.tree.remove(l),a;let d=s.isLeft?this.tree.add(l):this.tree.find(l);if(!d)throw new Error(`Unable to find segment #${l.id} [${l.leftSE.point.x}, ${l.leftSE.point.y}] -> [${l.rightSE.point.x}, ${l.rightSE.point.y}] in SweepLine tree.`);let p=d,M=d,w,R;for(;w===void 0;)p=this.tree.prev(p),p===null?w=null:p.key.consumedBy===void 0&&(w=p.key);for(;R===void 0;)M=this.tree.next(M),M===null?R=null:M.key.consumedBy===void 0&&(R=M.key);if(s.isLeft){let E=null;if(w){let b=w.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(E=b),!w.isAnEndpoint(b))){let F=this._splitSafely(w,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}let C=null;if(R){let b=R.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(C=b),!R.isAnEndpoint(b))){let F=this._splitSafely(R,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}if(E!==null||C!==null){let b=null;E===null?b=C:C===null?b=E:b=re.comparePoints(E,C)<=0?E:C,this.queue.remove(l.rightSE),a.push(l.rightSE);let F=l.split(b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}a.length>0?(this.tree.remove(l),a.push(s)):(this.segments.push(l),l.prev=w)}else{if(w&&R){let E=w.getIntersection(R);if(E!==null){if(!w.isAnEndpoint(E)){let C=this._splitSafely(w,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}if(!R.isAnEndpoint(E)){let C=this._splitSafely(R,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}}}this.tree.remove(l)}return a}_splitSafely(s,l){this.tree.remove(s);let a=s.rightSE;this.queue.remove(a);let d=s.split(l);return d.push(a),s.consumedBy===void 0&&this.tree.add(s),d}}let ht=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,pt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Et{run(s,l,a){Pe.type=s,U.reset();let d=[new Le(l,!0)];for(let b=0,F=a.length;b<F;b++)d.push(new Le(a[b],!1));if(Pe.numMultiPolys=d.length,Pe.type==="difference"){let b=d[0],F=1;for(;F<d.length;)_(d[F].bbox,b.bbox)!==null?F++:d.splice(F,1)}if(Pe.type==="intersection")for(let b=0,F=d.length;b<F;b++){let B=d[b];for(let z=b+1,H=d.length;z<H;z++)if(_(B.bbox,d[z].bbox)===null)return[]}let p=new f(re.compare);for(let b=0,F=d.length;b<F;b++){let B=d[b].getSweepEvents();for(let z=0,H=B.length;z<H;z++)if(p.insert(B[z]),p.size>ht)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let M=new Ne(p),w=p.size,R=p.pop();for(;R;){let b=R.key;if(p.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(p.size>ht)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(M.segments.length>pt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let F=M.process(b);for(let B=0,z=F.length;B<z;B++){let H=F[B];H.consumedBy===void 0&&p.insert(H)}w=p.size,R=p.pop()}U.reset();let E=Me.factory(M.segments);return new Xe(E).getGeom()}}let Pe=new Et;var cr={union:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("union",y,l)},intersection:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("intersection",y,l)},xor:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("xor",y,l)},difference:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("difference",y,l)}};return cr})});var it=new Set,Rt=!1;function Oe(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;it.size&&it.clear();let o=sn(e,0,i,n,!0),u=[];if(!o||o.next===o.prev)return u;let c=0,f=0,h=0;if(r&&(o=Rr(e,t,o,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let x=n;x<i;x+=n){let v=e[x],S=e[x+1];v<c&&(c=v),S<f&&(f=S),v>m&&(m=v),S>g&&(g=S)}h=Math.max(m-c,g-f),h=h!==0?32767/h:0}return Ft(o,u,c,f,h),u}function sn(e,t,n,r,i){let o=null;if(i===Ur(e,t,n,r)>0)for(let u=t;u<n;u+=r)o=on(u/r|0,e[u],e[u+1],o);else for(let u=n-r;u>=t;u-=r)o=on(u/r|0,e[u],e[u+1],o);return o&&ot(o,o.next)&&(ut(o),o=o.next),o}function ze(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(it.size===0||!it.has(r))&&(ot(r,r.next)||ue(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Rt=!0,ut(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Ft(e,t,n,r,i){i&&Br(e,n,r,i);let o=e,u=!1;for(;e.prev!==e.next;){let c=e.prev,f=e.next;if(ue(c,e,f)<0&&(i?Sr(e,n,r,i):vr(e))){t.push(c.i,e.i,f.i),ut(e),e=f,o=f;continue}if(e=f,e===o){if(Rt=!1,e=ze(e),Rt){o=e;continue}if(!u){e=Mr(e,t),o=e,u=!0;continue}Er(e,t,n,r,i);break}}}function vr(e){let t=e.prev,n=e,r=e.next,i=t.x,o=n.x,u=r.x,c=t.y,f=n.y,h=r.y,m=Math.min(i,o,u),g=Math.min(c,f,h),x=Math.max(i,o,u),v=Math.max(c,f,h),S=r.next;for(;S!==t;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=v&&!(i===S.x&&c===S.y)&&gt(i,c,o,f,u,h,S.x,S.y)&&ue(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Sr(e,t,n,r){let i=e.prev,o=e,u=e.next,c=i.x,f=o.x,h=u.x,m=i.y,g=o.y,x=u.y,v=Math.min(c,f,h),S=Math.min(m,g,x),P=Math.max(c,f,h),_=Math.max(m,g,x),I=_t(v,S,t,n,r),A=_t(P,_,t,n,r),k=e.prevZ;for(;k&&k.z>=I;){if(k.x>=v&&k.x<=P&&k.y>=S&&k.y<=_&&k!==u&&!(c===k.x&&m===k.y)&&gt(c,m,f,g,h,x,k.x,k.y)&&ue(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let L=e.nextZ;for(;L&&L.z<=A;){if(L.x>=v&&L.x<=P&&L.y>=S&&L.y<=_&&L!==u&&!(c===L.x&&m===L.y)&&gt(c,m,f,g,h,x,L.x,L.y)&&ue(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function Mr(e,t){let n=e,r=!1;do{let i=n.prev,o=n.next.next;cn(i,n,n.next,o,!1)&&st(i,o)&&st(o,i)&&(t.push(i.i,n.i,o.i),ut(n),ut(n.next),n=e=o,r=!0),n=n.next}while(n!==e);return r?ze(n):n}function Er(e,t,n,r,i){let o=e;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&Cr(o,u)){let c=fn(o,u);o=ze(o,o.next),c=ze(c,c.next),Ft(o,t,n,r,i),Ft(c,t,n,r,i);return}u=u.next}o=o.next}while(o!==e)}var It=!1;function Rr(e,t,n,r){let i=[];for(let o=0,u=t.length;o<u;o++){let c=t[o]*r,f=o<u-1?t[o+1]*r:e.length,h=sn(e,c,f,r,!1);h===h.next&&it.add(h),i.push(Tr(h))}i.sort(Fr),Pr(e.length/r,t.length),ln(n,n),It=!0;for(let o=0;o<i.length;o++)n=Ir(i[o],n);return It=!1,ze(n)}function Fr(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Ir(e,t){let n=_r(e,t);if(!n)return t;let r=fn(n,e),i=r.next;return ln(n,i.next),ze(r,r.next),ze(n,n.next)}var un=16,ie=new Float64Array(0),xt=0,Pt=[],kt=[];function Pr(e,t){let n=Math.ceil((e+2*t)/un)+t+2;ie.length<n*4&&(ie=new Float64Array(n*4)),xt=0}function ln(e,t){let n=e;do{let r=xt++;Pt[r]=n;let i=1/0,o=1/0,u=-1/0,c=-1/0,f=0;do{let m=n.next;n.z=r,n.x<i&&(i=n.x),n.x>u&&(u=n.x),n.y<o&&(o=n.y),n.y>c&&(c=n.y),m.x<i&&(i=m.x),m.x>u&&(u=m.x),m.y<o&&(o=m.y),m.y>c&&(c=m.y),n=m}while(++f<un&&n!==t);kt[r]=n;let h=r*4;ie[h]=i,ie[h+1]=o,ie[h+2]=u,ie[h+3]=c}while(n!==t)}function kr(e,t){let n=e.z*4;t.x<ie[n]&&(ie[n]=t.x),t.y<ie[n+1]&&(ie[n+1]=t.y),t.x>ie[n+2]&&(ie[n+2]=t.x),t.y>ie[n+3]&&(ie[n+3]=t.y)}function nn(e){let t=kt[e];for(;t.prev.next!==t;)t=t.next;return kt[e]=t,t}function rn(e){let t=Pt[e];for(;t.prev.next!==t;)t=t.next;return Pt[e]=t,t}function _r(e,t){let n=t,r=e.x,i=e.y,o=-1/0,u;if(ot(e,n))return n;for(let x=0,v=0;x<xt;x++,v+=4){if(i<ie[v+1]||i>ie[v+3]||ie[v]>r||ie[v+2]<=o)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n){if(ot(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let P=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(P<=r&&P>o&&(o=P,u=n.x<n.next.x?n:n.next,P===r))return u}}n=n.next}while(n!==S)}if(!u)return null;let c=u.x,f=u.y,h=Math.min(i,f),m=Math.max(i,f),g=1/0;for(let x=0,v=0;x<xt;x++,v+=4){if(ie[v+2]<c||ie[v]>r||ie[v+3]<h||ie[v+1]>m)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&gt(i<f?r:o,i,c,f,i<f?o:r,i,n.x,n.y)){let P=Math.abs(i-n.y)/(r-n.x);(st(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(P<g||P===g&&(n.x>u.x||n.x===u.x&&Ar(u,n)))&&(u=n,g=P)}n=n.next}while(n!==S)}return u}function Ar(e,t){return ue(e.prev,e,t.prev)<0&&ue(t.next,e,e.next)<0}var Re=[],tt=[],He=new Uint32Array(0),nt=new Uint32Array(0),rt=new Uint32Array(256);function Br(e,t,n,r){let i=e,o=0;do i.z=_t(i.x,i.y,t,n,r),Re[o++]=i,i=i.next;while(i!==e);Lr(o);let u=null;for(let c=0;c<o;c++){let f=Re[c];f.prevZ=u,u&&(u.nextZ=f),u=f}u.nextZ=null}function Lr(e){if(e<=32){for(let t=1;t<e;t++){let n=Re[t],r=n.z,i=t-1;for(;i>=0&&Re[i].z>r;)Re[i+1]=Re[i],i--;Re[i+1]=n}return}He.length<e&&(He=new Uint32Array(e),nt=new Uint32Array(e),tt=new Array(e));for(let t=0;t<e;t++)He[t]=Re[t].z;mt(e,Re,He,tt,nt,0),mt(e,tt,nt,Re,He,8),mt(e,Re,He,tt,nt,16),mt(e,tt,nt,Re,He,24)}function mt(e,t,n,r,i,o){rt.fill(0);for(let c=0;c<e;c++)rt[n[c]>>>o&255]++;let u=0;for(let c=0;c<256;c++){let f=rt[c];rt[c]=u,u+=f}for(let c=0;c<e;c++){let f=n[c],h=rt[f>>>o&255]++;r[h]=t[c],i[h]=f}}function _t(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Tr(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function gt(e,t,n,r,i,o,u,c){return(i-u)*(t-c)>=(e-u)*(o-c)&&(e-u)*(r-c)>=(n-u)*(t-c)&&(n-u)*(o-c)>=(i-u)*(r-c)}function Cr(e,t){let n=ot(e,t)&&ue(e.prev,e,e.next)>0&&ue(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||st(e,t)&&st(t,e)&&(ue(e.prev,e,t.prev)!==0||ue(e,t.prev,t)!==0))&&!Vr(e,t)&&(n||Or(e,t))}function ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ot(e,t){return e.x===t.x&&e.y===t.y}function cn(e,t,n,r,i=!0){let o=ue(e,t,n),u=ue(e,t,r),c=ue(n,r,e),f=ue(n,r,t);return(o>0&&u<0||o<0&&u>0)&&(c>0&&f<0||c<0&&f>0)?!0:i?!!(o===0&&dt(e,n,t)||u===0&&dt(e,r,t)||c===0&&dt(n,e,r)||f===0&&dt(n,t,r)):!1}function dt(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Vr(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.y,t.y),u=e;do{let c=u.next;if(u.x>r&&c.x>r||u.x<n&&c.x<n||u.y>o&&c.y>o||u.y<i&&c.y<i){u=c;continue}if(u.i!==e.i&&c.i!==e.i&&u.i!==t.i&&c.i!==t.i&&cn(u,c,e,t))return!0;u=c}while(u!==e);return!1}function st(e,t){return ue(e.prev,e,e.next)<0?ue(e,t,e.next)>=0&&ue(e,e.prev,t)>=0:ue(e,t,e.prev)<0||ue(e,e.next,t)<0}function Or(e,t){let n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{let u=n.next;n.y>o!=u.y>o&&i<(u.x-n.x)*(o-n.y)/(u.y-n.y)+n.x&&(r=!r),n=u}while(n!==e);return r}function fn(e,t){let n=At(e.i,e.x,e.y),r=At(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function on(e,t,n,r){let i=At(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ut(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),It&&kr(e.prev,e.next)}function At(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Ur(e,t,n,r){let i=0;for(let o=t,u=n-r;o<n;o+=r)i+=(e[u]-e[o])*(e[o+1]+e[u+1]),u=o;return i}var an=23283064365386963e-26,Dr=12,hn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Bt=0,yt=1,lt=2,bt=5,ct=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),o=i>>3,u=this.pos;this.type=i&7,t(o,n,this),this.pos===u&&this.skip(i)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let n=this.buf,r,i;return i=n[this.pos++],r=i&127,i<128||(i=n[this.pos++],r|=(i&127)<<7,i<128)||(i=n[this.pos++],r|=(i&127)<<14,i<128)||(i=n[this.pos++],r|=(i&127)<<21,i<128)?r:(i=n[this.pos],r|=(i&15)<<28,Gr(r,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Dr&&hn?hn.decode(this.buf.subarray(n,t)):qr(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===lt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===Bt)for(;this.buf[this.pos++]>127;);else if(n===lt)this.pos=this.readVarint()+this.pos;else if(n===bt)this.pos+=4;else if(n===yt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)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(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Nr(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=ei(this.buf,t,this.pos);let r=this.pos-n;r>=128&&pn(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=t[r]}writeRawMessage(t,n){this.pos++;let r=this.pos;t(n,this);let i=this.pos-r;i>=128&&pn(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,n,r){this.writeTag(t,lt),this.writeRawMessage(n,r)}writePackedVarint(t,n){n.length&&this.writeMessage(t,jr,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,Xr,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,$r,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yr,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wr,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Qr,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Kr,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Jr,n)}writeBytesField(t,n){this.writeTag(t,lt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,bt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,bt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,yt),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,yt),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,Bt),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,Bt),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,lt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,bt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,yt),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function Gr(e,t,n){let r=n.buf,i,o;if(o=r[n.pos++],i=(o&112)>>4,o<128||(o=r[n.pos++],i|=(o&127)<<3,o<128)||(o=r[n.pos++],i|=(o&127)<<10,o<128)||(o=r[n.pos++],i|=(o&127)<<17,o<128)||(o=r[n.pos++],i|=(o&127)<<24,o<128)||(o=r[n.pos++],i|=(o&1)<<31,o<128))return $e(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function $e(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Nr(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Hr(n,r,t),zr(r,t)}function Hr(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function zr(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function pn(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function jr(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function Xr(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function $r(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yr(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Zr(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wr(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Qr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Kr(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Jr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function qr(e,t,n){let r="",i=t;for(;i<n;){let o=e[i],u=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c>n)break;let f,h,m;c===1?o<128&&(u=o):c===2?(f=e[i+1],(f&192)===128&&(u=(o&31)<<6|f&63,u<=127&&(u=null))):c===3?(f=e[i+1],h=e[i+2],(f&192)===128&&(h&192)===128&&(u=(o&15)<<12|(f&63)<<6|h&63,(u<=2047||u>=55296&&u<=57343)&&(u=null))):c===4&&(f=e[i+1],h=e[i+2],m=e[i+3],(f&192)===128&&(h&192)===128&&(m&192)===128&&(u=(o&15)<<18|(f&63)<<12|(h&63)<<6|m&63,(u<=65535||u>=1114112)&&(u=null))),u===null?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),r+=String.fromCharCode(u),i+=c}return r}function ei(e,t,n){for(let r=0,i,o;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(o)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=i;continue}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var Lt=class e{constructor(t,n,r,i){this.pbf=t;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,r,i,o){let u=new e(t,r,i,o);return t.readFields(ti,u,n),u}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let r=t.readVarint()+t.pos,i=1,o=0,u=0,c=0,f=[],h=[];for(;t.pos<r;){if(o<=0){let m=t.readVarint();i=m&7,o=m>>3}if(o--,i===1||i===2)u+=t.readSVarint(),c+=t.readSVarint(),i===1&&(h.length&&f.push(h),h=[]),h.push(u,c);else if(i===7)h.length>=2&&h.push(h[0],h[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: ${i}`)}return h.length&&f.push(h),t.pos=n,f}bbox(){let t=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return[n,r,i,o]}};function ti(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ni(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ni(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let r=t.keys[e.readVarint()],i=t.values[e.readVarint()];r!==void 0&&(t.properties[r]=i)}}var Tt=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let r=new e(t);return t.readFields(ri,r,n),r}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let r=n.readVarint()+n.pos;return Lt.read(n,r,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ri(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ii(n)))}function ii(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let r=e.readVarint()>>3;r===1?n=e.readString():r===2?n=e.readFloat():r===3?n=e.readDouble():r===4?n=e.readVarint64():r===5?n=e.readVarint():r===6?n=e.readSVarint():r===7?n=e.readBoolean():e.skip(r)}return n}var wt=class{constructor(t){this.layers={};new ct(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((r,i,o)=>{if(r===3&&o){let u=Tt.read(o,o.readVarint()+o.pos);u.length&&(this.layers[u.name]=u)}},null)}};function Ye(e){let t=[],n=null;for(let r of e){if(r.length<6)continue;let i=oi(r);i!==0&&(i>0?(n&&t.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,r=e.length-2;n<e.length;r=n,n+=2)t+=(e[r]-e[n])*(e[n+1]+e[r+1]);return t/2}function pe(e,t){if(!e)return!0;let n=e[0];switch(n){case"all":return e.slice(1).every(r=>pe(r,t));case"any":return e.slice(1).some(r=>pe(r,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let r=t[e[1]];return r==null?!1:e.slice(2).includes(r)}case"!in":{let r=t[e[1]];return r==null?!0:!e.slice(2).includes(r)}default:{let r=t[e[1]],i=e[2];if(r==null)return n==="!=";switch(n){case"==":return r===i;case"!=":return r!==i;case">":return r>i;case">=":return r>=i;case"<":return r<i;case"<=":return r<=i;default:return!0}}}}var si=Math.PI/8,ui=.35,li=32,dn=.25,xn=.5,gn=.07;function Ce(e,t){let n=t.radius;if(!(n>0))return e;let r=e.length/2-1;if(r<3)return e;let i=Math.max(2,Math.round(t.segments??4)),o=Math.max(t.minCutRatio??ui,0),u=t.extent,c=[];for(let f=0;f<r;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+r-1)%r*2],x=e[(f+r-1)%r*2+1],v=e[(f+1)%r*2],S=e[(f+1)%r*2+1],P=h-g,_=m-x,I=v-h,A=S-m,k=Math.hypot(P,_),L=Math.hypot(I,A);if(k<1e-6||L<1e-6){c.push(h,m);continue}let V=P/k,U=_/k,N=I/L,T=A/L;if(t.keep?.[f]){c.push(h,m);continue}let j=V*N+U*T;if(j>.985){c.push(h,m);continue}if(u!==void 0&&(h<=0||h>=u||m<=0||m>=u)){c.push(h,m);continue}let Y=Math.min(n,k*mn,L*mn);if(Y<n*o){c.push(h,m);continue}let X=h-V*Y,O=m-U*Y,G=h+N*Y,W=m+T*Y,D=Math.acos(Math.max(-1,Math.min(1,j))),Q=Math.min(si,Math.PI/2/i),oe=Math.ceil(D/Q-1e-6),ee=t.maxChord&&t.maxChord>0?Math.ceil(Y/Math.tan(D/2)*D/t.maxChord):0,ne=Math.max(1,Math.min(li,Math.max(Math.min(i,oe),ee)));c.push(X,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*X+2*K*le*h+le*le*G,K*K*O+2*K*le*m+le*le*W)}c.push(G,W)}return c.length<6?e:(c.push(c[0],c[1]),c)}var mn=.4;var we=e=>e/64;function Ve(e,t,n=0){let r=yn(e.outer,t,n);if(!r)return null;let i=[];for(let o of e.holes){let u=yn(o,t,n);u&&i.push(u)}return{outer:r,holes:i}}function yn(e,t,n){let r=[];for(let i=0;i<e.length-2;i+=2)r.push(e[i],e[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let o=r;r=[];let u=o.length/2;if(u===0)return null;for(let c=0;c<u;c++){let f=o[c*2],h=o[c*2+1],m=o[(c+u-1)%u*2],g=o[(c+u-1)%u*2+1],x=bn(f,h,i,t,n),v=bn(m,g,i,t,n);if(x!==v){let S=ci(m,g,f,h,i,t,n),P=i===0?-n:i===1?t+n:m+(f-m)*S,_=i===2?-n:i===3?t+n:g+(h-g)*S;r.push(P,_)}x&&r.push(f,h)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function bn(e,t,n,r,i){return n===0?e>=-i:n===1?e<=r+i:n===2?t>=-i:t<=r+i}function ci(e,t,n,r,i,o,u){return i===0?(-u-e)/(n-e):i===1?(o+u-e)/(n-e):i===2?(-u-t)/(r-t):(o+u-t)/(r-t)}function vt(e,t,n,r,i,o=0){let u=-o,c=i+o;return e===u&&n===u||e===c&&n===c||t===u&&r===u||t===c&&r===c}function Ct(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var wn=1,Ut=18,Dt=32,vn=8,kn=65535/Dt,fi=9,ai=1,hi=0,pi=1,mi=2;var Sn=0,di=1,Mn=2,xi=3,gi=.47;function _n(e,t,n,r={},i){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:gi,{b:u,ensure:c,take:f}=yi(Math.max(1024,e.length*48));for(let h of e.features()){if(h.type!==3||!pe(n,h.properties))continue;let m=Di(h.properties),g=Gi(h.properties,m);if(m<=g)continue;let x=Hi(h.properties)??Number(h.id??0),v=Ui(x>>>0),S=Oi(v,h.properties),P=Vi(h.properties,m),_=Ye(h.loadGeometry()),I=i?_.some(A=>{let k=Ve(A,t,we(t));return k?Ct(k.outer,t):!1}):!1;for(let A of _){if(i&&I){let k=Xi(A,t,m,g,x,v,S,P);k&&i.push(k)}zi(u,A,c,{extent:t,metersPerUnit:o,height:m,minHeight:g,featureId:x,seed:v,tint:S,facade:P,props:h.properties,cornerRadius:r.cornerRadius??0,cornerSegments:r.cornerSegments,whole:!1})}}return f(t)}function yi(e){let t=e,n=new ArrayBuffer(t*Ut),r={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},i=u=>{if(r.vertexCount+u<=t)return;t=Math.max(t*2,r.vertexCount+u);let c=new ArrayBuffer(t*Ut);new Uint8Array(c).set(r.vertsU8.subarray(0,r.vertOffset)),n=c,r.verts=new DataView(c),r.vertsU8=new Uint8Array(c)};return r.ensure=i,{b:r,ensure:i,take:u=>{if(!r.indices.length)return null;let c=new Uint32Array(r.indices),f=new Float64Array(r.featureIds);return{vertices:n.slice(0,r.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:r.vertexCount,indexCount:c.length,extent:u}}}}var Gt=(e,t)=>e|t<<2,En=e=>Math.max(-32768,Math.min(32767,e)),Vt=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,kn)*Dt)));function Ze(e,t,n,r,i,o,u,c,f,h,m=0,g=0,x=0){let v=e.vertOffset;return e.verts.setInt16(v,En(Math.round(t*vn)),!0),e.verts.setInt16(v+2,En(Math.round(n*vn)),!0),e.verts.setUint16(v+4,Math.round(Math.min(r,kn)*Dt),!0),e.vertsU8[v+6]=f,e.vertsU8[v+7]=c,e.verts.setInt8(v+8,Ot(Math.round(i*127))),e.verts.setInt8(v+9,Ot(Math.round(o*127))),e.verts.setInt8(v+10,Ot(Math.round(u*127))),e.vertsU8[v+11]=h,e.verts.setUint16(v+12,Vt(m),!0),e.verts.setUint16(v+14,Vt(g),!0),e.verts.setUint16(v+16,Vt(x),!0),e.vertOffset+=Ut,e.vertexCount++}function Rn(e,t,n,r,i,o,u,c,f,h){let m=t.length/2;if(m<3)return;let g=Gt(hi,u),x=wi(t,c),v=r-n,S=new Float64Array(m*2),P=new Uint8Array(m);{let _=new Float64Array(m*2);for(let I=0;I<m-1;I++){let A=t[I*2+2]-t[I*2],k=t[I*2+3]-t[I*2+1],L=Math.hypot(A,k)||1;_[I*2]=k/L,_[I*2+1]=-A/L}for(let I=0;I<m-1;I++){let A=(I+m-2)%(m-1),k=_[A*2]*_[I*2]+_[A*2+1]*_[I*2+1],L=_[A*2]+_[I*2],V=_[A*2+1]+_[I*2+1],U=Math.hypot(L,V);k>.5&&U>1e-6&&(S[I*2]=L/U,S[I*2+1]=V/U,P[I]=1)}}for(let _=0;_<m-1;_++){let I=t[_*2],A=t[_*2+1],k=t[_*2+2],L=t[_*2+3];if(I===k&&A===L||h[_])continue;let V=k-I,U=L-A,N=Math.hypot(V,U)||1,T=U/N,j=-V/N,Y=x.offset[_],X=x.width[_],O=[0,1];if(f){for(let W=0;W<f.length;W++)for(let D=W+1;D<f.length;D++){let Q=je(f[W],I,A)-je(f[D],I,A),oe=je(f[W],k,L)-je(f[D],k,L);if(Q===oe)continue;let ee=Q/(Q-oe);ee>1e-4&&ee<1-1e-4&&O.push(ee)}O.sort((W,D)=>W-D)}let G=(W,D)=>{if(!f)return r;let Q=1/0;for(let oe of f)Q=Math.min(Q,je(oe,W,D));return Math.max(r,Q)};for(let W=0;W+1<O.length;W++){let D=O[W],Q=O[W+1];if(Q-D<1e-6)continue;let oe=I+V*D,ee=A+U*D,ne=I+V*Q,Z=A+U*Q,le=Y+N*D*c,K=Y+N*Q*c,q=(_+1)%(m-1),he=P[_]?S[_*2]:T,me=P[_]?S[_*2+1]:j,ce=P[q]?S[q*2]:T,fe=P[q]?S[q*2+1]:j,ae=T+(he-T)*(1-D),de=j+(me-j)*(1-D),Se=T+(ce-T)*Q,Fe=j+(fe-j)*Q,re=Math.hypot(ae,de)||1,Ue=Math.hypot(Se,Fe)||1,ve=ae/re,De=de/re,Ie=Se/Ue,Le=Fe/Ue;e.ensure(4);let Me=Ze(e,oe,ee,n,ve,De,0,0,o,g,le,X,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,X,v),Xe=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,X,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,X,v);e.indices.push(Me,Ne,Ge,Me,Xe,Ne),e.featureIds.push(i,i)}}}var bi=.9976;function wi(e,t){let n=e.length/2-1,r=[];for(let f=0;f<n;f++){let h=e[f*2+2]-e[f*2],m=e[f*2+3]-e[f*2+1],g=Math.hypot(h,m);r.push(g>0?{x:h/g,y:m/g,len:g*t}:{x:0,y:0,len:0})}let i=(f,h)=>r[f].len>0&&r[h].len>0&&r[f].x*r[h].x+r[f].y*r[h].y>=bi,o=0;for(;o<n&&i((o-1+n)%n,o);)o++;o>=n&&(o=0);let u=new Array(n).fill(0),c=new Array(n).fill(0);for(let f=0;f<n;){let h=(o+f)%n,m=[h],g=r[h].len,x=f+1;for(;x<n;){let S=(o+x)%n;if(!i((o+x-1)%n,S))break;m.push(S),g+=r[S].len,x++}let v=0;for(let S of m)u[S]=v,c[S]=g,v+=r[S].len;f=x}return{offset:u,width:c}}function vi(e,t,n,r,i,o,u){let c=[],f=[];for(let x=0;x<t.length;x++)c.push(t[x]);for(let x of n){f.push(c.length/2);for(let v=0;v<x.length;v++)c.push(x[v])}let h=Oe(c,f.length?f:void 0,2);if(!h.length)return;let m=Gt(pi,u),g=e.vertexCount;for(let x=0;x<c.length;x+=2)Ze(e,c[x],c[x+1],r,0,0,1,255,o,m);for(let x=0;x<h.length;x+=3)e.indices.push(g+h[x],g+h[x+2],g+h[x+1]),e.featureIds.push(i)}function Si(e){let t=Mi(e);if(t.length<3)return null;let n=Math.abs(Ei(e));if(n<=0)return null;let r=null,i=1/0;for(let o=0;o<t.length;o++){let u=(o+1)%t.length,c=t[u].x-t[o].x,f=t[u].y-t[o].y,h=Math.hypot(c,f);if(h<1e-6)continue;c/=h,f/=h;let m=1/0,g=-1/0,x=1/0,v=-1/0;for(let L of t){let V=L.x*c+L.y*f,U=-L.x*f+L.y*c;V<m&&(m=V),V>g&&(g=V),U<x&&(x=U),U>v&&(v=U)}let S=g-m,P=v-x,_=S*P;if(_<=0||_>=i)continue;i=_;let I=(m+g)/2,A=(x+v)/2,k=S>=P;r={cx:I*c-A*f,cy:I*f+A*c,ax:k?c:-f,ay:k?f:c,halfLong:(k?S:P)/2,halfShort:(k?P:S)/2,fill:n/_}}return r}function Mi(e){let t=[];for(let o=0;o<e.length-2;o+=2)t.push({x:e[o],y:e[o+1]});if(t.length<3)return t;t.sort((o,u)=>o.x===u.x?o.y-u.y:o.x-u.x);let n=(o,u,c)=>(u.x-o.x)*(c.y-o.y)-(u.y-o.y)*(c.x-o.x),r=[];for(let o of t){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],o)<=0;)r.pop();r.push(o)}let i=[];for(let o=t.length-1;o>=0;o--){let u=t[o];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],u)<=0;)i.pop();i.push(u)}return r.pop(),i.pop(),r.concat(i)}function Ei(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Ri=Math.tan(30*Math.PI/180),Fi=3.5,Ii=.9;function Pi(e,t,n,r,i){if(t.fill<.86)return null;let o=t.halfShort*2*i,u=t.halfLong*2*i,c=o*u,f=t.halfShort>0?t.halfLong/t.halfShort:99,h=ki(e);if(!h){if(n>15||c>600||o<3)return null;let m=r%1e3/1e3;c<30?h=m<.5?"skillion":"gabled":f<1.25?h=m<.35?"pyramidal":"hipped":h=m<.8?"gabled":"hipped"}return h==="flat"?null:{shape:h}}function ki(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var je=(e,t,n)=>e.a*t+e.b*n+e.c;function _i(e,t,n,r){let i=e.length/2;if(i<3)return[];let o=[],u=c=>[e[c*2],e[c*2+1]];for(let c=0;c<i;c++){let[f,h]=u(c),[m,g]=u((c+i-1)%i),x=t*f+n*h+r,v=t*m+n*g+r;if(x<=0!=v<=0){let S=v/(v-x);o.push(m+(f-m)*S,g+(h-g)*S)}x<=0&&o.push(f,h)}return o}function Ai(e,t){let n=.5/Math.max(t,1e-6),r=e.length/2-1;if(r<5)return e;let i=[],o=0;i.push(e[0],e[1]);for(let u=1;u<r;u++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1],g=h-c,x=m-f,v=Math.hypot(g,x),S=v>1e-6;if(S){for(let P=o+1;P<u;P++)if(Math.abs((e[P*2]-c)*x-(e[P*2+1]-f)*g)/v>=n){S=!1;break}}S||(i.push(e[(u-1)*2],e[(u-1)*2+1]),o=u-1)}return i.length/2<3?e:(i.push(i[0],i[1]),i)}function An(e,t,n){let{ax:r,ay:i,halfLong:o}=t;if(n==="skillion"){let f=-i,h=r;return[{a:f,b:h,c:-(f*t.cx+h*t.cy)+t.halfShort}]}let u=[],c=e.length/2-1;for(let f=0;f<c;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+1)%c*2],x=e[(f+1)%c*2+1],v=g-h,S=x-m,P=Math.hypot(v,S);if(P<1e-6||n==="gabled"&&Math.abs((v*r+S*i)/P)<.86)continue;let _=-S/P,I=v/P;u.push({a:_,b:I,c:-(_*h+I*m)})}return!u.length&&o>0?An(e,t,"hipped"):u}function Bi(e,t){let n=[];for(let i=0;i<t.length-2;i+=2)n.push(t[i],t[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<e.length;i++){let o=n;for(let u=0;u<e.length&&o.length>=6;u++)u!==i&&(o=_i(o,e[i].a-e[u].a,e[i].b-e[u].b,e[i].c-e[u].c));r.push(o.length>=6?o:[])}return r}function Li(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];for(let o=0;o<i.length;o+=2){let u=je(e[r],i[o],i[o+1]);u>n&&(n=u)}}return n}function Ti(e,t,n){return e.map(r=>({a:r.a*t,b:r.b*t,c:r.c*t+n}))}function Ci(e,t,n,r,i,o,u,c){let f=Gt(mi,u);for(let h=0;h<n.length;h++){let m=t[h];if(!m||m.length<6)continue;let g=Oe(m,void 0,2);if(!g.length)continue;let x=-n[h].a/c,v=-n[h].b/c,S=Math.hypot(x,v,1),P={x:x/S,y:v/S,z:1/S};e.ensure(m.length/2);let _=e.vertexCount;for(let I=0;I<m.length;I+=2){let A=Math.max(r,je(n[h],m[I],m[I+1]));Ze(e,m[I],m[I+1],A,P.x,P.y,P.z,255,o,f)}for(let I=0;I<g.length;I+=3)e.indices.push(_+g[I],_+g[I+2],_+g[I+1]),e.featureIds.push(i)}}function Vi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?xi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?Mn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?Sn:t>=40?Mn:di}function Oi(e,t){let n=String(t.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+(e%121-60)))}function Ui(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Di(e){let t=We(e.render_height)??We(e.height)??Ni(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,ai):fi}function Gi(e,t){let n=We(e.render_min_height)??We(e.min_height)??We(e.base)??0;return n>0&&n<t?n:0}function Ni(e){let t=We(e);return t&&t>0?t*3:null}function We(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var Ot=e=>e>127?127:e<-127?-127:e;function Hi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function Fn(e,t){let n=e.length/2-1,r=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:r};let i=(u,c)=>u===0?1:u===t?2:c===0?3:c===t?4:0,o=e.slice();for(let u=0;u<n;u++){let c=e[u*2],f=e[u*2+1],h=i(c,f);if(!h)continue;let m=(u+n-1)%n,g=(u+1)%n,x=i(e[m*2],e[m*2+1])===h,v=i(e[g*2],e[g*2+1])===h;v&&(r[u]=!0);let S=x===v?-1:x?g:m;if(S<0)continue;let P=c-e[S*2],_=f-e[S*2+1],I=Math.hypot(P,_);I<1e-6||(o[u*2]=c+P/I*wn,o[u*2+1]=f+_/I*wn)}return o[n*2]=o[0],o[n*2+1]=o[1],{ring:o,cut:r}}function zi(e,t,n,r){let{extent:i,metersPerUnit:o,height:u,minHeight:c,featureId:f,seed:h,tint:m,facade:g}=r,x=r.whole?t:Ve(t,i,we(i));if(!x)return;let v=r.cornerRadius/o,S={radius:v,segments:r.cornerSegments,minCutRatio:0,maxChord:o>0?xn/o:0,...r.whole?{}:{extent:i,margin:we(i)}},P=v>0?{outer:Ce(x.outer,S),holes:x.holes.map(X=>Ce(X,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=X=>({ring:X,cut:new Array(Math.max(X.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map(X=>r.whole?I(X):Fn(X,i)),L={outer:A.ring,holes:k.map(X=>X.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce((X,O)=>X+O.length/2,0);n(U*5+32);let N=L.holes.length||V?null:Si(L.outer),T=N?Pi(r.props,N,u,h,o):null,j=null,Y=[];if(T&&N){let X=An(Ai(L.outer,o),N,T.shape);Y=Bi(X,L.outer);let O=Li(X,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti(X,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let X=0;X<L.holes.length;X++)Rn(e,L.holes[X],c,u,f,m,g,o,null,k[X].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}function ji(e,t){let n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u=0;u<e.length;u+=2)e[u]<n&&(n=e[u]),e[u]>i&&(i=e[u]),e[u+1]<r&&(r=e[u+1]),e[u+1]>o&&(o=e[u+1]);return i>0&&n<t&&o>0&&r<t}function In(e,t){let n=we(t),r=Math.max(e.length/2-1,0),i=new Array(r);for(let o=0;o<r;o++)i[o]=vt(e[o*2],e[o*2+1],e[o*2+2],e[o*2+3],t,n);return i}function Xi(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f||!ji(f.outer,t))return null;let h=In(f.outer,t);return{osmId:i,height:n,minHeight:r,seed:o,tint:u,facade:c,outer:f.outer,holes:f.holes,outerCut:h,holeCuts:f.holes.map(m=>In(m,t))}}function Nt(e,t,n,r,i){let o=r*r,u=[],c=m=>e[m*2],f=m=>e[m*2+1],h=(m,g)=>{let x=e.length/2;return e.push((c(m)+c(g))/2,(f(m)+f(g))/2),x};for(let m=0;m<t.length;m+=3){u.push([n+t[m],n+t[m+1],n+t[m+2]]);let g=0;for(;u.length&&!(++g>2e4);){let[x,v,S]=u.pop(),P=(c(x)-c(v))**2+(f(x)-f(v))**2,_=(c(v)-c(S))**2+(f(v)-f(S))**2,I=(c(S)-c(x))**2+(f(S)-f(x))**2,A=Math.max(P,_,I);if(A<=o){i.push(x,v,S);continue}if(A===P){let k=h(x,v);u.push([x,k,S],[k,v,S])}else if(A===_){let k=h(v,S);u.push([v,k,x],[k,S,x])}else{let k=h(S,x);u.push([S,k,v],[k,x,v])}}}}function Bn(e,t,n=0,r,i=!1,o=4096){let u=[],c=[],f=[];for(let v of e.features()){if(v.type!==3||!pe(t,v.properties))continue;let S=v.properties.osm_id,P=typeof S=="number"?S:typeof S=="string"?Number(S):NaN,_=Number.isFinite(P)?P:Number(v.id??0);for(let I of Ye(v.loadGeometry())){let A=i?Ve(I,o):I;if(!A)continue;let k=[],L=[],V=r?Ce(A.outer,r):A.outer;for(let T=0;T<V.length;T++)k.push(V[T]);for(let T of A.holes){let j=r?Ce(T,r):T;L.push(k.length/2);for(let Y=0;Y<j.length;Y++)k.push(j[Y])}let U=Oe(k,L.length?L:void 0,2);if(!U.length)continue;let N=u.length/2;for(let T=0;T<k.length;T++)u.push(k[T]);if(n>0){let T=[];Nt(u,U,N,n,T);for(let j=0;j<T.length;j+=3)c.push(T[j],T[j+2],T[j+1]),f.push(_);continue}for(let T=0;T<U.length;T+=3)c.push(N+U[T],N+U[T+2],N+U[T+1]),f.push(_)}}if(!c.length)return null;let h=u.length/2,m=new Int16Array(u),g=new Uint32Array(c);return{featureIds:new Float64Array(f).buffer,vertices:m.buffer,indices:g.buffer,vertexCount:h,indexCount:g.length}}function Tn(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function Cn(e,t,n,r){if(!(n<=0)){e.extent=r;for(let i of t){let o=i.outer;if(o.length<6)continue;let u=1/0,c=1/0,f=-1/0,h=-1/0;for(let m=0;m<o.length;m+=2)o[m]<u&&(u=o[m]),o[m]>f&&(f=o[m]),o[m+1]<c&&(c=o[m+1]),o[m+1]>h&&(h=o[m+1]);e.shapes.push({outer:o,holes:i.holes,level:n,minX:u,minY:c,maxX:f,maxY:h})}e.cells=[]}}function $i(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let r=e.shapes[n],i=Qe(Math.floor(r.minX/t)),o=Qe(Math.floor(r.maxX/t)),u=Qe(Math.floor(r.minY/t)),c=Qe(Math.floor(r.maxY/t));for(let f=u;f<=c;f++)for(let h=i;h<=o;h++)e.cells[f*32+h].push(n)}}var Vn=e=>e.shapes.length===0;function Ht(e,t,n){!e.cells.length&&e.shapes.length&&$i(e);let r=e.extent/32,i=e.cells[Qe(Math.floor(n/r))*32+Qe(Math.floor(t/r))];if(!i||!i.length)return 0;let o=0;for(let u of i){let c=e.shapes[u];if(c.level<=o||t<c.minX||t>c.maxX||n<c.minY||n>c.maxY||!Ln(c.outer,t,n))continue;let f=!1;for(let h of c.holes)if(Ln(h,t,n)){f=!0;break}f||(o=c.level)}return Math.min(Math.round(o*100),127)}function On(e,t){let n=[],r=[],i=e.extent>0?e.metersPerTile/e.extent:0,o=i>0?2/i:0,u=Ht(e,t[0],t[1]);n.push(t[0],t[1]),r.push(u);for(let c=0;c+3<t.length;c+=2){let f=t[c],h=t[c+1],m=t[c+2],g=t[c+3],x=Ht(e,m,g);if(x!==u&&o>0){let v=Math.hypot(m-f,g-h),S=Math.min(Math.ceil(v/o),64),P=u;for(let _=1;_<S;_++){let I=_/S,A=f+(m-f)*I,k=h+(g-h)*I,L=Ht(e,A,k);L!==P&&(n.push(A,k),r.push(L),P=L)}}n.push(m,g),r.push(x),u=x}return{pts:n,levels:r}}var Qe=e=>e<0?0:e>31?31:e;function Ln(e,t,n){let r=!1,i=e.length/2;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}var Yi=wr(Un(),1),Dn=Yi,Xt=Dn.union??Dn.default?.union??null;Xt||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");function Gn(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n],e[n+1]]);return t}function Nn(e){let t=[];for(let r of e)t.push(r[0],r[1]);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Hn(e,t,n=0){if(e.length<2)return e;let r=new Map;for(let o of e){let u=o.lift??0,c=r.get(u);c?c.push(o):r.set(u,[o])}let i=[];for(let[o,u]of r){if(u.length<2){i.push(...u);continue}let f=(n>0&&t?u.map(g=>({outer:t(g.outer,-n)??g.outer,holes:g.holes.map(x=>t(x,n)??x)})):u).map(g=>[Gn(g.outer),...g.holes.map(Gn)]),h;try{if(!Xt)throw new Error("\\u043D\\u0435\\u0442 union");h=Xt(f[0],...f.slice(1))}catch{i.push(...u);continue}let m=h;if(!Array.isArray(m)||m.length===0){i.push(...u);continue}for(let g of m){if(!g.length)continue;let x=Nn(g[0]);if(x.length<8)continue;let v=[];for(let S=1;S<g.length;S++){let P=Nn(g[S]);P.length>=8&&v.push(P)}i.push(o?{outer:x,holes:v,lift:o}:{outer:x,holes:v})}}return i}var Qt=16,Zi=64,Wn=0,Wi=1,zn=2,Qi=3,St=1,Ki=.6;function Qn(e,t,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,o=r.elevation,u=r.base??0,c=Math.max(r.bevel??0,0)/i,f=Math.max(r.bevelDrop??0,0),h=Math.max(r.cornerRadius??0,0)/i,m=Math.max(512,e.length*24),g=new ArrayBuffer(m*Qt),x={view:new DataView(g),bytes:new Uint8Array(g),offset:0,count:0,indices:[],extent:t,ensure(O){if(x.count+O<=m)return;m=Math.max(m*2,x.count+O);let G=new ArrayBuffer(m*Qt);new Uint8Array(G).set(x.bytes.subarray(0,x.offset)),g=G,x.view=new DataView(G),x.bytes=new Uint8Array(G)}},v=[],S=[],P=new Map;for(let O of e.features()){if(O.type!==3||!pe(n,O.properties))continue;let G=r.liftBy?.(O.properties)??0,W=O.properties.osm_id,D=typeof W=="number"?W:typeof W=="string"?Number(W):NaN,Q=Number.isFinite(D)?D:Number(O.id??0);for(let oe of Ye(O.loadGeometry())){let ee=Ve(oe,t,we(t));ee&&(v.push(G?{...ee,lift:G}:ee),S.push(Q))}}let _=new Set,I=Math.max(r.weld??Ki,0),A=Hn(v,(O,G)=>Yt(O,G,t,_),I/i),k=I>0?A.map(O=>({...O,outer:Zn(O.outer,I/i,t),holes:O.holes.map(G=>Zn(G,I/i,t))})):A;for(let O of k){Xn(O.outer,P);for(let G of O.holes)Xn(G,P)}r.onShapes?.(k);let L=Ji(k,v,S),V=new Set;for(let[O,G]of P)G>1&&V.add(O);let U=[],N={radius:h,segments:r.cornerSegments,extent:t,margin:we(t),minCutRatio:0,maxChord:dn/i},T=[];for(let O of k){let G=x.indices.length,W=U.length,D=h>0?{outer:Ce(O.outer,{...N,keep:$n(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:$n(q,V)}))}:O,Q=c>0?Yt(D.outer,c,t,V):D.outer,oe=D.holes.map(q=>c>0?Yt(q,-c,t,V):q),ee=O.lift??0,ne=o+ee,Z=u+ee;Yn(x,Q??D.outer,oe.map((q,he)=>q??D.holes[he]),ne,Wn,r.maxSegment??0);let le=ne,K=ne-f;Q&&c>0&&f>0&&$t(x,Q,D.outer,le,K,Wi,t,V),K!==Z&&$t(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&$t(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Qi);for(let me=he;me<x.indices.length;me++)U.push(x.indices[me]);x.indices.length=he}T.push(G,x.indices.length,W,U.length)}if(!x.indices.length&&!U.length)return null;let j=x.indices.length;for(let O=0;O<T.length;O+=4)T[O+2]+=j,T[O+3]+=j;let Y=[];for(let O of L){Y.push(O.length);for(let G of O)Y.push(G)}let X=new Uint32Array(j+U.length);return X.set(x.indices,0),X.set(U,j),{vertices:g.slice(0,x.offset),indices:X.buffer,vertexCount:x.count,indexCount:X.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ji(e,t,n){let r=e.map(()=>[]);if(!e.length)return r;let i=e.map(o=>jn(o.outer));for(let o=0;o<t.length;o++){let u=qi(t[o].outer);if(!u)continue;let c=-1;for(let f=0;f<e.length;f++){let h=i[f];if(u[0]<h[0]||u[0]>h[2]||u[1]<h[1]||u[1]>h[3]||!Kt(e[f].outer,u[0],u[1]))continue;let m=!1;for(let g of e[f].holes)if(Kt(g,u[0],u[1])){m=!0;break}if(!m){c=f;break}}if(c<0){let f=jn(t[o].outer),h=0;for(let m=0;m<e.length;m++){let g=i[m],x=Math.min(f[2],g[2])-Math.max(f[0],g[0]),v=Math.min(f[3],g[3])-Math.max(f[1],g[1]),S=x>0&&v>0?x*v:0;S>h&&(h=S,c=m)}}c<0&&(c=0),r[c].includes(n[o])||r[c].push(n[o])}return r}function jn(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o=0;o<e.length;o+=2)e[o]<t&&(t=e[o]),e[o]>r&&(r=e[o]),e[o+1]<n&&(n=e[o+1]),e[o+1]>i&&(i=e[o+1]);return[t,n,r,i]}function qi(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let i=0;i<t;i++){let o=(i+1)%t;n+=e[i*2]*e[o*2+1]-e[o*2]*e[i*2+1]}let r=n>0;for(let i=0;i<t;i++){let o=(i+t-1)%t*2,u=i*2,c=(i+1)%t*2,f=(e[u]-e[o])*(e[c+1]-e[o+1])-(e[u+1]-e[o+1])*(e[c]-e[o]);if(f===0||f>0!==r)continue;let h=(e[o]+e[u]+e[c])/3,m=(e[o+1]+e[u+1]+e[c+1])/3;if(Kt(e,h,m))return[h,m]}return null}function Kt(e,t,n){let r=!1,i=e.length/2-1;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}function Ke(e,t,n,r){let i=`${Math.round(e*100)},${Math.round(t*100)}`,o=`${Math.round(n*100)},${Math.round(r*100)}`;return i<o?`${i}|${o}`:`${o}|${i}`}function Xn(e,t){for(let n=0;n+3<e.length;n+=2){let r=Ke(e[n],e[n+1],e[n+2],e[n+3]);t.set(r,(t.get(r)??0)+1)}}function $n(e,t){if(!t.size)return;let n=e.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let o=Ke(e[(i+n-1)%n*2],e[(i+n-1)%n*2+1],e[i*2],e[i*2+1]),u=Ke(e[i*2],e[i*2+1],e[(i+1)%n*2],e[(i+1)%n*2+1]);(t.has(o)||t.has(u))&&(r[i]=!0)}return r}function ft(e,t,n,r,i,o,u,c){let f=e.offset;return e.view.setFloat32(f,t,!0),e.view.setFloat32(f+4,n,!0),e.view.setInt16(f+8,eo(Math.round(r*Zi)),!0),e.view.setInt8(f+10,Wt(Math.round(i*127))),e.view.setInt8(f+11,Wt(Math.round(o*127))),e.view.setInt8(f+12,Wt(Math.round(u*127))),e.bytes[f+13]=c,e.view.setInt8(f+14,t<=0?-St:t>=e.extent?St:0),e.view.setInt8(f+15,n<=0?-St:n>=e.extent?St:0),e.offset+=Qt,e.count++}function Yn(e,t,n,r,i=Wn,o=0){let u=[],c=[];for(let g=0;g<t.length;g++)u.push(t[g]);for(let g of n){c.push(u.length/2);for(let x=0;x<g.length;x++)u.push(g[x])}let f=Oe(u,c.length?c:void 0,2);if(!f.length)return;let h=f;if(o>0){let g=[];Nt(u,f,0,o,g),h=g}e.ensure(u.length/2);let m=e.count;for(let g=0;g<u.length;g+=2)ft(e,u[g],u[g+1],r,0,0,1,i);for(let g=0;g<h.length;g+=3)e.indices.push(m+h[g],m+h[g+2],m+h[g+1])}function $t(e,t,n,r,i,o,u,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let h=0;h<f-1;h++){let m=n[h*2],g=n[h*2+1],x=n[h*2+2],v=n[h*2+3];if(m===x&&g===v||vt(m,g,x,v,u,we(u))||c.has(Ke(m,g,x,v)))continue;let S=x-m,P=v-g,_=Math.hypot(S,P)||1,I=P/_,A=-S/_,k=r-i,L=Math.hypot(t[h*2]-m,t[h*2+1]-g)||0,V=0;if(L>1e-6&&k!==0){let Y=1/Math.hypot(1,k/L);V=L/Math.hypot(L,k)*Math.sign(k),I*=Y,A*=Y}let U=ft(e,t[h*2],t[h*2+1],r,I,A,V,o),N=ft(e,t[h*2+2],t[h*2+3],r,I,A,V,o),T=ft(e,m,g,i,I,A,V,o),j=ft(e,x,v,i,I,A,V,o);e.indices.push(T,N,j,T,U,N)}}}function Yt(e,t,n,r){let i=e.length/2-1;if(i<3)return null;let o=[];for(let m=0;m<i;m++){let g=e[m*2],x=e[m*2+1],v=e[(m+i-1)%i*2],S=e[(m+i-1)%i*2+1],P=e[(m+1)%i*2],_=e[(m+1)%i*2+1],I=Math.hypot(g-v,x-S)||1,A=Math.hypot(P-g,_-x)||1,k=(x-S)/I,L=-(g-v)/I,V=(_-x)/A,U=-(P-g)/A,N=k+V,T=L+U,j=Math.hypot(N,T);if(j<1e-6){o.push(g,x);continue}N/=j,T/=j;let Y=Math.min(1/Math.max(N*k+T*L,.35),3),X=g-N*t*Y,O=x-T*t*Y,G=Ke(v,S,g,x),W=Ke(g,x,P,_);if(r.has(G)||r.has(W)){o.push(g,x);continue}let D=-we(n),Q=n+we(n);((ee,ne)=>ee<=D||ee>=Q||ne<=D||ne>=Q)(g,x)&&(X=g,O=x),o.push(X,O)}o.push(o[0],o[1]);let u=Math.abs(Zt(e)),c=Zt(o);if(Math.sign(c)!==Math.sign(Zt(e))||Math.abs(c)<u*.25)return null;let f=-we(n),h=n+we(n);for(let m=0;m<o.length;m+=2)o[m]=Math.max(f,Math.min(h,o[m])),o[m+1]=Math.max(f,Math.min(h,o[m+1]));return o}function Zt(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Wt=e=>e>127?127:e<-127?-127:e,eo=e=>e>32767?32767:e<-32768?-32768:e;function Zn(e,t,n){if(!(t>0))return e;let r=we(n),i=-r,o=n+r,u=e;for(let c=0;c<3;c++){let f=u.length/2-1;if(f<6)break;let h=new Array(f).fill(!0),m=f;for(let x=0;x<f&&!(m<=5);x++){let v=u[x*2],S=u[x*2+1];if(v<=i||v>=o||S<=i||S>=o)continue;let P=(x+f-1)%f;for(;!h[P]&&P!==x;)P=(P+f-1)%f;let _=(x+1)%f;for(;!h[_]&&_!==x;)_=(_+1)%f;if(P===x||_===x)break;let I=u[P*2],A=u[P*2+1],k=u[_*2]-I,L=u[_*2+1]-A,V=Math.hypot(k,L);V<1e-6||Math.abs((v-I)*L-(S-A)*k)/V<t&&(h[x]=!1,m--)}if(m===f)break;let g=[];for(let x=0;x<f;x++)h[x]&&g.push(u[x*2],u[x*2+1]);g.push(g[0],g[1]),u=g}return u}function Je(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=e.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var at=20;function qn(e,t,n=0,r,i=0,o={}){let{level:u}=o,c=Math.max(256,e.length*24),f=new ArrayBuffer(c*at),h=new DataView(f),m=0,g=[],x=[],v=V=>{if(m+V<=c)return;c=Math.max(c*2,m+V);let U=new ArrayBuffer(c*at);new Uint8Array(U).set(new Uint8Array(f,0,m*at)),f=U,h=new DataView(U)},S=(V,U,N,T,j,Y,X,O=0,G=0,W=0)=>{let D=m*at;return h.setInt16(D,V,!0),h.setInt16(D+2,U,!0),h.setInt16(D+4,N,!0),h.setInt16(D+6,T,!0),h.setInt8(D+8,j),h.setInt8(D+9,Y),h.setInt8(D+10,O),h.setInt8(D+11,G),h.setFloat32(D+12,X,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?oo(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||u!==void 0&&Je(V.properties)!==u)continue;let U=V.properties.osm_id,N=typeof U=="number"?U:typeof U=="string"?Number(U):NaN;_=Number.isFinite(N)?N:Number(V.id??0);let T=V.properties.width;P=typeof T=="number"&&T>.5&&T<100?T:0;let j=V.type===3;for(let Y of V.loadGeometry()){let X=n>0?no(Kn(Y),n):Kn(Y);if(X.length<4)continue;let O=r&&!Vn(r)?On(r,X):null,G=O?O.pts:X,W=O?.levels,D=G.length/2;if(D<2)continue;let Q=Je(V.properties),oe=Mt(Math.round(G[0]),Math.round(G[1])),ee=Mt(Math.round(G[D*2-2]),Math.round(G[D*2-1])),ne=null,Z=P;if(A&&P>0&&!j){let K=0;for(let fe=0;fe<D-1;fe++)K+=Math.hypot(G[fe*2+2]-G[fe*2],G[fe*2+3]-G[fe*2+1]);Z=er(Q,P,oe,ee,A);let q=fe=>Math.min(A.width.get(fe)??0,Z*2),he=q(oe)-Z,me=q(ee)-Z,ce=Math.min(I,K/2);if(ce>0&&(he>0||me>0)){ne=ae=>{let de=0;return he>0&&ae<ce&&(de=he*(1-ae/ce)),me>0&&K-ae<ce&&(de=Math.max(de,me*(1-(K-ae)/ce))),Z+de};let fe=[];for(let ae of[ce,K-ce])ae>.01&&ae<K-.01&&fe.push(ae);if(fe.length){let ae=to(G,W,fe);G=ae.pts,W=ae.levels,D=G.length/2}}}v((D-1)*4);let le=0;for(let K=0;K<D-1;K++){let q=G[K*2],he=G[K*2+1],me=G[K*2+2],ce=G[K*2+3],fe=Math.hypot(me-q,ce-he);if(j&&io(q,he,me,ce,e.extent)){le+=fe;continue}let ae=ro(q,he,me,ce,e.extent);if(!ae){le+=fe;continue}let[de,Se,Fe,re]=ae,Ue=Math.hypot(de-q,Se-he),ve=Math.hypot(Fe-de,re-Se),De=Math.hypot(me-Fe,ce-re),Ie=le+Ue,Le=W?W[K]:0,Me=W?W[K+1]:0,Ge=ne?ne(Ie):Z,Xe=ne?ne(Ie+ve):Z,Ne=S(de,Se,Fe,re,0,-1,Ie,Le,Me,Ge),ht=S(de,Se,Fe,re,0,1,Ie,Le,Me,Ge),pt=S(de,Se,Fe,re,1,1,Ie,Le,Me,Xe),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,Xe);le+=Ue+ve+De,g.push(Ne,ht,pt,Ne,pt,Et),x.push(_,_)}}}if(!g.length)return null;let k=new Uint32Array(g),L=new Float64Array(x);return{vertices:f.slice(0,m*at),indices:k.buffer,vertexCount:m,indexCount:k.length,featureIds:L.buffer}}function to(e,t,n){let r=[...n].sort((f,h)=>f-h),i=[e[0],e[1]],o=t?[t[0]]:void 0,u=0,c=0;for(let f=0;f+3<e.length;f+=2){let h=e[f],m=e[f+1],g=e[f+2],x=e[f+3],v=Math.hypot(g-h,x-m);for(;c<r.length&&r[c]<=u+.01;)c++;for(;c<r.length&&r[c]<u+v-.01;){let S=(r[c]-u)/v;i.push(h+(g-h)*S,m+(x-m)*S),o&&t&&o.push(Math.round(t[f/2]+(t[f/2+1]-t[f/2])*S)),c++}u+=v,i.push(g,x),o&&t&&o.push(t[f/2+1])}return{pts:i,levels:o}}function no(e,t){let n=[];for(let r=0;r+3<e.length;r+=2){let i=e[r],o=e[r+1],u=e[r+2],c=e[r+3];n.push(i,o);let f=Math.min(64,Math.floor(Math.hypot(u-i,c-o)/t));for(let h=1;h<f;h++){let m=h/f;n.push(i+(u-i)*m,o+(c-o)*m)}}return n.push(e[e.length-2],e[e.length-1]),n}function Kn(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1],o=t.length;o>=2&&t[o-2]===r&&t[o-1]===i||t.push(r,i)}return t}function ro(e,t,n,r,i){let o=n-e,u=r-t,c=0,f=1,h=[[-o,e],[o,i-e],[-u,t],[u,i-t]];for(let[m,g]of h){if(m===0){if(g<0)return null;continue}let x=g/m;if(m<0){if(x>f)return null;x>c&&(c=x)}else{if(x<c)return null;x<f&&(f=x)}}return f-c<1e-6?null:[Math.round(e+o*c),Math.round(t+u*c),Math.round(e+o*f),Math.round(t+u*f)]}function io(e,t,n,r,i){return e===n&&(e<=0||e>=i)?!0:t===r&&(t<=0||t>=i)}var Jn=new WeakMap,Mt=(e,t)=>(e+512)*65536+(t+512);function er(e,t,n,r,i){if(e===0||t<=0)return t;let o=8*4294967296,u=Math.max(i.raw.get(n+o)??0,i.raw.get(r+o)??0);return u>0&&t>u?u:t}function oo(e){let t=Jn.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of e.features()){if(i.type!==2)continue;let o=i.properties.width,u=typeof o=="number"&&o>.5&&o<100?o:0,c=Je(i.properties);for(let f of i.loadGeometry()){if(f.length<4)continue;let h=Mt(Math.round(f[0]),Math.round(f[1])),m=Mt(Math.round(f[f.length-2]),Math.round(f[f.length-1]));for(let g of[h,m]){let x=g+(c+8)*4294967296;n.ends.set(x,(n.ends.get(x)??0)+1),u>0&&n.raw.set(x,Math.max(n.raw.get(x)??0,u))}r.push({h,t:m,lv:c,w:u})}}for(let i of r){let o=er(i.lv,i.w,i.h,i.t,n);if(!(o<=0))for(let u of[i.h,i.t]){let c=n.width.get(u);(c===void 0||o>c)&&n.width.set(u,o)}}return Jn.set(e,n),n}var so=[["\\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."]],tr=new Map(so);function nr(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,r=t.map(o=>{let u=tr.get(o.toLowerCase());return u?(n=!0,o[0]===o[0].toUpperCase()?u[0].toUpperCase()+u.slice(1):u):o});return!n||!t.filter(o=>tr.get(o.toLowerCase())===void 0).length?e:r.join(" ")}function ir(e,t){let n=[],r=[],i=[],o=[],u=[],c=t.textPlacement==="line",f=[],h=[],m=[];for(let g of e.features()){if(!pe(t.filter,g.properties))continue;let x=g.loadGeometry(),v=co(g.type,x);if(!v)continue;let S=t.textField?rr(t.textField,g.properties):"",P=S&&t.abbreviate?nr(S):S,_=t.iconImage?rr(t.iconImage,g.properties):"";if(!(!P&&!_)){if(c){let I=lo(g.type,x);if(!I)continue;m.push({text:P,line:I});continue}n.push(v[0],v[1]),r.push(P),i.push(_),o.push(fo(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of uo(m)){h.push(f.length/2);for(let v of x)f.push(v);n.push(Math.round(x[0]),Math.round(x[1])),r.push(g),i.push(""),o.push(128),u.push(0)}h.push(f.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(o).buffer,rotations:new Int16Array(u).buffer,...c?{lines:new Int16Array(f).buffer,lineStarts:new Uint32Array(h).buffer}:{}}:null}function uo(e){let t=[],n=new Map,r=new Map,i=(o,u,c)=>`${o}\\u241F${u}\\u241F${c}`;for(let{text:o,line:u}of e){let c=i(o,u[0],u[1]),f=i(o,u[u.length-2],u[u.length-1]),h=n.get(f),m=r.get(c);if(m!==void 0){let g=t[m];if(g.line.push(...u.slice(2)),r.delete(c),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m),h!==void 0&&h!==m){let x=t[h];g.line.push(...x.line.slice(2)),x.line=[],n.delete(f),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m)}continue}if(h!==void 0){let g=t[h];g.line.unshift(...u.slice(0,u.length-2)),n.delete(f),n.set(i(o,g.line[0],g.line[1]),h);continue}n.set(c,t.length),r.set(f,t.length),t.push({text:o,line:u})}return t.filter(o=>o.line.length>=4)}function lo(e,t){if(e!==2)return null;let n=null,r=0;for(let i of t){if(i.length<4)continue;let o=0;for(let u=0;u+3<i.length;u+=2)o+=Math.hypot(i[u+2]-i[u],i[u+3]-i[u+1]);o>r&&(r=o,n=i)}return n}function co(e,t){if(!t.length)return null;if(e===1){let u=t[0];return u.length>=2?[u[0],u[1]]:null}if(e===2){let u=-1,c=0,f=0;for(let h of t)for(let m=0;m+3<h.length;m+=2){let g=h[m+2]-h[m],x=h[m+3]-h[m+1],v=g*g+x*x;v>u&&(u=v,c=h[m]+g/2,f=h[m+1]+x/2)}return u>0?[Math.round(c),Math.round(f)]:null}let n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+o)/2)]:null}function fo(e){let t=e.importance;if(typeof t=="number"&&isFinite(t))return Math.max(0,255-Math.min(Math.max(t,1),9)*20);let n=e.rank;return typeof n=="number"&&isFinite(n)?Math.max(0,255-Math.min(n,255)):128}function rr(e,t){let n=Array.isArray(e)?e:[e];for(let r of n){let i=!0,u=r.replace(/\\{([^}]+)\\}/g,(c,f)=>{let h=t[f];return h==null||h===""?(i=!1,""):String(h)}).trim();if(i&&u)return u}return""}function or(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let o=e.feature(i);if(o.type===1&&pe(t,o.properties))for(let u of o.loadGeometry())for(let c=0;c+1<u.length;c+=2)n.push(u[c],u[c+1]),r.push(o.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var ao="\\u241F",Jt=(e,t)=>e+ao+String(t);function ho(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}async function sr(e,t){let n=performance.now(),r=ho(),i=await fetch(e.url,{signal:t,credentials:"same-origin",...r?{referrer:r}:{}}),o=(A,k,L,V,U=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:V,parseMs:U},diag:{status:A,bytes:k,layers:L,built:0}});if(!i.ok){if(i.status===404||i.status===204)return o(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${e.url}`)}let u=await i.arrayBuffer(),c=performance.now()-n;if(u.byteLength===0)return o(i.status,0,[],c);let f=performance.now(),h=new wt(u),m=Object.keys(h.layers),g={},x=[],v={},S=new Set,P=[],I=e.plan.some(A=>A.type==="surface"&&(A.elevation??0)>0)&&e.plan.some(A=>A.type==="line"&&A.ground)?Tn(e.metersPerTile):void 0;for(let A of e.plan){if(!mo(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=xo(e.zoom,k.extent);try{if(A.splitBy){let U=go(k,A.splitBy,A.filter);if(!U.length)continue;let N=v[A.splitBy]??(v[A.splitBy]=[]);for(let T of U){N.includes(T)||N.push(T);let j={...A,splitBy:void 0,filter:bo(A.filter,A.splitBy,T)},Y=qt(j,k,L,e.metersPerTile,I,void 0,x);Y&&(g[Jt(A.id,T)]=Y)}continue}if(A.network&&A.type==="line"){for(let U of yo(k,A.filter)){let N=qt(A,k,L,e.metersPerTile,I,U,x);N&&(g[Jt(A.id,U)]=N,S.add(U))}continue}let V=qt(A,k,L,e.metersPerTile,I,void 0,x);V&&(g[A.id]=V)}catch(V){P.push(`${A.id}: ${V instanceof Error?V.message:String(V)}`)}}return{type:"loaded",id:e.id,buckets:g,...x.length?{seams:x}:{},...Object.keys(v).length?{splits:v}:{},...S.size?{levels:[...S].sort((A,k)=>A-k)}:{},timing:{fetchMs:c,parseMs:performance.now()-f},diag:{status:i.status,bytes:u.byteLength,layers:m,built:Object.keys(g).length,...P.length?{failed:P}:{}}}}function po(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let o=e[i];typeof o=="number"&&o>r&&(r=o)}return r}}function mo(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function xo(e,t){return e<=6?Math.max(64,t/24):0}function qt(e,t,n,r,i,o,u){{if(e.type==="fill"){let f=r>0?r/t.extent:0,h=e.cornerRadius&&f>0?{radius:e.cornerRadius/f,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:gn/f}:void 0,m=Bn(t,e.filter,n,h,e.clipToTile===!0,t.extent);return m?{kind:"fill",...m,extent:t.extent}:null}if(e.type==="surface"){let f=Qn(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...i?{onShapes:h=>Cn(i,h,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:po(e.groundBy)}:{}});return f?{kind:"surface",...f}:null}if(e.type==="line"){let f=qn(t,e.filter,n,e.ground?i:void 0,r>0?r/t.extent:0,{level:o});return f?{kind:"line",...f,extent:t.extent}:null}if(e.type==="model"){let f=or(t,e.filter);return f?{kind:"placement",...f,extent:t.extent}:null}if(e.type==="symbol"){let f=ir(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return f?{kind:"symbol",...f,extent:t.extent}:null}let c=_n(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments},u);return c?{kind:"fill-extrusion",vertices:c.vertices,indices:c.indices,featureIds:c.featureIds,vertexCount:c.vertexCount,indexCount:c.indexCount,extent:c.extent}:null}}function go(e,t,n){let r=[];for(let i of e.features()){if(!pe(n,i.properties))continue;let o=i.properties[t];typeof o!="string"&&typeof o!="number"||r.includes(o)||r.push(o)}return r.sort((i,o)=>typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o))),r}function yo(e,t){let n=[];for(let r of e.features()){if(!pe(t,r.properties))continue;let i=Je(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function bo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var wo=e=>e.kind==="symbol",vo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(vo(n)){t.push(n.anchors);continue}if(wo(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var lr=Map;var qe=new lr,en=self;en.onmessage=e=>{let t=e.data;if(t.type==="abort"){qe.get(t.id)?.abort(),qe.delete(t.id);return}let n=new AbortController;qe.set(t.id,n),sr(t,n.signal).then(r=>{qe.has(t.id)&&(qe.delete(t.id),en.postMessage(r,ur(r)))}).catch(r=>{let i=n.signal.aborted;qe.delete(t.id);let o={type:"error",id:t.id,message:r instanceof Error?r.message:String(r),aborted:i};en.postMessage(o)})};})();\n';var sd=2,ar=class{constructor(e=Pn()){this.workers=[];this.blobUrl=null;this.pending=new z;this.queue=new z;this.busy=[];this.nextId=1;this.mainThreadAborts=new z;this.destroyed=false;try{let t=new Blob([zn],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Xl(n,a.signal).then(l=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:l instanceof Error?l.message:String(l),aborted:s});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=sd||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function Pn(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Kl(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Hn(i,e){let t=Kl(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 On(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 Yl(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 $l={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}},go=i=>$l[i]??$l.high;function ql(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function sr(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?Dn(a)??a:n==="strong"&&!o?Zl(a)??a:a}function cr(){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,gpu:cd()}}function cd(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?ql(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function Vn(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 lr(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function Zl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function Dn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Bn=120,fd=40,ud=.35,dd=.02,hd=150,md=30,pd=1,bd=1800,Wn=30,yd=1.25,yo=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Bn);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(Wn);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%Bn,this.filled<Bn&&this.filled++,this.steady++,this.steady===bd&&(this.attempts[this.current]=0),this.filled<fd)return null;let n=this.sum/this.filled;return n>=ud?this.down(n):n>dd?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%Wn,this.recentFilled<Wn&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*yd)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=Dn(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=pd&&lr(t)<lr(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=Zl(this.current);if(!t||lr(t)>lr(this.ceiling))return null;let o=hd*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=md;}};function gd(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=d=>d.x>=r&&d.x<=a&&d.y>=n&&d.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let d=0;d+1<i.length;d++){let h=i[d],m=i[d+1],y=s(h),p=s(m);if(y&&p){f.length||f.push(h),f.push(m);continue}let b=vd(h,m,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),p||u();}return u(),c}function vd(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[u,d]of f){if(u===0){if(d<0)return null;continue}let h=d/u;if(u<0){if(h>c)return null;h>s&&(s=h);}else {if(h<s)return null;h<c&&(c=h);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var wd=1,vo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${wd++}`,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=te(l),c=ne(s.lng),f=ie(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=te(o);t.push(ne(r.lng)-this.originX,ie(r.lat)-this.originY);}return t}color(e,t){let o=me(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}},Gn=class extends vo{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=qt([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=qt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=me(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=jn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Ql(e,n[a],n[a+1])<=r)return true;return false}},fr=class extends vo{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=sn(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(Nn(a))),n=qt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=jn(Nn(this.coordinates[0]??[]),this.altitude,t);if(!Xn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Xn(e,jn(Nn(this.coordinates[r]),this.altitude,t)))return false;return true}},Un=class extends fr{constructor(e){super({...e,coordinates:[xd(e.center,e.radius,e.segments)]});}};function xd(i,e,t){let o=te(i),r=e/We(o.lat),n=ne(o.lng),a=ie(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([Fe(n+Math.cos(f)*r),Ee(a+Math.sin(f)*r)]);}return s}function jn(i,e,t){let o=[];for(let r of i){let n=te(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function Nn(i){if(i.length<2)return i;let e=te(i[0]),t=te(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Ql(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 Xn(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 Jl="objects3d",Ot="level",_d=32,Cd=100,Sd=250;function es(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 Md(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 Kn=class extends Qe{constructor(t){super();this.options=t;this.transform=new Vt;this.ctx=null;this.sources=new z;this.rasterSources=new z;this.renderer=new ro;this.objects=new Qt;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.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new z;this.autoIndoorLevel=true;this.debugFB=null;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?sr(cr()):t.quality;this.governor=new yo(r,r,_d,Cd),this.quality=go(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new St(t.theme?Wo(t.theme,t.style):t.style),this.background=t.background?me(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=te(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 ar(t.workerCount??Math.min(Pn(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 xo(t);let o=new zt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...dt,...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(j,{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 ir({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:Jl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??j)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Md):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:Jl,"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($e(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(j);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??j)!==j)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===Ot&&t.add(o.source??j);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??j;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 uo({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 er(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===j?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===j&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new Io(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 u of this.getPopups())u.closeOnClick&&this.removePopup(u);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=Vn(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=te(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=te(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?te(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+bt((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?te(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+bt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Je(r.zoom),s=(ne(a.center.lng)-ne(r.center.lng))*l,c=(ie(a.center.lat)-ie(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),d=u*Math.pow(2,r.zoom-a.zoom),h=1.42,m=h*h,y,p=null;if(f<1e-6){let g=Math.log(d/u);y=Math.abs(g)/h,p=v=>({u:0,w:u*Math.exp(h*Math.sign(g)*v)});}else {let g=C=>{let S=C===0?u:d,E=C===0?d:u;return (E*E-S*S+(C===0?1:-1)*m*m*f*f)/(2*S*m*f)},v=C=>Math.log(-g(C)+Math.sqrt(g(C)*g(C)+1)),w=v(0);y=(v(1)-w)/h;let _=C=>(Math.exp(C)+Math.exp(-C))/2,T=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);p=C=>{let S=h*C+w;return {u:u*_(w)*T(S)/m-u*Math.sinh(w)/m,w:u*_(w)/_(S)}};}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:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=es(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Bt;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=mr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?es(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=Ce((t-o.start)/o.duration,0,1),n=o.fly?r:wo(r),a=this.transform,l=te(o.from.center),s=te(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?Ce(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*u,lat:l.lat+(s.lat-l.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*wo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*wo(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(te(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new St(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(Wo(t,this.options.style))}static get themes(){return Object.keys(we)}static get themeList(){return Object.entries(we).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)}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),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:Fe(r.mercX),lat:Ee(r.mercY)},key:zt.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??j);if(!n)continue;let a=rn(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 z,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??j)));}if(!n||!o.length)return null;let a=nn(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=Hn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Yl("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=On(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"?sr(cr()):t;return this.governor.reset(o,o),this.applyQuality(go(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.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(go(o.to),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=me(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??j)===o&&"splitBy"in n&&n.splitBy===Ot))for(let n of r.splitValues(Ot)){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[Ot];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Ot]:this._style.splitValues[Ot]=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 bo)}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,Wt):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);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,f=!!l.getExtension("EXT_float_blend"),u=f?l.RGBA32F:l.RGBA16F,d=f?l.FLOAT:l.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==s||this.debugFB.h!==c)&&(l.deleteFramebuffer(this.debugFB.fb),l.deleteTexture(this.debugFB.tex),l.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let h=l.createTexture(),m=l.createFramebuffer(),y=l.createRenderbuffer();if(!h||!m||!y)return null;l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,d,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null),l.bindRenderbuffer(l.RENDERBUFFER,y),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,m),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,y);let p=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),p!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:h,rb:y,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let h=new Float32Array(r*n*4);return l.readPixels(t,o,r,n,l.RGBA,l.FLOAT,h),{data:h,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}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[h,m]of this.sources)this.sourceDrawn(h,this.transform.zoom)?m.update(this.transform):m.deactivate();this.updateObjects3D();for(let[h,m]of this.rasterSources)this.rasterLayerVisible(h)&&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<Sd,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let d=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(d),this.emit("render",{frameMs:l,intervalMs:u}),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();}}},_b=Kn;
2408
- exports.AssetLoader=ho;exports.BASE_SOURCE=j;exports.BUILDING_HEIGHT_SCALE=wt;exports.BUILDING_POS_SCALE=vt;exports.BUILDING_VERTEX_STRIDE=ze;exports.CITY_STYLE=tf;exports.Circle=Un;exports.DEFAULT_ICONS=dt;exports.DEFAULT_LIGHT=Nr;exports.DEFAULT_SHADOWS=Cl;exports.DEFAULT_SKY=Dr;exports.DEFAULT_STYLE=Gr;exports.DepthTarget=jt;exports.EARTH_CIRCUMFERENCE=_o;exports.FILL_VERTEX_STRIDE=et;exports.GLOBE_MAX_PITCH=Wt;exports.GLOBE_ZOOM_MAX=st;exports.GLOBE_ZOOM_MIN=To;exports.GLYPH_BORDER=fe;exports.GLYPH_SIZE=qe;exports.GROUND_SCALE=pc;exports.GeomType=Nt;exports.GlyphSource=io;exports.GroundArrows=Yt;exports.IconSource=lo;exports.IndoorMask=$t;exports.LEVEL_LIMIT=yc;exports.LINE_VERTEX_STRIDE=tt;exports.LayerRenderer=ro;exports.LngLatBounds=Bt;exports.MAX_LATITUDE=$n;exports.MODEL_VERTEX_STRIDE=jo;exports.Map=Kn;exports.MapObject=vo;exports.Marker=po;exports.Model=mo;exports.ModelLayer=nt;exports.ObjectManager=Qt;exports.Polygon=fr;exports.Polyline=Gn;exports.Popup=bo;exports.QualityGovernor=yo;exports.RELIEF_STYLE=ef;exports.RUNTIME_FILL_STRIDE=ln;exports.RUNTIME_LINE_STRIDE=Tt;exports.RasterSource=uo;exports.RasterTile=tr;exports.SDF_EDGE=gn;exports.SDF_PX=ao;exports.SOFT_STYLE=Jc;exports.SPLIT_SEP=Ea;exports.SURFACE_CUT_BLEED=Gt;exports.SURFACE_LEVEL_SCALE=Gi;exports.SURFACE_VERTEX_STRIDE=xt;exports.SdfAtlas=no;exports.Style=St;exports.SymbolRenderer=zt;exports.THEMES=we;exports.TILE_SIZE=lt;exports.TileID=ot;exports.Transform=Vt;exports.VectorTile=Dt;exports.VectorTileFeature=Lo;exports.VectorTileLayer=Ro;exports.abbreviateStreet=In;exports.addGround=Or;exports.altitudeFromMercatorZ=Rd;exports.applyTheme=Bo;exports.arrowLabelOffset=Ol;exports.arrowVertices=pf;exports.buildRuntimeFill=sn;exports.buildRuntimeLine=qt;exports.cameraForBounds=mr;exports.circumferenceAtLatitude=We;exports.clampLat=Co;exports.clampPixelRatio=Vn;exports.classifyRenderer=ql;exports.clipLineToRect=gd;exports.coordinateDigits=Kl;exports.coveringTiles=fo;exports.createGround=Hr;exports.default=_b;exports.deviceHints=cr;exports.distToSegment=Ql;exports.evaluateColor=He;exports.evaluateNumber=D;exports.extractFeature=No;exports.featureLevel=ut;exports.fillFootprint=Qr;exports.fogPlanes=Mt;exports.footprintOf=Jr;exports.formatHash=Hn;exports.generateBuildings=Mr;exports.generateFill=Er;exports.generateLine=Wr;exports.generateSurface=Pr;exports.generateSymbols=Rn;exports.globeBasis=vr;exports.globeFlatMix=Eo;exports.globeRadius=ko;exports.globeToLocal=ri;exports.groundAt=Po;exports.iconRotation=Bl;exports.insideFootprint=$e;exports.latFromMercatorY=Ee;exports.lngFromMercatorX=Fe;exports.lngLatToUnit=Ao;exports.matchesFilter=ve;exports.mercatorMetersPerTile=So;exports.mercatorX=ne;exports.mercatorY=ie;exports.mercatorZFromAltitude=hr;exports.metersPerPixel=zd;exports.metersPerTile=qn;exports.nextQualityDown=Dn;exports.parseGlb=Pf;exports.parseGlbAsync=un;exports.parseGlyphs=Ml;exports.parseHash=On;exports.patchUV=fl;exports.pickBuilding=rn;exports.pickFill=nn;exports.pitchIntent=fi;exports.pixelsPerMeter=Fd;exports.placeAlongLine=xn;exports.pointInRing=Xn;exports.qualityFor=sr;exports.qualityProfile=go;exports.raySphere=wr;exports.resolveTemplate=Ln;exports.roundRing=Ue;exports.sdfFromAlpha=vn;exports.shapeText=wn;exports.splitBucketKey=je;exports.splitByGround=Br;exports.splitPolygons=ct;exports.stitchPieces=Vr;exports.styleWithTheme=Wo;exports.tileOriginMeters=Zn;exports.tileUrl=Wl;exports.toLngLat=te;exports.unitToLngLat=gr;exports.worldSize=Je;//# sourceMappingURL=osmgl.cjs.map
2767
+ `;var tn=i=>i.kind==="symbol",Pc=i=>i.kind==="placement";function vt(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],s=r[n+1],l=r[n+2],c=r[n+3],u=r[n+4],f=r[n+5];if(Gd(e,t,a,s,l,c,u,f)||o>0&&(Ai(e,t,a,s,l,c)<=o||Ai(e,t,l,c,u,f)<=o||Ai(e,t,u,f,a,s)<=o))return true}return false}function Gd(i,e,t,o,r,n,a,s){let l=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-s)-(r-a)*(e-s),u=(i-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||u<0,h=l>0||c>0||u>0;return !(f&&h)}function Ai(i,e,t,o,r,n){let a=r-t,s=n-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*s)/l)):0;return Math.hypot(i-(t+a*c),e-(o+s*c))}function Ri(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 s=0;s<o.length;s++){let l=o[s]*Je;a[s*2]=r.minX+t.getInt16(l,true)*n,a[s*2+1]=r.minY+t.getInt16(l+2,true)*n;}return a}function Ii(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let u=i.indices[c]*Ee;l[c*2]=a+o.getInt16(u,true)*n,l[c*2+1]=s+o.getInt16(u+2,true)*n;}return l}var jd={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Xd=40,Yd=10.5,Fc=2.5,Kd=16,$d=4,qd=7,Go=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,s,l=false){this.count=0;let c=t.zoom,u=r.layers.filter(w=>w.type==="symbol"&&w.layout?.placement==="map"&&r.layerVisibleAt(w,c));if(!u.length)return;let f=t.center,h=oe(f.lng),d=re(f.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let b=[];for(let w of u){let x=o.get(w.source??Y);if(!x)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let S=m*1.5,k=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,T=N(w.layout?.arrowLength,c,Xd)*k,P=N(w.layout?.arrowWidth,c,Yd)*k,L=N(w.layout?.arrowOutline,c,Fc)*k,A=N(w.layout?.arrowGap,c,Kd)*k,R=N(w.layout?.arrowDotRadius,c,$d)*k,I=N(w.layout?.arrowDotGap,c,qd)*k,H=Pi(T,P,R,A-I),z=L>0?Pi(T,P,R,A-I,L).outline:null,E={layer:w,verts:[],shape:H};for(let F of x.visibleTiles){let O=x.getTile(F)?.data?.buckets?.[_];if(!O||!tn(O))continue;let W=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,j=F.bounds(),G=(j.maxX-j.minX)/O.extent,ee=j.minX,le=j.minY;for(let K=0;K<W.length/2;K++){let U=ee+W[K*2]*G,ne=le+W[K*2+1]*G;if(M&&!vt(this.highlightFootprint,U,ne,S))continue;let te=(V?V[K]:0)*Math.PI/180,Z=Math.sin(te),se=-Math.cos(te),me=U-h-Z*A,ge=ne-d-se*A;z&&Fi(E,z,me,ge,Z,se),Fi(E,H.outline,me,ge,Z,se),this.count++;}}E.verts.length&&b.push(E);}if(!b.length)return;let p=b[0].shape,g=p.outline.length/2,y=[],v=[];for(let w of b){let x=y.length/2/g;for(let _ of w.verts)y.push(_);v.push({layer:w.layer,first:x,count:w.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,p,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),n.use(),s?.(n),l&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(h,d,0)),n.setMat4("u_matrix",t.objectMatrix(h,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let w of v){let x=w.layer.paint,_=N(x.opacity,c,1),M=T=>T&&typeof T=="object"&&"from"in T?void 0:T,S=Fe(M(x.color),c,[.18,.45,.76,1]),C=Fe(M(x.haloColor),c,[1,1,1,1]),k=N(w.layer.layout?.arrowOutline,c,Fc)>0;Zd(e,n,w,C,S,_,k,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 de(e,new Uint8Array(this.capacity*n*8),jd,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*n;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new he(e,a),this.vao=new ue(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 Zd(i,e,t,o,r,n,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",Le([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=l)zc(i,t.first+c,s);}e.setVec4v("u_color",Le([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=l)zc(i,t.first+c,s);}function zc(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Oc=4,Li=12;function Pi(i,e,t,o,r=0){let n=i*.38,a=e*1.35,s=n*.3,l=e*.32,c=e/2,u=-i+l,f=[],h=(g,y)=>f.push(g,y);h(0,0),h(-n,a),h(-n+s,c),h(u,l);for(let g=1;g<Oc;g++){let y=g/Oc*Math.PI;h(u-Math.sin(y)*l,Math.cos(y)*l);}h(u,-l),h(-n+s,-c),h(-n,-a);let d=r>0?Qd(f,r):f,m=Ds__default.default(f,void 0,2);if(t<=0)return {outline:d,indices:m};let b=d.length/2,p=t+r;for(let g=0;g<Li;g++){let y=g/Li*Math.PI*2;d.push(o+Math.cos(y)*p,Math.sin(y)*p);}for(let g=1;g<Li-1;g++)m.push(b,b+g,b+g+1);return {outline:d,indices:m}}function Qd(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=i[a*2]*i[s*2+1]-i[s*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let s=i[(a+t-1)%t*2],l=i[(a+t-1)%t*2+1],c=i[a*2],u=i[a*2+1],f=i[(a+1)%t*2],h=i[(a+1)%t*2+1],d=Math.hypot(c-s,u-l)||1,m=Math.hypot(f-c,h-u)||1,b=r*(u-l)/d,p=-r*(c-s)/d,g=r*(h-u)/m,y=-r*(f-c)/m,v=b+g,w=p+y,x=Math.hypot(v,w);if(x<1e-9){n.push(c,u);continue}v/=x,w/=x;let _=Math.min(1/Math.max(v*b+w*p,.35),3);n.push(c+v*e*_,u+w*e*_);}return n}function Fi(i,e,t,o,r,n){let a=-n,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],u=e[l+1];i.verts.push(t+r*c+a*u,o+n*c+s*u);}}function Jd(i,e,t,o,r,n=0,a=0){let s=t*Math.PI/180,l={verts:[]};return Fi(l,Pi(o,r,n,a).outline,i,e,Math.sin(s),-Math.cos(s)),l.verts}var em=5;function Hc(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var on=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,s,l=false){if(!a.size)return;let c=n.layers.filter(u=>u.type==="raster"&&!!u.overlay===l&&n.layerVisibleAt(u,s));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let u of c){let f=a.get(u.source);if(!f)continue;let h=N(u.paint?.opacity,s,1);if(!(h<=.001)){r.setFloat("u_opacity",h),o.bind();for(let d of f.visibleTiles){let m=this.patchFor(e,f,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<=em&&a<=o.z;a++){let s=o.scaledTo(o.z-a),l=t.getTile(s);if(!l||l.state!=="loaded")continue;let c=this.textureFor(e,l);if(c)return {texture:c,uv:Hc(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 rn=class{constructor(){this.shader=null;this.vao=null;this.vbo=null;this.textures=new Map;}render(e,t,o,r,n,a){if(!r.size)return;let s=o.layers.filter(f=>f.type==="raster"&&!!f.overlay===a&&r.has(f.source)&&o.layerVisibleAt(f,n));if(!s.length)return;let l=e.gl,c=this.ensureShader(e),u=this.ensureBuffers(e);c.use(),c.setInt("u_image",0),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),u.bind();for(let f of s){let h=r.get(f.source);if(!h?.content)continue;let d=N(f.paint?.opacity,n,1);if(d<=.001)continue;let m=this.textureFor(e,h);if(!m)continue;let[b,p]=h.corners[0],g=new Float32Array(16),y=[[0,0],[1,0],[1,1],[0,1]];for(let v=0;v<4;v++)g[v*4]=h.corners[v][0]-b,g[v*4+1]=h.corners[v][1]-p,g[v*4+2]=y[v][0],g[v*4+3]=y[v][1];this.vbo?.update(new Uint8Array(g.buffer)),e.bindTexture(0,m),c.setFloat("u_opacity",d),c.setMat4("u_matrix",t.objectMatrix(b,p,0)),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);}e.bindVAO(null);}destroy(e){for(let t of this.textures.values())e.gl.deleteTexture(t.texture);this.textures.clear(),this.vao?.destroy(),this.vbo?.destroy(),this.vao=null,this.vbo=null;}textureFor(e,t){let o=e.gl,r=t.content;if(!r)return null;let n=this.textures.get(t);if(!n){let a=o.createTexture();if(!a)return null;n={texture:a,version:-1},this.textures.set(t,n),e.bindTexture(0,a),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);}return (n.version!==t.version||t.live)&&(e.bindTexture(0,n.texture),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),n.version=t.version),n.texture}ensureShader(e){return this.shader||(this.shader=new pe(e,"media",dc,mc)),this.shader}ensureBuffers(e){if(this.vao)return this.vao;let t={stride:16,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_uv",size:2,type:5126,offset:8}]};this.vbo=new de(e,new Float32Array(16),t);let o=new he(e,new Uint16Array([0,1,2,0,2,3])),r=this.ensureShader(e),n=new Map;for(let a of t.attribs)n.set(a.name,r.attribLocation(a.name));return this.vao=new ue(e,[{buffer:this.vbo,locations:n}],o),this.vao}};var tm="indoor-",Uo=class{constructor(){this.parts=null;this.stamp="";this.cache=new D;this.box=null;this.hidden=new ae;this.collected=new ae;}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 h of t.layers){if(!h.id.startsWith(tm)||h.type!=="fill"||!t.layerVisibleAt(h,o))continue;let d=t.bucketKeyFor(h);d&&(r.push(d),n??(n=e.get(h.source??Y)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(h=>h.dataKey+(n.getTile(h)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,u=-1/0,f=-1/0;for(let h of n.visibleTiles){let d=n.getTile(h)?.data?.buckets;if(d)for(let m of r){let b=d[m];if(!b||b.kind!=="fill")continue;let p=Ri(b,h);s.push(p);for(let g=0;g<p.length;g+=2)p[g]<l&&(l=p[g]),p[g]>u&&(u=p[g]),p[g+1]<c&&(c=p[g+1]),p[g+1]>f&&(f=p[g+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,u,f]: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),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,u=new D;for(let f=0;f*3<r.length;f++){let h=n[f];if(this.hidden.has(h))continue;let d=u.get(h);d||u.set(h,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let b=r[f*3+m]*Ee,p=a.getInt16(b,true),g=a.getInt16(b+2,true);p<d[0]&&(d[0]=p),g<d[1]&&(d[1]=g),p>d[2]&&(d[2]=p),g>d[3]&&(d[3]=g);}}for(let[f,h]of u){let d=s.minX+(h[0]+h[2])/2*l,m=s.minY+(h[1]+h[3])/2*l;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||vt(o,d,m,0)&&this.hidden.add(f);}}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 s=this.cache.get(r.dataKey);if(s!==void 0)return s;let l=t.data?.buckets?.[o];if(!l)return null;let c=null;if(l.kind==="fill-extrusion"&&l.featureIds&&this.hidden.size){let u=new Uint32Array(l.indices),f=new Float64Array(l.featureIds),h=[];for(let d=0;d*3<u.length;d++)this.hidden.has(f[d])||h.push(u[d*3],u[d*3+1],u[d*3+2]);if(h.length<u.length){let d=new he(e,new Uint32Array(h));c={vao:new ue(e,[{buffer:n,locations:a}],d),ibo:d,count:h.length};}}return this.cache.set(r.dataKey,c),c}};function nn(i){return i==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}var jo=class{constructor(e,t,o="mapbox"){if(e.length<t*t*4)throw new RangeError(`\u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${t}\xD7${t} \u0442\u0440\u0435\u0431\u0443\u0435\u0442 ${t*t*4} \u0431\u0430\u0439\u0442, \u043F\u0440\u0438\u0448\u043B\u043E ${e.length}`);let[r,n,a,s]=nn(o),l=new Float32Array(t*t),c=1/0,u=-1/0;for(let f=0;f<l.length;f++){let h=f*4,d=e[h]*r+e[h+1]*n+e[h+2]*a-s;l[f]=d,d<c&&(c=d),d>u&&(u=d);}this.heights=l,this.size=t,this.min=c,this.max=u;}heightAt(e,t){let o=this.size,r=Dc(e*o-.5,0,o-1),n=Dc(t*o-.5,0,o-1),a=Math.floor(r),s=Math.floor(n),l=Math.min(a+1,o-1),c=Math.min(s+1,o-1),u=r-a,f=n-s,h=this.heights,d=h[s*o+a]*(1-u)+h[s*o+l]*u,m=h[c*o+a]*(1-u)+h[c*o+l]*u;return d*(1-f)+m*f}};function Dc(i,e,t){return i<e?e:i>t?t:i}function om(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new At(t,l,s),u=c.bounds(),f=(u.minX+u.maxX)/2,h=(u.minY+u.maxY)/2,d=[[f,h],[u.minX,u.minY],[u.maxX,u.minY],[u.minX,u.maxY],[u.maxX,u.maxY]],m=false;for(let[p,g]of d)if(i.isOnGlobeFront(Oe(p),Pe(g))){m=true;break}if(!m)continue;let b=false;for(let[p,g]of d){let y=i.localToPoint(i.globeLocal(p,g));if(y&&y.x>-a&&y.y>-a&&y.x<i.width+a&&y.y<i.height+a){b=true;break}}if(b&&(n.push(c),n.length>=r))return n}return n}function wt(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,s=Math.min(Math.round(i.zoom),t);if(s<o)return [];if(i.globeActive)return om(i,e,s);let{min:l,max:c}=i.visibleWrapRange(),u=[],f=[];for(let d=l;d<=c;d++)f.push(new At(0,0,0,d));let h=0;for(;f.length&&!(++h>2e4||u.length>=n);){let d=f.pop();if(!i.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&u.push(d);continue}if(i.tileScreenSize(d.z,i.distanceToTile(d))<=a&&d.z>=o){u.push(d);continue}for(let b of d.children())f.push(b);}return u.sort((d,m)=>i.distanceToTile(d)-i.distanceToTile(m)),u}var rm=64,Bc=1024,Wc=256,nm=2048,im=192*1024*1024,am=2,Vc=5126,sm={stride:12,attribs:[{name:"a_pos",size:2,type:Vc,offset:0},{name:"a_skirt",size:1,type:Vc,offset:8}]},zi=class{constructor(e,t){this.ctx=e;this.size=t;this.key="";let o=e.gl,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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430");this.texture=r,this.framebuffer=n,e.bindTexture(Xo,r),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,t,t,0,o.RGBA,o.UNSIGNED_BYTE,null),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.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,r,0),o.bindFramebuffer(o.FRAMEBUFFER,null);}clear(e){let t=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this.size,this.size),t.clearColor(e[0],e[1],e[2],1),t.clear(t.COLOR_BUFFER_BIT);}destroy(){this.ctx.gl.deleteTexture(this.texture),this.ctx.gl.deleteFramebuffer(this.framebuffer);}},Xo=5,an=class{constructor(){this.exaggeration=1;this.revision=0;this.source=null;this.empty=null;this.unsubscribe=null;this.current=[];this.lastCover=null;this.mesh=null;this.targets=new Map;}setSource(e){if(this.unsubscribe?.(),this.unsubscribe=null,this.source=e,this.revision++,!e)return;let t=()=>{this.revision++;};e.on("data",t),this.unsubscribe=()=>e.off("data",t);}get enabled(){return this.source!==null&&this.exaggeration!==0}apply(e,t,o){let r=this.enabled?this.demFor(o):null,n=r?this.textureFor(e,r.dem):null;if(e.bindTexture(Xo,n??this.emptyTexture(e)),t.setInt("u_terrain",Xo),!r||!n){t.setFloat("u_terrain_exaggeration",0),t.setVec4("u_terrain_uv",0,0,0,0),t.setVec4("u_terrain_unpack",0,0,0,0),t.setFloat("u_terrain_dim",1);return}let[a,s,l,c]=nn(this.source.encoding);t.setVec4("u_terrain_uv",r.uv[0],r.uv[1],r.uv[2],r.uv[3]),t.setVec4("u_terrain_unpack",a,s,l,c),t.setFloat("u_terrain_dim",r.dem.image?.width??1),t.setFloat("u_terrain_exaggeration",this.exaggeration);}demFor(e){let t=this.coverFor(e),o=t?this.tileFor(t):null;if(!t||!o||e.z<t.z)return this.tileFor(e);let r=e.z-t.z,n=1/(1<<r),a=(e.x-(t.x<<r))*n,s=(e.y-(t.y<<r))*n,[l,c,u,f]=o.uv;return {dem:o.dem,uv:[l*n,c*n,u+l*a,f+c*s]}}groundRange(){let e=1/0,t=-1/0;for(let o of this.current){let r=1<<o.z,n=this.heightAtMerc((o.x+.5)/r,(o.y+.5)/r);n<e&&(e=n),n>t&&(t=n);}return e<=t?[e,t]:[0,0]}covers(e){return this.coverFor(e)!==null}coverFor(e){for(let t of this.current)if(t.z<=e.z){let o=e.z-t.z;if(e.x>>o===t.x&&e.y>>o===t.y)return t}else {let o=t.z-e.z;if(t.x>>o===e.x&&t.y>>o===e.y)return t}return null}tileFor(e){let t=this.source;if(!t)return null;for(let o=e.z;o>=0;o--){let r=e.z-o,n=e.x>>r,a=e.y>>r,s=t.getTile({z:o,x:n,y:a,dataKey:`${o}/${n}/${a}`});if(!s||s.state!=="loaded"||!s.image)continue;let l=1/(1<<r),c=(e.x-(n<<r))*l,u=(e.y-(a<<r))*l;return {dem:s,uv:[l,l,c,u]}}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(Xo,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),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);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,n}emptyTexture(e){if(this.empty)return this.empty;let t=e.gl,o=t.createTexture();return e.bindTexture(Xo,o),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,255])),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),this.empty=o,o}heightAt(e,t){return this.heightAtMerc(oe(e),re(t))}heightAtMerc(e,t){let o=this.source;if(!o||this.exaggeration===0)return 0;let r=this.coverForPoint(e,t);if(r){let s=this.tileFor(r),l=s?o.heights(s.dem):null;if(s&&l){let c=1<<r.z,[u,f,h,d]=s.uv,m=h+u*(e*c-r.x),b=d+f*(t*c-r.y);return l.heightAt(m,b)*this.exaggeration}}let n=null;for(let s of o.visibleTiles){let l=1<<s.z,c=e*l-s.x,u=t*l-s.y;if(c<0||c>=1||u<0||u>=1||n&&s.z<=n.z)continue;let f=o.getTile(s);!f||f.state!=="loaded"||(n={dem:f,z:s.z,tx:c,ty:u});}if(!n)return 0;let a=o.heights(n.dem);return a?a.heightAt(n.tx,n.ty)*this.exaggeration:0}coverForPoint(e,t){let o=this.lastCover;if(o&&this.inside(o,e,t))return o;for(let r of this.current)if(this.inside(r,e,t))return this.lastCover=r,r;return null}inside(e,t,o){let r=1<<e.z,n=t*r-e.x,a=o*r-e.y;return n>=0&&n<1&&a>=0&&a<1}tilesFor(e){return this.current=wt(e,{minzoom:0,maxzoom:22,detailBias:am,maxTiles:48}),this.lastCover=null,this.current}sizesFor(e,t,o){let r=0;return t.map(n=>{let a=e.tileScreenSize(n.z,e.distanceToTile(n))*Math.min(Math.max(o,1),2),s=Math.min(nm,Math.max(Wc,1<<Math.ceil(Math.log2(Math.max(a,1))))),l=this.targets.get(n.dataKey)?.size;for(l!==void 0&&a<=l*1.3&&a>=l*.3&&(s=l);s>Wc&&r+s*s*4>im;)s/=2;return r+=s*s*4,s})}meshOf(e,t){if(this.mesh)return this.mesh;let o=rm,r=[],n=[],a=(f,h)=>h*(o+1)+f;for(let f=0;f<=o;f++)for(let h=0;h<=o;h++)r.push(h/o,f/o,0);for(let f=0;f<o;f++)for(let h=0;h<o;h++)n.push(a(h,f),a(h,f+1),a(h+1,f+1)),n.push(a(h,f),a(h+1,f+1),a(h+1,f));let s=r.length/3;for(let f=0;f<=o;f++)r.push(f/o,0,1),r.push(f/o,1,1),r.push(0,f/o,1),r.push(1,f/o,1);let l=(f,h)=>s+f*4+h;for(let f=0;f<o;f++){let h=[[a(f,0),a(f+1,0),l(f,0),l(f+1,0)],[a(f+1,o),a(f,o),l(f+1,1),l(f,1)],[a(0,f+1),a(0,f),l(f+1,2),l(f,2)],[a(o,f),a(o,f+1),l(f,3),l(f+1,3)]];for(let[d,m,b,p]of h)n.push(d,m,p),n.push(d,p,b);}let c=new de(e,new Float32Array(r),sm),u=new he(e,new Uint32Array(n));return this.mesh={vao:new ue(e,[{buffer:c,locations:t}],u),count:n.length},this.mesh}targetOf(e){return this.targets.get(e)}targetFor(e,t,o=Bc){let r=this.targets.get(t);return r&&r.size!==o&&(r.destroy(),this.targets.delete(t),r=void 0),r?{target:r,fresh:false}:(r=new zi(e,o),this.targets.set(t,r),{target:r,fresh:true})}keepOnly(e){for(let[t,o]of this.targets)e.has(t)||(o.destroy(),this.targets.delete(t));}get drapeSize(){return Bc}skirtMeters(e){return Math.max(Ft(Math.max(e,0))/32,4)}destroy(e){this.empty&&e.gl.deleteTexture(this.empty),this.empty=null;for(let t of this.targets.values())t.destroy();this.targets.clear(),this.mesh=null;}};var Nc=35,lm=70,cm=.35,um=.5,fm=1.1;function ro(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=Re((i.pitch-Nc)/(lm-Nc),0,1),n=t.fogRange[0]*(1-cm*r)*o,a=t.fogRange[1]*(1-um*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*fm:1/0;return {near:n,far:a,intensity:s,cutoff:l}}function Oi(i,e,t,o,r){let n=o.x/Math.max(i.width,1)*2-1,a=1-o.y/Math.max(i.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],u=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f),d=h&&Uc(h,t);if(!d||!nt(l,i.tileMatrix64(f,d.extent))||(ve(c,l,[n,a,-1,1]),ve(u,l,[n,a,1,1]),c[3]===0||u[3]===0))continue;let m=c[0]/c[3],b=c[1]/c[3],p=c[2]/c[3],g=u[0]/u[3]-m,y=u[1]/u[3]-b,v=u[2]/u[3]-p,w=dm(d,m,b,Gc(f,d.extent,m,b,p,g,y,v,r),g,y,v);w&&(!s||w.t<s.distance)&&(s={featureId:w.featureId,tile:f,layerId:t,distance:w.t});}return s}function Gc(i,e,t,o,r,n,a,s,l){if(!l||Math.abs(s)<1e-9)return r;let c=1<<i.z,u=0;for(let f=0;f<2;f++){let h=(u-r)/s;if(!isFinite(h))break;let d=t+n*h,m=o+a*h;u=l((i.x+d/e)/c,(i.y+m/e)/c);}return r-u}function Hi(i,e,t,o,r){let n=o.x/Math.max(i.width,1)*2-1,a=1-o.y/Math.max(i.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],u=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f);if(h)for(let d of t){let m=h.data?.buckets?.[d];if(!m||m.kind!=="fill"||!m.featureIds||!nt(l,i.tileMatrix64(f,m.extent))||(ve(c,l,[n,a,-1,1]),ve(u,l,[n,a,1,1]),c[3]===0||u[3]===0))continue;let b=c[0]/c[3],p=c[1]/c[3],g=u[2]/u[3]-c[2]/c[3];if(Math.abs(g)<1e-9)continue;let v=-Gc(f,m.extent,b,p,c[2]/c[3],u[0]/u[3]-b,u[1]/u[3]-p,g,r)/g;if(v<0||v>1)continue;let w=b+(u[0]/u[3]-b)*v,x=p+(u[1]/u[3]-p)*v,_=hm(m,w,x);_!==null&&(!s||v<s.distance)&&(s={featureId:_,tile:f,layerId:d,distance:v});}}return s}function hm(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=l=>o.getInt16(l*Je,true),s=l=>o.getInt16(l*Je+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],u=r[l*3+1],f=r[l*3+2],h=a(c),d=s(c),m=a(u),b=s(u),p=a(f),g=s(f),y=(e-m)*(d-b)-(h-m)*(t-b),v=(e-p)*(b-g)-(m-p)*(t-g),w=(e-h)*(g-d)-(p-h)*(t-d),x=y<0||v<0||w<0,_=y>0||v>0||w>0;if(!(x&&_))return n[l]}return null}function Uc(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function dm(i,e,t,o,r,n,a){let s=new DataView(i.vertices),l=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),u=b=>s.getInt16(b*Ee,true)/pt,f=b=>s.getInt16(b*Ee+2,true)/pt,h=b=>s.getUint16(b*Ee+4,true)/Qt,d=1/0,m=-1;for(let b=0;b+2<l.length;b+=3){let p=l[b],g=l[b+1],y=l[b+2],v=u(p),w=f(p),x=h(p),_=u(g)-v,M=f(g)-w,S=h(g)-x,C=u(y)-v,k=f(y)-w,T=h(y)-x,P=n*T-a*k,L=a*C-r*T,A=r*k-n*C,R=_*P+M*L+S*A;if(R>-1e-9&&R<1e-9)continue;let I=1/R,H=e-v,z=t-w,E=o-x,F=(H*P+z*L+E*A)*I;if(F<0||F>1)continue;let B=z*S-E*M,O=E*_-H*S,W=H*M-z*_,V=(r*B+n*O+a*W)*I;if(V<0||F+V>1)continue;let j=(C*B+k*O+T*W)*I;j<0||j>1||j>=d||(d=j,m=c[b/3]??0);}return m>=0?{featureId:m,t:d}:null}function sn(i,e,t){let o=Uc(i,e);return o?Di(o,t):null}function Di(i,e){if(!i.featureIds)return null;let t=new Uint32Array(i.indices),o=new Float64Array(i.featureIds),r=[];for(let n=0;n+2<t.length;n+=3)o[n/3]===e&&r.push(t[n],t[n+1],t[n+2]);return r.length?{vertices:i.vertices,indices:new Uint32Array(r)}:null}var no=24,Bi=8,pm=2,bm=12,ln=8,cn=8;function Yo(i){let e=0;for(let d of i)e+=d.length/2;if(e<2)return null;let t=(ln+2)*2,o=e*t+i.length*(cn+2)*2+8,r=e*(ln+2)*6+i.length*cn*6+24,n=new ArrayBuffer(o*no),a=new DataView(n),s=new Uint32Array(r),l=0,c=0,u=(d,m,b,p,g,y)=>{let v=l*no;return a.setFloat32(v,d,true),a.setFloat32(v+4,m,true),a.setFloat32(v+8,b,true),a.setFloat32(v+12,p,true),a.setFloat32(v+16,g,true),a.setFloat32(v+20,y,true),l++},f=(d,m,b,p)=>{s[c++]=d,s[c++]=m,s[c++]=p,s[c++]=d,s[c++]=p,s[c++]=b;},h=(d,m,b,p,g,y,v)=>{let w=u(d,m,0,0,0,v),x=u(d,m,b,p,1,v);for(let _=1;_<=cn;_++){let M=Math.PI*_/cn,S=b*Math.cos(M)+g*Math.sin(M),C=p*Math.cos(M)+y*Math.sin(M),k=u(d,m,S,C,1,v);s[c++]=w,s[c++]=x,s[c++]=k,x=k;}};for(let d of i){let m=gm(d),b=m.length/2;if(b<2)continue;let p=new Float64Array(b-1),g=new Float64Array(b-1);for(let _=0;_<b-1;_++){let M=m[_*2+2]-m[_*2],S=m[_*2+3]-m[_*2+1],C=Math.hypot(M,S)||1;p[_]=M/C,g[_]=S/C;}let y=0,v=-1,w=-1;for(let _=0;_<b;_++){let M=m[_*2],S=m[_*2+1];_>0&&(y+=Math.hypot(M-m[_*2-2],S-m[_*2-1]));let C=_>0?_-1:0,k=_<b-1?_:b-2,T=-g[C],P=p[C],L=-g[k],A=p[k],R=T+L,I=P+A,H=Math.hypot(R,I);H>1e-9?(R/=H,I/=H):(R=T,I=P);let z=R*L+I*A,E=z>1e-6?1/z:1/0,F=Math.acos(Math.min(1,Math.max(-1,p[C]*p[k]+g[C]*g[k])));if(!(F>bm*Math.PI/180)&&E<=pm){let O=u(M,S,R*E,I*E,1,y),W=u(M,S,-R*E,-I*E,-1,y);v>=0&&f(v,w,O,W),v=O,w=W;}else {let O=Math.max(1,Math.min(ln,Math.ceil(F/(Math.PI/ln)))),V=p[C]*g[k]-g[C]*p[k]>=0?1:-1,j=u(M,S,T,P,1,y),G=u(M,S,-T,-P,-1,y);v>=0&&f(v,w,j,G);for(let ee=1;ee<=O;ee++){let le=V*F*(ee/O),K=Math.cos(le),U=Math.sin(le),ne=T*K-P*U,te=T*U+P*K,Z=u(M,S,ne,te,1,y),se=u(M,S,-ne,-te,-1,y);f(j,G,Z,se),j=Z,G=se;}v=j,w=G;}}let x=b-2;h(m[0],m[1],-g[0],p[0],-p[0],-g[0],0),h(m[(b-1)*2],m[(b-1)*2+1],-g[x],p[x],p[x],g[x],y);}return c?{vertices:n.slice(0,l*no),indices:s.slice(0,c),vertexCount:l}:null}function Wi(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=Ds__default.default(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 gm(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 io=5126,ym={stride:Bi,attribs:[{name:"a_pos",size:2,type:io,offset:0}]},Ni={stride:no,attribs:[{name:"a_pos",size:2,type:io,offset:0},{name:"a_extrude",size:2,type:io,offset:8},{name:"a_side",size:1,type:io,offset:16},{name:"a_dist",size:1,type:io,offset:20}]},vm={stride:4,attribs:[{name:"a_ground",size:1,type:io,offset:0}]},Vi=class{constructor(e,t,o){this.revision=e;this.ground=t;this.parts=o;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy(),e.gbo?.destroy();}},wm=(i,e)=>[i[0],i[1],i[2],i[3]*e],Ko=class{constructor(){this.elevationAt=null;this.elevationRevision=0;this.objects=[];this.markers=[];this.gpu=new D;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,s,l=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,b)=>m.zIndex-b.zIndex);let u=e.gl.drawingBufferWidth,f=t.width>0?u/t.width:1,h=t.worldSize*f,d=null;for(let m of this.objects){if(!m.visible)continue;let b=m.ghostOpacity;if(c&&b<=0)continue;let p=this.gpuFor(e,m,r,a);if(!p)continue;let g=l?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,y=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:v,vao:w,ibo:x}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?wm(v.color,b):v.color;if(v.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",Le(_)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==n&&(n.use(),s?.(n),d=n);let M=v.width/2*f,S=h>1e-9?1/h:1;if(n.setVec4v("u_color",Le(_)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*f),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",S),n.setFloat("u_units_to_px",h),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[C,k]=v.dashArray;n.setVec2("u_dash",C*f,(C+k)*f);}if(v.arrow){n.setVec4v("u_arrow_color",Le(v.arrowColor??[1,1,1,1]));let C=(v.arrowSize??5)*f;n.setVec3("u_arrow",(v.arrowPeriod??46)*f,Math.max(C*.4,1),Math.min(C,M*.72));}g&&n.setMat4("u_shadow_matrix",g),n.setMat4("u_matrix",y);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=this.elevationAt,a=(s,l,c)=>{let u=oe(s),f=re(l);return e.worldPxToPoint(u*r,f*r,c+(n?n(u,f):0))};for(let s=this.objects.length-1;s>=0;s--){let l=this.objects[s];if(l.visible&&l.hitTest(t,a,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 s of a){let l=Q(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>n&&(n=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.elevationAt?this.elevationRevision:0,a=this.gpu.get(t.id);if(a&&a.revision===t.revision&&a.ground===n)return a;a?.destroy();let s=[];for(let c of t.build()){let u=c.kind==="fill"?ym:Ni,f=c.kind==="fill"?o:r,h=new de(e,new Uint8Array(c.mesh.vertices),u),d=new he(e,c.mesh.indices),m=this.groundOf(t,c,u.stride),b=m?new de(e,m,vm):null,p=[{buffer:h,locations:f}];b&&p.push({buffer:b,locations:f});let g=new ue(e,p,d);s.push({part:c,vao:g,vbo:h,ibo:d,gbo:b});}let l=new Vi(t.revision,n,s);return this.gpu.set(t.id,l),s.length?l:null}groundOf(e,t,o){let r=this.elevationAt;if(!r)return null;let n=new DataView(t.mesh.vertices),a=new Float32Array(t.mesh.vertexCount);for(let s=0;s<a.length;s++){let l=n.getFloat32(s*o,true)+e.originX,c=n.getFloat32(s*o+4,true)+e.originY;a[s]=r(l,c);}return a}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 un=32,xm=1179937895,_m=1313821514,Mm=5130562,Cm={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Sm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Gi(i){let{json:e,bin:t}=jc(i),o=await km(e,t);return Yc(e,t,o)}function Tm(i){let{json:e,bin:t}=jc(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 Yc(e,t,null)}function jc(i){let e=new DataView(i);if(e.getUint32(0,true)!==xm)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),s=r+8;a===_m?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,s,n))):a===Mm&&(o=new Uint8Array(i,s,n)),r=s+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 km(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 s=t[a].extensions.EXT_meshopt_compression,l=s.byteOffset??0,c=e.subarray(l,l+s.byteLength),u=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(u,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),n.set(a,u);}return n}function Xc(i){let e=X();if(i.matrix){for(let S=0;S<16;S++)e[S]=i.matrix[S];return e}ut(e);let[t,o,r]=i.translation??[0,0,0],[n,a,s,l]=i.rotation??[0,0,0,1],[c,u,f]=i.scale??[1,1,1],h=n+n,d=a+a,m=s+s,b=n*h,p=n*d,g=n*m,y=a*d,v=a*m,w=s*m,x=l*h,_=l*d,M=l*m;return e[0]=(1-(y+w))*c,e[1]=(p+M)*c,e[2]=(g-_)*c,e[4]=(p-M)*u,e[5]=(1-(b+w))*u,e[6]=(v+x)*u,e[8]=(g+_)*f,e[9]=(v-x)*f,e[10]=(1-(b+y))*f,e[12]=t,e[13]=o,e[14]=r,e}var Em={5120:127,5121:255,5122:32767,5123:65535};function Am(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],s=i[8],l=i[9],c=i[10],u=e*(n*c-a*l)-r*(t*c-o*l)+s*(t*a-o*n);if(Math.abs(u)<1e-20)return [1,0,0,0,1,0,0,0,1];let f=1/u;return [(n*c-a*l)*f,(a*s-r*c)*f,(r*l-n*s)*f,(o*l-t*c)*f,(e*c-o*s)*f,(t*s-e*l)*f,(t*a-o*n)*f,(o*r-e*a)*f,(e*n-t*r)*f]}function Yc(i,e,t){let o=S=>{let C=t?.get(S);if(C)return C;let k=i.bufferViews?.[S];if(!k)return null;let T=k.byteOffset??0;return e.subarray(T,T+k.byteLength)},r=[],n=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0],f=S=>{if(S===void 0)return null;let C=i.accessors?.[S];if(!C)return null;let k=Sm[C.type]??1,T=new Float64Array(C.count*k),P=C.bufferView!==void 0?i.bufferViews?.[C.bufferView]:void 0;if(!P||C.bufferView===void 0)return {data:T,components:k};let L=o(C.bufferView);if(!L)return {data:T,components:k};let A=Cm[C.componentType]??4,R=P.extensions?.EXT_meshopt_compression,I=R?R.byteStride:P.byteStride,H=I&&I>0?I:A*k,z=C.byteOffset??0,E=new DataView(L.buffer,L.byteOffset,L.byteLength),F=C.normalized?Em[C.componentType]??1:1;for(let B=0;B<C.count;B++)for(let O=0;O<k;O++){let W=z+B*H+O*A,V;switch(C.componentType){case 5120:V=E.getInt8(W);break;case 5121:V=E.getUint8(W);break;case 5122:V=E.getInt16(W,true);break;case 5123:V=E.getUint16(W,true);break;case 5125:V=E.getUint32(W,true);break;default:V=E.getFloat32(W,true);}T[B*k+O]=F===1?V:Math.max(V/F,-1);}return {data:T,components:k}},h=(S,C,k=-1)=>{if(S.mode!==void 0&&S.mode!==4)return;let T=f(S.attributes.POSITION);if(!T)return;let P=f(S.attributes.NORMAL),L=f(S.attributes.TEXCOORD_0),A=f(S.indices),R=r.length/3,I=T.data.length/3,H=Am(C),E=(S.material!==void 0?i.materials?.[S.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,F=E?{ox:E.offset?.[0]??0,oy:E.offset?.[1]??0,sx:E.scale?.[0]??1,sy:E.scale?.[1]??1,rot:E.rotation??0}:null;for(let U=0;U<I;U++){let ne=T.data[U*3],te=T.data[U*3+1],Z=T.data[U*3+2],se=C[0]*ne+C[4]*te+C[8]*Z+C[12],me=C[1]*ne+C[5]*te+C[9]*Z+C[13],ge=C[2]*ne+C[6]*te+C[10]*Z+C[14];if(r.push(se,me,ge),se<c[0]&&(c[0]=se),me<c[1]&&(c[1]=me),ge<c[2]&&(c[2]=ge),se>u[0]&&(u[0]=se),me>u[1]&&(u[1]=me),ge>u[2]&&(u[2]=ge),P){let _e=P.data[U*3],Me=P.data[U*3+1],Te=P.data[U*3+2],Ne=H[0]*_e+H[3]*Me+H[6]*Te,st=H[1]*_e+H[4]*Me+H[7]*Te,lt=H[2]*_e+H[5]*Me+H[8]*Te,Be=Math.hypot(Ne,st,lt);Be>1e-12?(Ne/=Be,st/=Be,lt/=Be):(Ne=0,st=1,lt=0),n.push(Ne,st,lt);}else n.push(0,1,0);let Ce=L?L.data[U*2]:0,Se=L?L.data[U*2+1]:0;if(F){if(F.rot!==0){let _e=Math.cos(F.rot),Me=Math.sin(F.rot),Te=_e*Ce+Me*Se,Ne=-Me*Ce+_e*Se;Ce=Te,Se=Ne;}Ce=Ce*F.sx+F.ox,Se=Se*F.sy+F.oy;}a.push(Ce,Se);}let B=s.length;if(A)for(let U=0;U<A.data.length;U++)s.push(R+A.data[U]);else for(let U=0;U<I;U++)s.push(R+U);let O=S.material!==void 0?i.materials?.[S.material]:void 0,W=O?.pbrMetallicRoughness,V=W?.metallicFactor!==void 0||W?.roughnessFactor!==void 0,j=W?.baseColorFactor??[1,1,1,1],G=W?.baseColorTexture?.index,ee=G!==void 0?i.textures?.[G]?.source:void 0,le=O?.emissiveFactor??[0,0,0],K=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:B,indexCount:s.length-B,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?W?.metallicFactor??1:0,roughness:V?W?.roughnessFactor??1:1,emissive:[le[0]*K,le[1]*K,le[2]*K],texture:ee??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:k});},d=i.skins?.length?null:Rm(i,f),m=d?d.nodes:null,b=(S,C,k,T)=>{let P=i.nodes?.[S];if(!P)return;let L=Xc(P),A=X();Ie(A,C,L);let R=X(),I=T,H=m?.get(S);if(H?(H.parentNode=T,H.parent=k.slice(),ut(R),I=S):Ie(R,k,L),P.mesh!==void 0)for(let E of i.meshes?.[P.mesh]?.primitives??[])h(E,R,I);let z=P.extensions?.KHR_lights_punctual?.light;if(z!==void 0){let E=i.extensions?.KHR_lights_punctual?.lights?.[z],F=E?.type;if(E&&(F==="point"||F==="spot"||F==="directional")){let B=-A[8],O=-A[9],W=-A[10],V=Math.hypot(B,O,W)||1,j=E.spot?.innerConeAngle??0,G=E.spot?.outerConeAngle??Math.PI/4;p.push({type:F,color:[E.color?.[0]??1,E.color?.[1]??1,E.color?.[2]??1],intensity:E.intensity??1,range:E.range??0,position:[A[12],A[13],A[14]],direction:[B/V,O/V,W/V],cosInner:Math.cos(j),cosOuter:Math.cos(G)});}}for(let E of P.children??[])b(E,A,R,I);},p=[],g=X();ut(g);let y=X();ut(y);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((S,C)=>C)??[];for(let S of v)b(S,g,y,-1);let w=[];for(let S of i.images??[]){if(S.bufferView===void 0){w.push(new Uint8Array(0));continue}let C=o(S.bufferView);w.push(C?C.slice():new Uint8Array(0));}let x=r.length/3,_=new ArrayBuffer(x*un),M=new Float32Array(_);for(let S=0;S<x;S++){let C=S*8;M[C]=r[S*3],M[C+1]=r[S*3+1],M[C+2]=r[S*3+2],M[C+3]=n[S*3],M[C+4]=n[S*3+1],M[C+5]=n[S*3+2],M[C+6]=a[S*2],M[C+7]=a[S*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,u[0]=u[1]=u[2]=0),{vertices:_,indices:new Uint32Array(s),primitives:l,images:w,min:c,max:u,animation:d,lights:p}}function Rm(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,s=n.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[n.sampler];if(!l)continue;let c=e(l.input),u=e(l.output);if(!c||!u||!c.data.length)continue;let f=s==="rotation"?4:3,h=l.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*f);for(let p=0;p<d;p++){let g=h?(p*3+1)*f:p*f;for(let y=0;y<f;y++)m[p*f+y]=u.data[g+y];}let b=o.get(a)??{parentNode:-1,parent:ut(X()),base:Im(i.nodes?.[a]),channels:[]};b.channels.push({path:s,times:Float32Array.from(c.data),values:m,step:l.interpolation==="STEP"}),o.set(a,b),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Im(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 Ui(i,e,t,o){let r=i.nodes.get(e);if(!r)return ut(o);let n=X();Lm(r,t,n);let a=X();if(Ie(a,r.parent,n),r.parentNode<0)return Kc(o,a);let s=X();return Ui(i,r.parentNode,t,s),Ie(o,s,a)}var Kc=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Lm(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let s=a.times.length,l=a.path==="rotation"?4:3,c=0;for(;c<s-1&&a.times[c+1]<e;)c++;let u=Math.min(c+1,s-1),f=a.times[u]-a.times[c],h=a.step||f<=0?0:Math.min(Math.max((e-a.times[c])/f,0),1),d=c*l,m=u*l;if(a.path==="rotation"){let b=0;for(let y=0;y<4;y++)b+=a.values[d+y]*a.values[m+y];let p=b<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-h)+a.values[m+y]*p*h,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let b=a.path==="translation"?o:n;for(let p=0;p<3;p++)b[p]=a.values[d+p]*(1-h)+a.values[m+p]*h;}}return Kc(t,Xc({translation:o,rotation:r,scale:n}))}var De=5126,Pm=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),$c={stride:un,attribs:[{name:"a_pos",size:3,type:De,offset:0},{name:"a_normal",size:3,type:De,offset:12},{name:"a_tex",size:2,type:De,offset:24}]},Xi=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);}},ji=256,fn=41,qc={stride:fn*4,attribs:[{name:"a_i_m0",size:4,type:De,offset:0,divisor:1},{name:"a_i_m1",size:4,type:De,offset:16,divisor:1},{name:"a_i_m2",size:4,type:De,offset:32,divisor:1},{name:"a_i_m3",size:4,type:De,offset:48,divisor:1},{name:"a_i_s0",size:4,type:De,offset:64,divisor:1},{name:"a_i_s1",size:4,type:De,offset:80,divisor:1},{name:"a_i_s2",size:4,type:De,offset:96,divisor:1},{name:"a_i_s3",size:4,type:De,offset:112,divisor:1},{name:"a_i_n0",size:3,type:De,offset:128,divisor:1},{name:"a_i_n1",size:3,type:De,offset:140,divisor:1},{name:"a_i_n2",size:3,type:De,offset:152,divisor:1}]},$o=2,ao=16,Rt=class{constructor(){this.models=[];this.gpu=new D;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(ji*fn);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.elevationAt=null;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,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",$o);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let u=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!u||!c.mesh)continue;let f=c.fade<1;o.setFloat("u_opacity",c.fade);let h=c.matrixFor(t);o.setMat4("u_matrix",h),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),u.vao.bind();for(let b of [false,true])if(!(f&&!b))for(let p of c.mesh.primitives){if(!f&&p.blend!==b)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,s):h),d&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,s):d);let g=p.texture>=0?u.textures[p.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),g&&e.bindTexture($o,g),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(b?"premultiplied":"none"),e.setDepthMask(!b),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 s=new D;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(f=>f.blend||f.node>=0))continue;let u=s.get(c.url);u?u.push(c):s.set(c.url,[c]);}let l=false;o.setFloat("u_reflect",0);for(let[,c]of s){if(c.length<2)continue;let u=this.gpuFor(e,c[0],r);if(!u||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new de(e,this.instScratch,qc,true)),u.instVao||(u.instVao=new ue(e,[{buffer:u.vbo,locations:r},{buffer:this.instBuffer,locations:r}],u.ibo)),l||(o.use(),n(o),o.setInt("u_base_texture",$o),o.setFloat("u_opacity",1),l=true);let f=c[0].mesh;for(let h=0;h<c.length;h+=ji){let d=Math.min(ji,c.length-h);for(let m=0;m<d;m++){let b=c[h+m],p=m*fn;this.instScratch.set(b.matrixFor(t),p);let g=a?this.shadowMatrix(t,b):Pm;this.instScratch.set(g,p+16),this.instScratch.set(b.normalMatrix(),p+32),this.drawnInstanced.add(b);}this.instBuffer.update(this.instScratch.subarray(0,d*fn)),e.bindVAO(u.instVao.vao);for(let m of f.primitives){let b=m.texture>=0?u.textures[m.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),b&&e.bindTexture($o,b),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);}}}l&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(u=>u.type!=="directional"),n=r.length<=ao?r:[...r].sort((u,f)=>f.intensity-u.intensity).slice(0,ao),a=new Float32Array(ao*4),s=new Float32Array(ao*4),l=new Float32Array(ao*4),c=new Float32Array(ao*4);n.forEach((u,f)=>{let h=f*4;a[h]=u.position[0],a[h+1]=u.position[1],a[h+2]=u.position[2],a[h+3]=u.range,s[h]=u.color[0]*u.intensity,s[h+1]=u.color[1]*u.intensity,s[h+2]=u.color[2]*u.intensity,s[h+3]=u.type==="spot"?1:0,l[h]=u.direction[0],l[h+1]=u.direction[1],l[h+2]=u.direction[2],c[h]=u.cosInner,c[h+1]=u.cosOuter;}),o={count:n.length,pos:a,color:s,dir:l,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+t.groundZ+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models){if(this.elevationAt){let t=e.origin();e.groundZ=this.elevationAt(t.x,t.y);}else e.groundZ!==0&&(e.groundZ=0);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 s=this.shadowMatrix(t,n);o.setMat4("u_matrix",s),a.vao.bind();for(let l of n.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,n,l.node):s),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,l.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude+t.groundZ),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+t.groundZ),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 de(e,new Uint8Array(t.mesh.vertices),$c),s=new he(e,t.mesh.indices),l=new ue(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(f=>{if(!f)return null;let h=n.createTexture();return h?(e.bindTexture($o,h),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,f),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),h):null}),u=new Xi(l,a,s,c);return u.users=1,this.counted.add(t),this.gpu.set(t.url,u),u}static get layout(){return $c}static get instanceLayout(){return qc}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Yi=4,Zc=new ae;function Qc(i){return e=>e.type==="line"&&N(e.paint.elevation,i,0)>0}function Fm(i){Zc.has(i)||(Zc.add(i),console.warn(`[osmgl] ${i}`));}var zm=.5,Om=.01,Hm=300,Dm=4,Ki=127,Bm=.5,so=128,Zo=5120,qo=5121,co=5122,Jc=5123,uo=5126,Wm={stride:8,attribs:[{name:"a_pos",size:2,type:uo,offset:0}]},$i={stride:Je,attribs:[{name:"a_pos",size:2,type:co,offset:0}]},eu={stride:Ve,attribs:[{name:"a_p0",size:2,type:co,offset:0},{name:"a_p1",size:2,type:co,offset:4},{name:"a_corner",size:2,type:Zo,offset:8},{name:"a_ground",size:2,type:Zo,offset:10},{name:"a_dist",size:1,type:uo,offset:12},{name:"a_width",size:1,type:uo,offset:16},{name:"a_lift",size:2,type:co,offset:20}]},tu={stride:Et,attribs:[{name:"a_dcolor",size:4,type:qo,normalized:true,offset:0},{name:"a_dwidth",size:1,type:uo,offset:4}]},lo={stride:Ee,attribs:[{name:"a_pos",size:2,type:co,offset:0},{name:"a_height",size:1,type:Jc,offset:4},{name:"a_tint",size:1,type:qo,normalized:true,offset:6},{name:"a_ao",size:1,type:qo,normalized:true,offset:7},{name:"a_normal",size:3,type:Zo,normalized:true,offset:8},{name:"a_kind",size:1,type:qo,offset:11},{name:"a_wall",size:3,type:Jc,offset:12}]},Vm={flat:0,water:1,foliage:2,sand:3,asphalt:4},Nm=[1,9,14,26,3],ou={stride:bt,attribs:[{name:"a_pos",size:2,type:uo,offset:0},{name:"a_level",size:1,type:co,offset:8},{name:"a_normal",size:3,type:Zo,normalized:true,offset:10},{name:"a_kind",size:1,type:qo,offset:13},{name:"a_bleed",size:2,type:Zo,offset:14}]},hn=class{constructor(e,t,o,r,n,a,s=r,l=null){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=s;this.dataBuffer=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.dataBuffer?.destroy(),this.ibo.destroy();}},ru={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25};function qi(i,e){if(i.z===e.z)return i.x===e.x&&i.y===e.y;if(i.z>e.z){let o=i.z-e.z;return i.x>>o===e.x&&i.y>>o===e.y}let t=e.z-i.z;return e.x>>t===i.x&&e.y>>t===i.y}var mn=class mn{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new D;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new on;this.mediaLayer=new rn;this.mediaSources=new D;this.customLayers=[];this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new D;this.lineLocs=new D;this.objectLine=null;this.objectLineLocs=new D;this.buildingLocs=new D;this.shadows={...ru};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new D;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new D;this.highlightKey="";this.groundArrows=new Go;this.highlightTris=new D;this.fillHighlightGpu=new D;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Uo;this.terrain=new an;this.drapeTile=null;this.drapePending=false;this.terrainShader=null;this.terrainLocs=new D;this.hiddenBuildings=new Set;this.seams=new Zr;this.seamGpu=new D;this.hiddenWithSeams=new D;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new D;this.hiddenStamp="";this.bucketIdCache=new D;this.surfaceCut=new D;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Rt;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new D;this.modelInstLocs=new D;this.uploadLeft=0;this.uploadDeferred=false;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((n,a)=>n-a).join(","),t="";for(let[r,n]of this.seams.hiddenByTile)t+=`${r}=${e(n)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,n]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let s of n)a.add(s);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,n,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.surfaceCut.get(s);if(l!==void 0&&(l===null||l.vbo===n))return l;l&&(l.vao.destroy(),l.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let u=new Float64Array(c.shapeFeatures),f=new Uint32Array(c.shapeRanges),h=[],d=0;for(let x=0;x<u.length;d++){let _=u[x++],M=_>0;for(let S=0;S<_;S++)if(!a.has(u[x+S])){M=false;break}x+=_,M&&h.push(d);}if(!h.length)return this.surfaceCut.set(s,null),null;let m=new Uint32Array(c.indices),b=c.capIndexOffset??m.length,p=new Uint8Array(m.length);for(let x of h){for(let _=f[x*4];_<f[x*4+1];_++)p[_]=1;for(let _=f[x*4+2];_<f[x*4+3];_++)p[_]=1;}let g=[];for(let x=0;x<b;x++)p[x]||g.push(m[x]);let y=g.length;for(let x=b;x<m.length;x++)p[x]||g.push(m[x]);let v=new he(e,new Uint32Array(g)),w={vao:new ue(e,[{buffer:n,locations:this.surfaceLocs}],v),ibo:v,vbo:n,mainCount:y,capCount:g.length-y};return this.surfaceCut.set(s,w),w}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let n=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:n,vbo:o}),n}syncSeams(e,t,o){let r=e.get(Y);if(!(!r||!r.visibleTiles.length))for(let n of t.layers){if(n.type!=="fill-extrusion"||(n.source??Y)!==Y||!t.layerVisibleAt(n,o))continue;let a=t.bucketKeyFor(n);if(a===null)continue;let s=n,l=r.visibleTiles[0].z;this.seams.update(r,a,{zoom:l,metersPerTile:Ft(l),cornerRadius:s.cornerRadius,cornerSegments:s.cornerSegments})&&this.syncSeamGpu();return}}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a,s=this.buildingLocs,l=null){if(!a||!a.size)return null;let c=r+"|"+o,u=this.hiddenCut.get(c);if(u!==void 0&&(u===null||u.vbo===n))return u;u&&(u.vao.destroy(),u.ibo.destroy());let f=t.data?.buckets?.[o];if(!f||!("featureIds"in f)||!f.featureIds)return null;let h=this.bucketIds(c,f.featureIds,n),[d,m]=a.size<h.size?[a,h]:[h,a],b=false;for(let w of d)if(m.has(w)){b=true;break}if(!b)return this.hiddenCut.set(c,null),null;let p=new Uint32Array(f.indices),g=new Float64Array(f.featureIds),y=[];for(let w=0;w*3<p.length;w++)a.has(g[w])||y.push(p[w*3],p[w*3+1],p[w*3+2]);let v=null;if(y.length<p.length){let w=new he(e,new Uint32Array(y));v={vao:new ue(e,l?[{buffer:n,locations:s},{buffer:l,locations:s}]:[{buffer:n,locations:s}],w),ibo:w,count:y.length,vbo:n};}return this.hiddenCut.set(c,v),v}init(e){this.symbols?.init(e),this.fill=new pe(e,"fill",xc,_c),this.surface=new pe(e,"surface",Ac,Rc),this.line=new pe(e,"line",Mc,Cc),this.objectLine=new pe(e,"objectLine",Sc,Tc),this.building=new pe(e,"buildings",kc,Ec),this.depth=new pe(e,"depth",ac,Ti),this.groundShadow=new pe(e,"groundShadow",gc,yc),this.terrainShader=new pe(e,"terrain",vc,wc),this.terrainLocs=new D;for(let n of ["a_pos","a_skirt"])this.terrainLocs.set(n,this.terrainShader.attribLocation(n));this.sky=new pe(e,"sky",fc,hc),this.raster=new pe(e,"raster",pc,bc),this.globeBody=new pe(e,"globeBody",oc,rc),this.globeClip=new pe(e,"globeClip",nc,ic),this.globeMesh=Gm(e,this.globeBody),this.model=new pe(e,"model",lc,Ei),this.modelInstanced=new pe(e,"model-instanced",cc,Ei),this.modelDepth=new pe(e,"modelDepth",uc,Ti);for(let n of Rt.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Rt.layout.attribs,...Rt.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=ec(e);let t=new D([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new de(e,new Float32Array([0,0,1,0,1,1,0,1]),Wm),r=new he(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new ue(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of $i.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of ou.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of eu.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Ni.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));this.objectLineLocs.set("a_ground",this.objectLine.attribLocation("a_ground")),this.fillLocs.set("a_ground",this.fill.attribLocation("a_ground"));for(let n of lo.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));for(let[n,a]of [[this.fillLocs,this.fill],[this.lineLocs,this.line],[this.buildingLocs,this.building]])for(let s of tu.attribs)n.set(s.name,a.attribLocation(s.name));}render(e,t,o,r,n,a=new D){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.uploadLeft=mn.UPLOAD_BUDGET,this.uploadDeferred=false,this.materialTime=n/1e3,this.materialAnimating=false,this.fog=ro(t,r),this.patternScale=Tr/Math.max($e(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),u=t.cameraPositionPx;this.cameraMeters=[u[0]/c,u[1]/c,u[2]/c];let f=p=>o.get(p.source??Y);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.symbols&&(this.symbols.elevationAt=this.terrain.enabled?(p,g)=>this.terrain.heightAtMerc(p,g):null),this.syncSeams(o,r,s),this.syncHiddenStamp(),this.objects&&(this.objects.elevationAt=this.terrain.enabled?(p,g)=>this.terrain.heightAtMerc(p,g):null,this.objects.elevationRevision=this.terrain.revision),this.models.elevationAt=this.terrain.enabled?(p,g)=>this.terrain.heightAtMerc(p,g):null,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,s),this.mediaLayer.render(e,t,r,this.mediaSources,s,false)),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.terrain.enabled?this.drapeTerrain(e,t,o,r,f,s):this.drawFlatLayers(e,t,r,f,s),this.terrain.enabled||this.drawFillHighlight(e,t,o,r),this.groundArrows&&!this.terrain.enabled&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.setVec2("u_world_origin",0,0);},this.shadowActive)),this.terrain.enabled||this.drawGroundShadow(e,t,o,r),this.terrain.enabled||this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let p of r.layers){if(p.type!=="surface"||p.overlay||!r.layerVisibleAt(p,s))continue;let g=f(p);g&&(this.flattened(g,r,p)||this.drawSurface(e,t,g,r,p,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let h=Qc(s),d=new Set,m=this.terrain.enabled;for(let p of r.layers){if(m)break;if(p.type==="raster"||!h(p)||p.overlay||!r.layerVisibleAt(p,s))continue;let g=f(p);if(g){if(p.type==="line"&&p.network){if(d.has(p.network))continue;d.add(p.network),this.drawNetwork(e,t,r,f,p.network,s,y=>!y.overlay&&h(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,g,r,p,s);}}this.drawOverlay(e,t,r,f,s,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,s))continue;let g=f(p);g&&(this.drawBuildings(e,t,g,r,p,s,n)&&(l=true),this.drawHighlight(e,t,g,r,p,s));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,p=>{this.applyShadowUniforms(p),this.applyFogUniforms(p,t,r),this.applyLight(p,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(l=true)),this.drawOverlay(e,t,r,f,s,"volume"),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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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,s,true),this.mediaLayer.render(e,t,r,this.mediaSources,s,true));let b=this.terrain.enabled?[]:r.layers.filter(p=>p.type==="line"&&N(p.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(p,s));if(b.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of b){let g=f(p);g&&this.drawLine(e,t,g,r,p,s,N(p.paint.ghostOpacity,s,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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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),l||this.materialAnimating||this.uploadDeferred||this.drapePending}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Yi,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(d=>d.type==="fill-extrusion"&&!d.overlay&&r.layerVisibleAt(d,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Wo(e,this.shadows.resolution);let s=r.light,[l,c]=this.terrain.enabled?this.terrain.groundRange():[0,0];if(t.updateShadow(Wt(s.keyAzimuth,s.keyAltitude),Hm,l,c),!t.shadowReady)return;let u=this.shadowTarget;u.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let f=e.gl;f.enable(f.POLYGON_OFFSET_FILL),f.polygonOffset(2,4);let h=this.depth;h.use();for(let d of a){let m=o.get(d.source??Y);if(!m)continue;let b=r.bucketKeyFor(d);if(b===null)continue;let p=N(d.paint.heightScale,t.zoom,1);(d.source??Y)===Y&&this.indoorMask.prepare(m,b);for(let g of m.visibleTiles){if(!this.drawsTile(t,r,d,g))continue;let y=m.getTile(g),v=y&&this.bucketFor(e,y,b,lo,this.buildingLocs,"fill-extrusion");if(!v)continue;h.setFloat("u_height_scale",this.growScale(v,n,!m.warm)*p),this.applyTileScale(h,g,v.extent,e),h.setMat4("u_matrix",t.shadowTileMatrix(g,v.extent));let w=(d.source??Y)===Y,x=this.cutHidden(e,y,b,g.dataKey,v.buffer,this.hiddenFor(b,w,g.dataKey)),_=w?x??this.indoorMask.indicesFor(e,y,b,g,v.buffer,this.buildingLocs):x;_?(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.count,e.gl.UNSIGNED_INT,0)):(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.indexCount,v.indexType,0));}}if(this.seams.meshes.size){let d=a.find(m=>(m.source??Y)===Y);if(d){h.setFloat("u_height_scale",N(d.paint.heightScale,t.zoom,1));for(let[m,{tile:b,mesh:p}]of this.seams.meshes){let g=this.seamBucket(e,m,p);h.setMat4("u_matrix",t.shadowTileMatrix(b,p.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,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)),f.disable(f.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),u.bindTexture(Yi),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(u.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,o),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),et(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(ve(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);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(je(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),et(r,"u_sky_color",o.sky.skyColor),et(r,"u_horizon_color",o.sky.horizonColor),Um(r,o.sky);let[n,a]=this.skyBand(t,o),s=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",n,a,s),this.applyAtmosphere(r,t,o);let l=t.cameraRay();r.setVec3("u_cam_right",l.right[0],l.right[1],l.right[2]),r.setVec3("u_cam_up",l.up[0],l.up[1],l.up[2]),r.setVec3("u_cam_fwd",l.fwd[0],l.fwd[1],l.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=Wt(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),et(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let u=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",u,o.sky.starIntensity),u>.001){et(r,"u_space_color",o.sky.spaceColor),et(r,"u_atmo_color",o.sky.atmosphereColor);let f=t.globeDisc();r.setVec4("u_globe_disc",f.dir[0],f.dir[1],f.dir[2],f.angle);let[h,d,m,b]=t.localRayCorners();r.setVec3("u_ray_tl",h[0],h[1],h[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",b[0],b[1],b[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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,n=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,n),e.setVec2("u_globe_center",t.centerPointPx.x/n,t.centerPointPx.y/n);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let s=Wt(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-s[0],-s[1],-s[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.up[2]]);}drawFlatLayers(e,t,o,r,n,a=false){let s=Qc(n),l=new Set;for(let c of o.layers){if(this.drawCustomBefore(e,t,c.id),c.type==="raster"||c.type==="fill-extrusion"||c.type==="symbol"||c.overlay||s(c)&&!a||!o.layerVisibleAt(c,n))continue;let u=r(c);if(u){if(c.type==="line"&&c.network){if(l.has(c.network))continue;l.add(c.network),this.drawNetwork(e,t,o,r,c.network,n,f=>!f.overlay&&(a||!s(f))&&o.layerVisibleAt(f,n));continue}if(c.type==="surface"){if(!this.flattened(u,o,c))continue;this.drawFill(e,t,u,o,c,n);continue}c.type==="fill"?this.drawFill(e,t,u,o,c,n):this.drawLine(e,t,u,o,c,n);}}this.drawCustomRest(e,t,o);}drawCustomBefore(e,t,o){if(this.customLayers.length)for(let r of this.customLayers)r.before===o&&this.drawCustom(e,t,r.layer);}drawCustomRest(e,t,o){if(!this.customLayers.length)return;let r=new Set(o.layers.map(n=>n.id));for(let n of this.customLayers)n.before!==void 0&&r.has(n.before)||this.drawCustom(e,t,n.layer);}drawCustom(e,t,o){let r=e.gl;try{o.render(r,t.objectMatrix(0,0,0));}catch(n){console.warn(`[osmgl] \u0441\u0432\u043E\u0439 \u0441\u043B\u043E\u0439 \xAB${o.id}\xBB \u0443\u043F\u0430\u043B \u043F\u0440\u0438 \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0435:`,n instanceof Error?n.message:n);}e.resetState();}drapeTerrain(e,t,o,r,n,a){let s=o.get(Y),l=this.terrainShader;if(!s||!l)return;let c=e.gl,u=r.background,f=this.terrain.tilesFor(t);if(!f.length)return;let h=this.terrain.sizesFor(t,f,this.dpr),d=0;this.drapePending=false;let m=qi,b=Math.round(a*4)/4,p=new Set;for(let A=0;A<f.length;A++){let R=f[A],I=h[A];p.add(R.dataKey);let H=[b.toString()];for(let[B,O]of o)for(let W of O.visibleTiles)m(R,W)&&H.push(`${B}/${W.dataKey}:${O.getTile(W)?.state??""}`);let z=H.join(","),{target:E,fresh:F}=this.terrain.targetFor(e,R.dataKey,I);if(E.key!==z){if(d>=Dm){F&&E.clear(u),this.drapePending=true;continue}d++,E.key=z,e.bindFramebuffer(E.framebuffer),e.viewport(0,0,I,I),c.clearColor(u[0],u[1],u[2],1),c.clear(c.COLOR_BUFFER_BIT),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setStencilTest(false),this.drapeTile={terrain:R},this.drawFlatLayers(e,t,r,n,a,true),this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,B=>{this.applyFogUniforms(B,t,r),B.setVec4("u_globe",0,0,0,0),B.setInt("u_material",0),B.setFloat("u_elevation",0),B.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drapeTile=null;}}this.terrain.keepOnly(p),e.bindFramebuffer(null),e.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.clearColor(u[0],u[1],u[2],1),l.use(),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setBlend("none"),e.setCull("none"),e.setStencilTest(false);let g=this.terrain.meshOf(e,this.terrainLocs);l.setInt("u_texture",0),this.applyFogUniforms(l,t,r);let y=r.spec.terrain?.tint,v=y?.low===void 0&&y?.high!==void 0,w=y?.high!==void 0,x=w?fe(y.high)??[1,1,1,1]:[1,1,1,1],_=v?x:w?fe(y.low)??[1,1,1,1]:[1,1,1,1],M=y?.mid?fe(y.mid)??_:[0,1,2].map(A=>(_[A]+x[A])/2).concat(1),S=y?.range??[500,4e3],C=Math.min(Math.max((16-a)/3,0),1);l.setVec3("u_relief_low",_[0],_[1],_[2]),l.setVec3("u_relief_mid",M[0],M[1],M[2]),l.setVec3("u_relief_high",x[0],x[1],x[2]),l.setVec2("u_relief_range",S[0],S[1]),l.setVec3("u_relief_mix",(w?y.tint??.5:0)*C,(y?y.shade??.7:0)*(.35+.65*C),v?1:0);let k=r.light,[T,P,L]=Wt(k.keyAzimuth,k.keyAltitude);l.setVec3("u_relief_light",-T,-P,-L),g.vao.bind();for(let A of f){let R=this.terrain.targetOf(A.dataKey);R&&(this.terrain.apply(e,l,A),e.bindTexture(0,R.texture),l.setFloat("u_skirt",this.terrain.skirtMeters(A.z)),l.setFloat("u_tile_meters",Ft(A.z)),l.setMat4("u_matrix",t.tileMatrix(A,1)),c.drawElements(c.TRIANGLES,g.count,c.UNSIGNED_INT,0));}e.bindVAO(null);}applyTileMatrix(e,t,o,r){if(this.drapeTile){let n=this.drapeTile.terrain,a=Math.pow(2,n.z-o.z),s=2*a/r,l=2*(o.x*a-n.x)-1,c=1-2*(o.y*a-n.y);e.setMat4("u_matrix",new Float32Array([s,0,0,0,0,-s,0,0,0,0,0,0,l,c,0,1]));return}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??ro(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}et(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[n,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",n,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){if(this.drapeTile)return qi(this.drapeTile.terrain,r);if(this.terrain.enabled&&!this.terrain.covers(r))return false;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,N(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(zm/Math.max(t.pixelsPerMeter,1e-9),Om);return o-r}clipToTile(e,t){if(this.drapeTile){e.setStencilTest(false);return}let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Ki);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(Y);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Ki)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 s=this.fill;s.use(),s.setVec4("u_globe",0,0,0,0),s.setInt("u_material",0),s.setVec2("u_world_origin",0,0),s.setVec4("u_color",0,0,0,1),s.setFloat("u_elevation",0),this.quad.vao.bind();let l=0;for(let c of n)l++,this.stencilIds.set(c.dataKey,l),a.stencilFunc(a.ALWAYS,l,Ki),s.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||t.globeActive)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 s=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 l=new Float32Array(16);for(let c of n.visibleTiles){let u=t.tileMatrix(c,1);l.set(u);for(let f=0;f<4;f++)l[12+f]+=s*u[8+f];a.setMat4("u_matrix",l),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,true),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=Wt(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),u=fe(s.ambientColor),f=fe(s.keyColor),h=[0,0,0];for(let d=0;d<3;d++){let m=u[d]*s.ambientIntensity,b=f[d]*s.keyIntensity*c;h[d]=m>0?m/(m+b):1;}a.setVec3("u_shadow_ground",h[0],h[1],h[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)this.drapeTile&&!qi(this.drapeTile.terrain,d)||(a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),this.applyTileMatrix(a,t,d,1),this.terrain.apply(e,a,d),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));e.setBlend("premultiplied");}applyShadowUniforms(e,t=false){if(e.setInt("u_shadow_map",Yi),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let o=this.shadowTarget?.size??1,n=(t?.25*this.shadowTexelMeters:Math.max(this.shadows.bias,1.5*this.shadowTexelMeters))*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/o,n,1),e.setFloat("u_shadow_normal_offset",1.5*2/o);let a=fe(this.shadows.color);e.setVec3("u_shadow_color",a[0],a[1],a[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,n,a){let s=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};s();for(let l of o.layers){if(l.type==="raster"||l.type==="symbol"||l.type==="fill-extrusion"||!l.overlay||(l.overlay===true?"volume":l.overlay)!==a||!o.layerVisibleAt(l,n))continue;let c=r(l);if(c){if(l.type==="surface"){this.flattened(c,o,l)?this.drawFill(e,t,c,o,l,n):this.drawSurface(e,t,c,o,l,n),s();continue}l.type==="fill"?this.drawFill(e,t,c,o,l,n):this.drawLine(e,t,c,o,l,n);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=n=>{let a=(n+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o,r){if(e.setFloat("u_extent",o),this.terrain.apply(r,e,t),this.debugTiles){let[c,u,f]=this.tileTint(t);e.setVec4("u_tile_tint",c,u,f,Bm);}else e.setVec4("u_tile_tint",0,0,0,0);let n=Ft(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",n/o);let[a,s]=es(t.z,t.x,t.y);e.setVec2("u_world_origin",a/this.patternScale,s/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*n,l[1]-t.y*n,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Vm[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,s=N(a.materialStrength,o,1)*this.detailScale,l=N(a.materialScale,o,Nm[n]),c=N(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",s,l,c,this.materialTime),c>0&&s>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let s=this.fill,l=r.colorAt(n,a),c=N(n.paint?.opacity,a,1);if(c<=.001)return;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,n,a),s.setVec4v("u_color",Le([l[0],l[1],l[2],l[3]*c])),s.setFloat("u_opacity",c);let u=gt(n)!==null,f=r.bucketKeyFor(n);if(f!==null){for(let h of o.visibleTiles){if(!this.drawsTile(t,r,n,h))continue;let d=o.getTile(h),m=d&&this.bucketFor(e,d,f,$i,this.fillLocs,"fill");if(!m)continue;s.setFloat("u_data_color",u&&m.dataBuffer?1:0),this.clipToTile(e,h),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,m.extent)),this.applyTileScale(s,h,m.extent,e),this.applyTileMatrix(s,t,h,m.extent);let b=this.cutHidden(e,d,f,h.dataKey,m.buffer,this.replacedIds(),this.fillLocs,m.dataBuffer);b?(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0)):(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.indexCount,m.indexType,0));}s.setFloat("u_data_color",0),e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,s=0,l){let c=this.line,u=r.colorAt(n,a),f=N(n.paint.opacity,a,1)*(s||1),h=N(n.paint.width,a,1);if(f<=.001||h<=.01&&!n.paint.widthMeters)return;let d=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,b=t.width>0?d/t.width:1,p=N(n.paint.widthMeters,a,0),g=p>0?p*t.pixelsPerMeter*b/2:h/2*b;c.use(),this.applyShadowUniforms(c),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",Le([u[0],u[1],u[2],u[3]*f])),c.setFloat("u_opacity",f);let y=gt(n);c.setFloat("u_center_w",t.cameraToCenterDistance);let v=N(n.paint.offsetMeters,a,0),w=v!==0?v*t.pixelsPerMeter*b:N(n.paint.offset,a,0)*b,x=Math.max(N(n.paint.blur,a,0),0)*b,_=l!==void 0?Math.max(0,l)*(r.spec.levelHeight??0):0;c.setFloat("u_elevation",(N(n.paint.elevation,a,0)+_)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,m);let M=n.paint.dashArray,S=n.paint.dashMeters,C=n.paint.arrow===true,k=n.paint.arrowStyle,T=C&&(k==="head"||k==="headOnly"),P=C&&k==="dash";if(c.setInt("u_pattern",P?5:M||S?1:k==="headOnly"&&C?4:T?3:C?2:0),S){let[A,R]=S,I=t.pixelsPerMeter*b;c.setVec2("u_dash",A*I,(A+R)*I);}else if(M){let[A,R]=M;c.setVec2("u_dash",A*b,(A+R)*b);}if(C){let A=Fe(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Le(A));let R=N(n.paint.arrowPeriod,a,46)*b,I=N(n.paint.arrowSize,a,5)*b;if(P){let H=N(n.paint.arrowGap,a,24)*b,z=Math.max(R-H,1),E=Math.min(I,z),F=N(n.paint.arrowShaft,a,2)*b,B=N(n.paint.arrowHead,a,4)*b,O=N(n.paint.arrowOutline,a,0)*b;c.setVec4("u_arrow",F,E,B,z),c.setVec2("u_dash",O,R);}else T?c.setVec4("u_arrow",R,I,g,0):c.setVec4("u_arrow",R,Math.max(I*.4,1),Math.min(I,g*.72),0);}let L=r.bucketKeyFor(n);if(L!==null){for(let A of o.visibleTiles){if(!this.drawsTile(t,r,n,A))continue;let R=o.getTile(A);if(!R)continue;let I=n.network?l!==void 0?[at(n.id,l)]:(R.data?.levels??[]).map(H=>at(n.id,H)):[L];for(let H of I){let z=this.bucketFor(e,R,H,eu,this.lineLocs,"line");if(!z)continue;let E=z.dataBuffer?y:null;c.setFloat("u_data_color",E&&(E.color!==void 0||E.opacity!==void 0)?1:0),c.setFloat("u_data_width",E&&E.width!==void 0?1:0);let F=A.bounds(),B=(F.maxX-F.minX)*t.worldSize/z.extent*b;c.setFloat("u_tile_to_px",B);let O=B>1e-6?1/B:1;c.setFloat("u_half_width",g*O),c.setFloat("u_blur",x*O),c.setFloat("u_meters_to_units",t.pixelsPerMeter*O),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",N(n.paint.widthExtra,a,0)*O),c.setFloat("u_offset",w*O),c.setFloat("u_tile_per_px",O),c.setFloat("u_px_to_units",b*O),this.applyTileScale(c,A,z.extent,e),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(A,z.extent)),this.applyTileMatrix(c,t,A,z.extent);let W=this.cutHidden(e,R,H,A.dataKey,z.buffer,this.replacedIds(),this.lineLocs,z.dataBuffer);W?(W.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,W.count,e.gl.UNSIGNED_INT,0)):(z.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,z.indexCount,z.indexType,0));}}c.setFloat("u_data_color",0),c.setFloat("u_data_width",0);}}drawNetwork(e,t,o,r,n,a,s){let l=o.layers.filter(u=>u.type==="line"&&u.network===n&&s(u));if(!l.length)return;let c=new Set;for(let u of l){let f=r(u);if(f)for(let h of f.visibleTiles){let d=f.getTile(h);for(let m of d?.data?.levels??[])c.add(m);}}if(c.size)for(let u of [...c].sort((f,h)=>f-h))for(let f of l){let h=r(f);h&&this.drawLine(e,t,h,o,f,a,0,u);}}drawHighlight(e,t,o,r,n,a){let s=this.highlight;if(!s||!this.building||s.layerId!==n.id)return;let l=`${n.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=fe(s.color)??[.31,.79,.5,1],u=this.building;u.use(),this.applyShadowUniforms(u),this.applyFogUniforms(u,t,r),this.applyLight(u,r),u.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),u.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),u.setFloat("u_opacity",s.opacity),u.setFloat("u_ao_strength",N(n.paint.aoStrength,a,.4)),u.setFloat("u_tint_variation",0),u.setFloat("u_facade_detail",0),u.setFloat("u_ice",0),u.setFloat("u_window_glow",0),u.setFloat("u_roof_variation",0),u.setFloat("u_height_scale",N(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,so,so),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(so);let h=this.seams.stitched.has(s.featureId);h&&this.drawSeamHighlight(e,t,u,s.featureId);for(let d of h?[]:o.visibleTiles){let m=o.getTile(d);if(!m)continue;let b=m.data?.buckets?.[n.id];if(!b)continue;let p=d.dataKey,g=this.highlightGpu.get(p);if(g===void 0){let y=sn(m,n.id,s.featureId);if(y){let v=new de(e,new Uint8Array(y.vertices),lo),w=new he(e,y.indices);g={vao:new ue(e,[{buffer:v,locations:this.buildingLocs}],w),vbo:v,ibo:w,count:y.indices.length};}else g=null;this.highlightGpu.set(p,g);}g&&(this.applyTileScale(u,d,b.extent,e),this.shadowActive&&u.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,b.extent)),u.setMat4("u_matrix",t.tileMatrix(d,b.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),f.stencilOp(f.KEEP,f.KEEP,f.KEEP),f.stencilMask(255),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(l=>l.id===o.layerId),a=e.get(n?.source??Y);if(!a)return;let s=new ae;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),u=c?.data?.buckets?.[o.layerId];if(!c||!u)continue;let f=sn(c,o.layerId,o.featureId);f&&this.highlightTris.set(l.dataKey,Ii(f,u.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let s=r.layers.find(h=>h.id===n.layerId),l=s?o.get(s.source??Y):void 0;if(!s||!l)return;let c=n.bucketKey,u=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",Le([u[0],u[1],u[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,so,so),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(so);for(let h of l.visibleTiles){let d=l.getTile(h),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let b=this.fillHighlightFor(e,m,h,n.featureId,c);b&&(a.setMat4("u_matrix",t.tileMatrix(h,m.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),f.stencilOp(f.KEEP,f.KEEP,f.KEEP),f.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(h=>{h?.vao.destroy(),h?.ibo.destroy(),h?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),u=[];for(let h=0;h*3<l.length;h++)c[h]===r&&u.push(l[h*3],l[h*3+1],l[h*3+2]);let f=null;if(u.length){let h=new de(e,new Uint8Array(t.vertices),$i),d=new he(e,new Uint32Array(u));f={vao:new ue(e,[{buffer:h,locations:this.fillLocs}],d),vbo:h,ibo:d,count:u.length};}return this.fillHighlightGpu.set(a,f),f}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let s=this.surface,l=r.colorAt(n,a,[.7,.8,.7,1]),c=N(n.paint.opacity,a,1);if(c<=.001)return;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,n,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",N(n.paint.sideShade,a,.12));let u=n.elevation<(n.base??0),f=n.paint.sideColor?Fe(n.paint.sideColor,a,l):l;s.setVec3("u_side_color",f[0],f[1],f[2]),s.setFloat("u_side_light",N(n.paint.sideLight,a,u?1:0)),s.setFloat("u_relief",this.reliefScale);let h=r.bucketKeyFor(n);if(h===null)return;let d=c>=1&&!n.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[];for(let g of o.visibleTiles){if(!this.drawsTile(t,r,n,g))continue;let y=o.getTile(g),v=y&&this.bucketFor(e,y,h,ou,this.surfaceLocs,"surface");v&&m.push({id:g,bucket:v,cut:y?this.cutSurface(e,y,h,g.dataKey,v.buffer,this.replacedIds()):null});}let b=(g,y,v)=>{this.clipToTile(e,g),this.applyTileScale(s,g,y.extent,e),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(g,y.extent)),this.applyTileMatrix(s,t,g,y.extent),(v??y).vao.bind();},p=m.filter(({bucket:g,cut:y})=>y?y.capCount>0:g.capIndexOffset<g.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:g,bucket:y,cut:v}of p){b(g,y,v);let w=v?e.gl.UNSIGNED_INT:y.indexType,x=w===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,v?v.capCount:y.indexCount-y.capIndexOffset,w,(v?v.mainCount:y.capIndexOffset)*x);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:g,bucket:y,cut:v}of m)b(g,y,v),e.gl.drawElements(e.gl.TRIANGLES,v?v.mainCount:y.capIndexOffset,v?e.gl.UNSIGNED_INT:y.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,s){let l=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),u=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,f=N(n.paint.opacity,a,1);if(f<=.001)return false;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),l.setVec4v("u_wall_color",c),l.setVec4v("u_roof_color",u),l.setFloat("u_opacity",f),l.setFloat("u_ao_strength",N(n.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",N(n.paint.tintVariation,a,.07));let h=gt(n)!==null,d=(x,_)=>n.paint[x]?r.colorAt({...n,paint:{...n.paint,color:n.paint[x]}},a,_):_,m=d("windowColor",[.62,.71,.8,1]),b=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",m[0],m[1],m[2]),l.setVec3("u_window_frame",b[0],b[1],b[2]),l.setFloat("u_facade_detail",N(n.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",N(n.paint.windowGlow,a,0)),l.setFloat("u_floor_height",N(n.paint.floorHeight,a,3.2)),l.setFloat("u_window_variation",N(n.paint.windowVariation,a,1)),l.setFloat("u_seam_strength",N(n.paint.seamStrength,a,1)),l.setFloat("u_ice",N(n.paint.ice,a,0)),l.setFloat("u_window_recess",N(n.paint.windowRecess,a,.18)),l.setFloat("u_window_recess_shade",N(n.paint.windowRecessShade,a,.16)),l.setFloat("u_plinth_height",N(n.paint.plinthHeight,a,4)),l.setFloat("u_plinth_shade",N(n.paint.plinthShade,a,.14)),l.setFloat("u_roof_variation",N(n.paint.roofVariation,a,.3)),this.applyLight(l,r);let p=f>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let g=N(n.paint.heightScale,a,1),y=false,v=r.bucketKeyFor(n);if(v===null)return y;let w=(n.source??Y)===Y;w&&this.indoorMask.prepare(o,v);for(let x of o.visibleTiles){if(!this.drawsTile(t,r,n,x))continue;let _=o.getTile(x),M=_&&this.bucketFor(e,_,v,lo,this.buildingLocs,"fill-extrusion");if(!M)continue;l.setFloat("u_data_color",h&&M.dataBuffer?1:0);let S=this.growScale(M,s,!o.warm);S<1&&(y=true),l.setFloat("u_height_scale",S*g),this.applyTileScale(l,x,M.extent,e),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,M.extent)),l.setMat4("u_matrix",t.tileMatrix(x,M.extent));let k=this.cutHidden(e,_,v,x.dataKey,M.buffer,this.hiddenFor(v,w,x.dataKey),this.buildingLocs,M.dataBuffer)??(_&&w?this.indoorMask.indicesFor(e,_,v,x,M.buffer,this.buildingLocs):null);k?(k.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,k.count,e.gl.UNSIGNED_INT,0)):(M.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,M.indexCount,M.indexType,0));}return w&&(l.setFloat("u_data_color",0),this.drawSeams(e,t,l,g)),l.setFloat("u_data_color",0),y}drawSeamHighlight(e,t,o,r){for(let[n,{tile:a,mesh:s}]of this.seams.meshes){let l=`${n}\u241F${r}`,c=this.highlightGpu.get(l);if(c===void 0){let u=Di(s,r);if(u){let f=new de(e,new Uint8Array(u.vertices),lo),h=new he(e,u.indices);c={vao:new ue(e,[{buffer:f,locations:this.buildingLocs}],h),vbo:f,ibo:h,count:u.indices.length};}else c=null;this.highlightGpu.set(l,c);}c&&(this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[n,{tile:a,mesh:s}]of this.seams.meshes){let l=this.seamBucket(e,n,s);o.setFloat("u_height_scale",r),this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),l.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,0);}}seamBucket(e,t,o){let r=this.seamGpu.get(t);if(!r){let n=new de(e,new Uint8Array(o.vertices),lo),a=new he(e,new Uint32Array(o.indices)),s=new ue(e,[{buffer:n,locations:this.buildingLocs}],a);r=new hn(s,n,a,o.indexCount,e.gl.UNSIGNED_INT,o.extent),this.seamGpu.set(t,r);}return r}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}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?jm(Math.max(r,0)):1}applyLight(e,t){let o=t.light;et(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=Wt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),et(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[s,l,c]=Wt(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",s,l,c),et(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 s=t.buckets.get(o);if(s)return s;let l=t.data?.buckets?.[o];if(!l||l.kind==="symbol"||l.kind==="placement")return null;if(l.kind!==a)return Fm(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${l.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;if(this.uploadLeft<=0)return this.uploadDeferred=true,null;this.uploadLeft-=l.vertices.byteLength+l.indices.byteLength;let c=new de(e,new Uint8Array(l.vertices),r),u=new he(e,new Uint32Array(l.indices)),f=l.dataPaint?new de(e,new Uint8Array(l.dataPaint),tu):null,h=new ue(e,f?[{buffer:c,locations:n},{buffer:f,locations:n}]:[{buffer:c,locations:n}],u),d=new hn(h,c,u,u.count,u.type,l.extent,l.capIndexOffset??u.count,f);return t.buckets.set(o,d),d}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;}};mn.UPLOAD_BUDGET=15e5;var Qo=mn,dn=new D;function Gm(i,e){let r=new Float32Array(66306),n=0;for(let h=0;h<=128;h++){let d=(h/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[n++]=m/256*2*Math.PI-Math.PI,r[n++]=d;}let a=new Uint16Array(256*128*6),s=0;for(let h=0;h<128;h++)for(let d=0;d<256;d++){let m=h*257+d,b=m+256+1;a[s++]=m,a[s++]=m+1,a[s++]=b,a[s++]=m+1,a[s++]=b+1,a[s++]=b;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:uo,offset:0}]},c=new D([["a_lnglat",e.attribLocation("a_lnglat")]]),u=new de(i,r,l),f=new he(i,a);return {vao:new ue(i,[{buffer:u,locations:c}],f),vbo:u,ibo:f,count:a.length}}function Um(i,e){if(e.highColor){et(i,"u_high_color",e.highColor);return}let t=dn.get(e.skyColor);t||(t=fe(e.skyColor),dn.set(e.skyColor,t)),i.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function et(i,e,t){let o=dn.get(t);o||(o=fe(t),dn.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function Wt(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 jm(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var pn=1,Jo=class{constructor(e=1024){this.entries=new D;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+pn>this.size&&(this.shelfY+=this.shelfHeight+pn,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+pn>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 s=0;s<r;s++){let l=s*o,c=(a.y+s)*this.size+a.x;this.data.set(t.subarray(l,l+o),c);}return this.shelfX+=o+pn,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 bn=1,er=class{constructor(e=1024){this.images=new D;this.entries=new D;this.texture=null;this.dirty=true;this.shelfX=0;this.shelfY=0;this.shelfHeight=0;this.full=false;this.version=0;this.size=e,this.data=new Uint8Array(e*e*4);}has(e){return this.images.has(e)}get(e){return this.images.get(e)}list(){return [...this.images.keys()]}add(e,t,o={}){return this.images.has(e)?false:(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??1,sdf:o.sdf??false}),this.version++,true)}update(e,t,o={}){let r=this.images.get(e);return r?(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??r.pixelRatio,sdf:o.sdf??r.sdf}),this.entries.delete(e),this.version++,true):false}remove(e){return this.images.delete(e)?(this.entries.delete(e),this.version++,true):false}entryFor(e){let t=this.entries.get(e);if(t)return t;let o=this.images.get(e);if(!o||this.full)return null;let{width:r,height:n}=o;if(r>this.size||n>this.size)return null;if(this.shelfX+r+bn>this.size&&(this.shelfY+=this.shelfHeight+bn,this.shelfX=0,this.shelfHeight=0),this.shelfY+n+bn>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a=this.shelfX,s=this.shelfY;for(let c=0;c<n;c++){let u=c*r*4,f=((s+c)*this.size+a)*4;this.data.set(o.data.subarray(u,u+r*4),f);}this.shelfX+=r+bn,this.shelfHeight=Math.max(this.shelfHeight,n),this.dirty=true;let l={x:a,y:s,width:r,height:n};return this.entries.set(e,l),l}bind(e,t){let o=e.gl;this.texture||(this.texture=o.createTexture(),e.bindTexture(t,this.texture),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),e.bindTexture(t,this.texture),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.size,this.size,0,o.RGBA,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null;}};var Zi=.75,or=8,be=3,xt=24,fo=256,nu=255,tr=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new D;this.loaded=new ae;this.inflight=new D;}setUrl(e){e!==this.urlTemplate&&(this.urlTemplate=e,this.glyphs.clear(),this.loaded.clear());}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/fo))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/fo);if(r<=nu&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new ae;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/fo);n>nu||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*fo}-${e*fo+fo-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 iu(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 iu(i){let e=new Sf__default.default(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((s,l,c)=>{if(s!==3||!c)return;let u=c.readVarint()+c.pos,f={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((h,d,m)=>{m&&(h===1?f.id=m.readVarint():h===2?f.bitmap=m.readBytes():h===3?f.width=m.readVarint():h===4?f.height=m.readVarint():h===5?f.left=m.readSVarint():h===6?f.top=m.readSVarint():h===7&&(f.advance=m.readVarint()));},null,u),t.push(f);},null,a);},null),t}var Ym=.25,ho=1e20;function Qi(i,e,t){let o=e+be*2,r=t+be*2,n=o*r,a=new Float64Array(n),s=new Float64Array(n);a.fill(ho),s.fill(0);for(let c=0;c<t;c++)for(let u=0;u<e;u++){let f=i[c*e+u]/255,h=(c+be)*o+(u+be);if(f>=1)a[h]=0,s[h]=ho;else if(f>0){let d=.5-f;a[h]=d>0?d*d:0,s[h]=d<0?d*d:0;}else a[h]=ho,s[h]=0;}au(a,o,r),au(s,o,r);let l=new Uint8Array(n);for(let c=0;c<n;c++){let u=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Km(Math.round(255-255*(u/or+Ym)));}return {data:l,width:o,height:r}}function au(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),s=new Float64Array(o+1);for(let l=0;l<e;l++){for(let c=0;c<t;c++)r[c]=i[c*e+l];su(r,n,a,s,t);for(let c=0;c<t;c++)i[c*e+l]=n[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=i[l*e+c];su(r,n,a,s,e);for(let c=0;c<e;c++)i[l*e+c]=n[c];}}function su(i,e,t,o,r){t[0]=0,o[0]=-ho,o[1]=ho;for(let n=1,a=0;n<r;n++){let s=0;do{let l=t[a];s=(i[n]-i[l]+n*n-l*l)/(n-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=n,o[a]=s,o[a+1]=ho;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let s=t[a];e[n]=(n-s)*(n-s)+i[s];}}var Km=i=>i<0?0:i>255?255:i;var lu=48,rr=class{constructor(e={}){this.defs=e;this.sdfs=new D;this.pending=new ae;this.failed=new ae;}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(lu*(n>1?n:1))),s=Math.max(8,Math.round(lu/(n<1?n:1))),l=await $m(o,a,s);return this.sdfs.set(e,Qi(l,a,s)),!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 $m(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((f,h)=>{a.onload=()=>f(),a.onerror=()=>h(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 s=document.createElement("canvas");s.width=e,s.height=t;let l=s.getContext("2d",{willReadFrequently:!0});if(!l)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");l.clearRect(0,0,e,t),l.drawImage(a,0,0,e,t);let c=l.getImageData(0,0,e,t).data,u=new Uint8ClampedArray(e*t);for(let f=0;f<u.length;f++)u[f]=c[f*4+3];return u}finally{URL.revokeObjectURL(n);}}var Vt={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>',"frame-pin":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></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 8 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 1h2a2.5 2.5 0 0 1 2.5 2.5v11.5A2.5 2.5 0 0 1 5 17.5h-.1v3.9a.9.9 0 0 1-1.8 0v-3.9H3A2.5 2.5 0 0 1 .5 15V3.5A2.5 2.5 0 0 1 3 1zm1 2.6a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4z"/></svg>',traffic_light_pole:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x="3.1" y="15.5" width="1.8" height="5.9" rx=".9"/></svg>',traffic_light_body:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x=".5" y="1" width="7" height="16.5" rx="2.5"/></svg>',traffic_light_red:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="5.2" r="2"/></svg>',traffic_light_amber:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="9.7" r="2"/></svg>',traffic_light_green:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="14.2" r="2"/></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>'},qm={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(qm)){let t=Vt[e];t?Vt[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 Zm=1.2;function Ji(i,e,t=16,o=0){let r=Qm(i,t),n=[],a=[],s=0;for(let u of r){let f=0,h=0;for(let d of u){let m=d.codePointAt(0);if(m===void 0)continue;let b=e.get(m);b&&(f+=b.advance,h++);}h>1&&(f+=o*(h-1)),a.push(f),f>s&&(s=f);}if(s===0)return null;let l=xt*Zm,c=r.length*l;for(let u=0;u<r.length;u++){let f=-a[u]/2,h=-c/2+u*l+l/2;for(let d of r[u]){let m=d.codePointAt(0);if(m===void 0)continue;let b=e.get(m);b&&(b.width>0&&b.height>0&&b.bitmap&&n.push({glyph:b,x:f,y:h}),f+=b.advance+o);}}return n.length?{glyphs:n,width:s,height:c}:null}function Qm(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)}var Jm=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function ea(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=rp(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=n*s,c=o.fontSize?o.fontSize*.6:t/e.length,u=(o.fontSize??0)*.85,f=[],h=o.spacing??250,d=h>0&&h-t<h*.25?t+h*.25:h;if(o.accept&&o.atList){let b=[];for(let p of o.atList){if(b.length>=24)break;if(p<0||p+t>n)continue;let g=gn(i,r,e,t,p,c,a,u);if(!g)continue;let y={glyphs:g,path:g.map(v=>({x:v.x,y:v.y})),at:p};o.accept(y)&&b.push(y);}return b}if(o.accept)return ep(i,r,e,t,d,c,a,u,o.accept,o.offset??0,o.keepAt??[]);if(d>0&&l>=t+d){let b=Math.min(Math.floor((l-t)/d)+1,24),p=t+d*(b-1),g=(l-p)/2;for(let y=0;y<b;y++,g+=d){let v=g/s,w=gn(i,r,e,t,v,c,a,u);w&&f.push({glyphs:w,path:w.map(x=>({x:x.x,y:x.y})),at:v});}if(f.length)return f}let m=(n-t)/2;for(let b of Jm){let p=m+m*b,g=gn(i,r,e,t,p,c,a,u);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:p}];if(m===0)break}return []}function ep(i,e,t,o,r,n,a,s,l,c,u){let f=e[e.length-1],h=Math.max(o/3,r/8,12),d=[],m=[],b=g=>{if(g<0||g+o>f)return false;for(let w of m)if(Math.abs(w-g)<r)return false;let y=gn(i,e,t,o,g,n,a,s);if(!y)return false;let v={glyphs:y,path:y.map(w=>({x:w.x,y:w.y})),at:g};return l(v)?(d.push(v),m.push(g),true):false};for(let g of u){if(d.length>=24)break;b(g-c);}let p=(-c%h+h)%h;for(let g=p;g+o<=f&&!(d.length>=24);g+=h)b(g);return d}function gn(i,e,t,o,r,n,a,s){if(r<0||r+o>e[e.length-1]||!tp(i,e,r,r+o,n,a))return null;let l=nr(i,e,r),c=nr(i,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return cu(i,e,t,r,s);let u=e[e.length-1];return cu([...i].reverse(),np(e),t,u-(r+o),s)}function tp(i,e,t,o,r,n){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<i.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let u=Math.atan2(i[l].y-i[l-1].y,i[l].x-i[l-1].x),f=Math.atan2(i[l+1].y-i[l].y,i[l+1].x-i[l].x),h=Math.abs((f-u)*180/Math.PI+540)%360-180,d=Math.abs(h);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>n)return false}return true}function cu(i,e,t,o,r){let n=[];for(let c of t){let u=uu(i,e,o+c.offset,c.width);if(!u)return null;n.push(u);}if(!n.length)return null;if(r<=0)return n;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let f=Math.abs(op(n[c].angle,n[c-1].angle))*(Math.PI/180);l+=r*2*Math.tan(Math.min(f,Math.PI/3)/2);}s=o+t[c].offset+l;let u=uu(i,e,s,t[c].width);if(!u)return null;a.push(u);}return a}function uu(i,e,t,o){let r=nr(i,e,t+o/2);if(!r)return null;let n=nr(i,e,t),a=nr(i,e,t+o);if(!n||!a)return r;let s=a.x-n.x,l=a.y-n.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function op(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function rp(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 np(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function nr(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],s=i[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*n,y:a.y+c*n,angle:Math.atan2(c,l)*180/Math.PI}}var oa=20,fu={stride:oa,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}]},ap=220,sp=.15;function hu(i,e){if(!Number.isFinite(e.far))return 1;let t=Math.max(e.far-e.near,1),o=e.near+t*sp,r=(i-o)/Math.max(e.far-o,1);return r<=0?1:r>=1?0:1-r*r*(3-2*r)}var ir=192,It=64,ta=2,lp=1.22,cp=128,up=.7;function fp(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return N(o,e,0)*xt;let r=N(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*up/(t/xt)}var hp=256,dp=200,mp="frame-circle",pp="frame-pin",bp=10.29/24;function gp(i,e,t,o,r){let n=-r,a=-r,s=o.width+r,l=o.height+r,c=[],u=0;for(let f=0;f+1<i.length;f++){let h=i[f],d=i[f+1],m=Math.hypot(d.x-h.x,d.y-h.y);if(Math.max(h.x,d.x)>=n&&Math.min(h.x,d.x)<=s&&Math.max(h.y,d.y)>=a&&Math.min(h.y,d.y)<=l&&m>0){let p=Math.max(0,Math.ceil((u-t)/e)),g=Math.floor((u+m)/e);for(let y=p;y<=g;y++){let v=y*e;if(v>=0&&c[c.length-1]!==v&&c.push(v),c.length>=yp)return c}}u+=m;}return c}var yp=32;function vp(i,e){let t=0,o=1/0,r=0;for(let n=0;n+1<i.length;n++){let a=i[n].x,s=i[n].y,l=i[n+1].x-a,c=i[n+1].y-s,u=Math.hypot(l,c);if(u>0){let f=Math.min(Math.max(((e.x-a)*l+(e.y-s)*c)/(u*u),0),1),h=Math.hypot(e.x-(a+l*f),e.y-(s+c*f));h<o&&(o=h,r=t+u*f);}t+=u;}return o<=50?r:null}function yu(i){return !i.allowOverlap&&!i.ignorePlacement}function du(i){return yu(i)||!i.allowOverlap&&i.placementGroup!==void 0}function mu(i){return yu(i)?void 0:i.placementGroup}function pu(i,e){return e<=0?i:{x1:i.x1+e,y1:i.y1+e,x2:i.x2-e,y2:i.y2-e}}function wp(i){return i==="circle"?mp:i==="pin"?pp:null}var xp=["left","right","top"];function _p(i,e){return !e||i[0]===e||!i.includes(e)?i:[e,...i.filter(t=>t!==e)]}var mo=class mo{constructor(e,t){this.shader=null;this.locations=new D;this.atlas=new Jo(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.missingImage=null;this.askedImages=new Set;this.images=new er;this.highlightFootprint=null;this.elevationAt=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.lineAnchors=new D;this.lastSide=new D;this.lineAt=new D;this.lineAtNow=new D;this.sideNow=new D;this.fog={near:0,far:1/0,intensity:0,cutoff:1/0};this.tr=null;this.shownAt=new D;this.fading=false;this.styleOrder=new D;this.layersById=new D;this.glyphs=new tr(e,t),this.icons=new rr(Vt);}setGlyphsUrl(e){this.glyphs.setUrl(e);}setMissingImage(e){this.missingImage=e,this.askedImages.clear();}init(e){this.shader=new pe(e,"symbol",Ic,Lc);for(let t of fu.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.text}|${e.mercX.toFixed(6)}|${e.mercY.toFixed(6)}`}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}rememberedAt(e,t,o){let r=this.lineAt.get(e),n=this.tr;if(!r||!r.length||!n)return [];let a=[];for(let s=0;s+1<r.length;s+=mo.LINE_MARK){let l=n.worldPxToPoint(r[s]*n.worldSize,r[s+1]*n.worldSize);if(!l)continue;let c=vp(t,l);c!==null&&a.push(Math.max(0,c-o/2));}return a}rememberAt(e,t){let o=this.tr;if(!o||!t.length)return;let r=this.lineAtNow.get(e);r||(r=[],this.lineAtNow.set(e,r));for(let n of t){let a=o.pointToWorldPx(n);r.push(a.x/o.worldSize,a.y/o.worldSize);}}withinLayout(e){let t=this.padding;return e.x2>t.left-ir&&e.y2>t.top-ir&&e.x1<this.viewport.width-t.right+ir&&e.y1<this.viewport.height-t.bottom+ir}depthFadeAt(e,t){let o=this.tr;if(!o||!Number.isFinite(this.fog.far))return 1;let r=o.pointToWorldPx({x:e,y:t}),[n,a,s]=o.cameraPositionPx;return hu(Math.hypot(r.x-n,r.y-a,s),this.fog)}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)/ap;return r<1?(this.fading=true,r):1}order(e){let t=e.length,o=new Float64Array(t);for(let a=0;a<t;a++){let s=e[a];o[a]=s.priority+(this.stickyKeys.has(s.key)?dp:0);}let r=new Int32Array(t);for(let a=0;a<t;a++)r[a]=a;r.sort((a,s)=>{let l=o[s]-o[a];if(l!==0)return l;let c=e[a],u=e[s];return c.mercY!==u.mercY?c.mercY-u.mercY:c.mercX-u.mercX});let n=new Array(t);for(let a=0;a<t;a++)n[a]=e[r[a]];for(let a=0;a<t;a++)e[a]=n[a];}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(o=>mo.keyOf(o)));let e=this.lastSide;this.lastSide=this.sideNow,e.clear(),this.sideNow=e;let t=this.lineAt;this.lineAt=this.lineAtNow,t.clear(),this.lineAtNow=t;for(let o of [...this.shownAt.keys()])this.stickyKeys.has(o)||this.shownAt.delete(o);}render(e,t,o,r){var d,m;let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},this.tr=t,!n)return;let a=t.zoom,s=r.layers.filter(b=>b.type==="symbol"&&r.layerVisibleAt(b,a));if(!s.length)return;let l=this.collect(t,o,r,s);if(!l.length)return;this.now=performance.now(),this.fading=false,this.lineAnchors.clear(),this.order(l);let c=new D,u=new D,f=new D;s.forEach((b,p)=>f.set(b.id,p)),this.layersById.clear();for(let b of r.layers)b.type==="symbol"&&this.layersById.set(b.id,b);let h=0;for(let b of l){let p=this.place(b,a,c);if(!p)continue;this.placed.push({layerId:b.layer.id,text:b.text,icon:b.icon,mercX:b.mercX,mercY:b.mercY,box:p.box,order:f.get(b.layer.id)??0});let g=u.get(b.layer.id);g||u.set(b.layer.id,g={layer:b.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],partVerts:[],partTexs:[]}),g.verts.push(...p.verts),g.texs.push(...p.texs),g.iconVerts.push(...p.iconVerts),g.iconTexs.push(...p.iconTexs),g.imageVerts.push(...p.imageVerts),g.imageTexs.push(...p.imageTexs),g.frameVerts.push(...p.frameVerts),g.frameTexs.push(...p.frameTexs);for(let y=0;y<p.partVerts.length;y++)p.partVerts[y]?.length&&(((d=g.partVerts)[y]??(d[y]=[])).push(...p.partVerts[y]),((m=g.partTexs)[y]??(m[y]=[])).push(...p.partTexs[y]));h+=p.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),h&&(this.styleOrder=f,this.draw(e,t,u,h,a));}collect(e,t,o,r){let n=[],a=ir,s=this.padding,l=ro(e,o),c=l.far;this.fog=l;let[u,f,h]=e.cameraPositionPx;for(let d of r){let m=(d.layout?.priority??0)*hp,b=t.get(d.source??Y);if(!b)continue;let p=d.layout?.showFor==="highlight",g=d.layout?.placement==="map",{shift:y,drop:v}=g?wu(d,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let w=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,x=o.bucketKeyFor(d);if(x!==null)for(let _ of b.visibleTiles){let S=b.getTile(_)?.data?.buckets?.[x];if(!S||!tn(S))continue;let C=new Int16Array(S.anchors),k=new Uint8Array(S.priorities),T=S.rotations?new Int16Array(S.rotations):null,P=S.lines?new Int16Array(S.lines):null,L=S.lineStarts?new Uint32Array(S.lineStarts):null,A=_.bounds(),R=e.worldSize,I=(A.maxX-A.minX)*R/S.extent,H=A.minX*R,z=A.minY*R;for(let E=0;E<k.length;E++){let F=H+C[E*2]*I,B=z+C[E*2+1]*I,O=Math.hypot(F-u,B-f,h);if(c!==1/0&&O>c||p&&!vt(this.highlightFootprint,F/R,B/R,w))continue;let W=F,V=B;if(g&&T){let te=T[E]*Math.PI/180,Z=y;W-=Math.sin(te)*Z,V+=Math.cos(te)*Z;}let j=this.elevationAt?this.elevationAt(F/R,B/R):0,G=e.worldPxToPoint(W,V,j),ee=P&&L?Mp(e,P,L,E,H,z,I,this.elevationAt):void 0,le=d.layout?.textPlacement==="line";if(le){if(!ee)continue}else if(!G||G.x<s.left-a||G.y<s.top-a||G.x>e.width-s.right+a||G.y>e.height-s.bottom+a)continue;let K=F/R,U=B/R,ne=S.texts[E]??"";n.push({key:mo.keyOf({layerId:d.id,text:ne,mercX:K,mercY:U}),layer:d,screenX:G?G.x:ee[0].x,screenY:(G?G.y:ee[0].y)+v,text:ne,icon:S.icons[E]??"",priority:k[E]+m,rotate:xu(d,T,E,e.bearing),mercX:K,mercY:U,depth:le?1:hu(O,l),line:ee});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=e.key;if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now)*e.depth,s=this.hoverKey!==null&&this.hoverKey===n,l=N(r.textSize,t,13),c=N(r.iconSize,t,16),u=r.iconTextGap??5,[f,h]=r.offset??[0,0],d=r.placement==="map",m=null,b=null;if(e.icon&&!d&&this.images.has(e.icon)){let ie=this.images.get(e.icon);if(ie.sdf){let J=`image:${e.icon}`,q=this.atlas.get(J);if(!q){let ke=new Uint8Array(ie.width*ie.height);for(let xe=0;xe<ke.length;xe++)ke[xe]=ie.data[xe*4+3];q=this.atlas.add(J,ke,ie.width,ie.height)??void 0;}q&&(m=q);}else b=this.images.entryFor(e.icon),b&&(m=b);}if(e.icon&&!d&&!m&&!b){this.icons.isDefined(e.icon)||(this.missingImage&&!this.askedImages.has(e.icon)&&(this.askedImages.add(e.icon),this.missingImage(e.icon)),e.icon="dot");let ie=`icon:${e.icon}`,J=this.atlas.get(ie);if(!J){let q=this.icons.get(e.icon);q?J=this.atlas.add(ie,q.data,q.width,q.height)??void 0:this.pendingIcons.add(e.icon);}J&&(m=J);}let p=m&&!d?r.iconParts??[]:[],g=[];for(let ie of p){let J=`icon:${ie}`,q=this.atlas.get(J);if(!q){let ke=this.icons.get(ie);ke?q=this.atlas.add(J,ke.data,ke.width,ke.height)??void 0:this.pendingIcons.add(ie);}g.push(q??null);}let y=g.length>0&&g.every(ie=>ie!==null),v=null,w=m?wp(r.iconFrame):null;if(w){let ie=`icon:${w}`,J=this.atlas.get(ie);if(!J){let q=this.icons.get(w);q?J=this.atlas.add(ie,q.data,q.width,q.height)??void 0:this.pendingIcons.add(w);}J&&(v=J);}let x=v?Math.max(r.iconFrameScale??1.6,1):1,_=v?c*x:0,M=v?_*(v.height-be*2)/Math.max(v.width-be*2,1):0,S=v&&r.iconFrame==="pin"?bp:.5,C=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),C=Ji(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,fp(e.layer,t,l)),!C&&!m)||!C&&!m)return null;let k=l/xt,T=C?C.width*k:0,P=C?C.height*k:0,L=ta+(r.collisionPadding??0),A=this.stickyKeys.has(n)?L-ta:0;if(e.layer.layout?.textPlacement==="line")return C&&e.line?this.placeOnLine(e,C,k,P,o,a,A):null;let R=r.iconPlacement??"top",I=R==="auto"&&m&&C?_p(xp,this.lastSide.get(n)):[R],H=m?m.width/Math.max(m.height,1):1,z=null;for(let ie of I){let J=ie==="behind"&&!!m&&!!C,q=ie==="top"&&!!m&&!!C,ke=J?P+u*2:c,xe=m?ke*H:0,Ge=Math.max(xe,_),We=Math.max(ke,M),ce=J?Math.max(xe,T+u*2):q?Math.max(Ge,T):Ge+(m&&C?u:0)+T,Ae=J?Math.max(ke,P):q?We+u+P:Math.max(m?We:0,P),ot=S===.5||!m?0:q?We-Ae/2:We/2,wo=m&&C&&!J&&!q?(ce/2-Ge/2)*(ie==="right"?-1:1):0,Ke=e.screenX+f+wo,Ut=e.screenY+h-ot,Wn={x1:Ke-ce/2-L,y1:Ut-Ae/2-L,x2:Ke+ce/2+L,y2:Ut+Ae/2+L};if(this.withinLayout(Wn)&&!(!r.allowOverlap&&bu(o,pu(Wn,A),r.placementGroup))){z={behind:J,stacked:q,iconFirst:ie!=="right",iconW:xe,iconH:ke,blockW:Ge,blockH:We,totalW:ce,totalH:Ae,cx:Ke,cy:Ut,box:Wn},this.sideNow.set(n,ie);break}}if(!z)return null;let{behind:E,stacked:F,iconFirst:B,iconW:O,iconH:W,blockW:V,blockH:j,totalW:G,totalH:ee,cx:le,cy:K,box:U}=z;du(r)&&gu(o,U,mu(r));let ne=[],te=[],Z=[],se=[],me=[],ge=[],Ce=[],Se=[],_e=[],Me=[],Te=0,Ne=le-G/2,st=F?(j+u)/2:0,lt=j*(S-.5),Be=1/0,tt=1/0,Mr=-1/0,vo=-1/0;if(C){let ie=F||E?le:Ne+(m&&B?V+u:0)+T/2;for(let J of C.glyphs){let q=J.glyph,ke=`g:${q.id}`,xe=this.atlas.get(ke);if(!xe&&(!q.bitmap||(xe=this.atlas.add(ke,q.bitmap,q.width+be*2,q.height+be*2)??void 0,!xe)))continue;let Ge=ie+(J.x+q.left-be)*k,We=K+st+(J.y-q.top-be)*k,ce=xe.width*k,Ae=xe.height*k;yn(ne,te,Ge,We,ce,Ae,xe,0,a),Te++;let ot=be*k;Be=Math.min(Be,Ge+ot),tt=Math.min(tt,We+ot),Mr=Math.max(Mr,Ge+ce-ot),vo=Math.max(vo,We+Ae-ot);}if(m&&tt<1/0&&!E){let J=F?K-ee/2+j+u-tt:K+lt-(tt+vo)/2;if(J!==0){for(let q=1;q<ne.length;q+=4)ne[q]+=J;tt+=J,vo+=J;}}}if(m){let ie=s&&!E?lp:1,J=O*ie,q=W*ie,xe=(F?le-O/2:Ne+(B?0:G-V)+(V-O)/2)-(J-O)/2,Ge=(F?K-ee/2+(j-W)/2:K-W/2)+lt-(q-W)/2;if(v){let ce=_*ie,Ae=M*ie,ot=xe+J/2-ce/2,wo=Ge+q/2-Ae*S,Ke=be/Math.max(v.width-be*2,1)*ce,Ut=be/Math.max(v.height-be*2,1)*Ae;yn(Ce,Se,ot-Ke,wo-Ut,ce+Ke*2,Ae+Ut*2,v,0,a),Te++;}if(E&&Mr>Be){let ce=u*1.6,Ae=u;J=(Mr-Be+ce*2)*ie,q=(vo-tt+Ae*2)*ie,xe=Be-ce,Ge=tt-Ae;}let We=(ce,Ae,ot,wo=true)=>{let Ke=wo?be/Math.max(ce.height-be*2,1)*q:0;yn(Ae,ot,xe-Ke,Ge-Ke,J+Ke*2,q+Ke*2,ce,e.rotate,a),Te++;};if(b)We(b,me,ge,false);else if(y&&!E)for(let ce=0;ce<g.length;ce++)We(g[ce],_e[ce]??(_e[ce]=[]),Me[ce]??(Me[ce]=[]));else We(m,Z,se);}return Te?{verts:ne,texs:te,iconVerts:Z,iconTexs:se,imageVerts:me,imageTexs:ge,frameVerts:Ce,frameTexs:Se,partVerts:_e,partTexs:Me,quads:Te,box:U}:null}placeOnLine(e,t,o,r,n,a,s){let l=e.line,c=t.glyphs.map(L=>({offset:(L.x+t.width/2)*o,width:Math.max(L.glyph.advance,1)*o})),u=c.length?c[c.length-1].offset+c[c.length-1].width:0,f=e.layer.layout??{},h=[],d=[],m=[],b=0,p=r/2+ta,g=Math.max(f.symbolSpacing??250,u+1),y=`${e.layer.id}|${e.text}`,v=L=>{let A=L.path.map(z=>({x1:z.x-p,y1:z.y-p,x2:z.x+p,y2:z.y+p})),R=this.lineAnchors.get(y);if(R&&g>0){let z=L.path[L.path.length>>1];for(let E=0;E+1<R.length;E+=2)if(Math.hypot(z.x-R[E],z.y-R[E+1])<g)return false}for(let z of A)if(!this.withinLayout(z)||!f.allowOverlap&&bu(n,pu(z,s),f.placementGroup))return false;if(du(f))for(let z of A)gu(n,z,mu(f));m.push(...A);let I=L.path[L.path.length>>1],H=this.lineAnchors.get(y);return H?H.push(I.x,I.y):this.lineAnchors.set(y,[I.x,I.y]),true},w=-1/0,x=1/0;for(let L of t.glyphs)L.glyph.height<=0||(w=Math.max(w,L.glyph.top),x=Math.min(x,L.glyph.top-L.glyph.height));let _=Number.isFinite(w)?(w+x)/2*o:0,M=gp(l,g,u,this.viewport,cp);if(!M.length)return null;let S=this.rememberedAt(e.key,l,u),C=ea(l,c,u,{fontSize:xt*o,atList:S.length?S:M,accept:v});if(!C.length)return null;let k=this.lineAt.get(e.key);S.length&&k?this.lineAtNow.set(e.key,k):this.rememberAt(e.key,C.map(L=>L.path[L.path.length>>1]));for(let L of C){let A=L.path[L.path.length>>1]??L.glyphs[0],R=a*this.depthFadeAt(A.x,A.y);for(let I=0;I<t.glyphs.length;I++){let H=t.glyphs[I].glyph,z=L.glyphs[I],E=`g:${H.id}`,F=this.atlas.get(E);if(!F&&(!H.bitmap||(F=this.atlas.add(E,H.bitmap,H.width+be*2,H.height+be*2)??void 0,!F)))continue;let B=F.width*o,O=F.height*o,W=(H.height/2-H.top)*o+_,V=z.angle*Math.PI/180;yn(h,d,z.x-B/2-Math.sin(V)*W,z.y-O/2+Math.cos(V)*W,B,O,F,z.angle,R),b++;}}if(!b)return null;let T=m.map(L=>(L.x1+L.x2)/2),P=m.map(L=>(L.y1+L.y2)/2);return {verts:h,texs:d,iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],partVerts:[],partTexs:[],quads:b,box:{x1:Math.min(...T)-p,y1:Math.min(...P)-p,x2:Math.max(...T)+p,y2:Math.max(...P)+p}}}colorOf(e,t,o,r){if(e&&typeof e=="object"&&"from"in e){let n=e,a=this.layersById.get(n.from),s=Fe(a?.paint?.[t],o,r),l=1-Math.min(Math.max(n.darken??0,0),1);return [s[0]*l,s[1]*l,s[2]*l,s[3]]}return Fe(e,o,r)}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,s=e.gl;this.ensureBuffers(e,r);let l=this.vbo,c=this.vao;if(!l||!c||!this.ibo)return;let u=new ArrayBuffer(r*4*oa),f=new Float32Array(u),h=new Uint16Array(u),d=[],m=0,b=(p,g,y,v,w)=>{let x=p.length/16;if(x){d.push({layer:y,role:v,first:m/4*6,count:x*6,part:w});for(let _=0;_<x*4;_++){let M=m*5;f[M]=p[_*4],f[M+1]=p[_*4+1],h[M*2+4]=g[_*2],h[M*2+5]=g[_*2+1],f[M+3]=p[_*4+2],f[M+4]=p[_*4+3],m++;}}};for(let p of this.inStyleOrder(o)){b(p.frameVerts,p.frameTexs,p.layer,"frame");for(let g=0;g<p.partVerts.length;g++)b(p.partVerts[g]??[],p.partTexs[g]??[],p.layer,"part",g);b(p.iconVerts,p.iconTexs,p.layer,"icon"),b(p.imageVerts,p.imageTexs,p.layer,"image"),b(p.verts,p.texs,p.layer,"text");}l.update(new Uint8Array(u)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),this.images.bind(e,1),a.setInt("u_images",1),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Zi),a.setFloat("u_dpr",t.width>0?s.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let p of d){let g=p.layer.paint,y=N(g.opacity,n,1),v=p.role==="image";a.setFloat("u_image_mode",v?1:0),a.setFloat("u_image_opacity",y),a.setFloat("u_atlas_size",v?this.images.size:this.atlas.size);let w=p.role==="icon",x=p.role==="frame",_=p.role==="part"?(p.layer.paint.partColors??[])[p.part??0]??p.layer.paint.iconColor??p.layer.paint.color:void 0,M=(A,R,I)=>x?R??A??I:w?A??I:I,S=this.colorOf(p.role==="part"?_:x?g.frameColor??g.haloColor??g.color:M(g.iconColor,void 0,g.color),x?"haloColor":"color",n,[.15,.15,.15,1]),C=x?g.frameHaloColor:M(g.iconHaloColor,void 0,g.haloColor),k=C===void 0&&x,T=this.colorOf(C??(x?g.iconColor??g.color:g.haloColor),k?"color":"haloColor",n,[1,1,1,1]);x&&g.frameHaloColor===void 0&&(T[3]*=.35),x&&(S[3]*=N(g.frameOpacity,n,1));let P=N(p.role==="part"?(g.partHaloWidths??[])[p.part??0]??0:x?g.frameHaloWidth??1.1:M(g.iconHaloWidth,void 0,g.haloWidth),n,p.role==="part"?0:1.2),L=N(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",Le([S[0],S[1],S[2],S[3]*y])),a.setVec4v("u_halo_color",Le([T[0],T[1],T[2],T[3]*y])),a.setFloat("u_halo",P/(or*(L/xt))),s.drawElements(s.TRIANGLES,p.count,s.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 de(e,new Uint8Array(this.capacityQuads*4*oa),fu,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 he(e,o),this.vao=new ue(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;}};mo.LINE_MARK=2;var po=mo;function yn(i,e,t,o,r,n,a,s=0,l=1){let c=n/Math.max(a.height,1);if(s){let u=s*Math.PI/180,f=Math.cos(u),h=Math.sin(u),d=t+r/2,m=o+n/2;for(let[b,p]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let g=b-d,y=p-m;i.push(d+g*f-y*h,m+g*h+y*f,c,l);}}else i.push(t,o,c,l,t+r,o,c,l,t+r,o+n,c,l,t,o+n,c,l);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 Mp(i,e,t,o,r,n,a,s){if(o+1>=t.length)return;let l=t[o],c=t[o+1],u=[];for(let f=l;f<c;f++){let h=r+e[f*2]*a,d=n+e[f*2+1]*a,m=s?s(h/i.worldSize,d/i.worldSize):0,b=i.worldPxToPoint(h,d,m);if(!b)break;u.push(b);}return u.length>=2?u:void 0}var vu=(i,e)=>i*4096+e;function bu(i,e,t){let o=Math.floor(e.x1/It),r=Math.floor(e.y1/It),n=Math.floor(e.x2/It),a=Math.floor(e.y2/It);for(let s=o;s<=n;s++)for(let l=r;l<=a;l++){let c=i.get(vu(s,l));if(c){for(let u of c)if(!(u.group!==void 0&&u.group!==t)&&e.x1<u.x2&&e.x2>u.x1&&e.y1<u.y2&&e.y2>u.y1)return true}}return false}function gu(i,e,t){let o=Math.floor(e.x1/It),r=Math.floor(e.y1/It),n=Math.floor(e.x2/It),a=Math.floor(e.y2/It);for(let s=o;s<=n;s++)for(let l=r;l<=a;l++){let c=vu(s,l),u=i.get(c);u||i.set(c,u=[]),u.push(t===void 0?e:{...e,group:t});}}function wu(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=N(i.layout?.arrowLength,e,50)*r;return {shift:N(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function xu(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var Lt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new D;}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 Cp=[["\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."]],_u=new Map(Cp);function ra(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=_u.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=>_u.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function ia(i,e){let t=[],o=[],r=[],n=[],a=[],s=e.textPlacement==="line",l=[],c=[],u=[];for(let f of i.features()){if(!we(e.filter,f.properties))continue;let h=f.loadGeometry(),d=kp(f.type,h);if(!d)continue;let m=e.textField?na(e.textField,f.properties):"",b=m&&e.abbreviate?ra(m):m,p=e.iconImage?na(e.iconImage,f.properties):"";if(!(!b&&!p)){if(s){let g=Tp(f.type,h);if(!g)continue;u.push({text:b,line:g});continue}t.push(d[0],d[1]),o.push(b),r.push(p),n.push(Ep(f.properties)),a.push(e.iconRotate&&Math.round(Number(f.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:f,line:h}of Sp(u)){c.push(l.length/2);for(let d of h)l.push(d);t.push(Math.round(h[0]),Math.round(h[1])),o.push(f),r.push(""),n.push(128),a.push(0);}c.push(l.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Sp(i){let e=[],t=new Map,o=new Map,r=(n,a,s)=>`${n}\u241F${a}\u241F${s}`;for(let{text:n,line:a}of i){let s=r(n,a[0],a[1]),l=r(n,a[a.length-2],a[a.length-1]),c=t.get(l),u=o.get(s);if(u!==void 0){let f=e[u];if(f.line.push(...a.slice(2)),o.delete(s),o.set(r(n,f.line[f.line.length-2],f.line[f.line.length-1]),u),c!==void 0&&c!==u){let h=e[c];f.line.push(...h.line.slice(2)),h.line=[],t.delete(l),o.set(r(n,f.line[f.line.length-2],f.line[f.line.length-1]),u);}continue}if(c!==void 0){let f=e[c];f.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(n,f.line[0],f.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function Tp(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 kp(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,s=0,l=0;for(let c of e)for(let u=0;u+3<c.length;u+=2){let f=c[u+2]-c[u],h=c[u+3]-c[u+1],d=f*f+h*h;d>a&&(a=d,s=c[u]+f/2,l=c[u+1]+h/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>n&&(n=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Ep(i){let e=i.importance;if(typeof e=="number"&&isFinite(e))return Math.max(0,255-Math.min(Math.max(e,1),9)*20);let t=i.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function na(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(s,l)=>{let c=e[l];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function Mu(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&we(e,n.properties))for(let a of n.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Ap(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}function ar(i,e){let t={},o=[],r={},n=new Set,a=[],l=e.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&e.plan.some(c=>c.type==="line"&&c.ground)?bi(e.metersPerTile):void 0;for(let c of e.plan){if(!Fp(c,e.zoom,e.sourceMaxZoom))continue;let u=i.layers[c.sourceLayer];if(!u)continue;let f=zp(e.zoom,u.extent);try{if(c.splitBy){let d=Op(u,c.splitBy,c.filter);if(!d.length)continue;let m=r[c.splitBy]??(r[c.splitBy]=[]);for(let b of d){m.includes(b)||m.push(b);let p={...c,splitBy:void 0,filter:Dp(c.filter,c.splitBy,b)},g=aa(p,u,f,e.metersPerTile,e.zoom,l,void 0,o,e.tile);g&&(t[at(c.id,b)]=g);}continue}if(c.network&&c.type==="line"){for(let d of Hp(u,c.filter)){let m=aa(c,u,f,e.metersPerTile,e.zoom,l,d,o,e.tile);m&&(t[at(c.id,d)]=m,n.add(d));}continue}let h=aa(c,u,f,e.metersPerTile,e.zoom,l,void 0,o,e.tile);h&&(t[c.id]=h);}catch(h){a.push(`${c.id}: ${h instanceof Error?h.message:String(h)}`);}}return {buckets:t,seams:o,splits:r,levels:[...n].sort((c,u)=>c-u),failed:a}}async function Cu(i,e){let t=performance.now(),o=Ap(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(p,g,y,v,w=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:v,parseMs:w},diag:{status:p,bytes:g,layers:y,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(),s=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],s);let l=performance.now(),c=new dt(a),u=Object.keys(c.layers),{buckets:f,seams:h,splits:d,levels:m,failed:b}=ar(c,i);return {type:"loaded",id:i.id,raw:a,buckets:f,...h.length?{seams:h}:{},...Object.keys(d).length?{splits:d}:{},...m.length?{levels:m}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:u,built:Object.keys(f).length,...b.length?{failed:b}:{}}}}function Rp(i){return e=>{let t=e.lift,o=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return Number.isFinite(o)?Math.max(0,o):Math.max(0,Ye(e))*i}}function Ip(i){let e=i.lift,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;return !Number.isFinite(t)||t===0?null:()=>t}function Lp(i,e){return t=>{let o=t.width,r=typeof o=="number"?o:typeof o=="string"?Number(o):NaN,n=Number.isFinite(r)&&r>0?r:i??0;return n>0?n+(e??0):null}}function Pp(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 Fp(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function zp(i,e){return i<=6?Math.max(64,e/24):0}function aa(i,e,t,o,r,n,a,s,l){{let c=ci(l,e.extent);if(i.type==="fill"){let f=o>0?o/e.extent:0,h=i.cornerRadius&&f>0?{radius:i.cornerRadius/f,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Es/f}:void 0,d=ii(e,i.filter,t,h,i.clipToTile===true,e.extent,Do(i.dataPaint,r));return d?{kind:"fill",...d,extent:e.extent}:null}if(i.type==="surface"){let f=pi(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...n&&!i.fromLines&&i.groundField!==false?{onShapes:h=>gi(n,h,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Pp(i.groundBy)}:{},...i.fromLines?{widthOf:Lp(i.width,i.widthExtra),widthExtra:i.widthExtra??0}:{},...i.deck?{deck:i.deck}:{},...i.levelHeight&&!i.groundBy?{liftBy:Rp(i.levelHeight)}:{},liftAt:c});return f?{kind:"surface",...f}:null}if(i.type==="line"){let f=d=>c(d)??Ip(d),h=vi(e,i.filter,t,i.ground?n:void 0,o>0?o/e.extent:0,{level:a,paint:Do(i.dataPaint,r),liftAt:f});return h?{kind:"line",...h,extent:e.extent}:null}if(i.type==="model"){let f=Mu(e,i.filter);return f?{kind:"placement",...f,extent:e.extent}:null}if(i.type==="symbol"){let f=ia(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return f?{kind:"symbol",...f,extent:e.extent}:null}let u=oi(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,paint:Do(i.dataPaint,r)},s);return u?{kind:"fill-extrusion",vertices:u.vertices,indices:u.indices,featureIds:u.featureIds,vertexCount:u.vertexCount,indexCount:u.indexCount,extent:u.extent,...u.dataPaint?{dataPaint:u.dataPaint}:{}}:null}}function Op(i,e,t){let o=[];for(let r of i.features()){if(!we(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 Hp(i,e){let t=[];for(let o of i.features()){if(!we(e,o.properties))continue;let r=Ye(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Dp(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var vn=new Map;function Su(i){let e=i.indexOf("://");if(e<=0)return null;let t=i.slice(0,e),o=vn.get(t);return o?{scheme:t,handler:o}:null}var wn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new D;}get raw(){return this.data?.raw}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;}},sa=6,Bp=24,bo=class extends Ue{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.transform=null;this.protocolAborts=new D;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new Lt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get plan(){return this.opts.plan}get maxzoom(){return this.opts.maxzoom}newTile(t){let o=new wn(t);return this.cache.set(t.dataKey,o),o}acceptTile(t,o){this.cache.peek(t.id.dataKey)===t&&(t.data=o,t.state=Object.keys(o.buckets).length?"loaded":"empty",this.version++,this.emit("data",{tile:t}));}failTile(t,o){t.state="error",t.error=o,this.emit("error",{tile:t.id,message:o});}invalidate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&this.pool.abort(o.requestId),o.destroy(),this.cache.delete(t);this.visible=[],this.version++,this.emit("data",{tile:null});}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=wt(t,this.opts),r=new ae;for(let c of o)r.add(c.dataKey);for(let[c,u]of this.cache.entries())u.state==="loading"&&!r.has(c)&&(this.pool.abort(u.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let s=this.coverFor(o),l=this.readyFor(o);(this.anyReady(s)||this.visible.length===0||!this.covers(o))&&(this.visible=s,l&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let u=this.cache.peek(c.dataKey);return !!u&&u.state!=="loading"},r=(c,u)=>{let f=u.parent();for(let h=0;f&&h<=sa;h++){if(f.dataKey===c.dataKey)return true;f=f.parent();}return false},n=new D,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let s=this.descendantsOf(a);for(let c of a){let u=s.get(c.dataKey);if(u&&u.length){for(let m of u)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let f=c.parent(),h=null;for(let m=1;f&&m<=sa;m++,f=f.parent()){if(!o(f))continue;let b=f;if(m>1&&t.some(p=>p!==c&&o(p)&&r(b,p)))break;h=b;break}let d=h??c;n.set(d.dataKey,d);}let l=[];for(let[,c]of n){let u=c.parent(),f=false;for(let h=0;u&&h<=sa;h++){if(n.has(u.dataKey)){f=true;break}u=u.parent();}f||(l.push(c),this.cache.get(c.dataKey));}return l}descendantsOf(t){let o=new D;for(let n of t)o.set(n.dataKey,n);let r=new D;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let s=a.id.parent();for(let l=0;s&&l<Bp;l++){let c=o.get(s.dataKey);if(c){let u=r.get(c.dataKey);u?u.push(a.id):r.set(c.dataKey,[a.id]);break}s=s.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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 ae;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 s=0;n&&s<4;s++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let s of this.visible){let l=s.parent();for(let c=0;l&&c<4;c++){if(l.dataKey===r.dataKey){a=true;break}l=l.parent();}if(a)break}if(!a)return false}return true}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new wn(t);this.cache.set(t.dataKey,r);let n=this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)),a=this.transform?.(n,"tile")??n,s=Su(a);if(s){let c=new AbortController;this.protocolAborts.set(t.dataKey,c),s.handler(a,c.signal).then(u=>{if(this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==r)return;if(!u){r.state="empty",this.emit("data",{tile:r});return}let f=ar(new dt(u),{zoom:t.z,metersPerTile:xo(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan});this.acceptTile(r,{type:"loaded",id:0,raw:u,buckets:f.buckets,...f.seams.length?{seams:f.seams}:{},...f.levels.length?{levels:f.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:u.byteLength,layers:[],built:Object.keys(f.buckets).length}});}).catch(u=>{this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)===r&&this.failTile(r,u instanceof Error?u.message:String(u));});return}let l=Wp(a);r.requestId=this.pool.load({url:l,zoom:t.z,metersPerTile:xo(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},c=>{if(this.cache.peek(t.dataKey)===r){if(c.type==="error"){if(c.aborted)return;r.state="error",r.error=c.message,this.emit("error",{tile:t,message:c.message});}else r.data=c,r.state=Object.keys(c.buckets).length?"loaded":"empty",this.version++,c.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 ${c.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 Wp(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var xn=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;}},sr=class extends Ue{constructor(t){super();this.visible=[];this.aborts=new Map;this.transform=null;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Lt(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=wt(t,this.opts);let o=new ae;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();}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}loadTile(t){let o=new xn(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r);let n=_n(this.opts.url,t);this.fetchImage(this.transform?.(n,"raster")??n,r.signal).then(a=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){a.close();return}o.image=a,o.state="loaded",this.emit("data",{tile:o});}).catch(a=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=a instanceof Error?a.message:String(a),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 _n(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 Mn=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.dem=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null,this.dem=null;}},lr=class extends Ue{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:2,maxTiles:64,encoding:"mapbox",...t},this.cache=new Lt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get encoding(){return this.opts.encoding}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=wt(t,this.opts);let o=new ae;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);}heights(t){if(t.dem)return t.dem;if(!t.image)return null;let o=Vp(t.image);if(!o)return null;try{t.dem=new jo(o,t.image.width,this.opts.encoding);}catch(r){t.dem=null,console.warn("[osmgl] \u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043D\u0435 \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u043B\u0441\u044F:",r instanceof Error?r.message:r);}return t.dem}destroy(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear(),this.removeAllListeners();}loadTile(t){let o=new Mn(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(_n(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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob(),{premultiplyAlpha:"none",colorSpaceConversion:"none"})}};function Vp(i){if(typeof OffscreenCanvas>"u"&&typeof document>"u")return null;let{width:e,height:t}=i,r=(typeof OffscreenCanvas<"u"?new OffscreenCanvas(e,t):Object.assign(document.createElement("canvas"),{width:e,height:t})).getContext("2d");return r?(r.drawImage(i,0,0),r.getImageData(0,0,e,t).data):null}var cr=class extends Ue{constructor(t){super();this.options=t;this.content=null;this.corners=[];this.version=0;this.video=null;this.kind=t.kind,this.animate=t.animate??t.kind!=="image",this.setCoordinates(t.coordinates),this.load();}get live(){return this.kind==="video"?!!this.video&&!this.video.paused&&!this.video.ended:this.kind==="canvas"&&this.animate}setCoordinates(t){return this.corners=t.map(o=>{let r=Q(o);return [oe(r.lng),re(r.lat)]}),this.version++,this.emit("data",{source:this}),this}getCoordinates(){return this.options.coordinates}async updateImage(t){return t.coordinates&&this.setCoordinates(t.coordinates),t.url&&(this.options.url=t.url,await this.load()),this}getVideo(){return this.video}play(){this.video?.play();}pause(){this.video?.pause();}setAnimate(t){this.animate=t;}destroy(){this.video?.pause(),this.video=null,this.content=null;}async load(){try{if(this.kind==="canvas"){let t=typeof this.options.canvas=="string"?document.getElementById(this.options.canvas):this.options.canvas??null;if(!t)throw new Error("canvas \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D");this.content=t;}else if(this.kind==="video"){let t=document.createElement("video");t.crossOrigin="anonymous",t.loop=!0,t.muted=!0,t.playsInline=!0;let o=Array.isArray(this.options.url)?this.options.url:[this.options.url??""];for(let r of o){let n=document.createElement("source");n.src=r,t.appendChild(n);}await new Promise((r,n)=>{t.onloadeddata=()=>r(),t.onerror=()=>n(new Error("\u0432\u0438\u0434\u0435\u043E \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u043E\u0441\u044C")),t.load();}),this.video=t,this.content=t,t.play();}else {let t=Array.isArray(this.options.url)?this.options.url[0]:this.options.url;if(!t)throw new Error("\u043D\u0435 \u0437\u0430\u0434\u0430\u043D \u0430\u0434\u0440\u0435\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438");let o=new Image;o.crossOrigin="anonymous",await new Promise((r,n)=>{o.onload=()=>r(),o.onerror=()=>n(new Error(`\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${t} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C`)),o.src=t;}),this.content=o;}this.version++,this.emit("data",{source:this});}catch(t){this.emit("error",{message:t instanceof Error?t.message:String(t)});}}};var ur=4096,fr=class extends bo{constructor(t,o={}){super(t,{...o,url:"",plan:o.plan??[],minzoom:o.minzoom??0,maxzoom:o.maxzoom??18});this.features=[];this.clusters=new Map;this.layerName=o.sourceLayer??"geojson",this.bufferUnits=o.buffer??ur/32,this.clusterOn=o.cluster??false,this.clusterRadiusPx=o.clusterRadius??50,this.clusterTopZoom=o.clusterMaxZoom??(o.maxzoom??18)-1,o.data&&this.setData(o.data);}async setData(t){let o=typeof t=="string"?await(await fetch(t)).json():t;this.features=Gp(o),this.clusters.clear(),this.invalidate();}get featureCount(){return this.features.length}loadTile(t){let o=this.newTile(t),r=this.clusterOn&&t.z<=this.clusterTopZoom?this.clustersFor(t.z):this.features,n=Up(r,t,this.bufferUnits);try{let a=ar({layers:{[this.layerName]:n}},{zoom:t.z,metersPerTile:xo(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.maxzoom,plan:this.plan});this.acceptTile(o,{type:"loaded",id:0,buckets:a.buckets,...a.seams.length?{seams:a.seams}:{},...a.levels.length?{levels:a.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:0,layers:[this.layerName],built:Object.keys(a.buckets).length}});}catch(a){this.failTile(o,a instanceof Error?a.message:String(a));}}clustersFor(t){let o=this.clusters.get(t);if(o)return o;let r=this.clusterRadiusPx/(512*Math.pow(2,t)),n=new Map,a=[];for(let l of this.features){if(l.type!==1){a.push(l);continue}let c=l.rings[0][0],u=l.rings[0][1],f=`${Math.floor(c/r)}\u241F${Math.floor(u/r)}`,h=n.get(f);h?(h.x+=c,h.y+=u,h.count++):n.set(f,{x:c,y:u,count:1,first:l});}let s=0;for(let l of n.values()){if(l.count===1){a.push(l.first);continue}let c=l.x/l.count,u=l.y/l.count;a.push({id:++s,type:1,properties:{cluster:true,cluster_id:s,point_count:l.count,point_count_abbreviated:Np(l.count)},rings:[[c,u]],minX:c,minY:u,maxX:c,maxY:u});}return this.clusters.set(t,a),a}};function Np(i){return i<1e3?String(i):i<1e4?`${Math.round(i/100)/10}k`:i<1e6?`${Math.round(i/1e3)}k`:`${Math.round(i/1e5)/10}M`}function Gp(i){let e=i.type==="FeatureCollection"?i.features:[i],t=[],o=0;for(let r of e){let n=r.geometry;if(!n)continue;let a=Number(r.id??++o),s={...r.properties??{}},l=(c,u)=>{let f=u.map(p=>{let g=[];for(let[y,v]of p)g.push(oe(y),re(v));return g}).filter(p=>p.length>=2);if(!f.length)return;let h=1/0,d=1/0,m=-1/0,b=-1/0;for(let p of f)for(let g=0;g<p.length;g+=2)h=Math.min(h,p[g]),m=Math.max(m,p[g]),d=Math.min(d,p[g+1]),b=Math.max(b,p[g+1]);t.push({id:a,type:c,properties:s,rings:f,minX:h,minY:d,maxX:m,maxY:b});};switch(n.type){case "Point":l(1,[[n.coordinates]]);break;case "MultiPoint":l(1,[n.coordinates]);break;case "LineString":l(2,[n.coordinates]);break;case "MultiLineString":l(2,n.coordinates);break;case "Polygon":l(3,n.coordinates);break;case "MultiPolygon":for(let c of n.coordinates)l(3,c);break}}return t}function Up(i,e,t){let o=1<<e.z,r=t/ur/o,n=e.x/o-r,a=(e.x+1)/o+r,s=e.y/o-r,l=(e.y+1)/o+r,c=[];for(let u of i){if(u.maxX<n||u.minX>a||u.maxY<s||u.minY>l)continue;let f=[];for(let h of u.rings){let d=u.type===3?Yp(h,n,s,a,l):u.type===2?Kp(h,n,s,a,l):[h];for(let m of d){let b=[];for(let p=0;p<m.length;p+=2)b.push((m[p]*o-e.x)*ur,(m[p+1]*o-e.y)*ur);b.length>=2&&f.push(b);}}if(f.length){if(u.type===3)for(let h=0;h<f.length;h++){let d=jp(f[h]),m=qn(d),b=h===0;f[h]=m>0===b?d:Xp(d);}c.push({id:u.id,type:u.type,properties:u.properties,rings:f});}}return {name:"geojson",extent:ur,length:c.length,*features(){for(let u of c)yield {id:u.id,type:u.type,properties:u.properties,loadGeometry:()=>u.rings};}}}function jp(i){let e=i.length;return e>=4&&i[0]===i[e-2]&&i[1]===i[e-1]?i:[...i,i[0],i[1]]}function Xp(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function Yp(i,e,t,o,r){let n=i,a=[[s=>s>=e,(s,l,c,u)=>Cn(s,l,c,u,(e-s)/(c-s))],[s=>s<=o,(s,l,c,u)=>Cn(s,l,c,u,(o-s)/(c-s))],[(s,l)=>l>=t,(s,l,c,u)=>Cn(s,l,c,u,(t-l)/(u-l))],[(s,l)=>l<=r,(s,l,c,u)=>Cn(s,l,c,u,(r-l)/(u-l))]];for(let[s,l]of a){let c=[];for(let u=0;u<n.length;u+=2){let f=n[u],h=n[u+1],d=(u+2)%n.length,m=n[d],b=n[d+1],p=s(f,h),g=s(m,b);if(p&&c.push(f,h),p!==g){let[y,v]=l(f,h,m,b);c.push(y,v);}}if(n=c,n.length<6)return []}return [n]}function Cn(i,e,t,o,r){let n=Number.isFinite(r)?Math.min(Math.max(r,0),1):0;return [i+(t-i)*n,e+(o-e)*n]}function Kp(i,e,t,o,r){let n=[],a=[],s=(l,c)=>l>=e&&l<=o&&c>=t&&c<=r;for(let l=0;l+3<i.length;l+=2){let c=i[l],u=i[l+1],f=i[l+2],h=i[l+3],d=s(c,u),m=s(f,h);if(d&&m){a.length||a.push(c,u),a.push(f,h);continue}let b=$p(c,u,f,h,e,t,o,r);if(!b){a.length>=4&&n.push(a),a=[];continue}a.length||a.push(b[0],b[1]),a.push(b[2],b[3]),m||(a.length>=4&&n.push(a),a=[]);}return a.length>=4&&n.push(a),n}function $p(i,e,t,o,r,n,a,s){let l=0,c=1,u=t-i,f=o-e;for(let h=0;h<4;h++){let d=h===0?-u:h===1?u:h===2?-f:f,m=h===0?i-r:h===1?a-i:h===2?e-n:s-e;if(d===0){if(m<0)return null;continue}let b=m/d;if(d<0){if(b>c)return null;b>l&&(l=b);}else {if(b<l)return null;b<c&&(c=b);}}return [i+u*l,e+f*l,i+u*c,e+f*c]}var qp="osmgl-assets",go="assets";var Sn=null;function ku(){return Sn||(Sn=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(qp,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(go)||t.createObjectStore(go,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Sn)}function Zp(i){return ku().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(go,"readonly").objectStore(go).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Qp(i){ku().then(e=>{if(e)try{e.transaction(go,"readwrite").objectStore(go).put(i);}catch{}});}var Tu=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 Jp(i,e,t){let o=await crypto.subtle.importKey("raw",Tu(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Tu(t),tagLength:128},o,i)}var hr=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}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let n,a,s=await Zp(e);if(s)n=s.bytes,a=s.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(),Qp({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let l=await this.getKey(t,r);if(!l)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return Jp(n,l.key,l.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 e0=1,dr=class{constructor(e){this.groundZ=0;this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=X();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-${e0++}`,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 Gi(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:oe(e.lng),y:re(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/$e(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=ca(n(-this.rotation));this.rotationTiltX&&(a=Pt(la(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Pt(ua(n(this.rotationTiltZ)),a));let s=Pt(r,a),l=this.matrix;return ut(l),l[0]=s[0],l[1]=s[1],l[2]=s[2],l[4]=s[3],l[5]=s[4],l[6]=s[5],l[8]=s[6],l[9]=s[7],l[10]=s[8],l[15]=1,l}matrixInSpace(e,t){let o=Q(this.coordinates),r=X();for(let a=0;a<16;a++)r[a]=e[a];let n=X();return Ie(n,r,this.localMatrix(o.lat)),ft(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=$e(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*n,c=(s[1]/a-o.y)*n,u=s[2]/e.pixelsPerMeter-(this.altitude+this.groundZ),f=l,h=u,d=c,m=p=>p*Math.PI/180,b=ca(m(-this.rotation));return this.rotationTiltX&&(b=Pt(la(m(this.rotationTiltX)),b)),this.rotationTiltZ&&(b=Pt(ua(m(this.rotationTiltZ)),b)),[(b[0]*f+b[1]*h+b[2]*d)/t,(b[3]*f+b[4]*h+b[5]*d)/t,(b[6]*f+b[7]*h+b[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude+this.groundZ))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,s=Q(this.coordinates),l=this.localMatrix(s.lat),c=l[0],u=l[1],f=l[8],h=l[9],d=c*h-u*f;if(Math.abs(d)<1e-30)return false;let m=(n*h-a*f)/d,b=(c*a-u*n)/d,p=1.05,g=(o.min[0]+o.max[0])/2,y=(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-g)<=v&&Math.abs(b-y)<=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+this.groundZ),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=X();for(let f=0;f<16;f++)a[f]=e[f];let s=Q(this.coordinates),l=X();Ie(l,a,this.localMatrix(s.lat));let c=X();Ui(n,t,n.duration>0?o%n.duration:0,c);let u=X();return Ie(u,l,c),ft(r,u)}normalMatrix(){let e=n=>n*Math.PI/180,t=ca(e(-this.rotation));this.rotationTiltX&&(t=Pt(la(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Pt(ua(e(this.rotationTiltZ)),t));let o=Pt([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 Pt(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 la=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},ca=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},ua=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var kn=class{constructor(){this.hit=new D;this.miss=new ae;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 s=n.bounds();if(e.mercX<s.minX||e.mercX>s.maxX||e.mercY<s.minY||e.mercY>s.maxY)continue;let l=(e.mercX-s.minX)/(s.maxX-s.minX)*a.extent,c=(e.mercY-s.minY)/(s.maxY-s.minY)*a.extent,u=new Int16Array(a.vertices),f=new Uint32Array(a.indices),h=new Float64Array(a.featureIds),d=u.length/a.vertexCount;for(let m=0;m*3+2<f.length;m++){let b=f[m*3]*d,p=f[m*3+1]*d,g=f[m*3+2]*d;if(!s0(l,c,u[b],u[b+1],u[p],u[p+1],u[g],u[g+1]))continue;let y=h[m];return this.hit.set(e.id,y),y}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},t0=14,o0=2e3,r0=4e3,Eu=160,n0=50,i0=4e3,fa=6,En=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new D;this.loading=0;this.pending=[];this.known=new D;this.underBuilding=new kn;this.underVenue=new kn;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Eu;this.replacedBuildings=new ae;this.replacedReal=new ae;this.replacedVenues=new ae;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 hr(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,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let l=e.layout??{},c=l.minZoom??t0,u=l.loadRadius??o0,f=Math.max(l.keepRadius??r0,u),h=l.fullBudget===true?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((l.budget??Eu)*this.budgetScale*h));this.budget=d,this.addModel=r;let m=l.maskReplaced!==false,b=performance.now();if(o.zoom<c){for(let I of [...this.entries.values()])I.model.retire(),I.model.grow<=0&&this.release(I,n);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let p=o.center,g=l.fullDetail===true?0:this.lodFor(o.zoom,c);this.lod=g;let y="";for(let I of t.visibleTiles)y+=I.dataKey+(t.getTile(I)?.data?"+":"-");let v=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let I=new ae;v=0;for(let H of t.visibleTiles){let z=t.getTile(H)?.data?.buckets?.[e.id];if(!z||!Pc(z))continue;let E=new Int16Array(z.anchors),F=H.bounds(),B=F.maxX-F.minX,O=F.maxY-F.minY;for(let W=0;W<z.props.length;W++){let V=z.props[W],j=Nt(V.file,NaN);if(!Number.isFinite(j))continue;let G=String(V.kind??"model"),ee=G==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(I.has(ee))continue;I.add(ee),G==="rule"&&v++;let le=F.minX+E[W*2]/z.extent*B,K=F.minY+E[W*2+1]/z.extent*O,U=a0(le,K);this.known.set(ee,{id:ee,fileId:j,lng:U.lng,lat:U.lat,mercX:le,mercY:K,altitude:Nt(V.alt,0),scale:Nt(V.scale,1),rotation:Nt(V.rx,0),tiltX:Nt(V.rz,0),tiltZ:Nt(V.ry,0),kind:G==="rule"?"rule":"model",target:Au(G==="rule"?V.oid:V.replaces),replaces:m?G==="rule"?Tn(V.oid):String(V.anchor??"replace")==="replace"?Tn(V.replaces_all).length?Tn(V.replaces_all):Tn(V.replaces):[]:[]});}}this.rulesInScan=v;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,x=new ae;for(let I of w)I.kind==="model"&&I.target!==null&&x.add(I.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),S=I=>Math.hypot((I.lng-p.lng)*_*M,(I.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let C=new ae,k=[],T=0,P=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>n0)&&(w.sort((I,H)=>S(I)-S(H)),this.sortedAt={lng:p.lng,lat:p.lat});let A=0;for(let I of w){let H=S(I);if(H>f){T++;continue}if(I.kind==="rule"&&I.target!==null&&x.has(I.target)){let B=this.entries.get(I.id);B&&B.model.retire();continue}let z=this.entries.get(I.id);if(A>=d){P++,z&&z.model.retire();continue}A++,C.add(I.id);let E=()=>{if(!I.replaces.length)return;for(let W of I.replaces){this.replacedBuildings.add(W),this.replacedReal.add(W);for(let V=0;V<10;V++)this.replacedBuildings.add(W*10+V);}let B=this.underBuilding.find(I,a);B!==null&&this.replacedBuildings.add(B);let O=this.underVenue.find(I,s);O!==null&&this.replacedVenues.add(O);},F=z;if(F){E(),F.distance=H,F.leftAt=0,F.model.revive(),g<F.lod&&!F.upgrading&&this.loading<fa&&this.upgrade(F,g,r,n);continue}if(H>u){T++;continue}if(this.loading>=fa){k.push(I),E();continue}E(),this.spawn(I,H,g,r);}for(let I of [...this.entries.values()])if(!C.has(I.placement.id)){if(I.leftAt===0){I.leftAt=b;continue}b-I.leftAt>i0&&I.model.retire();}for(let I of [...this.entries.values()])I.model.growTarget===0&&I.model.grow<=0&&this.release(I,n);if(this.known.size>4e3)for(let[I,H]of [...this.known.entries()])S(H)>f*3&&this.known.delete(I);let R=this.stats;R.found=w.length,R.kept=C.size,R.live=this.entries.size,R.tooFar=T,R.overBudget=P,R.queued=k.length,R.rules=v,R.loadingNow=this.loading,R.pendingNow=k.length,R.replaced=this.replacedReal.size,this.pending=k;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<fa&&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 dr({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.replacedReal.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},Nt=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Tn=i=>{if(i==null)return [];let e=[];for(let t of String(i).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},Au=i=>{let e=Nt(i,NaN);return Number.isFinite(e)?e:null};function a0(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 s0(i,e,t,o,r,n,a,s){let l=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-s)-(r-a)*(e-s),u=(i-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||u<0,h=l>0||c>0||u>0;return !(f&&h)}function l0(i,e,t){return Iu(i)?.get(e)?.get(t)??{}}var An=new WeakMap;function Iu(i){let e=An.get(i);if(e!==void 0)return e;let t=i.raw;if(!t)return An.set(i,null),null;let o=new Map;try{let r=new dt(t);for(let[n,a]of Object.entries(r.layers)){let s=new Map;for(let l of a.features()){let c=Number(l.id??l.properties.osm_id??-1);c>=0&&s.set(c,{...l.properties});}o.set(n,s);}}catch{return An.set(i,null),null}return An.set(i,o),o}function c0(i,e){return Array.isArray(i)?{x1:Math.min(i[0].x,i[1].x)-e,y1:Math.min(i[0].y,i[1].y)-e,x2:Math.max(i[0].x,i[1].x)+e,y2:Math.max(i[0].y,i[1].y)+e}:{x1:i.x-e,y1:i.y-e,x2:i.x+e,y2:i.y+e}}function ha(i,e,t,o,r,n){let a=r.tolerance??4,s=c0(o,a),l=r.layers&&r.layers.length?new Set(r.layers):null,c=[],u=new Set;for(let f of t){if(l&&!l.has(f.id)||f.type==="raster"||f.visible===false)continue;let h=e.get(f.source??"base");if(!h)continue;let d="source-layer"in f?f["source-layer"]:"";for(let m of h.visibleTiles){let b=h.getTile(m);if(b?.data)for(let[p,g]of Object.entries(b.data.buckets)){if(p!==f.id&&!p.startsWith(f.id+"\u241F")||!("extent"in g)||!("kind"in g))continue;let y=h0(i,m,g.extent,s);if(!y)continue;let v=u0(g,y);for(let w of v){let x=`${f.id}\u241F${w}`;u.has(x)||(u.add(x),c.push({id:w,source:f.source??"base",sourceLayer:d,layer:f.id,properties:l0(b,d,w),state:n(f.source??"base",d,w),tile:m}));}}}}return c.reverse()}function u0(i,e){return i.kind==="surface"?f0(i,e):i.featureIds?i.kind==="line"?d0(i,e):i.kind==="fill-extrusion"?Ru(i,e,(t,o)=>[t.getInt16(o*Ee,true)/pt,t.getInt16(o*Ee+2,true)/pt]):i.kind==="fill"?Ru(i,e,(t,o)=>[t.getInt16(o*Je,true),t.getInt16(o*Je+2,true)]):[]:[]}function f0(i,e){if(!i.shapeRanges||!i.shapeFeatures)return [];let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=new Uint32Array(i.shapeRanges),n=new Float64Array(i.shapeFeatures),a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=u=>[t.getFloat32(u*bt,true),t.getFloat32(u*bt+4,true)],c=new Set;for(let u=0;u*4+1<r.length;u++){let f=r[u*4],h=r[u*4+1],d=false;for(let p=f;p+2<h&&!d;p+=3){let[g,y]=l(o[p]),[v,w]=l(o[p+1]),[x,_]=l(o[p+2]);if(Math.max(g,v,x)<e.x1||Math.min(g,v,x)>e.x2||Math.max(y,w,_)<e.y1||Math.min(y,w,_)>e.y2)continue;let M=(a-v)*(y-w)-(g-v)*(s-w),S=(a-x)*(w-_)-(v-x)*(s-_),C=(a-g)*(_-y)-(x-g)*(s-y),k=M<0||S<0||C<0,T=M>0||S>0||C>0;d=!(k&&T);}if(!d)continue;let m=0;for(let p=0;p<u&&m<n.length;p++)m+=1+n[m];if(m>=n.length)break;let b=n[m];for(let p=0;p<b;p++)c.add(n[m+1+p]);}return [...c]}function h0(i,e,t,o){let r=[{x:o.x1,y:o.y1},{x:o.x2,y:o.y1},{x:o.x1,y:o.y2},{x:o.x2,y:o.y2}],n=1<<e.z,a=1/0,s=1/0,l=-1/0,c=-1/0;for(let f of r){let h=i.pointToWorldPx(f),d=(h.x/i.worldSize*n-e.x)*t,m=(h.y/i.worldSize*n-e.y)*t;a=Math.min(a,d),l=Math.max(l,d),s=Math.min(s,m),c=Math.max(c,m);}let u=t/4;return l<-u||c<-u||a>t+u||s>t+u?null:{x1:a,y1:s,x2:l,y2:c}}function Ru(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=new Set,s=(e.x1+e.x2)/2,l=(e.y1+e.y2)/2;for(let c=0;c*3<r.length&&c<n.length;c++){let u=n[c];if(a.has(u))continue;let[f,h]=t(o,r[c*3]),[d,m]=t(o,r[c*3+1]),[b,p]=t(o,r[c*3+2]);if(Math.max(f,d,b)<e.x1||Math.min(f,d,b)>e.x2||Math.max(h,m,p)<e.y1||Math.min(h,m,p)>e.y2)continue;let g=(s-d)*(h-m)-(f-d)*(l-m),y=(s-b)*(m-p)-(d-b)*(l-p),v=(s-f)*(p-h)-(b-f)*(l-h),w=g<0||y<0||v<0,x=g>0||y>0||v>0;w&&x||a.add(u);}return [...a]}function d0(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=new Float64Array(i.featureIds),n=new Set,a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=Math.max(e.x2-e.x1,e.y2-e.y1)/2;for(let c=0;c*3<o.length&&c<r.length;c++){let u=r[c];if(n.has(u))continue;let f=o[c*3],h=t.getInt16(f*Ve,true),d=t.getInt16(f*Ve+2,true),m=t.getInt16(f*Ve+4,true),b=t.getInt16(f*Ve+6,true),p=m-h,g=b-d,y=p*p+g*g,v=y>0?Math.min(Math.max(((a-h)*p+(s-d)*g)/y,0),1):0,w=h+p*v,x=d+g*v;Math.hypot(a-w,s-x)<=l&&n.add(u);}return [...n]}function da(i,e,t,o){let r=[],n=new Set;for(let a of i.visibleTiles){let s=i.getTile(a),l=s?Iu(s):null;if(!(!s||!l)){for(let[c,u]of l)if(!(t.sourceLayer&&c!==t.sourceLayer))for(let[f,h]of u){if(t.filter&&!t.filter(h))continue;let d=`${c}\u241F${f}`;n.has(d)||(n.add(d),r.push({id:f,source:e,sourceLayer:c,layer:"",properties:h,state:o(e,c,f),tile:a}));}}}return r}var m0=200,p0={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},mr=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=p0[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??b0),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(oe(t.lng)*o,re(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=m0;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";}},b0='<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 pr=class extends mr{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 ma='"use strict";(()=>{var co=Object.create;var In=Object.defineProperty;var ao=Object.getOwnPropertyDescriptor;var fo=Object.getOwnPropertyNames;var ho=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var po=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var bo=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fo(t))!mo.call(e,o)&&o!==n&&In(e,o,{get:()=>t[o],enumerable:!(i=ao(t,o))||i.enumerable});return e};var go=(e,t,n)=>(n=e!=null?co(ho(e)):{},bo(t||!e||!e.__esModule?In(n,"default",{value:e,enumerable:!0}):n,e));var Tr=po((bn,gn)=>{(function(e,t){typeof bn=="object"&&typeof gn<"u"?gn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(bn,function(){"use strict";function e(M,a){var h={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},d,x,b,F;return F={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function S(k){return function(C){return A([k,C])}}function A(k){if(d)throw new TypeError("Generator is already executing.");for(;h;)try{if(d=1,x&&(b=k[0]&2?x.return:k[0]?x.throw||((b=x.return)&&b.call(x),0):x.next)&&!(b=b.call(x,k[1])).done)return b;switch(x=0,b&&(k=[k[0]&2,b.value]),k[0]){case 0:case 1:b=k;break;case 4:return h.label++,{value:k[1],done:!1};case 5:h.label++,x=k[1],k=[0];continue;case 7:k=h.ops.pop(),h.trys.pop();continue;default:if(b=h.trys,!(b=b.length>0&&b[b.length-1])&&(k[0]===6||k[0]===2)){h=0;continue}if(k[0]===3&&(!b||k[1]>b[0]&&k[1]<b[3])){h.label=k[1];break}if(k[0]===6&&h.label<b[1]){h.label=b[1],b=k;break}if(b&&h.label<b[2]){h.label=b[2],h.ops.push(k);break}b[2]&&h.ops.pop(),h.trys.pop();continue}k=a.call(M,h)}catch(C){k=[6,C],x=0}finally{d=b=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}}var t=function(){function M(a,h){this.next=null,this.key=a,this.data=h,this.left=null,this.right=null}return M}();function n(M,a){return M>a?1:M<a?-1:0}function i(M,a,h){for(var d=new t(null,null),x=d,b=d;;){var F=h(M,a.key);if(F<0){if(a.left===null)break;if(h(M,a.left.key)<0){var S=a.left;if(a.left=S.right,S.right=a,a=S,a.left===null)break}b.left=a,b=a,a=a.left}else if(F>0){if(a.right===null)break;if(h(M,a.right.key)>0){var S=a.right;if(a.right=S.left,S.left=a,a=S,a.right===null)break}x.right=a,x=a,a=a.right}else break}return x.right=a.left,b.left=a.right,a.left=d.right,a.right=d.left,a}function o(M,a,h,d){var x=new t(M,a);if(h===null)return x.left=x.right=null,x;h=i(M,h,d);var b=d(M,h.key);return b<0?(x.left=h.left,x.right=h,h.left=null):b>=0&&(x.right=h.right,x.left=h,h.right=null),x}function r(M,a,h){var d=null,x=null;if(a){a=i(M,a,h);var b=h(a.key,M);b===0?(d=a.left,x=a.right):b<0?(x=a.right,a.right=null,d=a):(d=a.left,a.left=null,x=a)}return{left:d,right:x}}function s(M,a,h){return a===null?M:(M===null||(a=i(M.key,a,h),a.left=M),a)}function u(M,a,h,d,x){if(M){d(""+a+(h?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+x(M)+`\n`);var b=a+(h?" ":"\\u2502 ");M.left&&u(M.left,b,!1,d,x),M.right&&u(M.right,b,!0,d,x)}}var l=function(){function M(a){a===void 0&&(a=n),this._root=null,this._size=0,this._comparator=a}return M.prototype.insert=function(a,h){return this._size++,this._root=o(a,h,this._root,this._comparator)},M.prototype.add=function(a,h){var d=new t(a,h);this._root===null&&(d.left=d.right=null,this._size++,this._root=d);var x=this._comparator,b=i(a,this._root,x),F=x(a,b.key);return F===0?this._root=b:(F<0?(d.left=b.left,d.right=b,b.left=null):F>0&&(d.right=b.right,d.left=b,b.right=null),this._size++,this._root=d),this._root},M.prototype.remove=function(a){this._root=this._remove(a,this._root,this._comparator)},M.prototype._remove=function(a,h,d){var x;if(h===null)return null;h=i(a,h,d);var b=d(a,h.key);return b===0?(h.left===null?x=h.right:(x=i(a,h.left,d),x.right=h.right),this._size--,x):h},M.prototype.pop=function(){var a=this._root;if(a){for(;a.left;)a=a.left;return this._root=i(a.key,this._root,this._comparator),this._root=this._remove(a.key,this._root,this._comparator),{key:a.key,data:a.data}}return null},M.prototype.findStatic=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return h;x<0?h=h.left:h=h.right}return null},M.prototype.find=function(a){return this._root&&(this._root=i(a,this._root,this._comparator),this._comparator(a,this._root.key)!==0)?null:this._root},M.prototype.contains=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return!0;x<0?h=h.left:h=h.right}return!1},M.prototype.forEach=function(a,h){for(var d=this._root,x=[],b=!1;!b;)d!==null?(x.push(d),d=d.left):x.length!==0?(d=x.pop(),a.call(h,d),d=d.right):b=!0;return this},M.prototype.range=function(a,h,d,x){for(var b=[],F=this._comparator,S=this._root,A;b.length!==0||S;)if(S)b.push(S),S=S.left;else{if(S=b.pop(),A=F(S.key,h),A>0)break;if(F(S.key,a)>=0&&d.call(x,S))return this;S=S.right}return this},M.prototype.keys=function(){var a=[];return this.forEach(function(h){var d=h.key;return a.push(d)}),a},M.prototype.values=function(){var a=[];return this.forEach(function(h){var d=h.data;return a.push(d)}),a},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.left;)a=a.left;return a},M.prototype.maxNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.right;)a=a.right;return a},M.prototype.at=function(a){for(var h=this._root,d=!1,x=0,b=[];!d;)if(h)b.push(h),h=h.left;else if(b.length>0){if(h=b.pop(),x===a)return h;x++,h=h.right}else d=!0;return null},M.prototype.next=function(a){var h=this._root,d=null;if(a.right){for(d=a.right;d.left;)d=d.left;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?(d=h,h=h.left):h=h.right}return d},M.prototype.prev=function(a){var h=this._root,d=null;if(a.left!==null){for(d=a.left;d.right;)d=d.right;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?h=h.left:(d=h,h=h.right)}return d},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return m(this._root)},M.prototype.load=function(a,h,d){h===void 0&&(h=[]),d===void 0&&(d=!1);var x=a.length,b=this._comparator;if(d&&y(a,h,0,x-1,b),this._root===null)this._root=c(a,h,0,x),this._size=x;else{var F=g(this.toList(),f(a,h),b);x=this._size+x,this._root=p({head:F},0,x)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(a){a===void 0&&(a=function(d){return String(d.key)});var h=[];return u(this._root,"",!0,function(d){return h.push(d)},a),h.join("")},M.prototype.update=function(a,h,d){var x=this._comparator,b=r(a,this._root,x),F=b.left,S=b.right;x(a,h)<0?S=o(h,d,S,x):F=o(h,d,F,x),this._root=s(F,S,x)},M.prototype.split=function(a){return r(a,this._root,this._comparator)},M.prototype[Symbol.iterator]=function(){var a,h,d;return e(this,function(x){switch(x.label){case 0:a=this._root,h=[],d=!1,x.label=1;case 1:return d?[3,6]:a===null?[3,2]:(h.push(a),a=a.left,[3,5]);case 2:return h.length===0?[3,4]:(a=h.pop(),[4,a]);case 3:return x.sent(),a=a.right,[3,5];case 4:d=!0,x.label=5;case 5:return[3,1];case 6:return[2]}})},M}();function c(M,a,h,d){var x=d-h;if(x>0){var b=h+Math.floor(x/2),F=M[b],S=a[b],A=new t(F,S);return A.left=c(M,a,h,b),A.right=c(M,a,b+1,d),A}return null}function f(M,a){for(var h=new t(null,null),d=h,x=0;x<M.length;x++)d=d.next=new t(M[x],a[x]);return d.next=null,h.next}function m(M){for(var a=M,h=[],d=!1,x=new t(null,null),b=x;!d;)a?(h.push(a),a=a.left):h.length>0?(a=b=b.next=h.pop(),a=a.right):d=!0;return b.next=null,x.next}function p(M,a,h){var d=h-a;if(d>0){var x=a+Math.floor(d/2),b=p(M,a,x),F=M.head;return F.left=b,M.head=M.head.next,F.right=p(M,x+1,h),F}return null}function g(M,a,h){for(var d=new t(null,null),x=d,b=M,F=a;b!==null&&F!==null;)h(b.key,F.key)<0?(x.next=b,b=b.next):(x.next=F,F=F.next),x=x.next;return b!==null?x.next=b:F!==null&&(x.next=F),d.next}function y(M,a,h,d,x){if(!(h>=d)){for(var b=M[h+d>>1],F=h-1,S=d+1;;){do F++;while(x(M[F],b)<0);do S--;while(x(M[S],b)>0);if(F>=S)break;var A=M[F];M[F]=M[S],M[S]=A,A=a[F],a[F]=a[S],a[S]=A}y(M,a,h,S,x),y(M,a,S+1,d,x)}}let w=(M,a)=>M.ll.x<=a.x&&a.x<=M.ur.x&&M.ll.y<=a.y&&a.y<=M.ur.y,E=(M,a)=>{if(a.ur.x<M.ll.x||M.ur.x<a.ll.x||a.ur.y<M.ll.y||M.ur.y<a.ll.y)return null;let h=M.ll.x<a.ll.x?a.ll.x:M.ll.x,d=M.ur.x<a.ur.x?M.ur.x:a.ur.x,x=M.ll.y<a.ll.y?a.ll.y:M.ll.y,b=M.ur.y<a.ur.y?M.ur.y:a.ur.y;return{ll:{x:h,y:x},ur:{x:d,y:b}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let T=R*R,L=(M,a)=>{if(-R<M&&M<R&&-R<a&&a<R)return 0;let h=M-a;return h*h<T*M*a?0:M<a?-1:1};class P{constructor(){this.reset()}reset(){this.xRounder=new U,this.yRounder=new U}round(a,h){return{x:this.xRounder.round(a),y:this.yRounder.round(h)}}}class U{constructor(){this.tree=new l,this.round(0)}round(a){let h=this.tree.add(a),d=this.tree.prev(h);if(d!==null&&L(h.key,d.key)===0)return this.tree.remove(a),d.key;let x=this.tree.next(h);return x!==null&&L(h.key,x.key)===0?(this.tree.remove(a),x.key):a}}let V=new P,D=11102230246251565e-32,j=134217729,O=(3+8*D)*D;function z(M,a,h,d,x){let b,F,S,A,k=a[0],C=d[0],v=0,I=0;C>k==C>-k?(b=k,k=a[++v]):(b=C,C=d[++I]);let _=0;if(v<M&&I<h)for(C>k==C>-k?(F=k+b,S=b-(F-k),k=a[++v]):(F=C+b,S=b-(F-C),C=d[++I]),b=F,S!==0&&(x[_++]=S);v<M&&I<h;)C>k==C>-k?(F=b+k,A=F-b,S=b-(F-A)+(k-A),k=a[++v]):(F=b+C,A=F-b,S=b-(F-A)+(C-A),C=d[++I]),b=F,S!==0&&(x[_++]=S);for(;v<M;)F=b+k,A=F-b,S=b-(F-A)+(k-A),k=a[++v],b=F,S!==0&&(x[_++]=S);for(;I<h;)F=b+C,A=F-b,S=b-(F-A)+(C-A),C=d[++I],b=F,S!==0&&(x[_++]=S);return(b!==0||_===0)&&(x[_++]=b),_}function G(M,a){let h=a[0];for(let d=1;d<M;d++)h+=a[d];return h}function te(M){return new Float64Array(M)}let ie=(3+16*D)*D,J=(2+12*D)*D,X=(9+64*D)*D*D,W=te(4),re=te(8),Q=te(12),B=te(16),N=te(4);function ee(M,a,h,d,x,b,F){let S,A,k,C,v,I,_,Y,H,q,K,ue,ge,ae,xe,ye,Fe,we,_e=M-x,Be=h-x,Te=a-b,Ce=d-b;ae=_e*Ce,I=j*_e,_=I-(I-_e),Y=_e-_,I=j*Ce,H=I-(I-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*Be,I=j*Te,_=I-(I-Te),Y=Te-_,I=j*Be,H=I-(I-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,W[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,W[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,W[2]=ue-(we-v)+(K-v),W[3]=we;let Ge=G(4,W),lt=J*F;if(Ge>=lt||-Ge>=lt||(v=M-_e,S=M-(_e+v)+(v-x),v=h-Be,k=h-(Be+v)+(v-x),v=a-Te,A=a-(Te+v)+(v-b),v=d-Ce,C=d-(Ce+v)+(v-b),S===0&&A===0&&k===0&&C===0)||(lt=X*F+O*Math.abs(Ge),Ge+=_e*C+Ce*S-(Te*k+Be*A),Ge>=lt||-Ge>=lt))return Ge;ae=S*Ce,I=j*S,_=I-(I-S),Y=S-_,I=j*Ce,H=I-(I-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=A*Be,I=j*A,_=I-(I-A),Y=A-_,I=j*Be,H=I-(I-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let so=z(4,W,4,N,re);ae=_e*C,I=j*_e,_=I-(I-_e),Y=_e-_,I=j*C,H=I-(I-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*k,I=j*Te,_=I-(I-Te),Y=Te-_,I=j*k,H=I-(I-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let uo=z(so,re,4,N,Q);ae=S*C,I=j*S,_=I-(I-S),Y=S-_,I=j*C,H=I-(I-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=A*k,I=j*A,_=I-(I-A),Y=A-_,I=j*k,H=I-(I-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let lo=z(uo,Q,4,N,B);return B[lo-1]}function Z(M,a,h,d,x,b){let F=(a-b)*(h-x),S=(M-x)*(d-b),A=F-S,k=Math.abs(F+S);return Math.abs(A)>=ie*k?A:-ee(M,a,h,d,x,b,k)}let oe=(M,a)=>M.x*a.y-M.y*a.x,de=(M,a)=>M.x*a.x+M.y*a.y,be=(M,a,h)=>{let d=Z(M.x,M.y,a.x,a.y,h.x,h.y);return d>0?-1:d<0?1:0},se=M=>Math.sqrt(de(M,M)),Ie=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return oe(x,d)/se(x)/se(d)},Ne=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return de(x,d)/se(x)/se(d)},ce=(M,a,h)=>a.y===0?null:{x:M.x+a.x/a.y*(h-M.y),y:h},Me=(M,a,h)=>a.x===0?null:{x:h,y:M.y+a.y/a.x*(h-M.x)},Se=(M,a,h,d)=>{if(a.x===0)return Me(h,d,M.x);if(d.x===0)return Me(M,a,h.x);if(a.y===0)return ce(h,d,M.y);if(d.y===0)return ce(M,a,h.y);let x=oe(a,d);if(x==0)return null;let b={x:h.x-M.x,y:h.y-M.y},F=oe(b,a)/x,S=oe(b,d)/x,A=M.x+S*a.x,k=h.x+F*d.x,C=M.y+S*a.y,v=h.y+F*d.y,I=(A+k)/2,_=(C+v)/2;return{x:I,y:_}};class ne{static compare(a,h){let d=ne.comparePoints(a.point,h.point);return d!==0?d:(a.point!==h.point&&a.link(h),a.isLeft!==h.isLeft?a.isLeft?1:-1:me.compare(a.segment,h.segment))}static comparePoints(a,h){return a.x<h.x?-1:a.x>h.x?1:a.y<h.y?-1:a.y>h.y?1:0}constructor(a,h){a.events===void 0?a.events=[this]:a.events.push(this),this.point=a,this.isLeft=h}link(a){if(a.point===this.point)throw new Error("Tried to link already linked events");let h=a.point.events;for(let d=0,x=h.length;d<x;d++){let b=h[d];this.point.events.push(b),b.point=this.point}this.checkForConsuming()}checkForConsuming(){let a=this.point.events.length;for(let h=0;h<a;h++){let d=this.point.events[h];if(d.segment.consumedBy===void 0)for(let x=h+1;x<a;x++){let b=this.point.events[x];b.consumedBy===void 0&&d.otherSE.point.events===b.otherSE.point.events&&d.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let a=[];for(let h=0,d=this.point.events.length;h<d;h++){let x=this.point.events[h];x!==this&&!x.segment.ringOut&&x.segment.isInResult()&&a.push(x)}return a}getLeftmostComparator(a){let h=new Map,d=x=>{let b=x.otherSE;h.set(x,{sine:Ie(this.point,a.point,b.point),cosine:Ne(this.point,a.point,b.point)})};return(x,b)=>{h.has(x)||d(x),h.has(b)||d(b);let{sine:F,cosine:S}=h.get(x),{sine:A,cosine:k}=h.get(b);return F>=0&&A>=0?S<k?1:S>k?-1:0:F<0&&A<0?S<k?-1:S>k?1:0:A<F?-1:A>F?1:0}}}let he=0;class me{static compare(a,h){let d=a.leftSE.point.x,x=h.leftSE.point.x,b=a.rightSE.point.x,F=h.rightSE.point.x;if(F<d)return 1;if(b<x)return-1;let S=a.leftSE.point.y,A=h.leftSE.point.y,k=a.rightSE.point.y,C=h.rightSE.point.y;if(d<x){if(A<S&&A<k)return 1;if(A>S&&A>k)return-1;let v=a.comparePoint(h.leftSE.point);if(v<0)return 1;if(v>0)return-1;let I=h.comparePoint(a.rightSE.point);return I!==0?I:-1}if(d>x){if(S<A&&S<C)return-1;if(S>A&&S>C)return 1;let v=h.comparePoint(a.leftSE.point);if(v!==0)return v;let I=a.comparePoint(h.rightSE.point);return I<0?1:I>0?-1:1}if(S<A)return-1;if(S>A)return 1;if(b<F){let v=h.comparePoint(a.rightSE.point);if(v!==0)return v}if(b>F){let v=a.comparePoint(h.rightSE.point);if(v<0)return 1;if(v>0)return-1}if(b!==F){let v=k-S,I=b-d,_=C-A,Y=F-x;if(v>I&&_<Y)return 1;if(v<I&&_>Y)return-1}return b>F?1:b<F||k<C?-1:k>C?1:a.id<h.id?-1:a.id>h.id?1:0}constructor(a,h,d,x){this.id=++he,this.leftSE=a,a.segment=this,a.otherSE=h,this.rightSE=h,h.segment=this,h.otherSE=a,this.rings=d,this.windings=x}static fromRing(a,h,d){let x,b,F,S=ne.comparePoints(a,h);if(S<0)x=a,b=h,F=1;else if(S>0)x=h,b=a,F=-1;else throw new Error(`Tried to create degenerate segment at [${a.x}, ${a.y}]`);let A=new ne(x,!0),k=new ne(b,!1);return new me(A,k,[d],[F])}replaceRightSE(a){this.rightSE=a,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let a=this.leftSE.point.y,h=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:a<h?a:h},ur:{x:this.rightSE.point.x,y:a>h?a:h}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(a){return a.x===this.leftSE.point.x&&a.y===this.leftSE.point.y||a.x===this.rightSE.point.x&&a.y===this.rightSE.point.y}comparePoint(a){if(this.isAnEndpoint(a))return 0;let h=this.leftSE.point,d=this.rightSE.point,x=this.vector();if(h.x===d.x)return a.x===h.x?0:a.x<h.x?1:-1;let b=(a.y-h.y)/x.y,F=h.x+b*x.x;if(a.x===F)return 0;let S=(a.x-h.x)/x.x,A=h.y+S*x.y;return a.y===A?0:a.y<A?-1:1}getIntersection(a){let h=this.bbox(),d=a.bbox(),x=E(h,d);if(x===null)return null;let b=this.leftSE.point,F=this.rightSE.point,S=a.leftSE.point,A=a.rightSE.point,k=w(h,S)&&this.comparePoint(S)===0,C=w(d,b)&&a.comparePoint(b)===0,v=w(h,A)&&this.comparePoint(A)===0,I=w(d,F)&&a.comparePoint(F)===0;if(C&&k)return I&&!v?F:!I&&v?A:null;if(C)return v&&b.x===A.x&&b.y===A.y?null:b;if(k)return I&&F.x===S.x&&F.y===S.y?null:S;if(I&&v)return null;if(I)return F;if(v)return A;let _=Se(b,this.vector(),S,a.vector());return _===null||!w(x,_)?null:V.round(_.x,_.y)}split(a){let h=[],d=a.events!==void 0,x=new ne(a,!0),b=new ne(a,!1),F=this.rightSE;this.replaceRightSE(b),h.push(b),h.push(x);let S=new me(x,F,this.rings.slice(),this.windings.slice());return ne.comparePoints(S.leftSE.point,S.rightSE.point)>0&&S.swapEvents(),ne.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),d&&(x.checkForConsuming(),b.checkForConsuming()),h}swapEvents(){let a=this.rightSE;this.rightSE=this.leftSE,this.leftSE=a,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let h=0,d=this.windings.length;h<d;h++)this.windings[h]*=-1}consume(a){let h=this,d=a;for(;h.consumedBy;)h=h.consumedBy;for(;d.consumedBy;)d=d.consumedBy;let x=me.compare(h,d);if(x!==0){if(x>0){let b=h;h=d,d=b}if(h.prev===d){let b=h;h=d,d=b}for(let b=0,F=d.rings.length;b<F;b++){let S=d.rings[b],A=d.windings[b],k=h.rings.indexOf(S);k===-1?(h.rings.push(S),h.windings.push(A)):h.windings[k]+=A}d.rings=null,d.windings=null,d.consumedBy=h,d.leftSE.consumedBy=h.leftSE,d.rightSE.consumedBy=h.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 a=this.prev.consumedBy||this.prev;this._beforeState=a.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let a=this.beforeState();this._afterState={rings:a.rings.slice(0),windings:a.windings.slice(0),multiPolys:[]};let h=this._afterState.rings,d=this._afterState.windings,x=this._afterState.multiPolys;for(let S=0,A=this.rings.length;S<A;S++){let k=this.rings[S],C=this.windings[S],v=h.indexOf(k);v===-1?(h.push(k),d.push(C)):d[v]+=C}let b=[],F=[];for(let S=0,A=h.length;S<A;S++){if(d[S]===0)continue;let k=h[S],C=k.poly;if(F.indexOf(C)===-1)if(k.isExterior)b.push(C);else{F.indexOf(C)===-1&&F.push(C);let v=b.indexOf(k.poly);v!==-1&&b.splice(v,1)}}for(let S=0,A=b.length;S<A;S++){let k=b[S].multiPoly;x.indexOf(k)===-1&&x.push(k)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let a=this.beforeState().multiPolys,h=this.afterState().multiPolys;switch(Re.type){case"union":{let d=a.length===0,x=h.length===0;this._isInResult=d!==x;break}case"intersection":{let d,x;a.length<h.length?(d=a.length,x=h.length):(d=h.length,x=a.length),this._isInResult=x===Re.numMultiPolys&&d<x;break}case"xor":{let d=Math.abs(a.length-h.length);this._isInResult=d%2===1;break}case"difference":{let d=x=>x.length===1&&x[0].isSubject;this._isInResult=d(a)!==d(h);break}default:throw new Error(`Unrecognized operation type found ${Re.type}`)}return this._isInResult}}class Pe{constructor(a,h,d){if(!Array.isArray(a)||a.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=h,this.isExterior=d,this.segments=[],typeof a[0][0]!="number"||typeof a[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let x=V.round(a[0][0],a[0][1]);this.bbox={ll:{x:x.x,y:x.y},ur:{x:x.x,y:x.y}};let b=x;for(let F=1,S=a.length;F<S;F++){if(typeof a[F][0]!="number"||typeof a[F][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let A=V.round(a[F][0],a[F][1]);A.x===b.x&&A.y===b.y||(this.segments.push(me.fromRing(b,A,this)),A.x<this.bbox.ll.x&&(this.bbox.ll.x=A.x),A.y<this.bbox.ll.y&&(this.bbox.ll.y=A.y),A.x>this.bbox.ur.x&&(this.bbox.ur.x=A.x),A.y>this.bbox.ur.y&&(this.bbox.ur.y=A.y),b=A)}(x.x!==b.x||x.y!==b.y)&&this.segments.push(me.fromRing(b,x,this))}getSweepEvents(){let a=[];for(let h=0,d=this.segments.length;h<d;h++){let x=this.segments[h];a.push(x.leftSE),a.push(x.rightSE)}return a}}class Le{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pe(a[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 d=1,x=a.length;d<x;d++){let b=new Pe(a[d],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=h}getSweepEvents(){let a=this.exteriorRing.getSweepEvents();for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Oe{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof a[0][0][0]=="number"&&(a=[a])}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 d=0,x=a.length;d<x;d++){let b=new Le(a[d],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=h}getSweepEvents(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Ee{static factory(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.isInResult()||b.ringOut)continue;let F=null,S=b.leftSE,A=b.rightSE,k=[S],C=S.point,v=[];for(;F=S,S=A,k.push(S),S.point!==C;)for(;;){let I=S.getAvailableLinkedEvents();if(I.length===0){let H=k[0].point,q=k[k.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${q.x}, ${q.y}].`)}if(I.length===1){A=I[0].otherSE;break}let _=null;for(let H=0,q=v.length;H<q;H++)if(v[H].point===S.point){_=H;break}if(_!==null){let H=v.splice(_)[0],q=k.splice(H.index);q.unshift(q[0].otherSE),h.push(new Ee(q.reverse()));continue}v.push({index:k.length,point:S.point});let Y=S.getLeftmostComparator(F);A=I.sort(Y)[0].otherSE;break}h.push(new Ee(k))}return h}constructor(a){this.events=a;for(let h=0,d=a.length;h<d;h++)a[h].segment.ringOut=this;this.poly=null}getGeom(){let a=this.events[0].point,h=[a];for(let k=1,C=this.events.length-1;k<C;k++){let v=this.events[k].point,I=this.events[k+1].point;be(v,a,I)!==0&&(h.push(v),a=v)}if(h.length===1)return null;let d=h[0],x=h[1];be(d,a,x)===0&&h.shift(),h.push(h[0]);let b=this.isExteriorRing()?1:-1,F=this.isExteriorRing()?0:h.length-1,S=this.isExteriorRing()?h.length:-1,A=[];for(let k=F;k!=S;k+=b)A.push([h[k].x,h[k].y]);return A}isExteriorRing(){if(this._isExteriorRing===void 0){let a=this.enclosingRing();this._isExteriorRing=a?!a.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let a=this.events[0];for(let x=1,b=this.events.length;x<b;x++){let F=this.events[x];ne.compare(a,F)>0&&(a=F)}let h=a.segment.prevInResult(),d=h?h.prevInResult():null;for(;;){if(!h)return null;if(!d)return h.ringOut;if(d.ringOut!==h.ringOut)return d.ringOut.enclosingRing()!==h.ringOut?h.ringOut:h.ringOut.enclosingRing();h=d.prevInResult(),d=h?h.prevInResult():null}}}class Ue{constructor(a){this.exteriorRing=a,a.poly=this,this.interiorRings=[]}addInterior(a){this.interiorRings.push(a),a.poly=this}getGeom(){let a=[this.exteriorRing.getGeom()];if(a[0]===null)return null;for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getGeom();x!==null&&a.push(x)}return a}}class ze{constructor(a){this.rings=a,this.polys=this._composePolys(a)}getGeom(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getGeom();x!==null&&a.push(x)}return a}_composePolys(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.poly)if(b.isExteriorRing())h.push(new Ue(b));else{let F=b.enclosingRing();F.poly||h.push(new Ue(F)),F.poly.addInterior(b)}}return h}}class We{constructor(a){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:me.compare;this.queue=a,this.tree=new l(h),this.segments=[]}process(a){let h=a.segment,d=[];if(a.consumedBy)return a.isLeft?this.queue.remove(a.otherSE):this.tree.remove(h),d;let x=a.isLeft?this.tree.add(h):this.tree.find(h);if(!x)throw new Error(`Unable to find segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] in SweepLine tree.`);let b=x,F=x,S,A;for(;S===void 0;)b=this.tree.prev(b),b===null?S=null:b.key.consumedBy===void 0&&(S=b.key);for(;A===void 0;)F=this.tree.next(F),F===null?A=null:F.key.consumedBy===void 0&&(A=F.key);if(a.isLeft){let k=null;if(S){let v=S.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(k=v),!S.isAnEndpoint(v))){let I=this._splitSafely(S,v);for(let _=0,Y=I.length;_<Y;_++)d.push(I[_])}}let C=null;if(A){let v=A.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(C=v),!A.isAnEndpoint(v))){let I=this._splitSafely(A,v);for(let _=0,Y=I.length;_<Y;_++)d.push(I[_])}}if(k!==null||C!==null){let v=null;k===null?v=C:C===null?v=k:v=ne.comparePoints(k,C)<=0?k:C,this.queue.remove(h.rightSE),d.push(h.rightSE);let I=h.split(v);for(let _=0,Y=I.length;_<Y;_++)d.push(I[_])}d.length>0?(this.tree.remove(h),d.push(a)):(this.segments.push(h),h.prev=S)}else{if(S&&A){let k=S.getIntersection(A);if(k!==null){if(!S.isAnEndpoint(k)){let C=this._splitSafely(S,k);for(let v=0,I=C.length;v<I;v++)d.push(C[v])}if(!A.isAnEndpoint(k)){let C=this._splitSafely(A,k);for(let v=0,I=C.length;v<I;v++)d.push(C[v])}}}this.tree.remove(h)}return d}_splitSafely(a,h){this.tree.remove(a);let d=a.rightSE;this.queue.remove(d);let x=a.split(h);return x.push(d),a.consumedBy===void 0&&this.tree.add(a),x}}let ut=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Rt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class $t{run(a,h,d){Re.type=a,V.reset();let x=[new Oe(h,!0)];for(let v=0,I=d.length;v<I;v++)x.push(new Oe(d[v],!1));if(Re.numMultiPolys=x.length,Re.type==="difference"){let v=x[0],I=1;for(;I<x.length;)E(x[I].bbox,v.bbox)!==null?I++:x.splice(I,1)}if(Re.type==="intersection")for(let v=0,I=x.length;v<I;v++){let _=x[v];for(let Y=v+1,H=x.length;Y<H;Y++)if(E(_.bbox,x[Y].bbox)===null)return[]}let b=new l(ne.compare);for(let v=0,I=x.length;v<I;v++){let _=x[v].getSweepEvents();for(let Y=0,H=_.length;Y<H;Y++)if(b.insert(_[Y]),b.size>ut)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let F=new We(b),S=b.size,A=b.pop();for(;A;){let v=A.key;if(b.size===S){let _=v.segment;throw new Error(`Unable to pop() ${v.isLeft?"left":"right"} SweepEvent [${v.point.x}, ${v.point.y}] from segment #${_.id} [${_.leftSE.point.x}, ${_.leftSE.point.y}] -> [${_.rightSE.point.x}, ${_.rightSE.point.y}] from queue.`)}if(b.size>ut)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(F.segments.length>Rt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=F.process(v);for(let _=0,Y=I.length;_<Y;_++){let H=I[_];H.consumedBy===void 0&&b.insert(H)}S=b.size,A=b.pop()}V.reset();let k=Ee.factory(F.segments);return new ze(k).getGeom()}}let Re=new $t;var io={union:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("union",M,h)},intersection:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("intersection",M,h)},xor:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("xor",M,h)},difference:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("difference",M,h)}};return io})});var ht=new Set,Wt=!1;function Xe(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length;ht.size&&ht.clear();let r=Bn(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let u=0,l=0,c=0;if(i&&(r=vo(e,t,r,n)),e.length>80*n){u=e[0],l=e[1];let f=u,m=l;for(let p=n;p<o;p+=n){let g=e[p],y=e[p+1];g<u&&(u=g),y<l&&(l=y),g>f&&(f=g),y>m&&(m=y)}c=Math.max(f-u,m-l),c=c!==0?32767/c:0}return Zt(r,s,u,l,c),s}function Bn(e,t,n,i,o){let r=null;if(o===Co(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=_n(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=_n(s/i|0,e[s],e[s+1],r);return r&&mt(r,r.next)&&(dt(r),r=r.next),r}function Ke(e,t=e){let n=t===e,i=e,o;do o=!1,i!==i.next&&(ht.size===0||!ht.has(i))&&(mt(i,i.next)||fe(i.prev,i,i.next)===0)?((n||i===t)&&(t=i.prev),Wt=!0,dt(i),i=i.prev,o=!0):(n||i!==t)&&(i=i.next,o=!n);while(o||i!==t);return t}function Zt(e,t,n,i,o){o&&Io(e,n,i,o);let r=e,s=!1;for(;e.prev!==e.next;){let u=e.prev,l=e.next;if(fe(u,e,l)<0&&(o?yo(e,n,i,o):xo(e))){t.push(u.i,e.i,l.i),dt(e),e=l,r=l;continue}if(e=l,e===r){if(Wt=!1,e=Ke(e),Wt){r=e;continue}if(!s){e=wo(e,t),r=e,s=!0;continue}Mo(e,t,n,i,o);break}}}function xo(e){let t=e.prev,n=e,i=e.next,o=t.x,r=n.x,s=i.x,u=t.y,l=n.y,c=i.y,f=Math.min(o,r,s),m=Math.min(u,l,c),p=Math.max(o,r,s),g=Math.max(u,l,c),y=i.next;for(;y!==t;){if(y.x>=f&&y.x<=p&&y.y>=m&&y.y<=g&&!(o===y.x&&u===y.y)&&At(o,u,r,l,s,c,y.x,y.y)&&fe(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function yo(e,t,n,i){let o=e.prev,r=e,s=e.next,u=o.x,l=r.x,c=s.x,f=o.y,m=r.y,p=s.y,g=Math.min(u,l,c),y=Math.min(f,m,p),w=Math.max(u,l,c),E=Math.max(f,m,p),R=qt(g,y,t,n,i),T=qt(w,E,t,n,i),L=e.prevZ;for(;L&&L.z>=R;){if(L.x>=g&&L.x<=w&&L.y>=y&&L.y<=E&&L!==s&&!(u===L.x&&f===L.y)&&At(u,f,l,m,c,p,L.x,L.y)&&fe(L.prev,L,L.next)>=0)return!1;L=L.prevZ}let P=e.nextZ;for(;P&&P.z<=T;){if(P.x>=g&&P.x<=w&&P.y>=y&&P.y<=E&&P!==s&&!(u===P.x&&f===P.y)&&At(u,f,l,m,c,p,P.x,P.y)&&fe(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function wo(e,t){let n=e,i=!1;do{let o=n.prev,r=n.next.next;Vn(o,n,n.next,r,!1)&&pt(o,r)&&pt(r,o)&&(t.push(o.i,n.i,r.i),dt(n),dt(n.next),n=e=r,i=!0),n=n.next}while(n!==e);return i?Ke(n):n}function Mo(e,t,n,i,o){let r=e;do{let s=r.next.next;for(;s!==r.prev;){if(r.i!==s.i&&_o(r,s)){let u=On(r,s);r=Ke(r,r.next),u=Ke(u,u.next),Zt(r,t,n,i,o),Zt(u,t,n,i,o);return}s=s.next}r=r.next}while(r!==e)}var Kt=!1;function vo(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let u=t[r]*i,l=r<s-1?t[r+1]*i:e.length,c=Bn(e,u,l,i,!1);c===c.next&&ht.add(c),o.push(Lo(c))}o.sort(So),Eo(e.length/i,t.length),Cn(n,n),Kt=!0;for(let r=0;r<o.length;r++)n=Ro(o[r],n);return Kt=!1,Ke(n)}function So(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Ro(e,t){let n=ko(e,t);if(!n)return t;let i=On(n,e),o=i.next;return Cn(n,o.next),Ke(i,i.next),Ke(n,n.next)}var Tn=16,le=new Float64Array(0),kt=0,Qt=[],Jt=[];function Eo(e,t){let n=Math.ceil((e+2*t)/Tn)+t+2;le.length<n*4&&(le=new Float64Array(n*4)),kt=0}function Cn(e,t){let n=e;do{let i=kt++;Qt[i]=n;let o=1/0,r=1/0,s=-1/0,u=-1/0,l=0;do{let f=n.next;n.z=i,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<r&&(r=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<r&&(r=f.y),f.y>u&&(u=f.y),n=f}while(++l<Tn&&n!==t);Jt[i]=n;let c=i*4;le[c]=o,le[c+1]=r,le[c+2]=s,le[c+3]=u}while(n!==t)}function Fo(e,t){let n=e.z*4;t.x<le[n]&&(le[n]=t.x),t.y<le[n+1]&&(le[n+1]=t.y),t.x>le[n+2]&&(le[n+2]=t.x),t.y>le[n+3]&&(le[n+3]=t.y)}function Pn(e){let t=Jt[e];for(;t.prev.next!==t;)t=t.next;return Jt[e]=t,t}function Ln(e){let t=Qt[e];for(;t.prev.next!==t;)t=t.next;return Qt[e]=t,t}function ko(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(mt(e,n))return n;for(let p=0,g=0;p<kt;p++,g+=4){if(o<le[g+1]||o>le[g+3]||le[g]>i||le[g+2]<=r)continue;let y=Pn(p);n=Ln(p);do{if(n.prev.next===n){if(mt(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let w=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(w<=i&&w>r&&(r=w,s=n.x<n.next.x?n:n.next,w===i))return s}}n=n.next}while(n!==y)}if(!s)return null;let u=s.x,l=s.y,c=Math.min(o,l),f=Math.max(o,l),m=1/0;for(let p=0,g=0;p<kt;p++,g+=4){if(le[g+2]<u||le[g]>i||le[g+3]<c||le[g+1]>f)continue;let y=Pn(p);n=Ln(p);do{if(n.prev.next===n&&i>=n.x&&n.x>=u&&i!==n.x&&At(o<l?i:r,o,u,l,o<l?r:i,o,n.x,n.y)){let w=Math.abs(o-n.y)/(i-n.x);(pt(n,e)||n.y===o&&n.next.y===o&&n.next.x>i)&&(w<m||w===m&&(n.x>s.x||n.x===s.x&&Ao(s,n)))&&(s=n,m=w)}n=n.next}while(n!==y)}return s}function Ao(e,t){return fe(e.prev,e,t.prev)<0&&fe(t.next,e,e.next)<0}var ke=[],ct=[],Ze=new Uint32Array(0),at=new Uint32Array(0),ft=new Uint32Array(256);function Io(e,t,n,i){let o=e,r=0;do o.z=qt(o.x,o.y,t,n,i),ke[r++]=o,o=o.next;while(o!==e);Po(r);let s=null;for(let u=0;u<r;u++){let l=ke[u];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null}function Po(e){if(e<=32){for(let t=1;t<e;t++){let n=ke[t],i=n.z,o=t-1;for(;o>=0&&ke[o].z>i;)ke[o+1]=ke[o],o--;ke[o+1]=n}return}Ze.length<e&&(Ze=new Uint32Array(e),at=new Uint32Array(e),ct=new Array(e));for(let t=0;t<e;t++)Ze[t]=ke[t].z;Et(e,ke,Ze,ct,at,0),Et(e,ct,at,ke,Ze,8),Et(e,ke,Ze,ct,at,16),Et(e,ct,at,ke,Ze,24)}function Et(e,t,n,i,o,r){ft.fill(0);for(let u=0;u<e;u++)ft[n[u]>>>r&255]++;let s=0;for(let u=0;u<256;u++){let l=ft[u];ft[u]=s,s+=l}for(let u=0;u<e;u++){let l=n[u],c=ft[l>>>r&255]++;i[c]=t[u],o[c]=l}}function qt(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Lo(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function At(e,t,n,i,o,r,s,u){return(o-s)*(t-u)>=(e-s)*(r-u)&&(e-s)*(i-u)>=(n-s)*(t-u)&&(n-s)*(r-u)>=(o-s)*(i-u)}function _o(e,t){let n=mt(e,t)&&fe(e.prev,e,e.next)>0&&fe(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||pt(e,t)&&pt(t,e)&&(fe(e.prev,e,t.prev)!==0||fe(e,t.prev,t)!==0))&&!Bo(e,t)&&(n||To(e,t))}function fe(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function mt(e,t){return e.x===t.x&&e.y===t.y}function Vn(e,t,n,i,o=!0){let r=fe(e,t,n),s=fe(e,t,i),u=fe(n,i,e),l=fe(n,i,t);return(r>0&&s<0||r<0&&s>0)&&(u>0&&l<0||u<0&&l>0)?!0:o?!!(r===0&&Ft(e,n,t)||s===0&&Ft(e,i,t)||u===0&&Ft(n,e,i)||l===0&&Ft(n,t,i)):!1}function Ft(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Bo(e,t){let n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.y,t.y),s=e;do{let u=s.next;if(s.x>i&&u.x>i||s.x<n&&u.x<n||s.y>r&&u.y>r||s.y<o&&u.y<o){s=u;continue}if(s.i!==e.i&&u.i!==e.i&&s.i!==t.i&&u.i!==t.i&&Vn(s,u,e,t))return!0;s=u}while(s!==e);return!1}function pt(e,t){return fe(e.prev,e,e.next)<0?fe(e,t,e.next)>=0&&fe(e,e.prev,t)>=0:fe(e,t,e.prev)<0||fe(e,e.next,t)<0}function To(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do{let s=n.next;n.y>r!=s.y>r&&o<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i),n=s}while(n!==e);return i}function On(e,t){let n=en(e.i,e.x,e.y),i=en(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function _n(e,t,n,i){let o=en(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function dt(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),Kt&&Fo(e.prev,e.next)}function en(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Co(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var Dn=23283064365386963e-26,Vo=12,Nn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),tn=0,It=1,bt=2,Pt=5,gt=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,i=this.length){for(;this.pos<i;){let o=this.readVarint(),r=o>>3,s=this.pos;this.type=o&7,t(r,n,this),this.pos===s&&this.skip(o)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let n=this.buf,i,o;return o=n[this.pos++],i=o&127,o<128||(o=n[this.pos++],i|=(o&127)<<7,o<128)||(o=n[this.pos++],i|=(o&127)<<14,o<128)||(o=n[this.pos++],i|=(o&127)<<21,o<128)?i:(o=n[this.pos],i|=(o&15)<<28,Oo(i,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Vo&&Nn?Nn.decode(this.buf.subarray(n,t)):Ko(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===bt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===tn)for(;this.buf[this.pos++]>127;);else if(n===bt)this.pos=this.readVarint()+this.pos;else if(n===Pt)this.pos+=4;else if(n===It)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)n*=2;if(n!==this.length){let i=new Uint8Array(n);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Dn),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Dn),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Do(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=Qo(this.buf,t,this.pos);let i=this.pos-n;i>=128&&Un(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let i=0;i<n;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,n){this.pos++;let i=this.pos;t(n,this);let o=this.pos-i;o>=128&&Un(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(t,n,i){this.writeTag(t,bt),this.writeRawMessage(n,i)}writePackedVarint(t,n){n.length&&this.writeMessage(t,Go,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,jo,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Xo,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Ho,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,zo,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Yo,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,$o,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Wo,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Zo,n)}writeBytesField(t,n){this.writeTag(t,bt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,Pt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,Pt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,It),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,It),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,tn),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,tn),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,bt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,Pt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,It),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function Oo(e,t,n){let i=n.buf,o,r;if(r=i[n.pos++],o=(r&112)>>4,r<128||(r=i[n.pos++],o|=(r&127)<<3,r<128)||(r=i[n.pos++],o|=(r&127)<<10,r<128)||(r=i[n.pos++],o|=(r&127)<<17,r<128)||(r=i[n.pos++],o|=(r&127)<<24,r<128)||(r=i[n.pos++],o|=(r&1)<<31,r<128))return et(e,o,t);throw new Error("Expected varint not more than 10 bytes")}function et(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Do(e,t){let n,i;if(e>=0?(n=e%4294967296|0,i=e/4294967296|0):(n=~(-e%4294967296),i=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),No(n,i,t),Uo(i,t)}function No(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function Uo(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Un(e,t,n){let i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(i);for(let o=n.pos-1;o>=e;o--)n.buf[o+i]=n.buf[o]}function Go(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function jo(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Ho(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function zo(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Xo(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Yo(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function $o(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Wo(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Zo(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Ko(e,t,n){let i="",o=t;for(;o<n;){let r=e[o],s=null,u=r>239?4:r>223?3:r>191?2:1;if(o+u>n)break;let l,c,f;u===1?r<128&&(s=r):u===2?(l=e[o+1],(l&192)===128&&(s=(r&31)<<6|l&63,s<=127&&(s=null))):u===3?(l=e[o+1],c=e[o+2],(l&192)===128&&(c&192)===128&&(s=(r&15)<<12|(l&63)<<6|c&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(l=e[o+1],c=e[o+2],f=e[o+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(s=(r&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),o+=u}return i}function Qo(e,t,n){for(let i=0,o,r;i<t.length;i++){if(o=t.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){e[n++]=239,e[n++]=191,e[n++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):r=o;continue}else r&&(e[n++]=239,e[n++]=191,e[n++]=189,r=null);o<128?e[n++]=o:(o<2048?e[n++]=o>>6|192:(o<65536?e[n++]=o>>12|224:(e[n++]=o>>18|240,e[n++]=o>>12&63|128),e[n++]=o>>6&63|128),e[n++]=o&63|128)}return n}var nn=class e{constructor(t,n,i,o){this.pbf=t;this.keys=n;this.values=i;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,i,o,r){let s=new e(t,i,o,r);return t.readFields(Jo,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let i=t.readVarint()+t.pos,o=1,r=0,s=0,u=0,l=[],c=[];for(;t.pos<i;){if(r<=0){let f=t.readVarint();o=f&7,r=f>>3}if(r--,o===1||o===2)s+=t.readSVarint(),u+=t.readSVarint(),o===1&&(c.length&&l.push(c),c=[]),c.push(s,u);else if(o===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: ${o}`)}return c.length&&l.push(c),t.pos=n,l}bbox(){let t=this.loadGeometry(),n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return[n,i,o,r]}};function Jo(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?qo(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function qo(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let i=t.keys[e.readVarint()],o=t.values[e.readVarint()];i!==void 0&&(t.properties[i]=o)}}var rn=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let i=new e(t);return t.readFields(ei,i,n),i}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let i=n.readVarint()+n.pos;return nn.read(n,i,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ei(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ti(n)))}function ti(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let i=e.readVarint()>>3;i===1?n=e.readString():i===2?n=e.readFloat():i===3?n=e.readDouble():i===4?n=e.readVarint64():i===5?n=e.readVarint():i===6?n=e.readSVarint():i===7?n=e.readBoolean():e.skip(i)}return n}var Lt=class{constructor(t){this.layers={};new gt(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((i,o,r)=>{if(i===3&&r){let s=rn.read(r,r.readVarint()+r.pos);s.length&&(this.layers[s.name]=s)}},null)}};function tt(e){let t=[],n=null;for(let i of e){if(i.length<6)continue;let o=ni(i);o!==0&&(o>0?(n&&t.push(n),n={outer:i,holes:[]}):n&&n.holes.push(i))}return n&&t.push(n),t}function ni(e){let t=0;for(let n=0,i=e.length-2;n<e.length;i=n,n+=2)t+=(e[i]-e[n])*(e[n+1]+e[i+1]);return t/2}function Qe(e){let t=e.trim();if(t[0]==="#"){let i=t.slice(1);if(i.length===3||i.length===4){let o=i.split("").map(r=>parseInt(r+r,16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}if(i.length===6||i.length===8){let o=[];for(let r=0;r<i.length;r+=2)o.push(parseInt(i.slice(r,r+2),16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}}let n=t.match(/^rgba?\\(([^)]+)\\)$/i);if(n){let i=n[1].split(",").map(o=>parseFloat(o));if(i.length>=3)return[i[0]/255,i[1]/255,i[2]/255,i.length>3?i[3]:1]}return[1,0,1,1]}function Bt(e){return Array.isArray(e)&&typeof e[0]=="string"}var Gn=new WeakMap;function nt(e,t){if(!Bt(e))return e;let n=Gn.get(e);n||(n=zn(e),Gn.set(e,n));try{return n(t)}catch{return null}}var jn=new WeakMap,ri=new Set(["get","has","id","geometry-type","properties","feature-state","within"]);function Je(e){if(!Array.isArray(e))return!1;let t=jn.get(e);if(t!==void 0)return t;let n=typeof e[0]=="string"&&ri.has(e[0]);if(!n){for(let i of e)if(Je(i)){n=!0;break}}return jn.set(e,n),n}function Tt(e,t){let n=nt(e,t);return typeof n=="string"?Qe(n):Ct(n)?[n.r,n.g,n.b,n.a]:null}function Ct(e){return!!e&&typeof e=="object"&&"r"in e&&"a"in e}function _t(e){if(Ct(e))return e;if(typeof e=="string"){let[t,n,i,o]=Qe(e);return{r:t,g:n,b:i,a:o}}return null}var $=e=>typeof e=="number"?e:Number(e),Ae=e=>e===null?"":Ct(e)?`rgba(${e.r},${e.g},${e.b},${e.a})`:typeof e=="string"?e:JSON.stringify(e),xt=e=>!(e===null||e===!1||e===0||e==="");function De(e,t){if(typeof e=="number"&&typeof t=="number")return e-t;let n=Ae(e),i=Ae(t);return n<i?-1:n>i?1:0}function zn(e){let t=e[0],n=e.slice(1),i=r=>{let s=n[r];return Bt(s)?zn(s):()=>s},o=n.map((r,s)=>i(s));switch(t){case"get":{let r=i(0),s=n.length>1?i(1):null;return u=>(s?s(u):u.properties)?.[Ae(r(u))]??null}case"has":{let r=i(0),s=n.length>1?i(1):null;return u=>{let l=s?s(u):u.properties;return!!l&&l[Ae(r(u))]!=null}}case"properties":return r=>r.properties??{};case"id":return r=>r.id??null;case"geometry-type":return r=>r.geometryType??null;case"feature-state":{let r=i(0);return s=>s.featureState?.[Ae(r(s))]??null}case"global-state":{let r=i(0);return s=>s.globalState?.[Ae(r(s))]??null}case"zoom":return r=>r.zoom??0;case"literal":return()=>n[0];case"array":return r=>o[o.length-1](r);case"to-string":return r=>Ae(o[0](r));case"to-number":return r=>{for(let s of o){let u=Number(s(r));if(Number.isFinite(u))return u}return 0};case"to-boolean":return r=>xt(o[0](r));case"to-color":return r=>_t(o[0](r))??null;case"typeof":return r=>{let s=o[0](r);return s===null?"null":Array.isArray(s)?"array":Ct(s)?"color":typeof s};case"rgb":case"rgba":return r=>({r:$(o[0](r))/255,g:$(o[1](r))/255,b:$(o[2](r))/255,a:o[3]?$(o[3](r)):1});case"to-rgba":return r=>{let s=_t(o[0](r));return s?[s.r*255,s.g*255,s.b*255,s.a]:null};case"case":return r=>{for(let s=0;s+1<o.length;s+=2)if(xt(o[s](r)))return o[s+1](r);return o.length%2===1?o[o.length-1](r):null};case"match":return r=>{let s=o[0](r);for(let u=1;u+1<o.length;u+=2){let l=n[u];if(Array.isArray(l)?l.some(f=>De(f,s)===0):De(l,s)===0)return o[u+1](r)}return o.length%2===0?o[o.length-1](r):null};case"coalesce":return r=>{for(let s of o){let u=s(r);if(u!=null)return u}return null};case"all":return r=>o.every(s=>xt(s(r)));case"any":return r=>o.some(s=>xt(s(r)));case"!":return r=>!xt(o[0](r));case"==":return r=>De(o[0](r),o[1](r))===0;case"!=":return r=>De(o[0](r),o[1](r))!==0;case"<":return r=>De(o[0](r),o[1](r))<0;case"<=":return r=>De(o[0](r),o[1](r))<=0;case">":return r=>De(o[0](r),o[1](r))>0;case">=":return r=>De(o[0](r),o[1](r))>=0;case"in":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.includes(Ae(s)):Array.isArray(u)&&u.some(l=>De(l,s)===0)};case"index-of":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.indexOf(Ae(s)):Array.isArray(u)?u.findIndex(l=>De(l,s)===0):-1};case"step":return r=>{let s=$(o[0](r)),u=o[1](r);for(let l=2;l+1<o.length&&s>=$(o[l](r));l+=2)u=o[l+1](r);return u};case"interpolate":case"interpolate-hcl":case"interpolate-lab":{let r=n[0],s=i(1),u=[];for(let l=2;l+1<n.length;l+=2)u.push({at:i(l),value:i(l+1)});return l=>{let c=$(s(l));if(!u.length)return null;if(c<=$(u[0].at(l)))return u[0].value(l);let f=u[u.length-1];if(c>=$(f.at(l)))return f.value(l);for(let m=1;m<u.length;m++){let p=$(u[m].at(l));if(c>p)continue;let g=$(u[m-1].at(l)),y=oi(r,g,p,c);return Xn(u[m-1].value(l),u[m].value(l),y)}return f.value(l)}}case"+":return r=>o.reduce((s,u)=>s+$(u(r)),0);case"*":return r=>o.reduce((s,u)=>s*$(u(r)),1);case"-":return r=>o.length===1?-$(o[0](r)):$(o[0](r))-$(o[1](r));case"/":return r=>$(o[0](r))/$(o[1](r));case"%":return r=>$(o[0](r))%$(o[1](r));case"^":return r=>Math.pow($(o[0](r)),$(o[1](r)));case"abs":return r=>Math.abs($(o[0](r)));case"ceil":return r=>Math.ceil($(o[0](r)));case"floor":return r=>Math.floor($(o[0](r)));case"round":return r=>Math.round($(o[0](r)));case"sqrt":return r=>Math.sqrt($(o[0](r)));case"ln":return r=>Math.log($(o[0](r)));case"ln2":return()=>Math.LN2;case"log10":return r=>Math.log10($(o[0](r)));case"log2":return r=>Math.log2($(o[0](r)));case"sin":return r=>Math.sin($(o[0](r)));case"cos":return r=>Math.cos($(o[0](r)));case"tan":return r=>Math.tan($(o[0](r)));case"asin":return r=>Math.asin($(o[0](r)));case"acos":return r=>Math.acos($(o[0](r)));case"atan":return r=>Math.atan($(o[0](r)));case"e":return()=>Math.E;case"pi":return()=>Math.PI;case"min":return r=>Math.min(...o.map(s=>$(s(r))));case"max":return r=>Math.max(...o.map(s=>$(s(r))));case"random":return r=>{let s=o.length>0?$(o[0](r)):0,u=o.length>1?$(o[1](r)):1;return s+Math.random()*(u-s)};case"concat":return r=>o.map(s=>Ae(s(r))).join("");case"downcase":return r=>Ae(o[0](r)).toLowerCase();case"upcase":return r=>Ae(o[0](r)).toUpperCase();case"length":return r=>{let s=o[0](r);return typeof s=="string"?[...s].length:Array.isArray(s)?s.length:0};case"at":return r=>{let s=$(o[0](r)),u=o[1](r);return Array.isArray(u)?u[s]??null:null};case"slice":return r=>{let s=o[0](r),u=$(o[1](r)),l=o.length>2?$(o[2](r)):void 0;return typeof s=="string"||Array.isArray(s)?s.slice(u,l):null};case"number-format":return r=>{let s=$(o[0](r)),u=n[1]??{};return new Intl.NumberFormat(u.locale??void 0,{minimumFractionDigits:u["min-fraction-digits"],maximumFractionDigits:u["max-fraction-digits"],currency:u.currency,style:u.currency?"currency":void 0}).format(s)};case"let":{let r=[],s=[];for(let l=0;l+1<n.length-1;l+=2)r.push(n[l]),s.push(i(l+1));let u=i(n.length-1);return l=>{let c={...l.vars};return r.forEach((f,m)=>{c[f]=s[m](l)}),u({...l,vars:c})}}case"var":{let r=n[0];return s=>s.vars?.[r]??null}case"within":{let r=n[0];return s=>{let u=s.point;if(!u||!r?.coordinates)return!1;let l=r.type==="MultiPolygon"?r.coordinates.flat():r.coordinates,c=!1;for(let f of l)for(let m=0,p=f.length-1;m<f.length;p=m++){let[g,y]=f[m],[w,E]=f[p];y>u[1]!=E>u[1]&&u[0]<(w-g)*(u[1]-y)/(E-y)+g&&(c=!c)}return c}}default:return()=>(Hn.has(t)||(Hn.add(t),console.warn(`[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\xAB${t}\\xBB \\u043F\\u043E\\u043A\\u0430 \\u043D\\u0435 \\u043F\\u043E\\u0434\\u0434\\u0435\\u0440\\u0436\\u0430\\u043D\\u043E`)),null)}}var Hn=new Set;function oi(e,t,n,i){let o=n-t,r=o===0?0:(i-t)/o;if(!Array.isArray(e))return r;let s=e[0];if(s==="exponential"){let u=Number(e[1]??1);return u===1||o===0?r:(Math.pow(u,i-t)-1)/(Math.pow(u,o)-1)}if(s==="cubic-bezier"){let[,u,l,c,f]=e;return ii(u,l,c,f,r)}return r}function ii(e,t,n,i,o){let r=3*e,s=3*(n-e)-r,u=1-r-s,l=3*t,c=3*(i-t)-l,f=1-l-c,m=o;for(let p=0;p<8;p++){let g=((u*m+s)*m+r)*m-o;if(Math.abs(g)<1e-5)break;let y=(3*u*m+2*s)*m+r;if(Math.abs(y)<1e-6)break;m-=g/y}return((f*m+c)*m+l)*m}function Xn(e,t,n){if(typeof e=="number"&&typeof t=="number")return e+(t-e)*n;let i=_t(e),o=_t(t);return i&&o?{r:i.r+(o.r-i.r)*n,g:i.g+(o.g-i.g)*n,b:i.b+(o.b-i.b)*n,a:i.a+(o.a-i.a)*n}:Array.isArray(e)&&Array.isArray(t)?e.map((r,s)=>Xn(r,t[s]??r,n)):n<.5?e:t}var $n={};function Wn(e,t,n){if(e===void 0)return n;if(typeof e=="string")return Qe(e);if(Bt(e))return ui(e),Tt(e,{zoom:t,globalState:$n})??n;let i=e.stops;return ai(i,t,(o,r,s)=>{let u=Qe(o),l=Qe(r);return[u[0]+(l[0]-u[0])*s,u[1]+(l[1]-u[1])*s,u[2]+(l[2]-u[2])*s,u[3]+(l[3]-u[3])*s]},n)}var Yn=new WeakSet,si=new WeakSet;function ui(e){si.has(e)||!Je(e)||Yn.has(e)||(Yn.add(e),console.warn("[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\u0441\\u043C\\u043E\\u0442\\u0440\\u0438\\u0442 \\u043D\\u0430 \\u0444\\u0438\\u0447\\u0443, \\u0430 \\u044D\\u0442\\u043E \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u0438\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u0435\\u0442\\u0441\\u044F \\u0440\\u0430\\u0437 \\u043D\\u0430 \\u0441\\u043B\\u043E\\u0439 \\u2014 \\u043E\\u043D\\u043E \\u0431\\u0443\\u0434\\u0435\\u0442 \\u0437\\u0430\\u043F\\u0430\\u0441\\u043D\\u044B\\u043C. \\u041D\\u0430 \\u0444\\u0438\\u0447\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u044E\\u0442\\u0441\\u044F \\u0446\\u0432\\u0435\\u0442, \\u043F\\u0440\\u043E\\u0437\\u0440\\u0430\\u0447\\u043D\\u043E\\u0441\\u0442\\u044C \\u0438 \\u0448\\u0438\\u0440\\u0438\\u043D\\u0430 \\u043B\\u0438\\u043D\\u0438\\u0438; \\u0441\\u043C. porting/maplibre-api.md, \\u0444\\u0430\\u0437\\u0430 7\\u0431.",e))}function li(e){let t=e[0];return ci.has(t)?t==="all"||t==="any"||t==="!"?!1:Array.isArray(e[1]):!0}var ci=new Set(["==","!=",">",">=","<","<=","in","!in","has","!has","all","any","!"]);function ai(e,t,n,i){if(!e.length)return i;if(t<=e[0][0])return n(e[0][1],e[0][1],0);let o=e[e.length-1];if(t>=o[0])return n(o[1],o[1],0);for(let r=1;r<e.length;r++){let[s,u]=e[r];if(t>s)continue;let[l,c]=e[r-1],f=s-l,m=f===0?0:(t-l)/f;return n(c,u,m)}return i}function pe(e,t,n){if(!e)return!0;let i=e[0];if(li(e))return nt(e,{properties:t,id:n?.id??null,geometryType:n?.geometryType,featureState:n?.featureState,globalState:$n})===!0;switch(i){case"all":return e.slice(1).every(o=>pe(o,t));case"any":return e.slice(1).some(o=>pe(o,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let o=t[e[1]];return o==null?!1:e.slice(2).includes(o)}case"!in":{let o=t[e[1]];return o==null?!0:!e.slice(2).includes(o)}default:{let o=t[e[1]],r=e[2];if(o==null)return i==="!=";switch(i){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!0}}}}var fi=Math.PI/8,hi=.35,mi=32,Kn=.25,Qn=.5,Jn=.07;function je(e,t){let n=t.radius;if(!(n>0))return e;let i=e.length/2-1;if(i<3)return e;let o=Math.max(2,Math.round(t.segments??4)),r=Math.max(t.minCutRatio??hi,0),s=t.extent,u=[];for(let l=0;l<i;l++){let c=e[l*2],f=e[l*2+1],m=e[(l+i-1)%i*2],p=e[(l+i-1)%i*2+1],g=e[(l+1)%i*2],y=e[(l+1)%i*2+1],w=c-m,E=f-p,R=g-c,T=y-f,L=Math.hypot(w,E),P=Math.hypot(R,T);if(L<1e-6||P<1e-6){u.push(c,f);continue}let U=w/L,V=E/L,D=R/P,j=T/P;if(t.keep?.[l]){u.push(c,f);continue}let O=U*D+V*j;if(O>.985){u.push(c,f);continue}if(s!==void 0&&(c<=0||c>=s||f<=0||f>=s)){u.push(c,f);continue}let z=Math.min(n,L*Zn,P*Zn);if(z<n*r){u.push(c,f);continue}let G=c-U*z,te=f-V*z,ie=c+D*z,J=f+j*z,X=Math.acos(Math.max(-1,Math.min(1,O))),W=Math.min(fi,Math.PI/2/o),re=Math.ceil(X/W-1e-6),Q=t.maxChord&&t.maxChord>0?Math.ceil(z/Math.tan(X/2)*X/t.maxChord):0,B=Math.max(1,Math.min(mi,Math.max(Math.min(o,re),Q)));u.push(G,te);for(let N=1;N<B;N++){let ee=N/B,Z=1-ee;u.push(Z*Z*G+2*Z*ee*c+ee*ee*ie,Z*Z*te+2*Z*ee*f+ee*ee*J)}u.push(ie,J)}return u.length<6?e:(u.push(u[0],u[1]),u)}var Zn=.4;var ve=e=>e/64;function He(e,t,n=0){let i=qn(e.outer,t,n);if(!i)return null;let o=[];for(let r of e.holes){let s=qn(r,t,n);s&&o.push(s)}return{outer:i,holes:o}}function qn(e,t,n){let i=[];for(let o=0;o<e.length-2;o+=2)i.push(e[o],e[o+1]);if(i.length<6)return null;for(let o=0;o<4;o++){let r=i;i=[];let s=r.length/2;if(s===0)return null;for(let u=0;u<s;u++){let l=r[u*2],c=r[u*2+1],f=r[(u+s-1)%s*2],m=r[(u+s-1)%s*2+1],p=er(l,c,o,t,n),g=er(f,m,o,t,n);if(p!==g){let y=pi(f,m,l,c,o,t,n),w=o===0?-n:o===1?t+n:f+(l-f)*y,E=o===2?-n:o===3?t+n:m+(c-m)*y;i.push(w,E)}p&&i.push(l,c)}}return i.length<6?null:(i.push(i[0],i[1]),i)}function er(e,t,n,i,o){return n===0?e>=-o:n===1?e<=i+o:n===2?t>=-o:t<=i+o}function pi(e,t,n,i,o,r,s){return o===0?(-s-e)/(n-e):o===1?(r+s-e)/(n-e):o===2?(-s-t)/(i-t):(r+s-t)/(i-t)}function Vt(e,t,n,i,o,r=0){let s=-r,u=o+r;return e===s&&n===s||e===u&&n===u||t===s&&i===s||t===u&&i===u}function on(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var tr=1,ln=18,cn=32,nr=8,ar=65535/cn,di=9,bi=1,gi=0,xi=1,yi=2;var rr=0,wi=1,or=2,Mi=3,vi=.47;function fr(e,t,n,i={},o){let r=i.metersPerUnit&&i.metersPerUnit>0?i.metersPerUnit:vi,{b:s,ensure:u,take:l}=Si(Math.max(1024,e.length*48));for(let c of e.features()){if(c.type!==3||!pe(n,c.properties))continue;let f=zi(c.properties),m=Xi(c.properties,f);if(f<=m)continue;let p=$i(c.properties)??Number(c.id??0),g=Hi(p>>>0),y=ji(g,c.properties),w=Gi(c.properties,f);i.paint?.setFeature(c.properties,c.id??null,"Polygon");let E=tt(c.loadGeometry()),R=o?E.some(T=>{let L=He(T,t,ve(t));return L?on(L.outer,t):!1}):!1;for(let T of E){if(o&&R){let L=Ki(T,t,f,m,p,g,y,w);L&&o.push(L)}Wi(s,T,u,{extent:t,metersPerUnit:r,height:f,minHeight:m,featureId:p,seed:g,tint:y,facade:w,props:c.properties,cornerRadius:i.cornerRadius??0,cornerSegments:i.cornerSegments,whole:!1})}i.paint?.advanceTo(s.vertexCount)}return l(t,i.paint)}function Si(e){let t=e,n=new ArrayBuffer(t*ln),i={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},o=s=>{if(i.vertexCount+s<=t)return;t=Math.max(t*2,i.vertexCount+s);let u=new ArrayBuffer(t*ln);new Uint8Array(u).set(i.vertsU8.subarray(0,i.vertOffset)),n=u,i.verts=new DataView(u),i.vertsU8=new Uint8Array(u)};return i.ensure=o,{b:i,ensure:o,take:(s,u)=>{if(!i.indices.length)return null;let l=new Uint32Array(i.indices),c=new Float64Array(i.featureIds);return{vertices:n.slice(0,i.vertOffset),indices:l.buffer,featureIds:c.buffer,vertexCount:i.vertexCount,indexCount:l.length,extent:s,...u?{dataPaint:u.take(i.vertexCount)}:{}}}}}var an=(e,t)=>e|t<<2,ir=e=>Math.max(-32768,Math.min(32767,e)),sn=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,ar)*cn)));function rt(e,t,n,i,o,r,s,u,l,c,f=0,m=0,p=0){let g=e.vertOffset;return e.verts.setInt16(g,ir(Math.round(t*nr)),!0),e.verts.setInt16(g+2,ir(Math.round(n*nr)),!0),e.verts.setUint16(g+4,Math.round(Math.min(i,ar)*cn),!0),e.vertsU8[g+6]=l,e.vertsU8[g+7]=u,e.verts.setInt8(g+8,un(Math.round(o*127))),e.verts.setInt8(g+9,un(Math.round(r*127))),e.verts.setInt8(g+10,un(Math.round(s*127))),e.vertsU8[g+11]=c,e.verts.setUint16(g+12,sn(f),!0),e.verts.setUint16(g+14,sn(m),!0),e.verts.setUint16(g+16,sn(p),!0),e.vertOffset+=ln,e.vertexCount++}function sr(e,t,n,i,o,r,s,u,l,c){let f=t.length/2;if(f<3)return;let m=an(gi,s),p=Ei(t,u),g=i-n,y=new Float64Array(f*2),w=new Uint8Array(f);{let E=new Float64Array(f*2);for(let R=0;R<f-1;R++){let T=t[R*2+2]-t[R*2],L=t[R*2+3]-t[R*2+1],P=Math.hypot(T,L)||1;E[R*2]=L/P,E[R*2+1]=-T/P}for(let R=0;R<f-1;R++){let T=(R+f-2)%(f-1),L=E[T*2]*E[R*2]+E[T*2+1]*E[R*2+1],P=E[T*2]+E[R*2],U=E[T*2+1]+E[R*2+1],V=Math.hypot(P,U);L>.5&&V>1e-6&&(y[R*2]=P/V,y[R*2+1]=U/V,w[R]=1)}}for(let E=0;E<f-1;E++){let R=t[E*2],T=t[E*2+1],L=t[E*2+2],P=t[E*2+3];if(R===L&&T===P||c[E])continue;let U=L-R,V=P-T,D=Math.hypot(U,V)||1,j=V/D,O=-U/D,z=p.offset[E],G=p.width[E],te=[0,1];if(l){for(let J=0;J<l.length;J++)for(let X=J+1;X<l.length;X++){let W=qe(l[J],R,T)-qe(l[X],R,T),re=qe(l[J],L,P)-qe(l[X],L,P);if(W===re)continue;let Q=W/(W-re);Q>1e-4&&Q<1-1e-4&&te.push(Q)}te.sort((J,X)=>J-X)}let ie=(J,X)=>{if(!l)return i;let W=1/0;for(let re of l)W=Math.min(W,qe(re,J,X));return Math.max(i,W)};for(let J=0;J+1<te.length;J++){let X=te[J],W=te[J+1];if(W-X<1e-6)continue;let re=R+U*X,Q=T+V*X,B=R+U*W,N=T+V*W,ee=z+D*X*u,Z=z+D*W*u,oe=(E+1)%(f-1),de=w[E]?y[E*2]:j,be=w[E]?y[E*2+1]:O,se=w[oe]?y[oe*2]:j,Ie=w[oe]?y[oe*2+1]:O,Ne=j+(de-j)*(1-X),ce=O+(be-O)*(1-X),Me=j+(se-j)*W,Se=O+(Ie-O)*W,ne=Math.hypot(Ne,ce)||1,he=Math.hypot(Me,Se)||1,me=Ne/ne,Pe=ce/ne,Le=Me/he,Oe=Se/he;e.ensure(4);let Ee=rt(e,re,Q,n,me,Pe,0,0,r,m,ee,G,g),Ue=rt(e,B,N,n,Le,Oe,0,0,r,m,Z,G,g),ze=rt(e,re,Q,ie(re,Q),me,Pe,0,255,r,m,ee,G,g),We=rt(e,B,N,ie(B,N),Le,Oe,0,255,r,m,Z,G,g);e.indices.push(Ee,We,Ue,Ee,ze,We),e.featureIds.push(o,o)}}}var Ri=.9976;function Ei(e,t){let n=e.length/2-1,i=[];for(let l=0;l<n;l++){let c=e[l*2+2]-e[l*2],f=e[l*2+3]-e[l*2+1],m=Math.hypot(c,f);i.push(m>0?{x:c/m,y:f/m,len:m*t}:{x:0,y:0,len:0})}let o=(l,c)=>i[l].len>0&&i[c].len>0&&i[l].x*i[c].x+i[l].y*i[c].y>=Ri,r=0;for(;r<n&&o((r-1+n)%n,r);)r++;r>=n&&(r=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let l=0;l<n;){let c=(r+l)%n,f=[c],m=i[c].len,p=l+1;for(;p<n;){let y=(r+p)%n;if(!o((r+p-1)%n,y))break;f.push(y),m+=i[y].len,p++}let g=0;for(let y of f)s[y]=g,u[y]=m,g+=i[y].len;l=p}return{offset:s,width:u}}function Fi(e,t,n,i,o,r,s){let u=[],l=[];for(let p=0;p<t.length;p++)u.push(t[p]);for(let p of n){l.push(u.length/2);for(let g=0;g<p.length;g++)u.push(p[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=an(xi,s),m=e.vertexCount;for(let p=0;p<u.length;p+=2)rt(e,u[p],u[p+1],i,0,0,1,255,r,f);for(let p=0;p<c.length;p+=3)e.indices.push(m+c[p],m+c[p+2],m+c[p+1]),e.featureIds.push(o)}function ki(e){let t=Ai(e);if(t.length<3)return null;let n=Math.abs(Ii(e));if(n<=0)return null;let i=null,o=1/0;for(let r=0;r<t.length;r++){let s=(r+1)%t.length,u=t[s].x-t[r].x,l=t[s].y-t[r].y,c=Math.hypot(u,l);if(c<1e-6)continue;u/=c,l/=c;let f=1/0,m=-1/0,p=1/0,g=-1/0;for(let P of t){let U=P.x*u+P.y*l,V=-P.x*l+P.y*u;U<f&&(f=U),U>m&&(m=U),V<p&&(p=V),V>g&&(g=V)}let y=m-f,w=g-p,E=y*w;if(E<=0||E>=o)continue;o=E;let R=(f+m)/2,T=(p+g)/2,L=y>=w;i={cx:R*u-T*l,cy:R*l+T*u,ax:L?u:-l,ay:L?l:u,halfLong:(L?y:w)/2,halfShort:(L?w:y)/2,fill:n/E}}return i}function Ai(e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push({x:e[r],y:e[r+1]});if(t.length<3)return t;t.sort((r,s)=>r.x===s.x?r.y-s.y:r.x-s.x);let n=(r,s,u)=>(s.x-r.x)*(u.y-r.y)-(s.y-r.y)*(u.x-r.x),i=[];for(let r of t){for(;i.length>=2&&n(i[i.length-2],i[i.length-1],r)<=0;)i.pop();i.push(r)}let o=[];for(let r=t.length-1;r>=0;r--){let s=t[r];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}function Ii(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Pi=Math.tan(30*Math.PI/180),Li=3.5,_i=.9;function Bi(e,t,n,i,o){if(t.fill<.86)return null;let r=t.halfShort*2*o,s=t.halfLong*2*o,u=r*s,l=t.halfShort>0?t.halfLong/t.halfShort:99,c=Ti(e);if(!c){if(n>15||u>600||r<3)return null;let f=i%1e3/1e3;u<30?c=f<.5?"skillion":"gabled":l<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped"}return c==="flat"?null:{shape:c}}function Ti(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var qe=(e,t,n)=>e.a*t+e.b*n+e.c;function Ci(e,t,n,i){let o=e.length/2;if(o<3)return[];let r=[],s=u=>[e[u*2],e[u*2+1]];for(let u=0;u<o;u++){let[l,c]=s(u),[f,m]=s((u+o-1)%o),p=t*l+n*c+i,g=t*f+n*m+i;if(p<=0!=g<=0){let y=g/(g-p);r.push(f+(l-f)*y,m+(c-m)*y)}p<=0&&r.push(l,c)}return r}function Vi(e,t){let n=.5/Math.max(t,1e-6),i=e.length/2-1;if(i<5)return e;let o=[],r=0;o.push(e[0],e[1]);for(let s=1;s<i;s++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1],m=c-u,p=f-l,g=Math.hypot(m,p),y=g>1e-6;if(y){for(let w=r+1;w<s;w++)if(Math.abs((e[w*2]-u)*p-(e[w*2+1]-l)*m)/g>=n){y=!1;break}}y||(o.push(e[(s-1)*2],e[(s-1)*2+1]),r=s-1)}return o.length/2<3?e:(o.push(o[0],o[1]),o)}function hr(e,t,n){let{ax:i,ay:o,halfLong:r}=t;if(n==="skillion"){let l=-o,c=i;return[{a:l,b:c,c:-(l*t.cx+c*t.cy)+t.halfShort}]}let s=[],u=e.length/2-1;for(let l=0;l<u;l++){let c=e[l*2],f=e[l*2+1],m=e[(l+1)%u*2],p=e[(l+1)%u*2+1],g=m-c,y=p-f,w=Math.hypot(g,y);if(w<1e-6||n==="gabled"&&Math.abs((g*i+y*o)/w)<.86)continue;let E=-y/w,R=g/w;s.push({a:E,b:R,c:-(E*c+R*f)})}return!s.length&&r>0?hr(e,t,"hipped"):s}function Oi(e,t){let n=[];for(let o=0;o<t.length-2;o+=2)n.push(t[o],t[o+1]);if(n.length<6)return[];let i=[];for(let o=0;o<e.length;o++){let r=n;for(let s=0;s<e.length&&r.length>=6;s++)s!==o&&(r=Ci(r,e[o].a-e[s].a,e[o].b-e[s].b,e[o].c-e[s].c));i.push(r.length>=6?r:[])}return i}function Di(e,t){let n=0;for(let i=0;i<t.length;i++){let o=t[i];for(let r=0;r<o.length;r+=2){let s=qe(e[i],o[r],o[r+1]);s>n&&(n=s)}}return n}function Ni(e,t,n){return e.map(i=>({a:i.a*t,b:i.b*t,c:i.c*t+n}))}function Ui(e,t,n,i,o,r,s,u){let l=an(yi,s);for(let c=0;c<n.length;c++){let f=t[c];if(!f||f.length<6)continue;let m=Xe(f,void 0,2);if(!m.length)continue;let p=-n[c].a/u,g=-n[c].b/u,y=Math.hypot(p,g,1),w={x:p/y,y:g/y,z:1/y};e.ensure(f.length/2);let E=e.vertexCount;for(let R=0;R<f.length;R+=2){let T=Math.max(i,qe(n[c],f[R],f[R+1]));rt(e,f[R],f[R+1],T,w.x,w.y,w.z,255,r,l)}for(let R=0;R<m.length;R+=3)e.indices.push(E+m[R],E+m[R+2],E+m[R+1]),e.featureIds.push(o)}}function Gi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Mi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?or:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?rr:t>=40?or:wi}function ji(e,t){let n=String(t.class??""),i=128;return n==="industrial"||n==="warehouse"||n==="construction"?i=96:n==="commercial"||n==="office"||n==="retail"?i=150:(n==="apartments"||n==="residential"||n==="house")&&(i=134),Math.max(0,Math.min(255,i+(e%121-60)))}function Hi(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function zi(e){let t=ot(e.render_height)??ot(e.height)??Yi(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,bi):di}function Xi(e,t){let n=ot(e.render_min_height)??ot(e.min_height)??ot(e.base)??0;return n>0&&n<t?n:0}function Yi(e){let t=ot(e);return t&&t>0?t*3:null}function ot(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var un=e=>e>127?127:e<-127?-127:e;function $i(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function ur(e,t){let n=e.length/2-1,i=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:i};let o=(s,u)=>s===0?1:s===t?2:u===0?3:u===t?4:0,r=e.slice();for(let s=0;s<n;s++){let u=e[s*2],l=e[s*2+1],c=o(u,l);if(!c)continue;let f=(s+n-1)%n,m=(s+1)%n,p=o(e[f*2],e[f*2+1])===c,g=o(e[m*2],e[m*2+1])===c;g&&(i[s]=!0);let y=p===g?-1:p?m:f;if(y<0)continue;let w=u-e[y*2],E=l-e[y*2+1],R=Math.hypot(w,E);R<1e-6||(r[s*2]=u+w/R*tr,r[s*2+1]=l+E/R*tr)}return r[n*2]=r[0],r[n*2+1]=r[1],{ring:r,cut:i}}function Wi(e,t,n,i){let{extent:o,metersPerUnit:r,height:s,minHeight:u,featureId:l,seed:c,tint:f,facade:m}=i,p=i.whole?t:He(t,o,ve(o));if(!p)return;let g=i.cornerRadius/r,y={radius:g,segments:i.cornerSegments,minCutRatio:0,maxChord:r>0?Qn/r:0,...i.whole?{}:{extent:o,margin:ve(o)}},w=g>0?{outer:je(p.outer,y),holes:p.holes.map(G=>je(G,y))}:p,E=i.whole?w:He(w,o);if(!E)return;let R=G=>({ring:G,cut:new Array(Math.max(G.length/2-1,0)).fill(!1)}),T=i.whole?R(E.outer):ur(E.outer,o),L=E.holes.map(G=>i.whole?R(G):ur(G,o)),P={outer:T.ring,holes:L.map(G=>G.ring)},U=i.whole?!0:on(P.outer,o),V=P.outer.length/2+P.holes.reduce((G,te)=>G+te.length/2,0);n(V*5+32);let D=P.holes.length||U?null:ki(P.outer),j=D?Bi(i.props,D,s,c,r):null,O=null,z=[];if(j&&D){let G=hr(Vi(P.outer,r),D,j.shape);z=Oi(G,P.outer);let te=Di(G,z);if(te>1e-6){let ie=Math.min(Math.max(te*r*Pi,_i),Li);O=Ni(G,ie/te,s)}}sr(e,P.outer,u,s,l,f,m,r,O,T.cut);for(let G=0;G<P.holes.length;G++)sr(e,P.holes[G],u,s,l,f,m,r,null,L[G].cut);O?Ui(e,z,O,s,l,f,m,r):Fi(e,P.outer,P.holes,s,l,f,m)}function Zi(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s=0;s<e.length;s+=2)e[s]<n&&(n=e[s]),e[s]>o&&(o=e[s]),e[s+1]<i&&(i=e[s+1]),e[s+1]>r&&(r=e[s+1]);return o>0&&n<t&&r>0&&i<t}function lr(e,t){let n=ve(t),i=Math.max(e.length/2-1,0),o=new Array(i);for(let r=0;r<i;r++)o[r]=Vt(e[r*2],e[r*2+1],e[r*2+2],e[r*2+3],t,n);return o}function Ki(e,t,n,i,o,r,s,u){let l=He(e,t,ve(t));if(!l||!Zi(l.outer,t))return null;let c=lr(l.outer,t);return{osmId:o,height:n,minHeight:i,seed:r,tint:s,facade:u,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(f=>lr(f,t))}}var yt=8;function Qi(e){return e?Je(e.color)||Je(e.opacity)||Je(e.width):!1}var fn=class{constructor(t,n){this.spec=t;this.zoom=n;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*yt),this.view=new DataView(this.buffer),this.base=t.base!==void 0?Wn(t.base,n,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0)}setFeature(t,n,i){let o={zoom:this.zoom,properties:t,id:n,geometryType:i},r=this.spec.color!==void 0?Tt(this.spec.color,o):null,[s,u,l,c]=r??this.base,f=this.spec.opacity!==void 0?mr(nt(this.spec.opacity,o),1):1;this.r=Ot(s),this.g=Ot(u),this.b=Ot(l),this.a=Ot(c*f),this.width=this.spec.width!==void 0?Math.max(mr(nt(this.spec.width,o),0),0):0}advanceTo(t){if(!(t<=this.filled)){this.ensure(t);for(let n=this.filled;n<t;n++){let i=n*yt;this.view.setUint8(i,Math.round(this.r*255)),this.view.setUint8(i+1,Math.round(this.g*255)),this.view.setUint8(i+2,Math.round(this.b*255)),this.view.setUint8(i+3,Math.round(this.a*255)),this.view.setFloat32(i+4,this.width,!0)}this.filled=t}}take(t){return this.advanceTo(t),this.buffer.slice(0,t*yt)}ensure(t){if(t<=this.capacity)return;this.capacity=Math.max(this.capacity*2,t);let n=new ArrayBuffer(this.capacity*yt);new Uint8Array(n).set(new Uint8Array(this.buffer,0,this.filled*yt)),this.buffer=n,this.view=new DataView(n)}};function Dt(e,t){return Qi(e)?new fn(e,t):void 0}var Ot=e=>e<0?0:e>1?1:e;function mr(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?n:t}function hn(e,t,n,i,o){let r=i*i,s=[],u=f=>e[f*2],l=f=>e[f*2+1],c=(f,m)=>{let p=e.length/2;return e.push((u(f)+u(m))/2,(l(f)+l(m))/2),p};for(let f=0;f<t.length;f+=3){s.push([n+t[f],n+t[f+1],n+t[f+2]]);let m=0;for(;s.length&&!(++m>2e4);){let[p,g,y]=s.pop(),w=(u(p)-u(g))**2+(l(p)-l(g))**2,E=(u(g)-u(y))**2+(l(g)-l(y))**2,R=(u(y)-u(p))**2+(l(y)-l(p))**2,T=Math.max(w,E,R);if(T<=r){o.push(p,g,y);continue}if(T===w){let L=c(p,g);s.push([p,L,y],[L,g,y])}else if(T===E){let L=c(g,y);s.push([g,L,p],[L,y,p])}else{let L=c(y,p);s.push([y,L,g],[L,p,g])}}}}function pr(e,t,n=0,i,o=!1,r=4096,s){let u=[],l=[],c=[];for(let y of e.features()){if(y.type!==3||!pe(t,y.properties))continue;let w=y.properties.osm_id,E=typeof w=="number"?w:typeof w=="string"?Number(w):NaN,R=Number.isFinite(E)?E:Number(y.id??0);s?.setFeature(y.properties,y.id??null,"Polygon");for(let T of tt(y.loadGeometry())){let L=o?He(T,r):T;if(!L)continue;let P=[],U=[],V=i?je(L.outer,i):L.outer;for(let O=0;O<V.length;O++)P.push(V[O]);for(let O of L.holes){let z=i?je(O,i):O;U.push(P.length/2);for(let G=0;G<z.length;G++)P.push(z[G])}let D=Xe(P,U.length?U:void 0,2);if(!D.length)continue;let j=u.length/2;for(let O=0;O<P.length;O++)u.push(P[O]);if(n>0){let O=[];hn(u,D,j,n,O);for(let z=0;z<O.length;z+=3)l.push(O[z],O[z+2],O[z+1]),c.push(R);continue}for(let O=0;O<D.length;O+=3)l.push(j+D[O],j+D[O+2],j+D[O+1]),c.push(R)}s?.advanceTo(u.length/2)}if(!l.length)return null;let f=u.length/2,m=new Int16Array(u),p=new Uint32Array(l);return{featureIds:new Float64Array(c).buffer,vertices:m.buffer,indices:p.buffer,vertexCount:f,indexCount:p.length,...s?{dataPaint:s.take(f)}:{}}}function br(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function gr(e,t,n,i){if(!(n<=0)){e.extent=i;for(let o of t){let r=o.outer;if(r.length<6)continue;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let f=0;f<r.length;f+=2)r[f]<s&&(s=r[f]),r[f]>l&&(l=r[f]),r[f+1]<u&&(u=r[f+1]),r[f+1]>c&&(c=r[f+1]);e.shapes.push({outer:r,holes:o.holes,level:n,minX:s,minY:u,maxX:l,maxY:c})}e.cells=[]}}function Ji(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let i=e.shapes[n],o=it(Math.floor(i.minX/t)),r=it(Math.floor(i.maxX/t)),s=it(Math.floor(i.minY/t)),u=it(Math.floor(i.maxY/t));for(let l=s;l<=u;l++)for(let c=o;c<=r;c++)e.cells[l*32+c].push(n)}}var xr=e=>e.shapes.length===0;function mn(e,t,n){!e.cells.length&&e.shapes.length&&Ji(e);let i=e.extent/32,o=e.cells[it(Math.floor(n/i))*32+it(Math.floor(t/i))];if(!o||!o.length)return 0;let r=0;for(let s of o){let u=e.shapes[s];if(u.level<=r||t<u.minX||t>u.maxX||n<u.minY||n>u.maxY||!dr(u.outer,t,n))continue;let l=!1;for(let c of u.holes)if(dr(c,t,n)){l=!0;break}l||(r=u.level)}return Math.min(Math.round(r*100),127)}function yr(e,t){let n=[],i=[],o=e.extent>0?e.metersPerTile/e.extent:0,r=o>0?2/o:0,s=mn(e,t[0],t[1]);n.push(t[0],t[1]),i.push(s);for(let u=0;u+3<t.length;u+=2){let l=t[u],c=t[u+1],f=t[u+2],m=t[u+3],p=mn(e,f,m);if(p!==s&&r>0){let g=Math.hypot(f-l,m-c),y=Math.min(Math.ceil(g/r),64),w=s;for(let E=1;E<y;E++){let R=E/y,T=l+(f-l)*R,L=c+(m-c)*R,P=mn(e,T,L);P!==w&&(n.push(T,L),i.push(P),w=P)}}n.push(f,m),i.push(p),s=p}return{pts:n,levels:i}}var it=e=>e<0?0:e>31?31:e;function dr(e,t,n){let i=!1,o=e.length/2;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}function Rr(e,t){let n=t.halfWidth;if(!(n>0))return null;let i=qi(e);if(i.length<4)return null;let o=es(n,t.metersPerUnit),r=[],s=i.length/2,u=new Float64Array(s);for(let w=1;w<s;w++)u[w]=u[w-1]+Math.hypot(i[w*2]-i[w*2-2],i[w*2+1]-i[w*2-1]);let l=t.halfWidthAt,c=l?w=>Math.max(l(w),0):()=>n,f=w=>c(u[(w%s+s)%s]),m=1/0;for(let w=0;w<s;w++)m=Math.min(m,f(w));if(t.closed===!0){let w=[],E=[];Nt(w,i,f,!0,o,!0),Nt(E,i,f,!1,o,!0);let R=[];for(let P of[w,E]){let U=wr(P);if(U.length<8)continue;U.push(U[0],U[1]);let V=Sr(U,i,u,c,m);V&&V.length>=8&&R.push(V)}if(!R.length)return null;R.sort((P,U)=>Math.abs(wt(U))-Math.abs(wt(P)));let T=wt(R[0])<0?pn(R[0]):R[0],L=R.slice(1).map(P=>wt(P)>0?pn(P):P);return{outer:T,holes:L}}if(Nt(r,i,f,!0,o,!1),Nt(r,i,f,!1,o,!1),r.length<8)return null;let g=wr(r);if(g.length<8)return null;g.push(g[0],g[1]);let y=Sr(g,i,u,c,m);return!y||y.length<8?null:{outer:wt(y)<0?pn(y):y,holes:[]}}function wr(e){let t=[];for(let i=0;i+1<e.length;i+=2){let o=t.length;o>=2&&Math.abs(t[o-2]-e[i])<1e-9&&Math.abs(t[o-1]-e[i+1])<1e-9||t.push(e[i],e[i+1])}let n=t.length;return n>=4&&Math.abs(t[0]-t[n-2])<1e-9&&Math.abs(t[1]-t[n-1])<1e-9&&(t.length=n-2),t}function wt(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}function pn(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}function qi(e){let t=[];for(let n=0;n+1<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&Math.abs(t[r-2]-i)<1e-6&&Math.abs(t[r-1]-o)<1e-6||t.push(i,o)}return t}function es(e,t){let n=e*(t>0?t:.5),i=Math.ceil(Math.PI*n/1);return Math.max(2,Math.min(10,i))}function Nt(e,t,n,i,o,r){let s=t.length/2,u=c=>{let f=(c%s+s)%s;return[t[f*2],t[f*2+1]]},l=[];if(i)for(let c=0;c<s;c++)l.push(c);else for(let c=s-1;c>=0;c--)l.push(c);for(let c=0;c<l.length;c++){let f=l[c],m=c>0?l[c-1]:r?l[l.length-1]:-1,p=c+1<l.length?l[c+1]:r?l[0]:-1,[g,y]=u(f),w=n(f);if(!(w>0))continue;let E=m>=0?vr(u(m),[g,y]):null,R=p>=0?vr([g,y],u(p)):null;if(E&&R){let T=E[0]*R[1]-E[1]*R[0],P=1+(E[0]*R[0]+E[1]*R[1]),U=P>1e-6?w*Math.sqrt(2/P):1/0,V=Mr(u(m),[g,y]),D=Mr([g,y],u(p));T>0&&U<=w*2&&U<=Math.min(V,D)?e.push(g+(E[0]+R[0])*w/P,y+(E[1]+R[1])*w/P):dn(e,g,y,w,E,R,o)}else R?dn(e,g,y,w,[-R[1],R[0]],R,o):E&&dn(e,g,y,w,E,[E[1],-E[0]],o)}}function Mr(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function vr(e,t){let n=t[0]-e[0],i=t[1]-e[1],o=Math.hypot(n,i);return o>0?[-i/o,n/o]:null}function dn(e,t,n,i,o,r,s){let u=Math.atan2(o[1],o[0]),l=Math.atan2(r[1],r[0])-u;for(;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;let c=Math.max(1,Math.min(s,Math.ceil(Math.abs(l)/Math.PI*s)));for(let f=0;f<=c;f++){let m=u+l*f/c;e.push(t+Math.cos(m)*i,n+Math.sin(m)*i)}}function Sr(e,t,n,i,o){let r=rs(e);if(!r.length)return e;let s=[],u=[],l=e.length/2-1,c=[];for(let y=0;y<l;y++){s.push(e[y*2],e[y*2+1]),u.push(!1),c.length=0;for(let w of r)w.i===y&&c.push({t:w.t,x:w.x,y:w.y}),w.j===y&&c.push({t:w.u,x:w.x,y:w.y});if(c.length){c.sort((w,E)=>w.t-E.t);for(let w of c)s.push(w.x,w.y),u.push(!0)}}let f=u.length,m=u.indexOf(!0);if(m<0)return e;let p=[],g=0;for(let y=1;y<=f;y++){let w=(m+y)%f;if(!u[w])continue;let E=y;if(!ts(s,m,g,E,f,t,n,i,o))for(let R=g;R<=E;R++){let T=(m+R)%f,L=s[T*2],P=s[T*2+1],U=p.length;U>=2&&Math.abs(p[U-2]-L)<1e-9&&Math.abs(p[U-1]-P)<1e-9||p.push(L,P)}g=E}return p.length<6?e:(p.push(p[0],p[1]),p)}function ts(e,t,n,i,o,r,s,u,l){for(let c=n;c<=i;c++){let f=(t+c)%o;if(ns(e[f*2],e[f*2+1],r,s,u,l))return!0}return!1}function ns(e,t,n,i,o,r){let s=n.length/2-1,u=r*(1-.01),l=u*u,c=1/0,f=0,m=0;for(let R=0;R<s;R++){let T=n[R*2],L=n[R*2+1],P=n[R*2+2]-T,U=n[R*2+3]-L,V=P*P+U*U,D=V>0?Math.max(0,Math.min(1,((e-T)*P+(t-L)*U)/V)):0,j=e-(T+P*D),O=t-(L+U*D),z=j*j+O*O;if(z<l)return!0;z<c&&(c=z,f=R,m=D)}if(!(c<1/0))return!1;let p=n[f*2],g=n[f*2+1],y=n[f*2+2]-p,w=n[f*2+3]-g,E=o(i[f]+Math.hypot(y,w)*m)*(1-.01);return c<E*E}function rs(e){let t=[],n=e.length/2-1;if(n<4)return t;let i=new Float64Array(n),o=new Float64Array(n),r=new Float64Array(n),s=new Float64Array(n),u=[];for(let l=0;l<n;l++){u.push(l);let c=e[l*2],f=e[l*2+2],m=e[l*2+1],p=e[l*2+3];i[l]=c<f?c:f,o[l]=c<f?f:c,r[l]=m<p?m:p,s[l]=m<p?p:m}u.sort((l,c)=>i[l]-i[c]);for(let l=0;l<u.length;l++){let c=u[l];for(let f=l+1;f<u.length;f++){let m=u[f];if(i[m]>o[c])break;let p=Math.abs(c-m);if(p<2||p===n-1||r[m]>s[c]||r[c]>s[m])continue;let g=c<m?c:m,y=c<m?m:c,w=os(e[g*2],e[g*2+1],e[g*2+2],e[g*2+3],e[y*2],e[y*2+1],e[y*2+2],e[y*2+3]);w&&t.push({i:g,j:y,t:w[2],u:w[3],x:w[0],y:w[1]})}}return t}function os(e,t,n,i,o,r,s,u){let l=n-e,c=i-t,f=s-o,m=u-r,p=l*m-c*f;if(Math.abs(p)<1e-12)return null;let g=((o-e)*m-(r-t)*f)/p,y=((o-e)*c-(r-t)*l)/p;return g<=1e-9||g>=1-1e-9||y<=1e-9||y>=1-1e-9?null:[e+l*g,t+c*g,g,y]}function Ve(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let i=e.brunnel;return i==="bridge"?1:i==="tunnel"?-1:0}var Er=new WeakMap,Ye=(e,t)=>(e+512)*65536+(t+512);function kr(e,t,n,i,o){if(e===0||t<=0)return t;let r=8*4294967296,s=Math.max(o.raw.get(n+r)??0,o.raw.get(i+r)??0);return s>0&&t>s?s:t}function Ut(e){let t=Er.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},i=[];for(let o of e.features()){if(o.type!==2)continue;let r=o.properties.width,s=typeof r=="number"&&r>.5&&r<100?r:0,u=Ve(o.properties);for(let l of o.loadGeometry()){if(l.length<4)continue;let c=Ye(Math.round(l[0]),Math.round(l[1])),f=Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let m of[c,f]){let p=m+(u+8)*4294967296;n.ends.set(p,(n.ends.get(p)??0)+1),s>0&&n.raw.set(p,Math.max(n.raw.get(p)??0,s))}i.push({h:c,t:f,lv:u,w:s})}}for(let o of i){let r=kr(o.lv,o.w,o.h,o.t,n);if(!(r<=0))for(let s of[o.h,o.t]){let u=n.width.get(s);(u===void 0||r>u)&&n.width.set(s,r)}}return Er.set(e,n),n}var Gt=12;function jt(e,t){let n=e.length/2,i=0;for(let g=0;g<n-1;g++)i+=Math.hypot(e[g*2+2]-e[g*2],e[g*2+3]-e[g*2+1]);let o=Ye(Math.round(e[0]),Math.round(e[1])),r=Ye(Math.round(e[n*2-2]),Math.round(e[n*2-1])),s=kr(t.level,t.width,o,r,t.junctions),u=g=>Math.min(t.junctions.width.get(g)??0,s*2),l=u(o)-s,c=u(r)-s,f=Math.min(t.taper,i/2);if(!(f>0)||l<=0&&c<=0)return{width:s,at:null,total:i,knots:[]};let m=g=>{let y=0;return l>0&&g<f&&(y=l*(1-g/f)),c>0&&i-g<f&&(y=Math.max(y,c*(1-(i-g)/f))),s+y},p=[];for(let g of[f,i-f])g>.01&&g<i-.01&&p.push(g);return{width:s,at:m,total:i,knots:p}}function Ar(e,t){let n=[...t].sort((s,u)=>s-u);if(!n.length)return e;let i=[e[0],e[1]],o=0,r=0;for(let s=0;s+3<e.length;s+=2){let u=e[s],l=e[s+1],c=e[s+2],f=e[s+3],m=Math.hypot(c-u,f-l);for(;r<n.length&&n[r]<=o+.01;)r++;for(;r<n.length&&n[r]<o+m-.01;){let p=(n[r]-o)/m;i.push(u+(c-u)*p,l+(f-l)*p),r++}o+=m,i.push(c,f)}return i}function Ir(e,t,n){let i=[];for(let l of e.features()){if(l.type!==2||!t(l.properties))continue;let c=n(l.properties);if(!c||!(c>0))continue;let f=l.properties.osm_id,m=typeof f=="number"?f:typeof f=="string"?Number(f):NaN,p=Number.isFinite(m)?m:Number(l.id??0),g=Ve(l.properties);for(let y of l.loadGeometry())y.length<4||i.push({pts:Array.from(y),props:l.properties,id:p,w:c,lv:g,used:!1})}let o=new Map,r=(l,c)=>c?Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1])):Ye(Math.round(l[0]),Math.round(l[1]));i.forEach((l,c)=>{for(let f of[!1,!0]){let m=r(l.pts,f),p=o.get(m);p?p.push({piece:c,tail:f}):o.set(m,[{piece:c,tail:f}])}});let s=(l,c,f)=>{let m=o.get(l);if(!m||m.length!==2)return null;let p=m.filter(y=>!i[y.piece].used);if(p.length!==1)return null;let g=i[p[0].piece];return g.w===c&&g.lv===f?p[0]:null},u=[];for(let l=0;l<i.length;l++){let c=i[l];if(c.used)continue;c.used=!0;let f=c.pts.slice(),m=[c.id];for(let p=0;p<256;p++){let g=s(r(f,!0),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?Fr(y.pts):y.pts;for(let E=2;E<w.length;E+=2)f.push(w[E],w[E+1]);m.push(y.id)}for(let p=0;p<256;p++){let g=s(r(f,!1),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?y.pts:Fr(y.pts),E=[];for(let R=0;R+3<w.length;R+=2)E.push(w[R],w[R+1]);f=E.concat(f),m.push(y.id)}u.push({pts:f,props:c.props,ids:m})}return u}function Fr(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}var Pr=85.051129;var is=e=>Math.max(-Pr,Math.min(Pr,e));function Lr(e){return(180+e)/360}function _r(e){let t=is(e);return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}var Ht=.25,ss="liftPath";function us(e,t,n){if(typeof e!="string"||!e.length)return null;let i=Math.pow(2,t.z),o=[];for(let s of e.split("|")){let u=[],l=[],c=[];for(let f of s.split(";")){let m=f.split(",");if(m.length<3)continue;let p=Number(m[0]),g=Number(m[1]),y=Number(m[2]);!Number.isFinite(p)||!Number.isFinite(g)||!Number.isFinite(y)||(u.push((Lr(p)*i-t.x)*n),l.push((_r(g)*i-t.y)*n),c.push(y))}u.length>=2&&o.push({xs:u,ys:l,hs:c})}if(!o.length)return null;if(o.length===1)return cs(o[0].xs,o[0].ys,o[0].hs);let r=o.map(s=>ls(s.xs,s.ys,s.hs));return(s,u)=>{let l=1/0,c=0;for(let f of r){let m=f(s,u);m.d<l&&(l=m.d,c=m.h)}return c}}function ls(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],m=t[c+1]-t[c],p=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*m)/o[c])):0,g=e[c]+f*p,y=t[c]+m*p,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*p)}return{d:u,h:l}}}function cs(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],m=t[c+1]-t[c],p=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*m)/o[c])):0,g=e[c]+f*p,y=t[c]+m*p,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*p)}return l}}function Br(e,t){let n=new Map;return i=>{if(!e)return null;let o=i[ss];if(typeof o!="string"||!o.length)return null;let r=n.get(o);if(r!==void 0)return r;let s=us(o,e,t);return n.set(o,s),s}}var as=go(Tr(),1),Cr=as,yn=Cr.union??Cr.default?.union??null;yn||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");var zt=0,Xt=0;function fs(e){for(let t of e)if(t.length>=2){zt=Math.round(t[0]),Xt=Math.round(t[1]);return}zt=0,Xt=0}function Vr(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n]-zt,e[n+1]-Xt]);return t}function Or(e){let t=[];for(let i of e)t.push(i[0]+zt,i[1]+Xt);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Nr(e,t,n=0){if(e.length<2)return e;let i=new Map;for(let r of e){let s=r.at?r:r.lift??0,u=i.get(s);u?u.push(r):i.set(s,[r])}let o=[];for(let[r,s]of i){if(s.length<2){o.push(...s);continue}let u=typeof r=="number"?r:0;o.push(...hs(s,u,t,n))}return o}var xn=256;function hs(e,t,n,i=0){let o=e,r=i>0&&n?i:0;for(let s=0;s<32;s++){if(o.length<2)return o;if(o.length<=xn)return Dr(o,t,n,r);let u=ms(o),l=[];for(let c=0;c<u.length;c+=xn)l.push(...Dr(u.slice(c,c+xn),t,n,r));if(r=0,l.length>=o.length)return l;o=l}return o}function ms(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=e.map(c=>{let f=0,m=0,p=0;for(let w=0;w+1<c.outer.length;w+=2)f+=c.outer[w],m+=c.outer[w+1],p++;let g=p?f/p:0,y=p?m/p:0;return g<t&&(t=g),g>i&&(i=g),y<n&&(n=y),y>o&&(o=y),{s:c,cx:g,cy:y}}),s=i-t||1,u=o-n||1,l=c=>{let f=Math.max(0,Math.min(65535,Math.round(c*65535)));return f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,f};return r.map(c=>({s:c.s,key:l((c.cx-t)/s)|l((c.cy-n)/u)<<1})).sort((c,f)=>c.key-f.key).map(c=>c.s)}function Dr(e,t,n,i=0){{let o=[],r=i>0&&n?e.map(c=>({outer:n(c.outer,-i)??c.outer,holes:c.holes.map(f=>n(f,i)??f)})):e;fs(r.map(c=>c.outer));let s=r.map(c=>[Vr(c.outer),...c.holes.map(Vr)]),u;try{if(!yn)throw new Error("\\u043D\\u0435\\u0442 union");u=yn(s[0],...s.slice(1))}catch{return e}let l=u;if(!Array.isArray(l)||l.length===0)return e;for(let c of l){if(!c.length)continue;let f=Or(c[0]);if(f.length<8)continue;let m=[];for(let p=1;p<c.length;p++){let g=Or(c[p]);g.length>=8&&m.push(g)}o.push(t?{outer:f,holes:m,lift:t}:{outer:f,holes:m})}return o}}var ps=5,Rn=16,ds=64,Yr=0,bs=1,Ur=2,gs=3,Yt=1,xs=.6;function ys(e,t,n,i){if(!t||!(t>0)||!(n>0))return[];let o=t/2/n,r=[];for(let s of e){let u=s.length>=8&&Math.abs(s[0]-s[s.length-2])<1e-6&&Math.abs(s[1]-s[s.length-1])<1e-6,l,c=s;if(i&&!u){let g=Array.from(s),y=jt(g,{junctions:i.junctions,width:i.width,level:i.level,taper:i.reach});if(y.at){let w=i.extra/2/n,E=y.at;l=R=>E(R)/2/n+w,y.knots.length&&(c=Ar(g,y.knots))}}let f=Rr(c,{halfWidth:o,metersPerUnit:n,closed:u,halfWidthAt:l});if(!f)continue;let m=f.outer,p=[];if(i&&!u){let g=s.length/2;for(let[y,w,E]of[[s[0],s[1],0],[s[g*2-2],s[g*2-1],-1]]){if(!Ms(i,y,w))continue;let R=E===0?0:ws(c),T=l?l(R):o;p.push({x:y,y:w,r:T})}}r.push(p.length?{outer:m,holes:f.holes,caps:p}:{outer:m,holes:f.holes})}return r}function ws(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=Math.hypot(e[n+2]-e[n],e[n+3]-e[n+1]);return t}function Ms(e,t,n){let i=Ye(Math.round(t),Math.round(n))+(e.level+8)*4294967296;return(e.junctions.ends.get(i)??0)>1}function $r(e,t,n,i){let o=i.metersPerUnit>0?i.metersPerUnit:.5,r=i.elevation,s=i.base??0,u=Math.max(i.bevel??0,0)/o,l=Math.max(i.bevelDrop??0,0),c=Math.max(i.cornerRadius??0,0)/o,f=Math.max(512,e.length*24),m=new ArrayBuffer(f*Rn),p={view:new DataView(m),bytes:new Uint8Array(m),offset:0,count:0,indices:[],extent:t,ensure(B){if(p.count+B<=f)return;f=Math.max(f*2,p.count+B);let N=new ArrayBuffer(f*Rn);new Uint8Array(N).set(p.bytes.subarray(0,p.offset)),m=N,p.view=new DataView(N),p.bytes=new Uint8Array(N)}},g=i.widthOf?Ut(e):null,y=Math.max(i.widthExtra??0,0),w=Gt/o,E=B=>{if(!g)return;let N=i.widthOf(B);if(!(!N||!(N>0)))return{junctions:g,width:Math.max(N-y,0),extra:y,level:Ve(B),reach:w}},R=[],T=[],L=new Map,P=i.widthOf?Ir(e,B=>pe(n,B),i.widthOf):null,U=P?P.map(B=>({geometry:[B.pts],props:B.props,ids:B.ids})):[];if(!P)for(let B of e.features()){if(B.type!==3||!pe(n,B.properties))continue;let N=B.properties.osm_id,ee=typeof N=="number"?N:typeof N=="string"?Number(N):NaN;U.push({geometry:B.loadGeometry(),props:B.properties,ids:[Number.isFinite(ee)?ee:Number(B.id??0)]})}for(let B of U){let N=P!==null,ee=i.liftAt?.(B.props)??null,Z=ee?0:i.liftBy?.(B.props)??0,oe=B.ids;for(let de of N?ys(B.geometry,i.widthOf(B.props),o,E(B.props)):tt(B.geometry)){let be=He(de,t,ve(t));if(!be)continue;let se=de.caps;R.push({...be,...Z?{lift:Z}:{},...ee?{at:ee}:{},...se?{caps:se}:{}}),T.push(oe)}}let V=new Set,D=Math.max(i.weld??xs,0),j=i.widthOf?R:Nr(R,(B,N)=>Mn(B,N,t,V),D/o),O=D>0?j.map(B=>({...B,outer:Xr(B.outer,D/o,t),holes:B.holes.map(N=>Xr(N,D/o,t))})):j;for(let B of O){jr(B.outer,L);for(let N of B.holes)jr(N,L)}i.onShapes?.(O);let z=vs(O,R,T),G=new Set;for(let[B,N]of L)N>1&&G.add(B);if(O.some(B=>B.at)||new Set(O.map(B=>B.lift??0)).size>1){let B=(N,ee,Z)=>{let oe=O[N];return(oe.lift??0)+(oe.at?oe.at(ee,Z):0)};Es(O,(N,ee,Z)=>r+B(N,ee,Z),B,G)}for(let B of O){let N=B.caps;if(N)for(let ee of N)ks(B.outer,ee,G)}let ie=[],J={radius:c,segments:i.cornerSegments,extent:t,margin:ve(t),minCutRatio:0,maxChord:Kn/o},X=[];for(let B of O){let N=p.indices.length,ee=ie.length,Z=c>0?{outer:je(B.outer,{...J,keep:Hr(B.outer,G)}),holes:B.holes.map(he=>je(he,{...J,keep:Hr(he,G)}))}:B,oe=u>0?Mn(Z.outer,u,t,G):Z.outer,de=Z.holes.map(he=>u>0?Mn(he,-u,t,G):he),be=B.lift??0,se=B.at,Ie=r+be,Ne=Math.max(i.deck??0,0),ce=s+be-(be>0||se?Ne:0),Me=se?Math.min(i.maxSegment||1/0,ps/o):i.maxSegment??0;zr(p,oe??Z.outer,de.map((he,me)=>he??Z.holes[me]),Ie,Yr,Me,se);let Se=Ie,ne=Ie-l;oe&&u>0&&l>0&&wn(p,oe,Z.outer,Se,ne,bs,t,G,se),(ne!==ce||se)&&wn(p,Z.outer,Z.outer,ne,ce,Ur,t,G,se);for(let he of Z.holes)if((ne!==ce||se)&&wn(p,he,he,ne,ce,Ur,t,G,se),Ie<ce){let me=p.indices.length;zr(p,he,[],ce,gs,0,se);for(let Pe=me;Pe<p.indices.length;Pe++)ie.push(p.indices[Pe]);p.indices.length=me}X.push(N,p.indices.length,ee,ie.length)}if(!p.indices.length&&!ie.length)return null;let W=p.indices.length;for(let B=0;B<X.length;B+=4)X[B+2]+=W,X[B+3]+=W;let re=[];for(let B of z){re.push(B.length);for(let N of B)re.push(N)}let Q=new Uint32Array(W+ie.length);return Q.set(p.indices,0),Q.set(ie,W),{vertices:m.slice(0,p.offset),indices:Q.buffer,vertexCount:p.count,indexCount:Q.length,extent:t,capIndexOffset:W,shapeFeatures:new Float64Array(re).buffer,shapeRanges:new Uint32Array(X).buffer}}function vs(e,t,n){let i=e.map(()=>[]);if(!e.length)return i;let o=e.map(r=>Gr(r.outer));for(let r=0;r<t.length;r++){let s=Ss(t[r].outer);if(!s)continue;let u=-1;for(let l=0;l<e.length;l++){let c=o[l];if(s[0]<c[0]||s[0]>c[2]||s[1]<c[1]||s[1]>c[3]||!vt(e[l].outer,s[0],s[1]))continue;let f=!1;for(let m of e[l].holes)if(vt(m,s[0],s[1])){f=!0;break}if(!f){u=l;break}}if(u<0){let l=Gr(t[r].outer),c=0;for(let f=0;f<e.length;f++){let m=o[f],p=Math.min(l[2],m[2])-Math.max(l[0],m[0]),g=Math.min(l[3],m[3])-Math.max(l[1],m[1]),y=p>0&&g>0?p*g:0;y>c&&(c=y,u=f)}}u<0&&(u=0);for(let l of n[r])i[u].includes(l)||i[u].push(l)}return i}function Gr(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(let r=0;r<e.length;r+=2)e[r]<t&&(t=e[r]),e[r]>i&&(i=e[r]),e[r+1]<n&&(n=e[r+1]),e[r+1]>o&&(o=e[r+1]);return[t,n,i,o]}function Ss(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let o=0;o<t;o++){let r=(o+1)%t;n+=e[o*2]*e[r*2+1]-e[r*2]*e[o*2+1]}let i=n>0;for(let o=0;o<t;o++){let r=(o+t-1)%t*2,s=o*2,u=(o+1)%t*2,l=(e[s]-e[r])*(e[u+1]-e[r+1])-(e[s+1]-e[r+1])*(e[u]-e[r]);if(l===0||l>0!==i)continue;let c=(e[r]+e[s]+e[u])/3,f=(e[r+1]+e[s+1]+e[u+1])/3;if(vt(e,c,f))return[c,f]}return null}function vt(e,t,n){let i=!1,o=e.length/2-1;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}var Rs=Ht;function Es(e,t,n,i){if(e.length<2)return;let o=e.map(s=>{let u=1/0,l=1/0,c=-1/0,f=-1/0;for(let m=0;m<s.outer.length;m+=2)s.outer[m]<u&&(u=s.outer[m]),s.outer[m]>c&&(c=s.outer[m]),s.outer[m+1]<l&&(l=s.outer[m+1]),s.outer[m+1]>f&&(f=s.outer[m+1]);return{minX:u,minY:l,maxX:c,maxY:f}}),r=(s,u,l)=>{let c=o[s];if(u<c.minX||u>c.maxX||l<c.minY||l>c.maxY||!vt(e[s].outer,u,l))return!1;for(let f of e[s].holes)if(vt(f,u,l))return!1;return!0};for(let s=0;s<e.length;s++)for(let u of[e[s].outer,...e[s].holes])for(let l=0;l+3<u.length;l+=2){let c=(u[l]+u[l+2])/2,f=(u[l+1]+u[l+3])/2;for(let m=0;m<e.length;m++)if(!(m===s||!r(m,c,f))&&!(n(s,c,f)<=Ht&&n(m,c,f)<=Ht)&&!(Math.abs(t(s,c,f)-t(m,c,f))>Rs)){i.add($e(u[l],u[l+1],u[l+2],u[l+3]));break}}}function $e(e,t,n,i){let o=`${Math.round(e*100)},${Math.round(t*100)}`,r=`${Math.round(n*100)},${Math.round(i*100)}`;return o<r?`${o}|${r}`:`${r}|${o}`}function jr(e,t){for(let n=0;n+3<e.length;n+=2){let i=$e(e[n],e[n+1],e[n+2],e[n+3]);t.set(i,(t.get(i)??0)+1)}}function Hr(e,t){if(!t.size)return;let n=e.length/2-1,i=new Array(n).fill(!1);for(let o=0;o<n;o++){let r=$e(e[(o+n-1)%n*2],e[(o+n-1)%n*2+1],e[o*2],e[o*2+1]),s=$e(e[o*2],e[o*2+1],e[(o+1)%n*2],e[(o+1)%n*2+1]);(t.has(r)||t.has(s))&&(i[o]=!0)}return i}function Mt(e,t,n,i,o,r,s,u){let l=e.offset;return e.view.setFloat32(l,t,!0),e.view.setFloat32(l+4,n,!0),e.view.setInt16(l+8,Fs(Math.round(i*ds)),!0),e.view.setInt8(l+10,Sn(Math.round(o*127))),e.view.setInt8(l+11,Sn(Math.round(r*127))),e.view.setInt8(l+12,Sn(Math.round(s*127))),e.bytes[l+13]=u,e.view.setInt8(l+14,t<=0?-Yt:t>=e.extent?Yt:0),e.view.setInt8(l+15,n<=0?-Yt:n>=e.extent?Yt:0),e.offset+=Rn,e.count++}function zr(e,t,n,i,o=Yr,r=0,s){let u=[],l=[];for(let p=0;p<t.length;p++)u.push(t[p]);for(let p of n){l.push(u.length/2);for(let g=0;g<p.length;g++)u.push(p[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=c;if(r>0){let p=[];hn(u,c,0,r,p),f=p}e.ensure(u.length/2);let m=e.count;for(let p=0;p<u.length;p+=2)Mt(e,u[p],u[p+1],s?i+s(u[p],u[p+1]):i,0,0,1,o);for(let p=0;p<f.length;p+=3)e.indices.push(m+f[p],m+f[p+2],m+f[p+1])}function wn(e,t,n,i,o,r,s,u,l,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let m=0;m<f-1;m++){let p=n[m*2],g=n[m*2+1],y=n[m*2+2],w=n[m*2+3];if(p===y&&g===w||Vt(p,g,y,w,s,ve(s))||u.has($e(p,g,y,w)))continue;let E=y-p,R=w-g,T=Math.hypot(E,R)||1,L=R/T,P=-E/T,U=i-o,V=Math.hypot(t[m*2]-p,t[m*2+1]-g)||0,D=0;if(V>1e-6&&U!==0){let re=1/Math.hypot(1,U/V);D=V/Math.hypot(V,U)*Math.sign(U),L*=re,P*=re}let j=l?l(t[m*2],t[m*2+1]):0,O=l?l(t[m*2+2],t[m*2+3]):0,z=c??l,G=z?z(p,g):0,te=z?z(y,w):0,ie=Mt(e,t[m*2],t[m*2+1],i+j,L,P,D,r),J=Mt(e,t[m*2+2],t[m*2+3],i+O,L,P,D,r),X=Mt(e,p,g,o+G,L,P,D,r),W=Mt(e,y,w,o+te,L,P,D,r);e.indices.push(X,J,W,X,ie,J)}}}function Mn(e,t,n,i){let o=e.length/2-1;if(o<3)return null;let r=[];for(let f=0;f<o;f++){let m=e[f*2],p=e[f*2+1],g=e[(f+o-1)%o*2],y=e[(f+o-1)%o*2+1],w=e[(f+1)%o*2],E=e[(f+1)%o*2+1],R=Math.hypot(m-g,p-y)||1,T=Math.hypot(w-m,E-p)||1,L=(p-y)/R,P=-(m-g)/R,U=(E-p)/T,V=-(w-m)/T,D=L+U,j=P+V,O=Math.hypot(D,j);if(O<1e-6){r.push(m,p);continue}D/=O,j/=O;let z=Math.min(1/Math.max(D*L+j*P,.35),3),G=m-D*t*z,te=p-j*t*z,ie=$e(g,y,m,p),J=$e(m,p,w,E);if(i.has(ie)||i.has(J)){r.push(m,p);continue}let X=-ve(n),W=n+ve(n);((Q,B)=>Q<=X||Q>=W||B<=X||B>=W)(m,p)&&(G=m,te=p),r.push(G,te)}r.push(r[0],r[1]);let s=Math.abs(vn(e)),u=vn(r);if(Math.sign(u)!==Math.sign(vn(e))||Math.abs(u)<s*.25)return null;let l=-ve(n),c=n+ve(n);for(let f=0;f<r.length;f+=2)r[f]=Math.max(l,Math.min(c,r[f])),r[f+1]=Math.max(l,Math.min(c,r[f+1]));return r}function vn(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Sn=e=>e>127?127:e<-127?-127:e,Fs=e=>e>32767?32767:e<-32768?-32768:e;function Xr(e,t,n){if(!(t>0))return e;let i=ve(n),o=-i,r=n+i,s=e;for(let u=0;u<3;u++){let l=s.length/2-1;if(l<6)break;let c=new Array(l).fill(!0),f=l;for(let p=0;p<l&&!(f<=5);p++){let g=s[p*2],y=s[p*2+1];if(g<=o||g>=r||y<=o||y>=r)continue;let w=(p+l-1)%l;for(;!c[w]&&w!==p;)w=(w+l-1)%l;let E=(p+1)%l;for(;!c[E]&&E!==p;)E=(E+1)%l;if(w===p||E===p)break;let R=s[w*2],T=s[w*2+1],L=s[E*2]-R,P=s[E*2+1]-T,U=Math.hypot(L,P);U<1e-6||Math.abs((g-R)*P-(y-T)*L)/U<t&&(c[p]=!1,f--)}if(f===l)break;let m=[];for(let p=0;p<l;p++)c[p]&&m.push(s[p*2],s[p*2+1]);m.push(m[0],m[1]),s=m}return s}function ks(e,t,n){let i=t.r*.8,o=t.r*1.2,r=(s,u)=>{let l=Math.hypot(s-t.x,u-t.y);return l>=i&&l<=o};for(let s=0;s+3<e.length;s+=2)!r(e[s],e[s+1])||!r(e[s+2],e[s+3])||n.add($e(e[s],e[s+1],e[s+2],e[s+3]))}var St=24;function Kr(e,t,n=0,i,o=0,r={}){let{level:s,paint:u}=r,l=Math.max(256,e.length*24),c=new ArrayBuffer(l*St),f=new DataView(c),m=0,p=[],g=[],y=V=>{if(m+V<=l)return;l=Math.max(l*2,m+V);let D=new ArrayBuffer(l*St);new Uint8Array(D).set(new Uint8Array(c,0,m*St)),c=D,f=new DataView(D)},w=(V,D,j,O,z,G,te,ie=0,J=0,X=0,W=0,re=0)=>{let Q=m*St;return f.setInt16(Q,V,!0),f.setInt16(Q+2,D,!0),f.setInt16(Q+4,j,!0),f.setInt16(Q+6,O,!0),f.setInt8(Q+8,z),f.setInt8(Q+9,G),f.setInt8(Q+10,ie),f.setInt8(Q+11,J),f.setFloat32(Q+12,te,!0),f.setFloat32(Q+16,X,!0),f.setInt16(Q+20,W,!0),f.setInt16(Q+22,re,!0),m++},E=0,R=0,T=o>0?Gt/o:0,L=T>0?Ut(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||s!==void 0&&Ve(V.properties)!==s)continue;let D=V.properties.osm_id,j=typeof D=="number"?D:typeof D=="string"?Number(D):NaN;R=Number.isFinite(j)?j:Number(V.id??0);let O=V.properties.width;E=typeof O=="number"&&O>.5&&O<100?O:0;let z=r.liftAt?.(V.properties)??null;u?.setFeature(V.properties,V.id??null,V.type===3?"Polygon":"LineString");let G=V.type===3;for(let te of V.loadGeometry()){let ie=n>0?Is(Zr(te),n):Zr(te);if(ie.length<4)continue;let J=i&&!xr(i)?yr(i,ie):null,X=J?J.pts:ie,W=J?.levels,re=X.length/2;if(re<2)continue;let Q=Ve(V.properties),B=null,N=E;if(L&&E>0&&!G){let Z=jt(X,{junctions:L,width:E,level:Q,taper:T});if(N=Z.width,Z.at){B=Z.at;let oe=Z.knots;if(oe.length){let de=As(X,W,oe);X=de.pts,W=de.levels,re=X.length/2}}}y((re-1)*4);let ee=0;for(let Z=0;Z<re-1;Z++){let oe=X[Z*2],de=X[Z*2+1],be=X[Z*2+2],se=X[Z*2+3],Ie=Math.hypot(be-oe,se-de);if(G&&Ls(oe,de,be,se,e.extent)){ee+=Ie;continue}let Ne=Ps(oe,de,be,se,e.extent);if(!Ne){ee+=Ie;continue}let[ce,Me,Se,ne]=Ne,he=Math.hypot(ce-oe,Me-de),me=Math.hypot(Se-ce,ne-Me),Pe=Math.hypot(be-Se,se-ne),Le=ee+he,Oe=W?W[Z]:0,Ee=W?W[Z+1]:0,Ue=z?Wr(z(ce,Me)):0,ze=z?Wr(z(Se,ne)):0,We=B?B(Le):N,ut=B?B(Le+me):N,Rt=w(ce,Me,Se,ne,0,-1,Le,Oe,Ee,We,Ue,ze),$t=w(ce,Me,Se,ne,0,1,Le,Oe,Ee,We,Ue,ze),Re=w(ce,Me,Se,ne,1,1,Le,Oe,Ee,ut,Ue,ze),An=w(ce,Me,Se,ne,1,-1,Le,Oe,Ee,ut,Ue,ze);ee+=he+me+Pe,p.push(Rt,$t,Re,Rt,Re,An),g.push(R,R)}}u?.advanceTo(m)}if(!p.length)return null;let P=new Uint32Array(p),U=new Float64Array(g);return{vertices:c.slice(0,m*St),indices:P.buffer,vertexCount:m,indexCount:P.length,featureIds:U.buffer,...u?{dataPaint:u.take(m)}:{}}}function Wr(e){return Math.max(-32768,Math.min(32767,Math.round(e*100)))}function As(e,t,n){let i=[...n].sort((l,c)=>l-c),o=[e[0],e[1]],r=t?[t[0]]:void 0,s=0,u=0;for(let l=0;l+3<e.length;l+=2){let c=e[l],f=e[l+1],m=e[l+2],p=e[l+3],g=Math.hypot(m-c,p-f);for(;u<i.length&&i[u]<=s+.01;)u++;for(;u<i.length&&i[u]<s+g-.01;){let y=(i[u]-s)/g;o.push(c+(m-c)*y,f+(p-f)*y),r&&t&&r.push(Math.round(t[l/2]+(t[l/2+1]-t[l/2])*y)),u++}s+=g,o.push(m,p),r&&t&&r.push(t[l/2+1])}return{pts:o,levels:r}}function Is(e,t){let n=[];for(let i=0;i+3<e.length;i+=2){let o=e[i],r=e[i+1],s=e[i+2],u=e[i+3];n.push(o,r);let l=Math.min(64,Math.floor(Math.hypot(s-o,u-r)/t));for(let c=1;c<l;c++){let f=c/l;n.push(o+(s-o)*f,r+(u-r)*f)}}return n.push(e[e.length-2],e[e.length-1]),n}function Zr(e){let t=[];for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&t[r-2]===i&&t[r-1]===o||t.push(i,o)}return t}function Ps(e,t,n,i,o){let r=n-e,s=i-t,u=0,l=1,c=[[-r,e],[r,o-e],[-s,t],[s,o-t]];for(let[f,m]of c){if(f===0){if(m<0)return null;continue}let p=m/f;if(f<0){if(p>l)return null;p>u&&(u=p)}else{if(p<u)return null;p<l&&(l=p)}}return l-u<1e-6?null:[Math.round(e+r*u),Math.round(t+s*u),Math.round(e+r*l),Math.round(t+s*l)]}function Ls(e,t,n,i,o){return e===n&&(e<=0||e>=o)?!0:t===i&&(t<=0||t>=o)}var _s=[["\\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."]],Qr=new Map(_s);function Jr(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,i=t.map(r=>{let s=Qr.get(r.toLowerCase());return s?(n=!0,r[0]===r[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):r});return!n||!t.filter(r=>Qr.get(r.toLowerCase())===void 0).length?e:i.join(" ")}function eo(e,t){let n=[],i=[],o=[],r=[],s=[],u=t.textPlacement==="line",l=[],c=[],f=[];for(let m of e.features()){if(!pe(t.filter,m.properties))continue;let p=m.loadGeometry(),g=Cs(m.type,p);if(!g)continue;let y=t.textField?qr(t.textField,m.properties):"",w=y&&t.abbreviate?Jr(y):y,E=t.iconImage?qr(t.iconImage,m.properties):"";if(!(!w&&!E)){if(u){let R=Ts(m.type,p);if(!R)continue;f.push({text:w,line:R});continue}n.push(g[0],g[1]),i.push(w),o.push(E),r.push(Vs(m.properties)),s.push(t.iconRotate&&Math.round(Number(m.properties[t.iconRotate]??0))||0)}}if(u){for(let{text:m,line:p}of Bs(f)){c.push(l.length/2);for(let g of p)l.push(g);n.push(Math.round(p[0]),Math.round(p[1])),i.push(m),o.push(""),r.push(128),s.push(0)}c.push(l.length/2)}return i.length?{anchors:new Int16Array(n).buffer,texts:i,icons:o,priorities:new Uint8Array(r).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Bs(e){let t=[],n=new Map,i=new Map,o=(r,s,u)=>`${r}\\u241F${s}\\u241F${u}`;for(let{text:r,line:s}of e){let u=o(r,s[0],s[1]),l=o(r,s[s.length-2],s[s.length-1]),c=n.get(l),f=i.get(u);if(f!==void 0){let m=t[f];if(m.line.push(...s.slice(2)),i.delete(u),i.set(o(r,m.line[m.line.length-2],m.line[m.line.length-1]),f),c!==void 0&&c!==f){let p=t[c];m.line.push(...p.line.slice(2)),p.line=[],n.delete(l),i.set(o(r,m.line[m.line.length-2],m.line[m.line.length-1]),f)}continue}if(c!==void 0){let m=t[c];m.line.unshift(...s.slice(0,s.length-2)),n.delete(l),n.set(o(r,m.line[0],m.line[1]),c);continue}n.set(u,t.length),i.set(l,t.length),t.push({text:r,line:s})}return t.filter(r=>r.line.length>=4)}function Ts(e,t){if(e!==2)return null;let n=null,i=0;for(let o of t){if(o.length<4)continue;let r=0;for(let s=0;s+3<o.length;s+=2)r+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);r>i&&(i=r,n=o)}return n}function Cs(e,t){if(!t.length)return null;if(e===1){let s=t[0];return s.length>=2?[s[0],s[1]]:null}if(e===2){let s=-1,u=0,l=0;for(let c of t)for(let f=0;f+3<c.length;f+=2){let m=c[f+2]-c[f],p=c[f+3]-c[f+1],g=m*m+p*p;g>s&&(s=g,u=c[f]+m/2,l=c[f+1]+p/2)}return s>0?[Math.round(u),Math.round(l)]:null}let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((i+r)/2)]:null}function Vs(e){let t=e.importance;if(typeof t=="number"&&isFinite(t))return Math.max(0,255-Math.min(Math.max(t,1),9)*20);let n=e.rank;return typeof n=="number"&&isFinite(n)?Math.max(0,255-Math.min(n,255)):128}function qr(e,t){let n=Array.isArray(e)?e:[e];for(let i of n){let o=!0,s=i.replace(/\\{([^}]+)\\}/g,(u,l)=>{let c=t[l];return c==null||c===""?(o=!1,""):String(c)}).trim();if(o&&s)return s}return""}function to(e,t){let n=[],i=[];for(let o=0;o<e.length;o++){let r=e.feature(o);if(r.type===1&&pe(t,r.properties))for(let s of r.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),i.push(r.properties)}return i.length?{anchors:Int16Array.from(n).buffer,props:i}:null}var Os="\\u241F",En=(e,t)=>e+Os+String(t);function Ds(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}function Ns(e,t){let n={},i=[],o={},r=new Set,s=[],l=t.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&t.plan.some(c=>c.type==="line"&&c.ground)?br(t.metersPerTile):void 0;for(let c of t.plan){if(!zs(c,t.zoom,t.sourceMaxZoom))continue;let f=e.layers[c.sourceLayer];if(!f)continue;let m=Xs(t.zoom,f.extent);try{if(c.splitBy){let g=Ys(f,c.splitBy,c.filter);if(!g.length)continue;let y=o[c.splitBy]??(o[c.splitBy]=[]);for(let w of g){y.includes(w)||y.push(w);let E={...c,splitBy:void 0,filter:Ws(c.filter,c.splitBy,w)},R=Fn(E,f,m,t.metersPerTile,t.zoom,l,void 0,i,t.tile);R&&(n[En(c.id,w)]=R)}continue}if(c.network&&c.type==="line"){for(let g of $s(f,c.filter)){let y=Fn(c,f,m,t.metersPerTile,t.zoom,l,g,i,t.tile);y&&(n[En(c.id,g)]=y,r.add(g))}continue}let p=Fn(c,f,m,t.metersPerTile,t.zoom,l,void 0,i,t.tile);p&&(n[c.id]=p)}catch(p){s.push(`${c.id}: ${p instanceof Error?p.message:String(p)}`)}}return{buckets:n,seams:i,splits:o,levels:[...r].sort((c,f)=>c-f),failed:s}}async function no(e,t){let n=performance.now(),i=Ds(),o=await fetch(e.url,{signal:t,credentials:"same-origin",...i?{referrer:i}:{}}),r=(E,R,T,L,P=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:L,parseMs:P},diag:{status:E,bytes:R,layers:T,built:0}});if(!o.ok){if(o.status===404||o.status===204)return r(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${e.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return r(o.status,0,[],u);let l=performance.now(),c=new Lt(s),f=Object.keys(c.layers),{buckets:m,seams:p,splits:g,levels:y,failed:w}=Ns(c,e);return{type:"loaded",id:e.id,raw:s,buckets:m,...p.length?{seams:p}:{},...Object.keys(g).length?{splits:g}:{},...y.length?{levels:y}:{},timing:{fetchMs:u,parseMs:performance.now()-l},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(m).length,...w.length?{failed:w}:{}}}}function Us(e){return t=>{let n=t.lift,i=typeof n=="number"?n:typeof n=="string"?Number(n):NaN;return Number.isFinite(i)?Math.max(0,i):Math.max(0,Ve(t))*e}}function Gs(e){let t=e.lift,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return!Number.isFinite(n)||n===0?null:()=>n}function js(e,t){return n=>{let i=n.width,o=typeof i=="number"?i:typeof i=="string"?Number(i):NaN,r=Number.isFinite(o)&&o>0?o:e??0;return r>0?r+(t??0):null}}function Hs(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let i=0;for(let o of n.split(",")){let r=e[o];typeof r=="number"&&r>i&&(i=r)}return i}}function zs(e,t,n){let i=t-1,o=t<n?t+1:24;return!(e.maxzoom<i||e.minzoom>o)}function Xs(e,t){return e<=6?Math.max(64,t/24):0}function Fn(e,t,n,i,o,r,s,u,l){{let c=Br(l,t.extent);if(e.type==="fill"){let m=i>0?i/t.extent:0,p=e.cornerRadius&&m>0?{radius:e.cornerRadius/m,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:Jn/m}:void 0,g=pr(t,e.filter,n,p,e.clipToTile===!0,t.extent,Dt(e.dataPaint,o));return g?{kind:"fill",...g,extent:t.extent}:null}if(e.type==="surface"){let m=$r(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...r&&!e.fromLines&&e.groundField!==!1?{onShapes:p=>gr(r,p,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:Hs(e.groundBy)}:{},...e.fromLines?{widthOf:js(e.width,e.widthExtra),widthExtra:e.widthExtra??0}:{},...e.deck?{deck:e.deck}:{},...e.levelHeight&&!e.groundBy?{liftBy:Us(e.levelHeight)}:{},liftAt:c});return m?{kind:"surface",...m}:null}if(e.type==="line"){let m=g=>c(g)??Gs(g),p=Kr(t,e.filter,n,e.ground?r:void 0,i>0?i/t.extent:0,{level:s,paint:Dt(e.dataPaint,o),liftAt:m});return p?{kind:"line",...p,extent:t.extent}:null}if(e.type==="model"){let m=to(t,e.filter);return m?{kind:"placement",...m,extent:t.extent}:null}if(e.type==="symbol"){let m=eo(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return m?{kind:"symbol",...m,extent:t.extent}:null}let f=fr(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,paint:Dt(e.dataPaint,o)},u);return f?{kind:"fill-extrusion",vertices:f.vertices,indices:f.indices,featureIds:f.featureIds,vertexCount:f.vertexCount,indexCount:f.indexCount,extent:f.extent,...f.dataPaint?{dataPaint:f.dataPaint}:{}}:null}}function Ys(e,t,n){let i=[];for(let o of e.features()){if(!pe(n,o.properties))continue;let r=o.properties[t];typeof r!="string"&&typeof r!="number"||i.includes(r)||i.push(r)}return i.sort((o,r)=>typeof o=="number"&&typeof r=="number"?o-r:String(o).localeCompare(String(r))),i}function $s(e,t){let n=[];for(let i of e.features()){if(!pe(t,i.properties))continue;let o=Ve(i.properties);n.includes(o)||n.push(o)}return n.sort((i,o)=>i-o)}function Ws(e,t,n){let i=["==",t,n];return e?["all",e,i]:i}var Zs=e=>e.kind==="symbol",Ks=e=>e.kind==="placement";function ro(e){let t=[];e.raw&&t.push(e.raw);for(let n of Object.values(e.buckets)){if(Ks(n)){t.push(n.anchors);continue}if(Zs(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.dataPaint&&t.push(n.dataPaint),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var oo=Map;var st=new oo,kn=self;kn.onmessage=e=>{let t=e.data;if(t.type==="abort"){st.get(t.id)?.abort(),st.delete(t.id);return}let n=new AbortController;st.set(t.id,n),no(t,n.signal).then(i=>{st.has(t.id)&&(st.delete(t.id),kn.postMessage(i,ro(i)))}).catch(i=>{let o=n.signal.aborted;st.delete(t.id);let r={type:"error",id:t.id,message:i instanceof Error?i.message:String(i),aborted:o};kn.postMessage(r)})};})();\n';var g0=2,Rn=class{constructor(e=pa()){this.workers=[];this.blobUrl=null;this.pending=new D;this.queue=new D;this.busy=[];this.nextId=1;this.mainThreadAborts=new D;this.destroyed=false;try{let t=new Blob([ma],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Cu(n,a.signal).then(s=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(s));}).catch(s=>{let l=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:s instanceof Error?s.message:String(s),aborted:l});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=g0||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function pa(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Lu(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function ba(i,e){let t=Lu(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 ga(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let l=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!l||l.length<2)return null;t=l[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 s={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(s.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(s.pitch=Number(o[4])),s}function Pu(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 Fu={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}},gr=i=>Fu[i]??Fu.high;function zu(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function Ln(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?xa(a)??a:n==="strong"&&!o?Ou(a)??a:a}function Pn(){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,gpu:y0()}}function y0(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?zu(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function wa(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 In(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function Ou(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function xa(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var ya=120,v0=40,w0=.35,x0=.02,_0=150,M0=30,C0=1,S0=1800,va=30,T0=1.25,br=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(ya);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(va);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%ya,this.filled<ya&&this.filled++,this.steady++,this.steady===S0&&(this.attempts[this.current]=0),this.filled<v0)return null;let n=this.sum/this.filled;return n>=w0?this.down(n):n>x0?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%va,this.recentFilled<va&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*T0)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=xa(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=C0&&In(t)<In(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=Ou(this.current);if(!t||In(t)>In(this.ceiling))return null;let o=_0*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=M0;}};function k0(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,s=t+o,l=h=>h.x>=r&&h.x<=a&&h.y>=n&&h.y<=s,c=[],u=[],f=()=>{u.length>=2&&c.push(u),u=[];};for(let h=0;h+1<i.length;h++){let d=i[h],m=i[h+1],b=l(d),p=l(m);if(b&&p){u.length||u.push(d),u.push(m);continue}let g=E0(d,m,r,n,a,s);if(!g){f();continue}u.length||u.push(g[0]),u.push(g[1]),p||f();}return f(),c}function E0(i,e,t,o,r,n){let a=e.x-i.x,s=e.y-i.y,l=0,c=1,u=[[-a,i.x-t],[a,r-i.x],[-s,i.y-o],[s,n-i.y]];for(let[f,h]of u){if(f===0){if(h<0)return null;continue}let d=h/f;if(f<0){if(d>c)return null;d>l&&(l=d);}else {if(d<l)return null;d<c&&(c=d);}}return [{x:i.x+a*l,y:i.y+s*l},{x:i.x+a*c,y:i.y+s*c}]}var A0=64,_t=i=>`<svg viewBox="0 0 64 64" width="64" height="64" xmlns="http://www.w3.org/2000/svg">${i}</svg>`,Fn=i=>_t('<circle cx="32" cy="32" r="30" fill="#ffffff"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="8"/>'+i),_a=i=>_t('<circle cx="32" cy="32" r="30" fill="#0053a0"/>'+i),yr=i=>_t('<path d="M32 4 61 56H3z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'+i),Ma=(i,e="#0053a0")=>_t(`<rect x="3" y="3" width="58" height="58" rx="6" fill="${e}"/>`+i),R0={"sign-stop":_t('<path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="#c8102e"/><path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="none" stroke="#ffffff" stroke-width="3"/><text x="32" y="36" font-family="Arial, Helvetica, sans-serif" font-size="17" font-weight="700" fill="#ffffff" text-anchor="middle">STOP</text>'),"sign-give-way":_t('<path d="M32 58 3 6h58z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'),"sign-priority":_t('<path d="M32 3 61 32 32 61 3 32z" fill="#ffffff"/><path d="M32 13 51 32 32 51 13 32z" fill="#ffd400"/>'),"sign-no-entry":_t('<circle cx="32" cy="32" r="30" fill="#c8102e"/><rect x="11" y="27" width="42" height="10" rx="2" fill="#ffffff"/>'),"sign-no-traffic":Fn('<line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="8" stroke-linecap="round"/>'),"sign-speed-40":Fn('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">40</text>'),"sign-speed-60":Fn('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">60</text>'),"sign-no-parking":_t('<circle cx="32" cy="32" r="30" fill="#0053a0"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="7"/><line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="7" stroke-linecap="round"/>'),"sign-roundabout":_a('<g fill="none" stroke="#ffffff" stroke-width="5" stroke-linecap="round"><path d="M32 16a16 16 0 1 1-13.9 8"/></g><path d="M14 18l8 8-11 2z" fill="#ffffff"/>'),"sign-straight":_a('<path d="M32 12 46 30h-8v22h-12V30h-8z" fill="#ffffff"/>'),"sign-keep-right":_a('<path d="M44 20v18H30v10l-14-14 14-14v10h6V20z" fill="#ffffff" transform="rotate(-45 32 32)"/>'),"sign-crossing":Ma('<path d="M32 12 54 52H10z" fill="#ffffff"/><path d="M31 22a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4z" fill="#1a1a1a"/><path d="M29 24h4l4 9-3 1-2-4v6l4 8h-4l-3-6-3 6h-4l5-10v-8l-3 5-3-1z" fill="#1a1a1a"/>'),"sign-parking":Ma('<text x="32" y="45" font-family="Arial, Helvetica, sans-serif" font-size="38" font-weight="700" fill="#ffffff" text-anchor="middle">P</text>'),"sign-living-street":Ma('<path d="M14 34 32 20l18 14v2H14z" fill="#ffffff"/><rect x="19" y="36" width="26" height="10" rx="3" fill="#ffffff"/><circle cx="25" cy="47" r="3" fill="#ffffff"/><circle cx="39" cy="47" r="3" fill="#ffffff"/>'),"sign-traffic-signals":yr('<rect x="26" y="22" width="12" height="28" rx="4" fill="#1a1a1a"/><circle cx="32" cy="28" r="3.4" fill="#e03131"/><circle cx="32" cy="36" r="3.4" fill="#f2c14b"/><circle cx="32" cy="44" r="3.4" fill="#37b24d"/>'),"sign-crossing-ahead":yr('<path d="M31 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" fill="#1a1a1a"/><path d="M29 29h4l4 8-2.6 1.2L32 34v5l4 9h-4l-3-6-3 6h-4l5-10v-7l-2.6 4.6L22 34z" fill="#1a1a1a"/>'),"sign-level-crossing":yr('<path d="M20 44 44 24M20 24l24 20" stroke="#1a1a1a" stroke-width="5" stroke-linecap="round"/>'),"sign-hump":yr('<path d="M18 44c0-9 6-14 14-14s14 5 14 14z" fill="#1a1a1a"/>'),"sign-roadworks":yr('<path d="M28 20h8v6h-8z" fill="#1a1a1a"/><path d="M24 30h16l4 18H20z" fill="#1a1a1a"/>')};function I0(i){let e=String(Math.round(i)),t=e.length>2?21:26;return Fn(`<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="${t}" font-weight="700" fill="#1a1a1a" text-anchor="middle">${e}</text>`)}function Ca(i,e={}){let t=e.length??4.5,o=e.shaft??.45,r=e.head??1.6,n=e.headLength??1.4,a=e.branch??1.5,s=o/2,l=t/2,c=-t/2,u=l-n,f=()=>[c,-s,u,-s,u,-r/2,l,0,u,r/2,u,s,c,s,c,-s],h=(d,m)=>{let b=a,p=0,g=8,y=[m,-d*s];for(let v=0;v<=g;v++){let w=-Math.PI/2+Math.PI/2*(v/g);y.push(p+Math.cos(w)*(b+s),d*(b+Math.sin(w)*(b+s)));}y.push(p+b+r/2,d*b),y.push(p+b,d*(b+n)),y.push(p+b-r/2,d*b);for(let v=g;v>=0;v--){let w=-Math.PI/2+Math.PI/2*(v/g);y.push(p+Math.cos(w)*(b-s),d*(b+Math.sin(w)*(b-s)));}return y.push(m,d*s),y.push(m,-d*s),y};switch(i){case "straight":return [f()];case "left":return [h(-1,c)];case "right":return [h(1,c)];case "straight-left":case "straight-right":{let d=i==="straight-right"?1:-1;return [f(),h(d,c)]}case "u-turn":{let d=a,m=u-d,b=[],p=14;for(let y=0;y<=p;y++){let v=-Math.PI/2+Math.PI*y/p;b.push(m+Math.cos(v)*(d+s),Math.sin(v)*(d+s));}for(let y=p;y>=0;y--){let v=-Math.PI/2+Math.PI*y/p;b.push(m+Math.cos(v)*(d-s),Math.sin(v)*(d-s));}b.push(b[0],b[1]);let g=[m,-d-r/2,m-n,-d,m,-d+r/2,m,-d-r/2];return [zn(c,m,-s,s),b,g]}}}function L0(i,e=4,t=.4,o=.6){let r=[],n=t+o,a=Math.max(Math.floor((i-t)/n)+1,1),s=(a-1)*n;for(let l=0;l<a;l++){let c=-s/2+l*n;r.push(zn(-e/2,e/2,c-t/2,c+t/2));}return r}function P0(i,e=.4){return [zn(-e/2,e/2,-i/2,i/2)]}function F0(i,e=.4,t=2){let o=[],r=i/2;for(let n of [1,-1])for(let a=-i;a<=i;a+=t){let s=z0(zn(-i,i,a-e/2,a+e/2),n*Math.PI/4),l=O0(s,r);l&&o.push(l);}return o}function zn(i,e,t,o){return [i,t,e,t,e,o,i,o,i,t]}function z0(i,e){let t=Math.cos(e),o=Math.sin(e),r=[];for(let n=0;n+1<i.length;n+=2)r.push(i[n]*t-i[n+1]*o,i[n]*o+i[n+1]*t);return r}function O0(i,e){let t=i.slice(),o=[[1,0,e],[-1,0,e],[0,1,e],[0,-1,e]];for(let[r,n,a]of o){let s=[],l=t.length/2;for(let c=0;c<l;c++){let u=t[c*2],f=t[c*2+1],h=t[(c+1)%l*2],d=t[(c+1)%l*2+1],m=r*u+n*f-a,b=r*h+n*d-a;if(m<=0&&s.push(u,f),m<=0!=b<=0){let p=m/(m-b);s.push(u+(h-u)*p,f+(d-f)*p);}}if(t=s,t.length<6)return null}return t.push(t[0],t[1]),t}function Sa(i,e,t,o,r,n=r){let a=Math.cos(e),s=Math.sin(e),l=[];for(let c=0;c+1<i.length;c+=2){let u=i[c]*a-i[c+1]*s,f=i[c]*s+i[c+1]*a;l.push(t+u*r,o+f*n);}return l}var Hu=.25,H0=20*Math.PI/180;function D0(i,e={}){let t=[],o=new Map,r=(u,f)=>Math.round(u/Hu)+","+Math.round(f/Hu),n=(u,f)=>{let h=r(u,f),d=o.get(h);if(d!==void 0)return d;let m=t.length;return t.push({x:u,y:f,rays:[],degree:0,crossing:false}),o.set(h,m),m},a=[];i.forEach((u,f)=>{let h=u.pts.length/2;if(h<2){a.push([-1,-1]);return}let d=u.pts[0],m=u.pts[1],b=u.pts[h*2-2],p=u.pts[h*2-1],g=n(d,m),y=n(b,p);a.push([g,y]);let v=u.level??0;t[g].rays.push({axis:f,atTail:false,level:v,width:u.width,cls:u.cls??"",oneway:!!u.oneway,angle:Math.atan2(u.pts[3]-m,u.pts[2]-d)}),t[y].rays.push({axis:f,atTail:true,level:v,width:u.width,cls:u.cls??"",oneway:!!u.oneway,angle:Math.atan2(u.pts[h*2-3]-p,u.pts[h*2-4]-b)});});for(let u of t){u.rays.sort((d,m)=>d.angle-m.angle),u.degree=u.rays.length;let f=new Map;for(let d of u.rays)f.set(d.level,(f.get(d.level)??0)+1);let h=0;for(let d of f.values())h=Math.max(h,d);u.crossing=h>=3;}let s=W0(i,a,t),l=e.smooth??0,c=e.refine??0;if(l>0||c>0){let u=e.maxSmooth??25;for(let f of s){let h=f.head===f.tail&&f.pts.length>=8,d=h?V0(f.pts):f.pts;if(c>0){let m=e.densify??0;m>0&&(d=Qn(d,m)),d=$t(d,c);}l>0&&(d=Ao(d,Math.min(f.width*l,u))),f.pts=h?N0(d,f.pts):d;}}return {nodes:t,ends:a,chains:s,clearance(u,f){return this.clearanceAt(u,f.angle,f.level,[f.axis])},nodeWidth(u,f){let h=t[u];if(!h)return 0;let d=0;for(let m of h.rays)m.level===f&&m.width>d&&(d=m.width);return d},clearanceAt(u,f,h,d){let m=t[u];if(!m||!m.crossing)return 0;let b=0;for(let p of m.rays){if(d.includes(p.axis)||p.level!==h)continue;let g=Math.abs(B0(p.angle-f));if(g>Math.PI/2&&(g=Math.PI-g),g<H0)continue;let y=p.width/2/Math.sin(g);y>b&&(b=y);}return b}}}function B0(i){let e=i;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function W0(i,e,t){let o=new Array(i.length).fill(false),r=(s,l)=>Math.abs(s.width-l.width)<.01&&(s.level??0)===(l.level??0)&&(s.cls??"")===(l.cls??"")&&!!s.oneway==!!l.oneway,n=(s,l)=>{let c=t[s];if(!c)return null;let u=i[l].level??0,f=c.rays.filter(d=>d.level===u);if(f.length!==2)return null;let h=f.find(d=>d.axis!==l);return !h||o[h.axis]?null:r(i[l],i[h.axis])?h:null},a=[];for(let s=0;s<i.length;s++){if(o[s]||i[s].pts.length<4)continue;o[s]=true;let l=i[s].pts.slice(),c=[s],u=e[s][0],f=e[s][1];for(let d=0;d<4096;d++){let m=n(f,c[c.length-1]);if(!m)break;o[m.axis]=true;let b=m.atTail?Bu(i[m.axis].pts):i[m.axis].pts;for(let p=2;p<b.length;p+=2)l.push(b[p],b[p+1]);f=m.atTail?e[m.axis][0]:e[m.axis][1],c.push(m.axis);}for(let d=0;d<4096;d++){let m=n(u,c[0]);if(!m)break;o[m.axis]=true;let b=m.atTail?i[m.axis].pts:Bu(i[m.axis].pts),p=[];for(let g=0;g+3<b.length;g+=2)p.push(b[g],b[g+1]);l=p.concat(l),u=m.atTail?e[m.axis][0]:e[m.axis][1],c.unshift(m.axis);}let h=i[s];a.push({pts:l,axes:c,head:u,tail:f,width:h.width,level:h.level??0,oneway:!!h.oneway,lanes:h.lanes??0,cls:h.cls??""});}return a}var Du=40;function V0(i){let e=i.length/2,t=[],o=[],r=0;for(let a=e-1;a>0&&r<Du;a--)r+=Math.hypot(i[a*2]-i[a*2-2],i[a*2+1]-i[a*2-1]),t.unshift(i[a*2-2],i[a*2-1]);let n=0;for(let a=0;a+1<e&&n<Du;a++)n+=Math.hypot(i[a*2+2]-i[a*2],i[a*2+3]-i[a*2+1]),o.push(i[a*2+2],i[a*2+3]);return [...t,...i,...o]}function N0(i,e){let t=e.length/2,o=e[0],r=e[1],n=e[t*2-2],a=e[t*2-1],s=(h,d,m,b)=>{let p=m,g=1/0;for(let y=m;y<=b;y++){let v=Math.hypot(i[y*2]-h,i[y*2+1]-d);v<g&&(g=v,p=y);}return p},l=i.length/2,c=s(o,r,0,Math.floor(l/2)),u=s(n,a,Math.floor(l/2),l-1);if(u-c<3)return e;let f=i.slice(c*2,(u+1)*2);return f[f.length-2]=f[0],f[f.length-1]=f[1],f}function Bu(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}var G0={edgeInset:.2,centreGap:.22,minWidth:6,skipClasses:["service","track"],crossingClasses:["motorway","trunk","primary","secondary"],setback:1,minPiece:6,zebraDepth:4,zebraStep:1.05,zebra:true,keepOut:()=>false,crossingAt:()=>null,axes:[],maxGrow:1.6,taper:12};function U0(i,e={}){let t={...G0,...e},o=[];for(let r=0;r<i.chains.length;r++){let n=i.chains[r];if(n.width<t.minWidth||t.skipClasses.includes(n.cls)||n.level<0)continue;let a=n.pts.length/2,s=Math.atan2(n.pts[3]-n.pts[1],n.pts[2]-n.pts[0]),l=Math.atan2(n.pts[a*2-3]-n.pts[a*2-1],n.pts[a*2-4]-n.pts[a*2-2]),c=i.clearanceAt(n.head,s,n.level,n.axes),u=i.clearanceAt(n.tail,l,n.level,n.axes),f=t.axes[r],h=f&&f.length>=4?f:n.pts,d=$0(h,c>0?c+t.setback:0,u>0?u+t.setback:0),m=Y0(d,(T,P)=>t.keepOut(T,P,n),t.setback);if(m.length<4||vr(m)<t.minPiece)continue;let b=T=>{let P=T<0?0:m.length-2,L=T<0?0:d.length-2;return Math.hypot(m[P]-d[L],m[P+1]-d[L+1])<.5},p=T=>{let P=i.nodeWidth(T,n.level),A=i.nodes[T]&&!i.nodes[T].crossing&&i.nodes[T].degree===2?P:Math.min(P,n.width*t.maxGrow);return Math.max(A/2-n.width/2,0)},g=p(n.head),y=p(n.tail),v=vr(h),w=T=>Math.min(Math.max(t.taper,T*X0),v/2),x=w(g),_=w(y),M=c>0?c+t.setback:0,S=T=>{let P=M+T,L=0;return g>0&&P<x&&(L=g*(1-P/x)),y>0&&v-P<_&&(L=Math.max(L,y*(1-(v-P)/_))),n.width/2+L},C=(T,P)=>{T.length>=4&&o.push({kind:P,pts:T,cls:n.cls,level:n.level,chain:r});};if(C(Ta(m,T=>-(S(T)-t.edgeInset)),"edge"),C(Ta(m,T=>S(T)-t.edgeInset),"edge"),n.oneway||(C(ka(m,-t.centreGap),"centre"),C(ka(m,t.centreGap),"centre")),n.lanes>=2){let T=n.width/n.lanes;for(let P=1;P<n.lanes;P++){let L=-n.width/2+P*T;if(!n.oneway&&Math.abs(L)<T/2)continue;let A=L/(n.width/2);C(Ta(m,R=>A*S(R)),"lane");}}let k=(T,P)=>{let L=i.nodes[T];if(!L)return false;for(let A of L.rays){if(n.axes.includes(A.axis)||A.level!==n.level)continue;let R=Math.abs(q0(A.angle-P));if(R>Math.PI/2&&(R=Math.PI-R),R>=j0)return true}return false};if(t.crossingClasses.includes(n.cls)){let T=(L,A)=>{let R=t.crossingAt(n,r,L);return R===null?null:R-A},P=u>0?u+t.setback:0;c>0&&b(-1)&&k(n.head,s)&&o.push(...Wu(m,n,r,t,-1,T(n.head,M))),u>0&&b(1)&&k(n.tail,l)&&o.push(...Wu(m,n,r,t,1,T(n.tail,P)));}}return o}function Wu(i,e,t,o,r,n){let a=[],s=e.width/2-o.edgeInset,l=(p,g)=>{a.push({kind:g,pts:p,cls:e.cls,level:e.level,chain:t});},c=o.zebraDepth/2+.6,u=n===null?c:n,f=u+o.zebraDepth/2+2.4;if((u<0||vr(i)<f+2)&&(u=c,f=u+o.zebraDepth/2+2.4,vr(i)<f+2))return a;let h=Vu(i,f,r);if(l([...On(h,e.oneway?-s:o.centreGap+.1,0),...On(h,s,0)],"stop"),!o.zebra)return a;let d=Vu(i,u,r),m=Math.max(Math.floor((e.width-.6)/o.zebraStep),2),b=(m-1)*o.zebraStep;for(let p=0;p<m;p++){let g=-b/2+p*o.zebraStep;l([...On(d,g,-o.zebraDepth/2),...On(d,g,o.zebraDepth/2)],"zebra");}return a}function Vu(i,e,t){let o=t>0?wr(i):i,r=e,n=0;for(;n+3<o.length;n+=2){let h=Math.hypot(o[n+2]-o[n],o[n+3]-o[n+1]);if(h>r)break;r-=h;}let a=o[n],s=o[n+1],l=o[n+2]??a,c=o[n+3]??s,u=Math.hypot(l-a,c-s)||1,f=Math.min(r/u,1);return {x:a+(l-a)*f,y:s+(c-s)*f,dx:-(l-a)/u,dy:-(c-s)/u}}function On(i,e,t){return [i.x+i.dy*e+i.dx*t,i.y-i.dx*e+i.dy*t]}var j0=35*Math.PI/180,X0=15;function Ta(i,e){let t=i.length/2;if(t<2)return [];let o=[0];for(let n=1;n<t;n++)o.push(o[n-1]+Math.hypot(i[n*2]-i[n*2-2],i[n*2+1]-i[n*2-1]));let r=[];for(let n=0;n<t;n++){let a=ka(i.slice(Math.max(0,n-1)*2,Math.min(t,n+2)*2),e(o[n])),s=n===0?0:1;r.push(a[s*2],a[s*2+1]);}return r}function ka(i,e){let t=i.length/2,o=[];for(let r=0;r<t;r++){let n=i[Math.max(r-1,0)*2],a=i[Math.max(r-1,0)*2+1],s=i[r*2],l=i[r*2+1],c=i[Math.min(r+1,t-1)*2],u=i[Math.min(r+1,t-1)*2+1],f=Math.hypot(s-n,l-a),h=Math.hypot(c-s,u-l),d=f>0?(s-n)/f:(c-s)/(h||1),m=f>0?(l-a)/f:(u-l)/(h||1),b=h>0?(c-s)/h:d,p=h>0?(u-l)/h:m,g=d+b,y=m+p,v=Math.hypot(g,y);v<1e-6?(g=d,y=m):(g/=v,y/=v);let w=Math.max(g*d+y*m,.2),x=e/w;o.push(s+y*x,l-g*x);}return o}function Y0(i,e,t){if(i.length<4)return i;let o=.5,r=n=>{if(n.length<4||!e(n[0],n[1]))return n;let a=0,s=vr(n);for(;a<s;){a+=o;let l=K0(n,a);if(!l)break;if(!e(l[0],l[1]))return Ea(n,Math.min(a+t,s))}return []};return wr(r(wr(r(i))))}function K0(i,e){let t=e;for(let o=0;o+3<i.length;o+=2){let r=Math.hypot(i[o+2]-i[o],i[o+3]-i[o+1]);if(r>=t){let n=r>0?t/r:0;return [i[o]+(i[o+2]-i[o])*n,i[o+1]+(i[o+3]-i[o+1])*n]}t-=r;}return null}function $0(i,e,t){let o=Ea(i,e);return wr(Ea(wr(o),t))}function Ea(i,e){if(e<=0||i.length<4)return i;let t=e;for(let o=0;o+3<i.length;o+=2){let r=Math.hypot(i[o+2]-i[o],i[o+3]-i[o+1]);if(r>t){let n=t/r;return [i[o]+(i[o+2]-i[o])*n,i[o+1]+(i[o+3]-i[o+1])*n,...i.slice(o+2)]}t-=r;}return []}function vr(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=Math.hypot(i[t+2]-i[t],i[t+3]-i[t+1]);return e}function wr(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function q0(i){let e=i;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}var Z0={classes:["motorway","trunk","primary","secondary","tertiary"],setback:14,length:5,minApproach:25,straightAngle:35*Math.PI/180,maxAngle:150*Math.PI/180,blocked:()=>false,retreat:7};function Q0(i,e={}){let t={...Z0,...e},o=[];for(let r=0;r<i.chains.length;r++){let n=i.chains[r];if(!t.classes.includes(n.cls)||n.lanes<1||n.level<0||Nu(n.pts)<t.minApproach)continue;let a=n.oneway?[{node:n.tail,dir:1}]:[{node:n.tail,dir:1},{node:n.head,dir:-1}];for(let s of a){let l=t1(n.pts,s.dir),c=J0(i,s.node,l,n,t);if(!c.length)continue;let u=i.clearanceAt(s.node,l+Math.PI,n.level,n.axes);if(u<=0)continue;let f=e1(c,n.lanes,n.oneway);if(!f.length)continue;let h=null,d=0;for(let y=0;y<3;y++){d=u+t.setback+y*t.retreat;let v=o1(n.pts,d,s.dir);if(!v)break;if(!t.blocked(v.x,v.y)){h=v;break}}if(!h)continue;let m=s.dir===1?Math.max(0,Nu(n.pts)-d):d,p=(n.oneway?n.width:n.width/2)/f.length,g=n.oneway?-n.width/2:0;f.forEach((y,v)=>{let w=g+p*(v+.5),x=h.x+h.nx*w,_=h.y+h.ny*w;for(let M of Ca(y,{length:t.length}))o.push({kind:y,pts:Sa(M,h.angle,x,_,1,1),cls:n.cls,level:n.level,chain:r,at:m});});}}return o}function J0(i,e,t,o,r){let n=i.nodes[e];if(!n||!n.crossing)return [];let a=new Set;for(let l of n.rays){if(o.axes.includes(l.axis)||l.level!==o.level||l.oneway&&l.atTail)continue;let c=r1(l.angle-t),u=Math.abs(c);u>r.maxAngle||(u<=r.straightAngle?a.add("straight"):c>0?a.add("left"):a.add("right"));}return ["left","straight","right"].filter(l=>a.has(l))}function e1(i,e,t){let o=Math.max(t?e:Math.floor(e/2),1);if(o<1)return [];let r=i.includes("left"),n=i.includes("right"),a=i.includes("straight");if(o===1)return a&&n?["straight-right"]:a&&r?["straight-left"]:r&&n?["straight-left"]:r?["left"]:n?["right"]:["straight"];let s=new Array(o).fill("straight");if(r&&(s[0]=a&&o===2?"straight-left":"left"),n&&(s[o-1]=a&&o===2&&r||a?"straight-right":"right"),!a)for(let l=0;l<o;l++)s[l]==="straight"&&(s[l]=r&&(!n||l<o/2)?"left":"right");return s}function t1(i,e){let t=i.length/2;return e>0?Math.atan2(i[t*2-1]-i[t*2-3],i[t*2-2]-i[t*2-4]):Math.atan2(i[1]-i[3],i[0]-i[2])}function o1(i,e,t){let o=t>0?n1(i):i,r=e,n=0;for(;n+3<o.length;n+=2){let m=Math.hypot(o[n+2]-o[n],o[n+3]-o[n+1]);if(m>r)break;r-=m;}if(n+3>=o.length)return null;let a=o[n],s=o[n+1],l=o[n+2],c=o[n+3],u=Math.hypot(l-a,c-s)||1,f=Math.min(r/u,1),h=-(l-a)/u,d=-(c-s)/u;return {x:a+(l-a)*f,y:s+(c-s)*f,angle:Math.atan2(d,h),nx:d,ny:-h}}function r1(i){let e=i;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function Nu(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=Math.hypot(i[t+2]-i[t],i[t+3]-i[t+1]);return e}function n1(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function Aa(i,e,t=24){let o=i.length/2;if(o<3||!(e>0))return i;let r=i.slice(),n=i.slice(),a=e;for(let s=0;s<t;s++){let l=0,c=r.slice();for(let u=1;u<o-1;u++){let f=r[u*2-2],h=r[u*2-1],d=r[u*2],m=r[u*2+1],b=r[u*2+2],p=r[u*2+3],g=Math.hypot(d-f,m-h),y=Math.hypot(b-d,p-m),v=Math.hypot(b-f,p-h),w=Math.abs((d-f)*(p-h)-(m-h)*(b-f));if(w<1e-9||g<1e-9||y<1e-9)continue;let x=g*y*v/(2*w);if(x>=e)continue;l=Math.max(l,e-x);let _=Math.min(.5,1-x/e),M=(f+b)/2,S=(h+p)/2,C=d+(M-d)*_,k=m+(S-m)*_,T=C-n[u*2],P=k-n[u*2+1],L=Math.hypot(T,P);L>a&&(C=n[u*2]+T/L*a,k=n[u*2+1]+P/L*a),c[u*2]=C,c[u*2+1]=k;}if(r.splice(0,r.length,...c),l<e*.01)break}return r}function Uu(i,e,t=30,o=1/0){let r=i.length/2;if(r<3||!(e>0))return i;let n=i.slice(),a=i.slice();for(let s=0;s<t;s++){let l=0,c=n.slice();for(let u=1;u<r-1;u++){let f=n[u*2-2],h=n[u*2-1],d=n[u*2],m=n[u*2+1],b=n[u*2+2],p=n[u*2+3],g=Math.hypot(d-f,m-h),y=Math.hypot(b-d,p-m);if(g<1e-9||y<1e-9)continue;let v=((d-f)*(b-d)+(m-h)*(p-m))/(g*y),w=Math.acos(Math.max(-1,Math.min(1,v)));if(w<=e)continue;l=Math.max(l,w-e);let x=Math.min(.6,(w-e)/Math.PI+.15),_=d+((f+b)/2-d)*x,M=m+((h+p)/2-m)*x,S=_-a[u*2],C=M-a[u*2+1],k=Math.hypot(S,C);k>o&&(_=a[u*2]+S/k*o,M=a[u*2+1]+C/k*o),c[u*2]=_,c[u*2+1]=M;}if(n.splice(0,n.length,...c),l<.01)break}return n}function Ra(i,e,t={}){if(i.length<4||!(e>0))return null;let o=t.safety??1.15,r=t.iterations??40,n=t.maxTurn??Math.PI/6,a=Aa(i,e*o,r),s=Ao(a,e*1.3,12),l=Aa(s,e*o,r),c=Uu(l,n,r,e*2),u=c.length/2,f=[],h=[],d=new Float64Array(u);for(let b=1;b<u;b++)d[b]=d[b-1]+Math.hypot(c[b*2]-c[b*2-2],c[b*2+1]-c[b*2-1]);let m=t.halfAt;for(let b=0;b<u;b++){let p=c[Math.max(b-1,0)*2],g=c[Math.max(b-1,0)*2+1],y=c[b*2],v=c[b*2+1],w=c[Math.min(b+1,u-1)*2],x=c[Math.min(b+1,u-1)*2+1],_=Math.hypot(y-p,v-g),M=Math.hypot(w-y,x-v),S=_>1e-9?(y-p)/_:(w-y)/Math.max(M,1e-9),C=_>1e-9?(v-g)/_:(x-v)/Math.max(M,1e-9),k=M>1e-9?(w-y)/M:S,T=M>1e-9?(x-v)/M:C,P=S+k,L=C+T,A=Math.hypot(P,L);A<1e-9?(P=S,L=C):(P/=A,L/=A);let R=Math.max(P*S+L*C,.5),I=(m?Math.max(m(d[b]),.01):e)/R;f.push(y-L*I,v+P*I),h.push(y+L*I,v-P*I);}return {left:f,centre:c,right:h}}function Ia(i,e){let t=i.length/2-1;if(t<3||!(e>0))return null;let o=[],r=[],n=[];for(let a=0;a<t;a++){let s=(a+t-1)%t,l=(a+1)%t,c=i[s*2],u=i[s*2+1],f=i[a*2],h=i[a*2+1],d=i[l*2],m=i[l*2+1],b=Math.hypot(f-c,h-u),p=Math.hypot(d-f,m-h);if(b<1e-9||p<1e-9)continue;let g=(f-c)/b,y=(h-u)/b,v=(d-f)/p,w=(m-h)/p,x=g+v,_=y+w,M=Math.hypot(x,_);M<1e-9?(x=g,_=y):(x/=M,_/=M);let S=Math.max(x*g+_*y,.5),C=e/S;n.push(f,h),o.push(f-_*C,h+x*C),r.push(f+_*C,h-x*C);}if(n.length<6)return null;for(let a of [o,n,r])a.push(a[0],a[1]);return {left:o,centre:n,right:r}}function La(i,e,t=8,o=false,r=false){let{left:n,centre:a,right:s}=i,l=[];for(let c=0;c+1<s.length;c+=2)l.push(s[c],s[c+1]);r||Gu(l,a[a.length-2],a[a.length-1],s[s.length-2],s[s.length-1],n[n.length-2],n[n.length-1],e,t);for(let c=n.length-2;c>=0;c-=2)l.push(n[c],n[c+1]);return o||Gu(l,a[0],a[1],n[0],n[1],s[0],s[1],e,t),l.push(l[0],l[1]),l}function Gu(i,e,t,o,r,n,a,s,l){let c=Math.hypot(o-e,r-t),u=Math.hypot(n-e,a-t),f=c>1e-6&&u>1e-6?(c+u)/2:s,h=Math.atan2(r-t,o-e),m=Math.atan2(a-t,n-e)-h;for(;m<=0;)m+=Math.PI*2;let b=Math.max(2,Math.round(m/Math.PI*l));for(let p=1;p<b;p++){let g=h+m*p/b;i.push(e+Math.cos(g)*f,t+Math.sin(g)*f);}}var i1={taper:12,maxGrow:1.6,cornerRadius:6,widthExtra:0,cluster:40,tolerance:.1,trim:false,edges:false,merge:false,mergeClasses:false,apart:()=>false,fillet:0};function a1(i,e={}){let t={...i1,...e},o=[];for(let r=0;r<i.chains.length;r++){let n=i.chains[r],a=n.width+t.widthExtra,s=a/2,l=M=>{let S=i.nodeWidth(M,n.level)+t.widthExtra,k=i.nodes[M]&&!i.nodes[M].crossing&&i.nodes[M].degree===2?S:Math.min(S,a*t.maxGrow);return Math.max(k/2-s,0)},c=l(n.head),u=l(n.tail),f=Hn(n.pts),h=M=>Math.min(Math.max(t.taper,M*v1),f/2),d=h(c),m=h(u),b=c>0||u>0?M=>{let S=0;return c>0&&M<d&&(S=c*(1-M/d)),u>0&&f-M<m&&(S=Math.max(S,u*(1-(f-M)/m))),s+S}:void 0,p=n.pts,g=null,y=null;if(t.trim&&t.edges){let M=p.length,S=Math.atan2(p[3]-p[1],p[2]-p[0]),C=Math.atan2(p[M-3]-p[M-1],p[M-4]-p[M-2]);g=Oa(i,n.head,S,n,t),y=Oa(i,n.tail,C,n,t);}else if(t.trim){let M=p.length/2,S=Math.atan2(p[3]-p[1],p[2]-p[0]),C=Math.atan2(p[M*2-3]-p[M*2-1],p[M*2-4]-p[M*2-2]),k=Zu(i,n.head,S,n),T=Zu(i,n.tail,C,n);if(k>0||T>0){let P=w1(p,k,T);P.length>=4&&Hn(P)>2&&(p=P);}}let v=t.edges?p:g1(p,s*.33),w=b?M1(v,[d,f-m]):v,x=n.head===n.tail&&n.pts.length>=8&&p1(n.pts,s);if(t.edges&&x){let M=Ia(n.pts,s);if(M){let S=Gt(M.left),C=Gt(M.right),k=Math.abs(S)>=Math.abs(C)?M.left:M.right,T=k===M.left?M.right:M.left,P=Gt(k)<0?Fa(k):k,L=Gt(T)>0?Fa(T):T;o.push({kind:"carriageway",chain:r,outer:P,holes:[L],cls:n.cls,level:n.level,width:a,edges:M,head:n.head,tail:n.tail});continue}}if(t.edges&&!x){for(let M of [w]){let S=Ra(M,s,{halfAt:b});if(!S)continue;if(g||y){let T=A=>{let R=A;return g&&(R=qu(R,g,true)),y&&(R=qu(R,y,false)),R},P={left:T(S.left),centre:T(S.centre),right:T(S.right)},L=Math.abs(Hn(P.left)-Hn(P.right));P.left.length>=4&&P.centre.length>=4&&P.right.length>=4&&L<a*4&&(S=P);}let C=b?b(f):s,k=La(S,Math.max(C,s),8,!!g,!!y);if(Ha(k)){for(let T of Yr({outer:k,holes:[]}))o.push({kind:"carriageway",chain:r,outer:T.outer,holes:T.holes,cls:n.cls,level:n.level,width:a,edges:S,head:n.head,tail:n.tail});continue}o.push({kind:"carriageway",chain:r,outer:k,holes:[],cls:n.cls,level:n.level,width:a,edges:S,head:n.head,tail:n.tail});}continue}let _=x?[w]:b1(w,Math.PI*.8);for(let M of _){let S=Jt(M,{halfWidth:s+Math.max(c,u),halfWidthAt:b,metersPerUnit:1,closed:x});if(!S)continue;let C=S.outer;if(Ha(C)){for(let k of Yr({outer:S.outer,holes:S.holes}))o.push({kind:"carriageway",chain:r,outer:k.outer,holes:k.holes,cls:n.cls,level:n.level,width:a});continue}o.push({kind:"carriageway",chain:r,outer:C,holes:S.holes,cls:n.cls,level:n.level,width:a});}}for(let r of f1(i,t))o.push(r);for(let r of u1(i,t))o.push(r);return t.merge?s1(o,t):o}function s1(i,e){let t=new Map,o=[];for(let r of i){if(r.level!==0||e.apart(r)){o.push(r);continue}let n=e.mergeClasses?String(r.level):r.level+"|"+r.cls,a=t.get(n);a?a.push(r):t.set(n,[r]);}for(let r of t.values()){if(r.length<2){o.push(...r);continue}let n=eo(r.map(c=>({outer:c.outer,holes:c.holes}))),a=r[0];for(let c of r)c.width>a.width&&(a=c);let s=[];for(let c of r)c.edges&&c.chain!==void 0&&s.push({chain:c.chain,edges:c.edges});let l=true;for(let c of n){let u=$t(He($u(Ku(c.outer),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1);o.push({kind:"carriageway",outer:u,holes:c.holes.filter(f=>Math.abs(Gt(f))>=y1).map(f=>$t(He($u(Ku(f),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1)),cls:a.cls,level:a.level,width:a.width,sourceEdges:l&&s.length?s:void 0}),l=false;}}return o}var ju=.8,l1=35*Math.PI/180,c1=150*Math.PI/180;function u1(i,e){let t=[];if(!(e.fillet>0))return t;let o=new Map;for(let r of i.chains)for(let n of r.axes)o.set(n,r);for(let r=0;r<i.nodes.length;r++){let n=i.nodes[r];if(!n.crossing)continue;let a=new Map;for(let s of n.rays){let l=a.get(s.level);l?l.push(s):a.set(s.level,[s]);}for(let s of a.values()){if(s.length<2)continue;let l=(c,u)=>{let f=c.width+e.widthExtra,h=i.nodeWidth(r,c.level)+e.widthExtra,d=Math.max(Math.min(h,f*e.maxGrow),f)/2;return !(e.taper>0)||u>=e.taper?f/2:f/2+(d-f/2)*(1-u/e.taper)};for(let c=0;c<s.length;c++){let u=s[c],f=s[(c+1)%s.length],h=f.angle-u.angle;for(;h<=0;)h+=Math.PI*2;for(;h>Math.PI*2;)h-=Math.PI*2;if(h<l1||h>c1)continue;let d=Yu(n.x,n.y,u,f,l(u,1/0),l(f,1/0),h,e);if(d&&(d=Yu(n.x,n.y,u,f,l(u,d.awayA),l(f,d.awayB),h,e)),d){let m=Xu(o.get(u.axis),d.touchA,l(u,d.awayA)),b=Xu(o.get(f.axis),d.touchB,l(f,d.awayB));m&&b&&t.push({...d,nodes:[r]});}}}}return t}function Xu(i,e,t){if(!i)return false;let o=i.pts,r=1/0;for(let n=0;n+3<o.length;n+=2){let a=o[n+2]-o[n],s=o[n+3]-o[n+1],l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((e[0]-o[n])*a+(e[1]-o[n+1])*s)/l)):0,u=Math.hypot(e[0]-(o[n]+a*c),e[1]-(o[n+1]+s*c));u<r&&(r=u);}return r<=t+.5}function Yu(i,e,t,o,r,n,a,s){let l=Math.cos(t.angle),c=Math.sin(t.angle),u=Math.cos(o.angle),f=Math.sin(o.angle),h=i-c*r,d=e+l*r,m=i+f*n,b=e-u*n,p=l*f-c*u;if(Math.abs(p)<1e-6)return null;let g=((m-h)*f-(b-d)*u)/p,y=((m-h)*c-(b-d)*l)/p;if(!(g>0)||!(y>0))return null;let v=h+l*g,w=d+c*g;if(Math.hypot(v-i,w-e)>Math.max(r,n)*2)return null;let x=a/2,_=Math.max(r,n)*1.5,M=Math.min(s.fillet,Math.min(r,n)*1.6,_*Math.tan(x));if(M<1)return null;let S=M/Math.tan(x),C=l+u,k=c+f,T=Math.hypot(C,k);if(T<1e-9)return null;C/=T,k/=T;let P=v+C*M/Math.sin(x),L=w+k*M/Math.sin(x),A=v+l*S,R=w+c*S,I=v+u*S,H=w+f*S,z=Math.atan2(R-L,A-P),F=Math.atan2(H-L,I-P)-z;for(;F>Math.PI;)F-=Math.PI*2;for(;F<-Math.PI;)F+=Math.PI*2;let B=r*ju,O=n*ju,W=A+c*B,V=R-l*B,j=I-f*O,G=H+u*O,ee=za(i-c*(r-B),e+l*(r-B),l,c,i+f*(n-O),e-u*(n-O),u,f);if(!ee)return null;let le=ee[0],K=ee[1],U=[W,V,A,R],ne=Math.max(3,Math.round(Math.abs(F)/(8*Math.PI/180)));for(let se=1;se<ne;se++){let me=z+F*se/ne;U.push(P+Math.cos(me)*M,L+Math.sin(me)*M);}U.push(I,H,j,G,le,K,W,V);let te=Gt(U)<0?Fa(U):U,Z=t.width>=o.width?t:o;return {kind:"fillet",outer:te,holes:[],cls:Z.cls,level:Z.level,width:Z.width+s.widthExtra,awayA:Math.hypot(A-i,R-e),awayB:Math.hypot(I-i,H-e),touchA:[A,R],touchB:[I,H]}}function f1(i,e){let t=[],o=new Map;for(let r=0;r<i.nodes.length;r++){let n=i.nodes[r];if(!n.crossing)continue;let a=new Map;for(let s of n.rays)a.set(s.level,(a.get(s.level)??0)+1);for(let[s,l]of a){if(l<3)continue;let c=o.get(s);c?c.push(r):o.set(s,[r]);}}for(let[r,n]of o)for(let a of d1(i,n,r,e.cluster)){let s=m1(i,a,r,e);s&&t.push(s);}return t}var h1=1.5;function d1(i,e,t,o){let r=new Map;for(let l of e)r.set(l,l);let n=l=>{let c=l;for(;r.get(c)!==c;)c=r.get(c);return c},a=(l,c)=>{let u=n(l),f=n(c);u!==f&&r.set(u,f);};for(let l of i.chains){if(!r.has(l.head)||!r.has(l.tail)||l.head===l.tail)continue;let c=i.nodes[l.head],u=i.nodes[l.tail],f=Math.hypot(c.x-u.x,c.y-u.y);f>o||f>(i.nodeWidth(l.head,t)+i.nodeWidth(l.tail,t))/2*h1||a(l.head,l.tail);}let s=new Map;for(let l of e){let c=n(l),u=s.get(c);u?u.push(l):s.set(c,[l]);}return [...s.values()]}function m1(i,e,t,o){let r=new Set(e),n=(y,v)=>{for(let w of i.chains){if(!w.axes.includes(v))continue;let x=w.head===y?w.tail:w.head===y||w.tail===y?w.head:-1;if(x>=0&&r.has(x))return true}return false},a=[],s=0,l=0;for(let y of e){let v=i.nodes[y];s+=v.x,l+=v.y;for(let w of v.rays){if(w.level!==t||e.length>1&&n(y,w.axis))continue;let x={axes:[w.axis],level:t,width:w.width},_=Oa(i,y,w.angle,x,o),M=(w.width+o.widthExtra)/2,S=Math.max(i.clearanceAt(y,w.angle,t,[w.axis]),M);if(_){let C=Math.cos(w.angle),k=Math.sin(w.angle);for(let T of [1,-1]){let P=v.x-k*M*T,L=v.y+C*M*T,A=za(P,L,C,k,_.x,_.y,_.dx,_.dy);if(!A)continue;let R=(A[0]-P)*C+(A[1]-L)*k;R>S&&R<S*2+M&&(S=R);}}a.push({x:v.x,y:v.y,angle:w.angle,half:M,cls:w.cls,width:w.width+o.widthExtra,reach:S});}}if(a.length<3)return null;s/=e.length,l/=e.length,a.sort((y,v)=>Math.atan2(y.y+Math.sin(y.angle)-l,y.x+Math.cos(y.angle)-s)-Math.atan2(v.y+Math.sin(v.angle)-l,v.x+Math.cos(v.angle)-s));let c="",u=0;for(let y of a)y.width>u&&(u=y.width,c=y.cls);let f=[],h=a.length;for(let y=0;y<h;y++){let v=a[y],w=a[(y+1)%h],x=Math.cos(v.angle),_=Math.sin(v.angle),M=Math.cos(w.angle),S=Math.sin(w.angle),C=v.x+x*v.reach,k=v.y+_*v.reach;f.push(C+_*v.half,k-x*v.half),f.push(C-_*v.half,k+x*v.half);let T=v.x-_*v.half,P=v.y+x*v.half,L=w.x+S*w.half,A=w.y-M*w.half,R=za(T,P,x,_,L,A,M,S);if(R){let I=Pa(R[0]-s,R[1]-l),H=Pa(f[f.length-2]-s,f[f.length-1]-l),z=Pa(w.x+M*w.reach+S*w.half-s,w.y+S*w.reach-M*w.half-l);I>Math.min(H,z)&&I<=Math.max(H,z)*1.15&&f.push(R[0],R[1]);}}if(f.length<6)return null;let d=_1(f);if(d.length<6)return null;d.push(d[0],d[1]);let m=1/0;for(let y of a)m=Math.min(m,y.width);let b=Math.min(o.cornerRadius,m/2),p=He(d,{radius:b,segments:10}),g=p.length>=8?p:d;if(Ha(g)){let y=Yr({outer:g,holes:[]}),v=null,w=0;for(let x of y){let _=Math.abs(Gt(x.outer));_>w&&(w=_,v=x);}if(v)return {kind:"junction",outer:v.outer,holes:v.holes,cls:c,level:t,width:u,nodes:e}}return {kind:"junction",outer:g,holes:[],cls:c,level:t,width:u,nodes:e}}function Ku(i){let o=Array.from(i);for(let r=0;r<8;r++){let n=o.length/2-1;if(n<4)break;let a=new Array(n).fill(true),s=0;for(let c=0;c<n;c++){if(!a[c])continue;let u=(c+n-1)%n;for(;!a[u]&&u!==c;)u=(u+n-1)%n;let f=(c+1)%n;for(;!a[f]&&f!==c;)f=(f+1)%n;if(u===c||f===c)break;let h=o[u*2],d=o[u*2+1],m=o[c*2],b=o[c*2+1],p=o[f*2],g=o[f*2+1],y=Math.abs((m-h)*(g-d)-(b-d)*(p-h)),v=Math.hypot(p-h,g-d),w=v>1e-9?y/v:Math.hypot(m-h,b-d),x=w<.02,_=v<.6&&w>v*3;(x||_)&&n-s>3&&(a[c]=false,s++);}if(!s)break;let l=[];for(let c=0;c<n;c++)a[c]&&l.push(o[c*2],o[c*2+1]);l.push(l[0],l[1]),o=l;}return o}function $u(i,e){if(!(e>0))return i;let t=Array.from(i);for(let o=0;o<4;o++){let r=t.length/2-1;if(r<8)break;let n=new Array(r).fill(true),a=0;for(let l=0;l<r;l++){if(!n[l])continue;let c=(l+r-1)%r;for(;!n[c]&&c!==l;)c=(c+r-1)%r;let u=(l+1)%r;for(;!n[u]&&u!==l;)u=(u+1)%r;if(c===l||u===l)break;let f=t[c*2],h=t[c*2+1],d=t[l*2],m=t[l*2+1],b=t[u*2],p=t[u*2+1],g=Math.hypot(b-f,p-h);if(g<1e-9)continue;Math.abs((d-f)*(p-h)-(m-h)*(b-f))/g<e&&r-a>8&&(n[l]=false,a++);}if(!a)break;let s=[];for(let l=0;l<r;l++)n[l]&&s.push(t[l*2],t[l*2+1]);s.push(s[0],s[1]),t=s;}return t}function Fa(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function p1(i,e){let t=i.length/2;if(t<4)return false;let o=new Float64Array(t);for(let a=1;a<t;a++)o[a]=o[a-1]+Math.hypot(i[a*2]-i[a*2-2],i[a*2+1]-i[a*2-1]);let r=o[t-1],n=e*4;if(r<n*2)return false;for(let a=0;a<t;a++)for(let s=a+1;s<t;s++){let l=o[s]-o[a];if(l<n||r-l<n)continue;if(Math.hypot(i[a*2]-i[s*2],i[a*2+1]-i[s*2+1])<e*2)return false}return true}function Gt(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}function b1(i,e){let t=i.length/2;if(t<4)return [i];let o=[],r=0,n=0;for(let a=1;a+1<t;a++){let s=Math.atan2(i[a*2+1]-i[a*2-1],i[a*2]-i[a*2-2]),c=Math.atan2(i[a*2+3]-i[a*2+1],i[a*2+2]-i[a*2])-s;for(;c>Math.PI;)c-=Math.PI*2;for(;c<-Math.PI;)c+=Math.PI*2;n+=Math.abs(c),n>=e&&a-r>=2&&(o.push(i.slice(r*2,(a+1)*2)),r=a,n=0);}return o.length?(t-r>=2&&o.push(i.slice(r*2)),o):[i]}function g1(i,e){let t=i.length/2;if(t<3||!(e>0))return i;let o=[i[0],i[1]];for(let r=1;r<t-1;r++){let n=o[o.length-2],a=o[o.length-1],s=i[r*2],l=i[r*2+1];if(Math.hypot(s-n,l-a)>=e){o.push(s,l);continue}let c=i[r*2+2],u=i[r*2+3],f=c-n,h=u-a,d=Math.hypot(f,h);(d>1e-9?Math.abs((s-n)*h-(l-a)*f)/d:0)>e*.5&&o.push(s,l);}return o.push(i[t*2-2],i[t*2-1]),o}function za(i,e,t,o,r,n,a,s){let l=t*s-o*a;if(Math.abs(l)<1e-9)return null;let c=((r-i)*s-(n-e)*a)/l;return [i+t*c,e+o*c]}var Pa=(i,e)=>Math.hypot(i,e);function Ju(i,e,t){for(let o of i.rays){if(t.axes.includes(o.axis)||o.level!==t.level||o.width<t.width*.8)continue;let r=Math.abs(o.angle-e)%(Math.PI*2);if(r>Math.PI&&(r=Math.PI*2-r),r>Math.PI/2&&(r=Math.PI-r),r<ef)return true}return false}var y1=4,v1=15,ef=20*Math.PI/180;function Oa(i,e,t,o,r){let n=i.nodes[e];if(!n||!n.crossing||Ju(n,t,o))return null;let a=0,s=0;for(let p of n.rays){if(o.axes.includes(p.axis)||p.level!==o.level)continue;let g=Math.abs(p.angle-t)%(Math.PI*2);g>Math.PI&&(g=Math.PI*2-g),g>Math.PI/2&&(g=Math.PI-g),!(g<ef)&&p.width>a&&(a=p.width,s=p.angle);}if(a<o.width*1.05)return null;let l=i.clearanceAt(e,t,o.level,o.axes);if(!(l>0))return null;let c=Math.cos(s),u=Math.sin(s),f=-u,h=c;f*Math.cos(t)+h*Math.sin(t)<0&&(f=-f,h=-h);let d=Math.max((a+r.widthExtra)/2-1,0),m=Math.cos(t)*f+Math.sin(t)*h;return !(m>1e-6)||d/m>l*1.5+2?null:{x:n.x+f*d,y:n.y+h*d,dx:c,dy:u,limit:l+o.width*2}}function qu(i,e,t){if(i.length<4)return i;let o=t?i:Dn(i),r=(s,l)=>(s-e.x)*e.dy-(l-e.y)*e.dx,n=r(o[0],o[1]);if(n<0)return i;let a=0;for(let s=0;s+3<o.length;s+=2){let l=r(o[s+2],o[s+3]);if(n===0||n<0!=l<0){let c=n===l?0:n/(n-l),u=o[s]+(o[s+2]-o[s])*c,f=o[s+1]+(o[s+3]-o[s+1])*c,h=[u,f,...o.slice(s+2)];return h.length<4?i:t?h:Dn(h)}if(a+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]),a>e.limit)return i;n=l;}return i}function Zu(i,e,t,o){let r=i.nodes[e];if(!r||!r.crossing||Ju(r,t,o))return 0;let n=0;for(let s of r.rays)o.axes.includes(s.axis)||s.level===o.level&&s.width>n&&(n=s.width);if(n<o.width*1.05)return 0;let a=i.clearanceAt(e,t,o.level,o.axes);return Math.max(a-1,0)}function w1(i,e,t){let o=Qu(i,e);return Dn(Qu(Dn(o),t))}function Qu(i,e){if(e<=0||i.length<4)return i;let t=e;for(let o=0;o+3<i.length;o+=2){let r=Math.hypot(i[o+2]-i[o],i[o+3]-i[o+1]);if(r>t){let n=t/r;return [i[o]+(i[o+2]-i[o])*n,i[o+1]+(i[o+3]-i[o+1])*n,...i.slice(o+2)]}t-=r;}return []}function Dn(i){let e=[];for(let t=i.length-2;t>=0;t-=2)e.push(i[t],i[t+1]);return e}function Ha(i){let e=i.length/2-1;if(e<4)return false;let t=e>400?Math.ceil(e/400):1;for(let o=0;o<e;o+=t){let r=i[o*2],n=i[o*2+1],a=i[o*2+2],s=i[o*2+3];for(let l=o+2*t;l<e;l+=t)if(!(o===0&&l>=e-t)&&x1(r,n,a,s,i[l*2],i[l*2+1],i[l*2+2],i[l*2+3]))return true}return false}function x1(i,e,t,o,r,n,a,s){let l=(d,m,b,p,g,y)=>{let v=(b-d)*(y-m)-(p-m)*(g-d);return Math.abs(v)<1e-9?0:v},c=l(r,n,a,s,i,e),u=l(r,n,a,s,t,o),f=l(i,e,t,o,r,n),h=l(i,e,t,o,a,s);return (c>0&&u<0||c<0&&u>0)&&(f>0&&h<0||f<0&&h>0)}function _1(i){let e=[];for(let o=0;o+1<i.length;o+=2){let r=e.length;r>=2&&Math.hypot(i[o]-e[r-2],i[o+1]-e[r-1])<.05||e.push(i[o],i[o+1]);}let t=e.length;return t>=4&&Math.hypot(e[0]-e[t-2],e[1]-e[t-1])<.05&&(e.length=t-2),e}function M1(i,e){let t=[...e].filter(a=>a>.01).sort((a,s)=>a-s);if(!t.length)return i;let o=[i[0],i[1]],r=0,n=0;for(let a=0;a+3<i.length;a+=2){let s=i[a],l=i[a+1],c=i[a+2],u=i[a+3],f=Math.hypot(c-s,u-l);for(;n<t.length&&t[n]<=r+.01;)n++;for(;n<t.length&&t[n]<r+f-.01;){let h=(t[n]-r)/f;o.push(s+(c-s)*h,l+(u-l)*h),n++;}r+=f,o.push(c,u);}return o}function Hn(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=Math.hypot(i[t+2]-i[t],i[t+3]-i[t+1]);return e}var C1={levelHeight:8,maxGrade:.06},S1=1.5;function tf(i){return i<=0?0:i>=1?1:i*i*(3-2*i)}function T1(i,e={}){let t={...C1,...e},o=i.chains,r=i.nodes,n=o.map(m=>{let b=0;for(let p=0;p+3<m.pts.length;p+=2)b+=Math.hypot(m.pts[p+2]-m.pts[p],m.pts[p+3]-m.pts[p+1]);return b}),a=new Float64Array(r.length),s=new Float64Array(r.length);for(let m=0;m<o.length;m++){let b=o[m];if(b.level<=0)continue;let p=b.level*t.levelHeight;for(let g of [b.head,b.tail])a[g]<p&&(a[g]=p,s[g]=p);}let l=t.maxGrade/S1,c=r.map(()=>[]);for(let m=0;m<o.length;m++)c[o[m].head].push(m),o[m].tail!==o[m].head&&c[o[m].tail].push(m);let u=[];for(let m=0;m<r.length;m++)a[m]>0&&u.push(m);let f=new Uint8Array(r.length);for(;u.length;){let m=0;for(let p=1;p<u.length;p++)a[u[p]]>a[u[m]]&&(m=p);let b=u[m];if(u[m]=u[u.length-1],u.pop(),!f[b]){f[b]=1;for(let p of c[b]){let g=o[p],y=g.head===b?g.tail:g.head;if(y===b)continue;let v=a[b]-n[p]*l;v>a[y]&&(a[y]=v,s[y]=s[b],f[y]||u.push(y));}}}let h=o.map((m,b)=>{let p=m.level>0?m.level*t.levelHeight:0,g=Math.max(a[m.head],p),y=Math.max(a[m.tail],p),v=Math.max(s[m.head],s[m.tail],g,y,p);return {top:p,head:g,tail:y,peak:v,total:n[b]}}),d=(m,b)=>{let p=h[m];if(!p||p.peak<=0)return 0;let g=Math.max(0,b),y=Math.max(p.top,p.head-g*l,p.tail-Math.max(0,p.total-g)*l,0);return p.peak*tf(y/p.peak)};return {node:m=>{let b=a[m]??0,p=s[m]||b;return p>0?p*tf(b/p):0},at:d,length:m=>n[m]??0,flat:m=>{let b=h[m];return !!b&&b.top===0&&b.head<=0&&b.tail<=0},grade:m=>{let b=h[m];if(!b||b.total<=0)return 0;let p=0,g=Math.max(b.total/200,.5);for(let y=0;y+g<=b.total;y+=g)p=Math.max(p,Math.abs(d(m,y+g)-d(m,y))/g);return p}}}var k1=.06,E1=24,A1=.8;function R1(i,e){let t=i,o=e.metersPerUnit>0?e.metersPerUnit:.5,r=L1(t),n=Math.max(e.height,0);if(!(n>0)||!(r>0))return {heightAt:()=>n,rampIn:0,rampOut:0,knots:[],total:r};let a=Math.max(e.maxGrade??.06,.005),s=1.5*n/a/o,l=e.rampStart!==false,c=e.rampEnd!==false,u=l?s:0,f=c?s:0,h=u+f;h>r&&h>0&&(u=u/h*r,f=f/h*r);let d=b=>{if(b<=0)return l?0:n;if(b>=r)return c?0:n;let p=1;return u>0&&b<u&&(p=Math.min(p,rf(b/u))),f>0&&r-b<f&&(p=Math.min(p,rf((r-b)/f))),n*p},m=[];for(let[b,p]of [[0,u],[r,-f]])if(Math.abs(p)>0)for(let g=1;g<=of;g++){let y=b+p*g/of;y>.01&&y<r-.01&&m.push(y);}return m.sort((b,p)=>b-p),{heightAt:d,rampIn:u,rampOut:f,knots:m,total:r}}var of=8;function I1(i,e,t){let o=i,r=t.metersPerUnit>0?t.metersPerUnit:.5,n=Math.max(t.spacing??24,1)/r,a=Math.max(t.minHeight??.8,0),s=Math.max(t.deck,0),l=e.total;if(!(l>n*.5))return [];let c=[],u=l/2,f=Math.floor(l/n),h=u-(f-1)*n/2;for(let d=0;d<f;d++){let m=h+d*n;if(m<=0||m>=l)continue;let b=e.heightAt(m)-s;if(b<a)continue;let p=P1(o,m);p&&c.push({x:p.x,y:p.y,angle:p.angle,height:b,at:m});}return c}function L1(i){let e=0;for(let t=0;t+3<i.length;t+=2)e+=Math.hypot(i[t+2]-i[t],i[t+3]-i[t+1]);return e}function P1(i,e){let t=0;for(let o=0;o+3<i.length;o+=2){let r=i[o+2]-i[o],n=i[o+3]-i[o+1],a=Math.hypot(r,n);if(!(a<=0)){if(t+a>=e){let s=(e-t)/a;return {x:i[o]+r*s,y:i[o+1]+n*s,angle:Math.atan2(n,r)}}t+=a;}}return null}function rf(i){let e=i<0?0:i>1?1:i;return e*e*(3-2*e)}var Da=class{constructor(e={}){this.options=e;this.group=null;this.needle=null;this.map=null;this.onMove=()=>this.syncCompass();}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;this.map=t;let o=[];if(this.options.showZoom!==false&&(o.push(ht("+","\u041F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u044C",()=>t.zoomIn())),o.push(ht("\u2212","\u041E\u0442\u0434\u0430\u043B\u0438\u0442\u044C",()=>t.zoomOut()))),this.options.showCompass!==false){let r=ht("","\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043D\u0430 \u0441\u0435\u0432\u0435\u0440",()=>t.resetNorthPitch()),n=document.createElement("span");n.style.cssText="display:block;width:0;height:0;border:6px solid transparent;border-bottom:12px solid #e03131;transform-origin:50% 75%",r.appendChild(n),this.needle=n,o.push(r);}return this.group=Xt(...o),t.on("move",this.onMove),this.syncCompass(),this.group}onRemove(e){e.off("move",this.onMove),this.group=null,this.needle=null,this.map=null;}syncCompass(){if(!this.needle||!this.map)return;let e=this.map.getBearing(),t=this.options.visualizePitch?this.map.getPitch():0;this.needle.style.transform=`rotate(${-e}deg) scaleY(${Math.cos(t*Math.PI/180).toFixed(3)})`;}},Ba=class{constructor(e={}){this.options=e;this.element=null;this.map=null;this.onMove=()=>this.sync();}getDefaultPosition(){return "bottom-left"}onAdd(e){let t=e;this.map=t;let o=document.createElement("div");return o.className="osmgl-ctrl-scale",o.style.cssText=["box-sizing:border-box;background:rgba(255,255,255,.75);border:2px solid #333;border-top:none","font:11px/1.6 system-ui,sans-serif;color:#333;padding:0 5px;text-align:center;white-space:nowrap"].join(";"),this.element=o,t.on("move",this.onMove),this.sync(),o}onRemove(e){e.off("move",this.onMove),this.element=null,this.map=null;}setUnit(e){this.options.unit=e,this.sync();}sync(){let e=this.element,t=this.map;if(!e||!t)return;let o=this.options.maxWidth??100,r=t.getCenter().lat,a=40075016686e-3*Math.cos(r*Math.PI/180)/(512*Math.pow(2,t.getZoom()))*o,s=this.options.unit??"metric",l,c;if(s==="imperial"){let u=a*3.2808;if(u>5280){let f=xr(u/5280);l=`${f} mi`,c=f*5280/u;}else {let f=xr(u);l=`${f} ft`,c=f/u;}}else if(s==="nautical"){let u=xr(a/1852);l=`${u} nm`,c=u*1852/a;}else if(a>=1e3){let u=xr(a/1e3);l=`${u} \u043A\u043C`,c=u*1e3/a;}else {let u=xr(a);l=`${u} \u043C`,c=u/a;}e.style.width=`${Math.round(o*c)}px`,e.textContent=l;}};function xr(i){let e=Math.pow(10,Math.floor(Math.log10(i))),t=i/e;return (t>=5?5:t>=3?3:t>=2?2:1)*e}var Wa=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-right"}onAdd(){let e=this.options.customAttribution,t=Array.isArray(e)?e.join(" | "):e??"\xA9 OpenStreetMap contributors",o=document.createElement("div");if(o.className="osmgl-ctrl-attrib",o.style.cssText="background:rgba(255,255,255,.8);border-radius:4px;font:11px/1.8 system-ui,sans-serif;color:#333;padding:0 6px",o.innerHTML=t,this.options.compact){let r=ht("i","\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445",()=>{o.style.display=o.style.display==="none"?"block":"none";});r.style.borderRadius="50%";let n=document.createElement("div");return n.style.cssText="display:flex;align-items:center;gap:4px",o.style.display="none",n.append(o,r),n}return o}onRemove(){}},Va=class{constructor(e={}){this.options=e;this.target=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.target=this.options.container??t.getContainer(),Xt(ht("\u26F6","\u0412\u043E \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D",()=>{document.fullscreenElement?document.exitFullscreen():this.target?.requestFullscreen();}))}onRemove(){this.target=null;}},Na=class{constructor(e={}){this.options=e;this.watchId=null;this.map=null;}getDefaultPosition(){return "top-right"}onAdd(e){this.map=e;let t=ht("\u25CE","\u041C\u043E\u0451 \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435",()=>this.locate());return Xt(t)}onRemove(){this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=null,this.map=null;}locate(){if(!navigator.geolocation)return;let e=this.options.positionOptions??{enableHighAccuracy:true,timeout:1e4},t=o=>{this.map?.easeTo({center:{lng:o.coords.longitude,lat:o.coords.latitude},zoom:this.options.fitBoundsOptions?.zoom??16,duration:800});};this.options.trackUserLocation?(this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=navigator.geolocation.watchPosition(t,void 0,e)):navigator.geolocation.getCurrentPosition(t,void 0,e);}},Ga=class{constructor(e){this.options=e;this.button=null;this.saved=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.button=ht("\u26F0","\u0420\u0435\u043B\u044C\u0435\u0444",()=>{t.getTerrain()?(this.saved=t.getTerrain(),t.setTerrain(null)):t.setTerrain(this.saved??{source:this.options.source,exaggeration:this.options.exaggeration??1});}),Xt(this.button)}onRemove(){this.button=null;}},Ua=class{getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return Xt(ht("\u{1F310}","\u0413\u043B\u043E\u0431\u0443\u0441",()=>{t.setProjection(t.getProjection()==="globe"?"mercator":"globe");}))}onRemove(){}},ja=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-left"}onAdd(){let e=document.createElement("a");if(e.href=this.options.href??"https://www.openstreetmap.org/",e.target="_blank",e.rel="noopener",e.style.cssText="display:block;background:rgba(255,255,255,.8);border-radius:4px;padding:2px 6px;font:11px/1.6 system-ui,sans-serif;color:#333;text-decoration:none",this.options.src){let t=document.createElement("img");t.src=this.options.src,t.alt=this.options.label??"\u043B\u043E\u0433\u043E\u0442\u0438\u043F",t.style.cssText="display:block;height:18px",e.appendChild(t);}else e.textContent=this.options.label??"OpenStreetMap";return e}onRemove(){}};var F1=1,_r=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${F1++}`,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 s of a){let l=Q(s),c=oe(l.lng),u=re(l.lat);c<t&&(t=c),c>r&&(r=c),u<o&&(o=u),u>n&&(n=u);}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(oe(r.lng)-this.originX,re(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}},Ya=class extends _r{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=Yo([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 s of n){let l=Yo([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=fe(s.color);o.push(this.linePaint({kind:"line",mesh:l,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=$a(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(nf(e,n[a],n[a+1])<=r)return true;return false}},Bn=class extends _r{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=Wi(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(Xa(a))),n=Yo(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=$a(Xa(this.coordinates[0]??[]),this.altitude,t);if(!qa(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(qa(e,$a(Xa(this.coordinates[r]),this.altitude,t)))return false;return true}},Ka=class extends Bn{constructor(e){super({...e,coordinates:[z1(e.center,e.radius,e.segments)]});}};function z1(i,e,t){let o=Q(i),r=e/$e(o.lat),n=oe(o.lng),a=re(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let u=c/s*Math.PI*2;l.push([Oe(n+Math.cos(u)*r),Pe(a+Math.sin(u)*r)]);}return l}function $a(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 Xa(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 nf(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 qa(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,s=e[r].x,l=e[r].y;a>i.y!=l>i.y&&i.x<(s-n)*(i.y-a)/(l-a)+n&&(t=!t);}return t}var af="objects3d",yo="level",O1=32,H1=100,D1=250,sf=(i,e,t)=>`${i}\u241F${e}\u241F${t}`;function B1(i){return new Promise((e,t)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>t(new Error(`\u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${i}`)),o.src=i;})}function lf(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 W1(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 Za=class extends Ue{constructor(t){super();this.options=t;this.transform=new Co;this.ctx=null;this.sources=new D;this.rasterSources=new D;this.demSources=new D;this.renderer=new Qo;this.objects=new Ko;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.ready=false;this.destroyed=false;this.pixelRatio=1;this.layerEdits=[];this.featureStates=new D;this.centerClamped=true;this.spriteUrl=null;this.extraSprites=new D;this.spriteImages=new D;this.glyphsUrl="";this.mediaSources=new D;this.transformRequest=null;this.cameraUpdate=null;this.transformConstrain=null;this.zoomSnap=0;this.bearingSnap=7;this.objects3d=null;this.objects3dEnabled=true;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.inCameraHooks=false;this.groundAt=(t,o)=>this.renderer.terrain.heightAtMerc(t,o);this.writingHash=false;this.hashTimer=0;this.layerOverrides=new D;this.autoIndoorLevel=true;this.debugFB=null;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?Ln(Pn()):t.quality;this.governor=new br(r,r,O1,H1),this.quality=gr(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new oo(t.theme?Bo(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),this.controls=new Fr(this.container);let a=()=>this.gestures,s={...$n,...t.gestures??{}};this.handlers={dragPan:new Ze(a,"dragPan",s.dragPan),dragRotate:new Ze(a,"dragRotate",s.dragRotate),scrollZoom:new Ze(a,"scrollZoom",s.scrollZoom),doubleClickZoom:new Ze(a,"doubleClickZoom",s.doubleClickZoom),touchZoomRotate:new Ze(a,"touchZoomRotate",s.touchZoomRotate),touchPitch:new Ze(a,"touchPitch",s.touchPitch),keyboard:new Ze(a,"keyboard",s.keyboard),boxZoom:new So(this.canvas,this.container,(c,u)=>{this.fitScreenCoordinates(c,u,this.transform.bearing,{duration:400});}),cooperative:new To(this.canvas,this.container,c=>{this.gestures?.setOptions({scrollZoom:c});})},t.cooperativeGestures&&this.handlers.cooperative.enable();let l=this.transform;l.minZoom=t.minZoom??0,l.maxZoom=t.maxZoom??22,l.maxPitch=t.maxPitch??75,l.projection=t.projection??"mercator",l.center=Q(t.center??[0,0]),l.zoom=t.zoom??2,l.bearing=t.bearing??0,l.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Rn(t.workerCount??Math.min(pa(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.ready=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 Sr(t),this.glyphsUrl=this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf";let o=new po(this.glyphsUrl,this.options.fontstack);this.options.icons&&o.icons.setIcons({...Vt,...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);this.syncTerrain();let t=this.options.objects3d;if(t){this.objects3d=new En({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:af,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??Y)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(W1):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(s=>this.renderer.models.remove(s,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:af,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,s=>this.renderer.models.add(s),s=>this.renderer.models.remove(s,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 s=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let l of t.models){let c=l.origin();l.setHidden(vt(a,c.x,c.y,s));}}else for(let s of t.models)s.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===yo&&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}syncTerrain(){let t=this._style.spec.terrain,o=t?this.demSources.get(t.source)??null:null;this.renderer.terrain.setSource(o),this.renderer.terrain.exaggeration=t?.exaggeration??1,this.transform.elevationAt=this.renderer.terrain.enabled?this.groundAt:null;}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),this.demSources.get(t)?.destroy(),this.demSources.delete(t),this.mediaSources.get(t)?.destroy(),this.mediaSources.delete(t),o.type==="raster-dem"){let n=new lr({url:o.url??"",encoding:o.encoding??"mapbox",minzoom:o.minzoom??0,maxzoom:o.maxzoom??10});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.demSources.set(t,n),this.syncTerrain(),this.triggerRepaint(),this}if(o.type==="image"||o.type==="video"||o.type==="canvas"){let n=new cr({kind:o.type,url:o.url,canvas:o.canvas,coordinates:o.coordinates,animate:o.animate});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.mediaSources.set(t,n),this.renderer.mediaSources=this.mediaSources,this.triggerRepaint(),this}if(o.type==="geojson"){let n=new fr(this.pool,{data:o.data,sourceLayer:o.sourceLayer,cluster:o.cluster,clusterRadius:o.clusterRadius,clusterMaxZoom:o.clusterMaxZoom,minzoom:o.minzoom??0,maxzoom:o.maxzoom??18,cacheSize:this.quality.tileCacheSize,plan:this.planFor(t)});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.sources.set(t,n),this.triggerRepaint(),this}if(o.type==="raster"){let n=new sr({url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.setTransformRequest(this.transformRequest),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 bo(this.pool,{url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===Y?0:1});return r.setTransformRequest(this.transformRequest),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 Pr(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(),s={x:r.clientX-a.left,y:r.clientY-a.top},l=this.objects.hitTest(this.transform,s),c=l?null:this.queryRoom(s),u=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(u),this.setRoomHighlight(c));for(let f of this.getPopups())f.closeOnClick&&this.removePopup(f);this.emit("click",{point:s,lngLat:this.transform.unproject(s),object:l,building:u,symbol:this.querySymbol(s,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),s=this.querySymbol(a);this.setSymbolHover(s),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:s});});}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=wa(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.pixelRatio=r,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},s={center:t.center!==void 0?Q(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+Mt((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:s},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+Mt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=Ct(r.zoom),l=(oe(a.center.lng)-oe(r.center.lng))*s,c=(re(a.center.lat)-re(r.center.lat))*s,u=Math.hypot(l,c),f=Math.max(o.width,o.height),h=f*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,b,p=null;if(u<1e-6){let y=Math.log(h/f);b=Math.abs(y)/d,p=v=>({u:0,w:f*Math.exp(d*Math.sign(y)*v)});}else {let y=S=>{let C=S===0?f:h,k=S===0?h:f;return (k*k-C*C+(S===0?1:-1)*m*m*u*u)/(2*C*m*u)},v=S=>Math.log(-y(S)+Math.sqrt(y(S)*y(S)+1)),w=v(0);b=(v(1)-w)/d;let _=S=>(Math.exp(S)+Math.exp(-S))/2,M=S=>(Math.exp(2*S)-1)/(Math.exp(2*S)+1);p=S=>{let C=d*S+w;return {u:f*_(w)*M(C)/m-f*Math.sinh(w)/m,w:f*_(w)/_(C)}};}if(!Number.isFinite(b)||b<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,b/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:b,u1:u,curve:p,w0:f}},this.triggerRepaint(),this}setPadding(t){return this.padding=lf(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new jt;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=Nn(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?lf(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)}panBy(t,o={}){let r=this.transform.unproject({x:this.transform.width/2+t[0],y:this.transform.height/2+t[1]});return this.panTo(r,o)}panTo(t,o={}){return this.easeTo({...o,center:t,duration:o.duration??500})}zoomTo(t,o={}){return this.easeTo({...o,zoom:t,duration:o.duration??300})}zoomIn(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom+1),t)}zoomOut(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom-1),t)}rotateTo(t,o={}){return this.easeTo({...o,bearing:t,duration:o.duration??500})}resetNorth(t={}){return this.rotateTo(0,{...t,duration:t.duration??1e3})}resetNorthPitch(t={}){return this.easeTo({...t,bearing:0,pitch:0,duration:t.duration??1e3})}snapToNorth(t={}){return Math.abs(Mt(this.transform.bearing))<=this.bearingSnap?this.resetNorth(t):this}stop(){return this.animation=null,this}isEasing(){return this.animation!==null}isMoving(){return this.isEasing()||(this.gestures?.moving??false)}isZooming(){let t=this.animation;return t!==null&&t.from.zoom!==t.to.zoom||(this.gestures?.zooming??false)}isRotating(){let t=this.animation;return t!==null&&t.from.bearing!==t.to.bearing||(this.gestures?.rotating??false)}getMinZoom(){return this.transform.minZoom}setMinZoom(t){return this.transform.minZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMaxZoom(){return this.transform.maxZoom}setMaxZoom(t){return this.transform.maxZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMinPitch(){return this.transform.minPitch}setMinPitch(t){return this.transform.minPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxPitch(){return this.transform.maxPitch}setMaxPitch(t){return this.transform.maxPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxBounds(){return this.transform.maxBounds}setMaxBounds(t){return this.transform.maxBounds=t,this.transform.center=this.transform.center,this.afterCameraChange()}getZoomSnap(){return this.zoomSnap}setZoomSnap(t){return this.zoomSnap=Math.max(t,0),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t){return this.transform.fov=t,this.afterCameraChange()}getCenterElevation(){return this.transform.centerElevation}setCenterElevation(t){return this.transform.centerElevation=t,this.afterCameraChange()}getCameraTargetElevation(){return this.transform.centerElevation}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvas.parentElement??this.container}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){return this.maxPixelRatio=t>0?t:window.devicePixelRatio||1,this.resize(),this}redraw(){return this.triggerRepaint(),this}remove(){this.destroy();}loaded(){return this.isLoaded&&this.areTilesLoaded()}areTilesLoaded(){for(let t of this.sources.keys())if(this.sourceDrawn(t,this.transform.zoom)&&!this.isSourceLoaded(t))return false;return true}isSourceLoaded(t){let o=this.sources.get(t);if(!o)return false;for(let r of o.visibleTiles)if(o.getTile(r)?.state==="loading")return false;return true}fitScreenCoordinates(t,o,r=this.transform.bearing,n={}){let a=jt.from([this.transform.unproject(t),this.transform.unproject(o)]);return this.fitBounds(a,{...n,bearing:r})}calculateCameraOptionsFromTo(t,o,r,n=0){let a=this.transform,s=Q(t),l=Q(r),c=y=>1/(40075016686e-3*Math.max(Math.abs(Math.cos(y*Math.PI/180)),1e-6)),u=oe(l.lng)-oe(s.lng),f=re(l.lat)-re(s.lat),h=n*c(l.lat)-o*c(s.lat),d=Math.hypot(u,f,h);if(d===0)return {center:l,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,elevation:n};let m=Math.hypot(u,f),b=Math.log2(a.cameraToCenterDistance/d/512),p=Math.atan2(u,-f)*180/Math.PI,g=Math.acos(Math.min(m/d,1))*180/Math.PI;return g=h<0?90-g:90+g,{center:l,zoom:b,bearing:p,pitch:g,elevation:n}}snapZoom(t){return this.zoomSnap<=0?t:Math.round(t/this.zoomSnap)*this.zoomSnap}stepAnimation(t){let o=this.animation;if(!o)return false;let r=Re((t-o.start)/o.duration,0,1),n=o.fly?r:Cr(r),a=this.transform,s=Q(o.from.center),l=Q(o.to.center);if(o.fly){let{u:c,w:u}=o.fly.curve(o.fly.S*r),f=o.fly.u1>1e-6?Re(c/o.fly.u1,0,1):r;return a.center={lng:s.lng+(l.lng-s.lng)*f,lat:s.lat+(l.lat-s.lat)*f},a.zoom=o.from.zoom+Math.log2(o.fly.w0/u),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Cr(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Cr(r),r>=1&&(a.center=l,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:s.lng+(l.lng-s.lng)*n,lat:s.lat+(l.lat-s.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.applyCameraHooks(),this.emitMove(),this.triggerRepaint(),this}applyCameraHooks(){if(!this.inCameraHooks&&!(!this.cameraUpdate&&!this.transformConstrain)){this.inCameraHooks=true;try{let t=this.transform;if(this.cameraUpdate){let o=this.cameraUpdate({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});o&&(o.center!==void 0&&(t.center=Q(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom),o.bearing!==void 0&&(t.bearing=o.bearing),o.pitch!==void 0&&(t.pitch=o.pitch));}if(this.transformConstrain){let o=this.transformConstrain({center:t.center,zoom:t.zoom});o&&(o.center!==void 0&&(t.center=Q(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom));}}finally{this.inCameraHooks=false;}}}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 oo(this.applyLayerEdits(t));Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(n)),l=JSON.stringify(r.workerPlan(n));s!==l&&a.setPlan(this.planFor(n,r));}return this.syncTerrain(),this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}addLayer(t,o){if(t.type==="custom"){let r=t;return this.renderer.customLayers.some(n=>n.layer.id===r.id)?this:(this.renderer.customLayers.push({layer:r,before:o}),this.ctx&&r.onAdd?.(this,this.ctx.gl),this.triggerRepaint(),this)}return this.layerEdits.push({kind:"add",layer:t,before:o}),this.setStyle(this._style.spec)}removeLayer(t){let o=this.renderer.customLayers.findIndex(r=>r.layer.id===t);if(o>=0){let[r]=this.renderer.customLayers.splice(o,1);return this.ctx&&r.layer.onRemove?.(this,this.ctx.gl),this.triggerRepaint(),this}return this.layerEdits.push({kind:"remove",id:t}),this.layerOverrides.delete(t),this.setStyle(this._style.spec)}moveLayer(t,o){return this.layerEdits.push({kind:"move",id:t,before:o}),this.setStyle(this._style.spec)}getLayer(t){return this._style.spec.layers.find(o=>o.id===t)??this.renderer.customLayers.find(o=>o.layer.id===t)?.layer}getLayersOrder(){return this._style.spec.layers.map(t=>t.id)}setLayerZoomRange(t,o,r){return this.layerEdits.push({kind:"zoom",id:t,minzoom:o,maxzoom:r}),this.setStyle(this._style.spec)}getFilter(t){let o=this.getLayer(t);return o&&"filter"in o?o.filter:void 0}setFilter(t,o){return this.layerEdits.push({kind:"filter",id:t,filter:o}),this.setStyle(this._style.spec)}getStyle(){return structuredClone(this._style.spec)}isStyleLoaded(){return true}getLight(){return this._style.light}setTerrain(t){let o={...this._style.spec};return t?o.terrain=t:delete o.terrain,this.setStyle(o),this}getTerrain(){return this._style.spec.terrain??null}getSource(t){return this.sources.get(t)??this.rasterSources.get(t)??this.demSources.get(t)??this.mediaSources.get(t)}removeSource(t){let o=this.sources.get(t);o&&(o.destroy(),this.sources.delete(t));let r=this.rasterSources.get(t);r&&(r.destroy(),this.rasterSources.delete(t));let n=this.demSources.get(t);n&&(this.demSources.delete(t),this.syncTerrain());let a=this.mediaSources.get(t);return a&&(a.destroy(),this.mediaSources.delete(t)),(o||r||n||a)&&this.triggerRepaint(),this}refreshTiles(t){return this.refreshSource(t)}getRoll(){return this.transform.roll}setRoll(t){return this.transform.roll=t,this.afterCameraChange()}applyLayerEdits(t){if(!this.layerEdits.length)return t;let o=[...t.layers],r=n=>n===void 0?o.length:o.findIndex(a=>a.id===n);for(let n of this.layerEdits){if(n.kind==="add"){let s=structuredClone(n.layer),l=o.findIndex(c=>c.id===s.id);if(l>=0)o[l]=s;else {let c=r(n.before);o.splice(c<0?o.length:c,0,s);}continue}let a=o.findIndex(s=>s.id===n.id);if(!(a<0)){if(n.kind==="remove")o.splice(a,1);else if(n.kind==="move"){let[s]=o.splice(a,1),l=r(n.before);o.splice(l<0?o.length:l,0,s);}else if(n.kind==="zoom"){let s={...o[a]};n.minzoom===void 0?delete s.minzoom:s.minzoom=n.minzoom,n.maxzoom===void 0?delete s.maxzoom:s.maxzoom=n.maxzoom,o[a]=s;}else if(n.kind==="filter"){let s={...o[a]};n.filter===void 0||n.filter===null?delete s.filter:s.filter=n.filter,o[a]=s;}}}return {...t,layers:o}}queryRenderedFeatures(t,o={}){let r=t??[{x:0,y:0},{x:this.transform.width,y:this.transform.height}];return ha(this.transform,this.sources,this._style.layers,r,o,(n,a,s)=>this.featureStateOf(n,a,s))}querySourceFeatures(t,o={}){let r=this.sources.get(t);return r?da(r,t,o,(n,a,s)=>this.featureStateOf(n,a,s)):[]}setFeatureState(t,o){let r=sf(t.source,t.sourceLayer??"",t.id);return this.featureStates.set(r,{...this.featureStates.get(r)??{},...o}),this.triggerRepaint(),this}getFeatureState(t){return this.featureStateOf(t.source,t.sourceLayer??"",t.id)}removeFeatureState(t,o){let r=`${t.source}\u241F${t.sourceLayer??""}\u241F`;if(t.id===void 0)for(let n of [...this.featureStates.keys()])n.startsWith(r)&&this.featureStates.delete(n);else if(o===void 0)this.featureStates.delete(r+t.id);else {let n=this.featureStates.get(r+t.id);n&&delete n[o];}return this.triggerRepaint(),this}queryTerrainElevation(t){if(!this.renderer.terrain.enabled)return null;let o=Q(t);return this.renderer.terrain.heightAt(o.lng,o.lat)}setCenterClampedToGround(t){return this.centerClamped=t,this.triggerRepaint(),this}getCenterClampedToGround(){return this.centerClamped}featureStateOf(t,o,r){let n=this.featureStates.get(sf(t,o,r));return n?{...n}:{}}addImage(t,o,r={}){let n=this.renderer.symbols?.images;return n?n.add(t,o,r)?(this.triggerRepaint(),this):(console.warn(`[osmgl] \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \xAB${t}\xBB \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u2014 \u0434\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u044B \u043D\u0443\u0436\u0435\u043D updateImage`),this):this}updateImage(t,o,r={}){return this.renderer.symbols?.images.update(t,o,r)&&this.triggerRepaint(),this}removeImage(t){return this.renderer.symbols?.images.remove(t)&&this.triggerRepaint(),this}hasImage(t){return this.renderer.symbols?.images.has(t)??false}getImage(t){return this.renderer.symbols?.images.get(t)}listImages(){return this.renderer.symbols?.images.list()??[]}setMissingStyleImageResolver(t){return this.renderer.symbols?.setMissingImage(t),this}async setSprite(t){for(let[o,r]of [...this.spriteImages])r===""&&this.removeImage(o);return this.spriteImages.clear(),this.spriteUrl=t,t&&await this.loadSprite("",t),this}getSprite(){let t=this.spriteUrl?[{id:"",url:this.spriteUrl}]:[];for(let[o,r]of this.extraSprites)t.push({id:o,url:r});return t}async addSprite(t,o){return this.extraSprites.set(t,o),await this.loadSprite(t,o),this}removeSprite(t){for(let[o,r]of [...this.spriteImages])r===t&&(this.removeImage(o),this.spriteImages.delete(o));return this.extraSprites.delete(t),this}getGlyphs(){return this.glyphsUrl}setGlyphs(t){return this.glyphsUrl=t,this.renderer.symbols?.setGlyphsUrl(t),this.triggerRepaint(),this}async loadSprite(t,o){let r=Math.min(Math.round(window.devicePixelRatio||1),2),n=r>1?`@${r}x`:"";try{let[a,s]=await Promise.all([fetch(`${o}${n}.json`).then(u=>u.json()),B1(`${o}${n}.png`)]),l=document.createElement("canvas");l.width=s.width,l.height=s.height;let c=l.getContext("2d",{willReadFrequently:!0});if(!c)return;c.drawImage(s,0,0);for(let[u,f]of Object.entries(a)){if(f.width<=0||f.height<=0)continue;let h=c.getImageData(f.x,f.y,f.width,f.height),d=t?`${t}:${u}`:u,m={width:f.width,height:f.height,data:h.data},b={pixelRatio:f.pixelRatio??r,sdf:f.sdf??!1};this.hasImage(d)?this.updateImage(d,m,b):this.addImage(d,m,b),this.spriteImages.set(d,t);}this.triggerRepaint();}catch(a){console.warn(`[osmgl] \u0441\u043F\u0440\u0430\u0439\u0442 \xAB${o}\xBB \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0441\u044F:`,a instanceof Error?a.message:a);}}addControl(t,o){return this.controls.add(t,this,o),this}removeControl(t){return this.controls.remove(t,this),this}hasControl(t){return this.controls.has(t)}get dragPan(){return this.handlers.dragPan}get dragRotate(){return this.handlers.dragRotate}get scrollZoom(){return this.handlers.scrollZoom}get doubleClickZoom(){return this.handlers.doubleClickZoom}get touchZoomRotate(){return this.handlers.touchZoomRotate}get touchPitch(){return this.handlers.touchPitch}get keyboard(){return this.handlers.keyboard}get boxZoom(){return this.handlers.boxZoom}get cooperativeGestures(){return this.handlers.cooperative}static addProtocol(t,o){vn.set(t,o);}static removeProtocol(t){vn.delete(t);}setTransformRequest(t){this.transformRequest=t;for(let o of this.sources.values())o.setTransformRequest(t);for(let o of this.rasterSources.values())o.setTransformRequest(t);return this}setTransformCameraUpdate(t){return this.cameraUpdate=t,this}setTransformConstrain(t){return this.transformConstrain=t,this}setSourceTileLodParams(t,o){let r=this.sources.get(t)??this.rasterSources.get(t);return r?(r.setLodParams(o),this.triggerRepaint(),this):this}setGlobalStateProperty(t,o){return o==null?delete Ht[t]:Ht[t]=o,this.triggerRepaint(),this}getGlobalState(){return {...Ht}}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this.triggerRepaint(),this}setTheme(t){return this.setStyle(Bo(t,this.options.style))}setBaseStyle(t,o){this.options.style=t;for(let[r,n]of Object.entries(t.sources??{}))this.sources.has(r)||this.rasterSources.has(r)||this.demSources.has(r)||this.addSource(r,n);return this.setStyle(o===void 0?t:Bo(o,t)),this.syncTerrain(),this}static get themes(){return Object.keys(ye)}static get themeList(){return Object.entries(ye).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(s=>s.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[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(s=>s.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=JSON.stringify(gt(n)??null);if(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),JSON.stringify(gt(n)??null)!==a)for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),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:Oe(r.mercX),lat:Pe(r.mercY)},key:po.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=Oi(this.transform,n,r.id,t,this.groundAt);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 D,n;for(let s of this._style.layers){if(s.type!=="fill"||!s.id.startsWith("indoor-")||s.id==="indoor-shell"||!this._style.layerVisibleAt(s,this.transform.zoom))continue;let l=this._style.bucketKeyFor(s);l&&(o.push(l),r.set(l,s.id),n??(n=this.sources.get(s.source??Y)));}if(!n||!o.length)return null;let a=Hi(this.transform,n,o,t,this.groundAt);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=ba({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Pu("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=ga(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"?Ln(Pn()):t;return this.governor.reset(o,o),this.applyQuality(gr(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.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,s]of this.sources.entries())s.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(gr(o.to),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??Y)===o&&"splitBy"in n&&n.splitBy===yo))for(let n of r.splitValues(yo)){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[yo];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[yo]:this._style.splitValues[yo]=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 pr)}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,Mo):o.maxPitch,a=o.zoom<r,s=o.pitch>n;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?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);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,u=!!s.getExtension("EXT_float_blend"),f=u?s.RGBA32F:s.RGBA16F,h=u?s.FLOAT:s.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==l||this.debugFB.h!==c)&&(s.deleteFramebuffer(this.debugFB.fb),s.deleteTexture(this.debugFB.tex),s.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let d=s.createTexture(),m=s.createFramebuffer(),b=s.createRenderbuffer();if(!d||!m||!b)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,f,l,c,0,s.RGBA,h,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.bindTexture(s.TEXTURE_2D,null),s.bindRenderbuffer(s.RENDERBUFFER,b),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH24_STENCIL8,l,c),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindFramebuffer(s.FRAMEBUFFER,m),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,b);let p=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),p!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:d,rb:b,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*n*4);return s.readPixels(t,o,r,n,s.RGBA,s.FLOAT,d),{data:d,format:u?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}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,m]of this.sources)this.sourceDrawn(d,this.transform.zoom)?m.update(this.transform):m.deactivate();this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);if(this.renderer.terrain.enabled){for(let p of this.demSources.values())p.update(this.transform);let d=this.transform.center,m=this.centerClamped?this.renderer.terrain.heightAt(d.lng,d.lat):this.transform.centerElevation,b=this.transform.centerElevation;this.transform.centerElevation=Math.abs(m-b)<.5?m:b+(m-b)*.25;}else this.transform.centerElevation!==0&&(this.transform.centerElevation=0);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),s=performance.now()-o,l=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,u=c>0&&c<D1,f=u?c:0;this.continuousFrames=u?this.continuousFrames+1:0;let h=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(h),this.emit("render",{frameMs:s,intervalMs:f}),l&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.ready}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();for(let t of this.demSources.values())t.destroy();this.demSources.clear(),this.objects.destroy(),this.controls.destroy(this),this.handlers.boxZoom.destroy(),this.handlers.cooperative.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},w4=Za;
2768
+ exports.AssetLoader=hr;exports.AttributionControl=Wa;exports.BASE_SOURCE=Y;exports.BUILDING_HEIGHT_SCALE=Qt;exports.BUILDING_POS_SCALE=pt;exports.BUILDING_VERTEX_STRIDE=Ee;exports.BoxZoomHandler=So;exports.CITY_STYLE=zd;exports.Circle=Ka;exports.CooperativeGesturesHandler=To;exports.DATA_PAINT_STRIDE=Et;exports.DEFAULT_ICONS=Vt;exports.DEFAULT_LIGHT=_i;exports.DEFAULT_SHADOWS=ru;exports.DEFAULT_SKY=xi;exports.DEFAULT_STYLE=Jr;exports.DemSource=lr;exports.DemTile=jo;exports.DemTileEntry=Mn;exports.DepthTarget=Wo;exports.EARTH_CIRCUMFERENCE=Tr;exports.FILL_VERTEX_STRIDE=Je;exports.FeaturePaint=$r;exports.FullscreenControl=Va;exports.GLOBE_MAX_PITCH=Mo;exports.GLOBE_ZOOM_MAX=zt;exports.GLOBE_ZOOM_MIN=Ar;exports.GLYPH_BORDER=be;exports.GLYPH_SIZE=xt;exports.GROUND_SCALE=Yh;exports.GeoJSONSource=fr;exports.GeolocateControl=Na;exports.GeomType=Yt;exports.GestureHandler=Ze;exports.GlobeControl=Ua;exports.GlyphSource=tr;exports.GroundArrows=Go;exports.IconSource=rr;exports.ImageManager=er;exports.IndoorMask=Uo;exports.LEVEL_LIMIT=Th;exports.LINE_VERTEX_STRIDE=Ve;exports.LayerRenderer=Qo;exports.LngLatBounds=jt;exports.LogoControl=ja;exports.MAX_GRADE=k1;exports.MAX_LATITUDE=Ja;exports.MIN_PIER_HEIGHT_METERS=A1;exports.MODEL_VERTEX_STRIDE=un;exports.Map=Za;exports.MapObject=_r;exports.Marker=mr;exports.MediaSource=cr;exports.Model=dr;exports.ModelLayer=Rt;exports.NavigationControl=Da;exports.ObjectManager=Ko;exports.PIER_SPACING_METERS=E1;exports.Polygon=Bn;exports.Polyline=Ya;exports.Popup=pr;exports.QualityGovernor=br;exports.RELIEF_STYLE=Fd;exports.ROAD_SIGNS=R0;exports.RUNTIME_FILL_STRIDE=Bi;exports.RUNTIME_LINE_STRIDE=no;exports.RasterSource=sr;exports.RasterTile=xn;exports.SDF_EDGE=Zi;exports.SDF_PX=or;exports.SIGN_SIZE=A0;exports.SOFT_STYLE=Pd;exports.SPLIT_SEP=ql;exports.SURFACE_CUT_BLEED=zo;exports.SURFACE_LEVEL_SCALE=cl;exports.SURFACE_VERTEX_STRIDE=bt;exports.ScaleControl=Ba;exports.SdfAtlas=Jo;exports.Style=oo;exports.SymbolRenderer=po;exports.TAPER_METERS=Lo;exports.TERRAIN_STYLE=Ld;exports.THEMES=ye;exports.TILE_SIZE=ct;exports.TerrainControl=Ga;exports.TileID=At;exports.Transform=Co;exports.VectorTile=dt;exports.VectorTileFeature=zr;exports.VectorTileLayer=Or;exports.abbreviateStreet=ra;exports.addGround=gi;exports.altitudeFromMercatorZ=Y1;exports.applyTheme=Qr;exports.arrowLabelOffset=wu;exports.arrowVertices=Jd;exports.bridgePiers=I1;exports.bridgeProfile=R1;exports.buildRoadGraph=D0;exports.buildRuntimeFill=Wi;exports.buildRuntimeLine=Yo;exports.cameraForBounds=Nn;exports.chainAxes=li;exports.circumferenceAtLatitude=$e;exports.clampLat=kr;exports.clampPixelRatio=wa;exports.classifyRenderer=zu;exports.clipLineToRect=k0;exports.coordinateDigits=Lu;exports.coveringTiles=wt;exports.createGround=bi;exports.default=w4;exports.densifyLine=Qn;exports.deviceHints=Pn;exports.distToSegment=nf;exports.evaluateColor=Fe;exports.evaluateExpression=St;exports.evaluateNumber=N;exports.expressionColor=Eo;exports.expressionNumber=Zn;exports.extractFeature=sn;exports.featureDrivenPaint=gt;exports.featureLevel=Ye;exports.fillFootprint=Ri;exports.fogPlanes=ro;exports.footprintOf=Ii;exports.formatHash=ba;exports.generateBuildings=oi;exports.generateFill=ii;exports.generateLine=vi;exports.generateSurface=pi;exports.generateSymbols=ia;exports.globeBasis=Xn;exports.globeFlatMix=Ir;exports.globeRadius=Rr;exports.globeToLocal=as;exports.groundAt=qr;exports.iconRotation=xu;exports.insideFootprint=vt;exports.isExpression=Kt;exports.junctionIndex=Io;exports.laneArrow=Ca;exports.laneGuides=Q0;exports.latFromMercatorY=Pe;exports.liftFields=ci;exports.lngFromMercatorX=Oe;exports.lngLatToUnit=Lr;exports.makeFeaturePaint=Do;exports.matchesFilter=we;exports.mercatorMetersPerTile=Ft;exports.mercatorX=oe;exports.mercatorY=re;exports.mercatorZFromAltitude=Vn;exports.metersPerPixel=$1;exports.metersPerTile=xo;exports.needsDataPaint=hl;exports.nextQualityDown=xa;exports.parseGlb=Tm;exports.parseGlbAsync=Gi;exports.parseGlyphs=iu;exports.parseHash=ga;exports.parseLift=Js;exports.patchUV=Hc;exports.pickBuilding=Oi;exports.pickFill=Hi;exports.pitchIntent=ds;exports.pixelsPerMeter=K1;exports.placeAlongLine=ea;exports.placeMarking=Sa;exports.pointInRing=qa;exports.qualityFor=Ln;exports.qualityProfile=gr;exports.queryRendered=ha;exports.querySource=da;exports.raySphere=Yn;exports.refineLine=$t;exports.relaxAngle=Uu;exports.relaxCurvature=Aa;exports.resolveTemplate=na;exports.ribbonFromEdges=La;exports.ribbonRing=vh;exports.ribbonShape=Jt;exports.ringEdges=Ia;exports.roadEdges=Ra;exports.roadHeights=T1;exports.roadMarkings=U0;exports.roadSurfaces=a1;exports.roundLine=Ao;exports.roundRing=He;exports.sdfFromAlpha=Qi;exports.shapeText=Ji;exports.speedSign=I0;exports.splitBucketKey=at;exports.splitByGround=yi;exports.splitPolygons=Ot;exports.stitchPieces=wi;exports.stopLine=P0;exports.styleWithTheme=Bo;exports.taperedWidth=Po;exports.tileOriginMeters=es;exports.tileUrl=_n;exports.toLngLat=Q;exports.unitToLngLat=jn;exports.unpackVector=nn;exports.waffle=F0;exports.worldSize=Ct;exports.zebra=L0;//# sourceMappingURL=osmgl.cjs.map
2409
2769
  //# sourceMappingURL=osmgl.cjs.map