osmgl 0.9.0 → 0.9.1
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 +4 -4
- package/dist/osmgl.cjs.map +1 -1
- package/dist/osmgl.d.cts +17 -6
- package/dist/osmgl.d.ts +17 -6
- package/dist/osmgl.global.js +5 -5
- package/dist/osmgl.js +4 -4
- package/dist/osmgl.js.map +1 -1
- package/package.json +1 -1
package/dist/osmgl.global.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var OsmGL=(function(exports){'use strict';var _c=Object.defineProperty;var No=(n,e)=>()=>(n&&(e=n(n=0)),e);var Yi=(n,e)=>{for(var t in e)_c(n,t,{get:e[t],enumerable:true});};var Xh,Tl=No(()=>{Xh=(function(){var n="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FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(u){t=u.instance,t.exports.__wasm_call_ctors(),t.exports.meshopt_encodeVertexVersion(0),t.exports.meshopt_encodeIndexVersion(1);});function r(u){for(var d=new Uint8Array(u.length),m=0;m<u.length;++m){var p=u.charCodeAt(m);d[m]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,m=0;m<u.length;++m)d[b++]=d[m]<60?e[d[m]]:(d[m]-60)*64+d[++m];return d.buffer.slice(0,b)}function i(u){if(!u)throw new Error("Assertion failed")}function a(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function s(u,d,m){var p=t.exports.sbrk,b=p(u.length*4),g=p(d*4),y=new Uint8Array(t.exports.memory.buffer),A=a(u);y.set(A,b),m&&m(b,b,u.length,d);var B=t.exports.meshopt_optimizeVertexFetchRemap(g,b,u.length,d);y=new Uint8Array(t.exports.memory.buffer);var C=new Uint32Array(d);new Uint8Array(C.buffer).set(y.subarray(g,g+d*4)),A.set(y.subarray(b,b+u.length*4)),p(b-p(0));for(var v=0;v<u.length;++v)u[v]=C[u[v]];return [C,B]}function l(u,d,m,p,b){var g=t.exports.sbrk,y=g(d),A=g(p*b),B=new Uint8Array(t.exports.memory.buffer);B.set(a(m),A);var C=u(y,d,A,p,b),v=new Uint8Array(C);return v.set(B.subarray(y,y+C)),g(y-g(0)),v}function c(u){for(var d=0,m=0;m<u.length;++m){var p=u[m];d=d<p?p:d;}return d}function h(u,d){if(i(d==2||d==4),d==4)return new Uint32Array(u.buffer,u.byteOffset,u.byteLength/4);var m=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/2);return new Uint32Array(m)}function f(u,d,m,p,b,g){var y=t.exports.sbrk,A=y(m*p),B=y(m*g),C=new Uint8Array(t.exports.memory.buffer);C.set(a(d),B),u(A,m,p,b,B);var v=new Uint8Array(m*p);return v.set(C.subarray(A,A+m*p)),y(A-y(0)),v}return {ready:o,supported:true,reorderMesh:function(u,d,m){var p=d?m?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return s(u,c(u)+1,p)},encodeVertexBuffer:function(u,d,m){i(m>0&&m<=256),i(m%4==0);var p=t.exports.meshopt_encodeVertexBufferBound(d,m);return l(t.exports.meshopt_encodeVertexBuffer,p,u,d,m)},encodeIndexBuffer:function(u,d,m){i(m==2||m==4),i(d%3==0);var p=h(u,m),b=t.exports.meshopt_encodeIndexBufferBound(d,c(p)+1);return l(t.exports.meshopt_encodeIndexBuffer,b,p,d,4)},encodeIndexSequence:function(u,d,m){i(m==2||m==4);var p=h(u,m),b=t.exports.meshopt_encodeIndexSequenceBound(d,c(p)+1);return l(t.exports.meshopt_encodeIndexSequence,b,p,d,4)},encodeGltfBuffer:function(u,d,m,p){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return i(b[p]),b[p](u,d,m)},encodeFilterOct:function(u,d,m,p){return i(m==4||m==8),i(p>=1&&p<=16),f(t.exports.meshopt_encodeFilterOct,u,d,m,p,16)},encodeFilterQuat:function(u,d,m,p){return i(m==8),i(p>=4&&p<=16),f(t.exports.meshopt_encodeFilterQuat,u,d,m,p,16)},encodeFilterExp:function(u,d,m,p){return i(m>0&&m%4==0),i(p>=1&&p<=24),f(t.exports.meshopt_encodeFilterExp,u,d,m,p,m)}}})();});var jh,Hl=No(()=>{jh=(function(){var n="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",e="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",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),o=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var r=n;WebAssembly.validate(t)&&(r=e);var i,a=WebAssembly.instantiate(s(r),{}).then(function(f){i=f.instance,i.exports.__wasm_call_ctors();});function s(f){for(var u=new Uint8Array(f.length),d=0;d<f.length;++d){var m=f.charCodeAt(d);u[d]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62;}for(var p=0,d=0;d<f.length;++d)u[p++]=u[d]<60?o[u[d]]:(u[d]-60)*64+u[++d];return u.buffer.slice(0,p)}function l(f,u,d,m,p,b){var g=i.exports.sbrk,y=d+3&-4,A=g(y*m),B=g(p.length),C=new Uint8Array(i.exports.memory.buffer);C.set(p,B);var v=f(A,d,m,B,p.length);if(v==0&&b&&b(A,y,m),u.set(C.subarray(A,A+d*m)),g(A-g(0)),v!=0)throw new Error("Malformed buffer data: "+v)}var c={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return {ready:a,supported:true,decodeVertexBuffer:function(f,u,d,m,p){l(i.exports.meshopt_decodeVertexBuffer,f,u,d,m,i.exports[c[p]]);},decodeIndexBuffer:function(f,u,d,m){l(i.exports.meshopt_decodeIndexBuffer,f,u,d,m);},decodeIndexSequence:function(f,u,d,m){l(i.exports.meshopt_decodeIndexSequence,f,u,d,m);},decodeGltfBuffer:function(f,u,d,m,p,b){l(i.exports[h[p]],f,u,d,m,i.exports[c[b]]);}}})();});var Yh,kl=No(()=>{Yh=(function(){var n="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iDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(u){t=u.instance,t.exports.__wasm_call_ctors();});function r(u){for(var d=new Uint8Array(u.length),m=0;m<u.length;++m){var p=u.charCodeAt(m);d[m]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,m=0;m<u.length;++m)d[b++]=d[m]<60?e[d[m]]:(d[m]-60)*64+d[++m];return d.buffer.slice(0,b)}function i(u){if(!u)throw new Error("Assertion failed")}function a(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function s(u,d){var m=t.exports.sbrk,p=m(u.length*4),b=m(d*4),g=new Uint8Array(t.exports.memory.buffer),y=a(u);g.set(y,p);var A=t.exports.meshopt_optimizeVertexFetchRemap(b,p,u.length,d);g=new Uint8Array(t.exports.memory.buffer);var B=new Uint32Array(d);new Uint8Array(B.buffer).set(g.subarray(b,b+d*4)),y.set(g.subarray(p,p+u.length*4)),m(p-m(0));for(var C=0;C<u.length;++C)u[C]=B[u[C]];return [B,A]}function l(u){for(var d=0,m=0;m<u.length;++m){var p=u[m];d=d<p?p:d;}return d}function c(u,d,m,p,b,g,y,A,B){var C=t.exports.sbrk,v=C(4),_=C(m*4),w=C(b*g),x=C(m*4),E=new Uint8Array(t.exports.memory.buffer);E.set(a(p),w),E.set(a(d),x);var F=u(_,x,m,w,b,g,y,A,B,v);E=new Uint8Array(t.exports.memory.buffer);var M=new Uint32Array(F);a(M).set(E.subarray(_,_+F*4));var D=new Float32Array(1);return a(D).set(E.subarray(v,v+4)),C(v-C(0)),[M,D[0]]}function h(u,d,m,p){var b=t.exports.sbrk,g=b(m*p),y=new Uint8Array(t.exports.memory.buffer);y.set(a(d),g);var A=u(g,m,p);return b(g-b(0)),A}var f={LockBorder:1};return {ready:o,supported:true,compactMesh:function(u){i(u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),i(u.length%3==0);var d=u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return s(d,l(u)+1)},simplify:function(u,d,m,p,b,g){i(u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),i(u.length%3==0),i(d instanceof Float32Array),i(d.length%m==0),i(m>=3),i(p%3==0);for(var y=0,A=0;A<(g?g.length:0);++A)y|=f[g[A]];var B=u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u),C=c(t.exports.meshopt_simplify,B,u.length,d,d.length,m*4,p,b,y);return C[0]=u instanceof Uint32Array?C[0]:new u.constructor(C[0]),C},getScale:function(u,d){return i(u instanceof Float32Array),i(u.length%d==0),h(t.exports.meshopt_simplifyScale,u,u.length,d*4)}}})();});var Pl={};Yi(Pl,{MeshoptDecoder:()=>jh,MeshoptEncoder:()=>Xh,MeshoptSimplifier:()=>Yh});var Rl=No(()=>{Tl();Hl();kl();});var P=Map,te=Set;var tt=class{constructor(){this.listeners=new P;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new te),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(i){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:`,i);}return this}removeAllListeners(){this.listeners.clear();}};var Ee=(n,e,t)=>n<e?e:n>t?t:n;var Oe=n=>n*Math.PI/180,Zi=n=>n*180/Math.PI;function xt(n){let e=((n+180)%360+360)%360-180;return e===-180?180:e}var Ko=n=>1-Math.pow(1-n,3);function pe(n){let e=n.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(i=>parseInt(i+i,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 i=0;i<o.length;i+=2)r.push(parseInt(o.slice(i,i+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 Fe(n){return [n[0]*n[3],n[1]*n[3],n[2]*n[3],n[3]]}var Uo=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 P;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=Ec(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 i=this._viewport;i[0]===e&&i[1]===t&&i[2]===o&&i[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,i=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),i|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),i|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),i|=r.STENCIL_BUFFER_BIT),i&&r.clear(i);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function Ec(n){let e=n.getExtension("EXT_texture_filter_anisotropic")??n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=n.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),maxVertexAttribs:n.getParameter(n.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!n.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?n.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!n.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(n.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var ht=512,Jo=40075016686e-3,Qi=85.051129;function re(n){return Array.isArray(n)?{lng:n[0],lat:n[1]}:n}var ot=n=>512*Math.pow(2,n),Xo=n=>Math.max(-Qi,Math.min(Qi,n));function ce(n){return (180+n)/360}function fe(n){let e=Xo(n);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Le(n){return n*360-180}function De(n){let e=180-n*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function ze(n){return Jo*Math.cos(n*Math.PI/180)}function Jr(n,e){return n/ze(e)}function zm(n,e){return n*ze(e)}function Vm(n,e){return Jr(1,n)*ot(e)}function Wm(n,e){return ze(n)/ot(e)}function qi(n,e){let t=Math.pow(2,n);return ze(De((e+.5)/t))/t}function jo(n){return Jo/Math.pow(2,n)}function $i(n,e,t){let o=jo(n),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Zt=class n{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 n;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof n)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=re(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=re(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:ce(this.west),maxX:ce(this.east),minY:fe(this.north),maxY:fe(this.south)}}};function Xr(n,e){if(n.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,ea),r=Math.max(e.height-t.top-t.bottom,ea),i=n.toMercator(),a=e.bearing??0,s=-a*Math.PI/180,l=Math.cos(s),c=Math.sin(s),h=(i.minX+i.maxX)/2,f=(i.minY+i.maxY)/2,u=0,d=0;for(let[A,B]of [[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]){let C=(A-h)*l-(B-f)*c,v=(A-h)*c+(B-f)*l;u=Math.max(u,Math.abs(C)*2),d=Math.max(d,Math.abs(v)*2);}let m=Math.min(o/Math.max(u,1e-12),r/Math.max(d,1e-12)),p=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),b=ot(p),g=(t.left-t.right)/2/b,y=(t.top-t.bottom)/2/b;return {center:{lng:Le(h-(g*l+y*c)),lat:De(f-(-g*c+y*l))},zoom:p,bearing:a}}var ea=32;function U(){let n=new Float64Array(16);return n[0]=n[5]=n[10]=n[15]=1,n}function Ze(n){return n.fill(0),n[0]=n[5]=n[10]=n[15]=1,n}function Me(n,e,t){let o=e[0],r=e[1],i=e[2],a=e[3],s=e[4],l=e[5],c=e[6],h=e[7],f=e[8],u=e[9],d=e[10],m=e[11],p=e[12],b=e[13],g=e[14],y=e[15];for(let A=0;A<4;A++){let B=t[A*4],C=t[A*4+1],v=t[A*4+2],_=t[A*4+3];n[A*4]=B*o+C*s+v*f+_*p,n[A*4+1]=B*r+C*l+v*u+_*b,n[A*4+2]=B*i+C*c+v*d+_*g,n[A*4+3]=B*a+C*h+v*m+_*y;}return n}function Ke(n,e,t,o,r){return n!==e&&n.set(e),n[12]=e[0]*t+e[4]*o+e[8]*r+e[12],n[13]=e[1]*t+e[5]*o+e[9]*r+e[13],n[14]=e[2]*t+e[6]*o+e[10]*r+e[14],n[15]=e[3]*t+e[7]*o+e[11]*r+e[15],n}function Ve(n,e,t,o,r){for(let i=0;i<4;i++)n[i]=e[i]*t,n[4+i]=e[4+i]*o,n[8+i]=e[8+i]*r,n[12+i]=e[12+i];return n}function Yr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[4],a=e[5],s=e[6],l=e[7],c=e[8],h=e[9],f=e[10],u=e[11];return n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=i*r+c*o,n[5]=a*r+h*o,n[6]=s*r+f*o,n[7]=l*r+u*o,n[8]=c*r-i*o,n[9]=h*r-a*o,n[10]=f*r-s*o,n[11]=u*r-l*o,n}function Zr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[0],a=e[1],s=e[2],l=e[3],c=e[4],h=e[5],f=e[6],u=e[7];return n!==e&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=i*r+c*o,n[1]=a*r+h*o,n[2]=s*r+f*o,n[3]=l*r+u*o,n[4]=c*r-i*o,n[5]=h*r-a*o,n[6]=f*r-s*o,n[7]=u*r-l*o,n}function oa(n,e,t,o,r){let i=1/Math.tan(e/2);return n.fill(0),n[0]=i/t,n[5]=i,n[11]=-1,n[10]=(r+o)/(o-r),n[14]=2*r*o/(o-r),n}function ra(n,e,t,o,r,i,a){let s=1/(e-t),l=1/(o-r),c=1/(i-a);return n.fill(0),n[0]=-2*s,n[5]=-2*l,n[10]=2*c,n[12]=(e+t)*s,n[13]=(r+o)*l,n[14]=(a+i)*c,n[15]=1,n}function Ue(n,e){let t=e[0],o=e[1],r=e[2],i=e[3],a=e[4],s=e[5],l=e[6],c=e[7],h=e[8],f=e[9],u=e[10],d=e[11],m=e[12],p=e[13],b=e[14],g=e[15],y=t*s-o*a,A=t*l-r*a,B=t*c-i*a,C=o*l-r*s,v=o*c-i*s,_=r*c-i*l,w=h*p-f*m,x=h*b-u*m,E=h*g-d*m,F=f*b-u*p,M=f*g-d*p,D=u*g-d*b,S=y*D-A*M+B*F+C*E-v*x+_*w;return S?(S=1/S,n[0]=(s*D-l*M+c*F)*S,n[1]=(r*M-o*D-i*F)*S,n[2]=(p*_-b*v+g*C)*S,n[3]=(u*v-f*_-d*C)*S,n[4]=(l*E-a*D-c*x)*S,n[5]=(t*D-r*E+i*x)*S,n[6]=(b*B-m*_-g*A)*S,n[7]=(h*_-u*B+d*A)*S,n[8]=(a*M-s*E+c*w)*S,n[9]=(o*E-t*M-i*w)*S,n[10]=(m*v-p*B+g*y)*S,n[11]=(f*B-h*v-d*y)*S,n[12]=(s*x-a*F-l*w)*S,n[13]=(t*F-o*x+r*w)*S,n[14]=(p*A-m*C-b*y)*S,n[15]=(h*C-f*A+u*y)*S,n):null}function be(n,e,t){let[o,r,i,a]=t;return n[0]=e[0]*o+e[4]*r+e[8]*i+e[12]*a,n[1]=e[1]*o+e[5]*r+e[9]*i+e[13]*a,n[2]=e[2]*o+e[6]*r+e[10]*i+e[14]*a,n[3]=e[3]*o+e[7]*r+e[11]*i+e[15]*a,n}function Qe(n,e){for(let t=0;t<16;t++)n[t]=e[t];return n}function Yo(n){let e=Math.hypot(n[0],n[1],n[2])||1;return [n[0]/e,n[1]/e,n[2]/e]}function ta(n,e){return [n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function Mc(n,e){return [n[0]-e[0],n[1]-e[1],n[2]-e[2]]}function jr(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function na(n,e,t,o){let r=Yo(Mc(t,e)),i=Yo(ta(r,o)),a=ta(i,r);return n[0]=i[0],n[1]=a[0],n[2]=-r[0],n[3]=0,n[4]=i[1],n[5]=a[1],n[6]=-r[1],n[7]=0,n[8]=i[2],n[9]=a[2],n[10]=-r[2],n[11]=0,n[12]=-jr(i,e),n[13]=-jr(a,e),n[14]=jr(r,e),n[15]=1,n}var Qt=60,Zo=4.5,dt=6,Qo=n=>n/(2*Math.PI);function qo(n){if(n<=Zo)return 0;if(n>=dt)return 1;let e=(n-Zo)/(dt-Zo);return e*e*(3-2*e)}function $o(n,e){let t=n*Math.PI/180,o=Xo(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Qr(n){let e=Math.hypot(n[0],n[1],n[2])||1,t=n[0]/e,o=n[1]/e,r=n[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function Fc(n,e){return $o(Le(n),De(e))}function qr(n,e){let t=n*Math.PI/180,o=Xo(e)*Math.PI/180,r=Math.cos(o),i=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[i*Math.sin(t),r,i*Math.cos(t)],up:[r*Math.sin(t),-i,r*Math.cos(t)]}}function ia(n,e,t){let o=n[0]*e,r=n[1]*e,i=n[2]*e;return [o*t.east[0]+r*t.east[1]+i*t.east[2],o*t.south[0]+r*t.south[1]+i*t.south[2],o*t.up[0]+r*t.up[1]+i*t.up[2]-e]}function Dc(n,e,t,o,r){let i=n-t;return i>.5&&(i-=1),i<-0.5&&(i+=1),[i*r,(e-o)*r,0]}function aa(n,e,t,o,r,i,a,s){let l=ia(Fc(n,e),r,a);if(s<=0)return l;let c=Dc(n,e,t,o,i);return [l[0]+(c[0]-l[0])*s,l[1]+(c[1]-l[1])*s,l[2]+(c[2]-l[2])*s]}function $r(n,e,t){let o=n[0]*e[0]+n[1]*e[1]+n[2]*e[2],r=n[0]**2+n[1]**2+n[2]**2-t*t,i=o*o-r;if(i<0)return null;let a=-o-Math.sqrt(i);return a<0?null:[n[0]+e[0]*a,n[1]+e[1]*a,n[2]+e[2]*a]}var sa=1e3,Sc=2,la=84,Ic=.42,qt=class n{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=Oe(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=Ic*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=Ee(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=xt(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<dt?Math.min(this.maxPitch,Qt):this.maxPitch,o=Ee(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Zi(this._fov)}set fov(e){let t=Oe(Ee(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 n;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(ce(e.lng),fe(e.lat));a[2]+=t*this._pixelsPerMeter;let s=this.localToPoint(a);if(s)return s}let o=[ce(e.lng)*this._worldSize,fe(e.lat)*this._worldSize,t,1],r=[0,0,0,0];be(r,this._pixelMatrix,o);let i=r[3]||1e-9;return {x:r[0]/i,y:r[1]/i}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let i=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Le(e/this._worldSize),lat:De(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(i[2]+=o*this._pixelsPerMeter,this.localToPoint(i)):null}let r=[0,0,0,0];return be(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:Le(t.x/this._worldSize),lat:De(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];be(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),be(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},s={x:o[0]/i,y:o[1]/i,z:o[2]/i},l=s.z-a.z,c=Math.abs(l)<1e-9?1:(0-a.z)/l,h=Ee(c,-1e6,1e6);return {x:a.x+(s.x-a.x)*h,y:a.y+(s.y-a.y)*h}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let s=this.globeUnproject(t);if(!s)return;let l=xt(this._center.lng+(e.lng-s.lng)),c=Ee(this._center.lat+(e.lat-s.lat),-la,la);this._center={lng:l,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ce(e.lng)*this._worldSize,y:fe(e.lat)*this._worldSize},i=r.x-o.x,a=r.y-o.y;this._center={lng:Le((this._centerX+i)/this._worldSize),lat:De((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,i=this._tileMatrix;return Ke(i,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(i,i,r,r,1),Qe(this._f32,i)}tileMatrix64(e,t,o=U()){this._ensure();let r=e.bounds(),i=(r.maxX-r.minX)*this._worldSize/t;return Ke(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ve(o,o,i,i,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ke(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Qe(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Oe(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Oe(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<dt}get globeFlatMix(){return this._ensure(),qo(this._zoom)}get globeRadiusPx(){return this._ensure(),Qo(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(!Ue(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],i=t[14]+e,a=Math.hypot(o,r,i)||1;return {dir:[o/a,r/a,i/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,i])=>{let a=[0,0,0,0],s=[0,0,0,0];be(a,this._localPixelInverse,[r,i,0,1]),be(s,this._localPixelInverse,[r,i,1,1]);let l=a[3]||1e-9,c=s[3]||1e-9,h=s[0]/c-a[0]/l,f=s[1]/c-a[1]/l,u=s[2]/c-a[2]/l,d=Math.hypot(h,f,u)||1;return [h/d,f/d,u/d]})}cameraRay(){this._ensure();let e=Oe(this._pitch),t=Oe(this._bearing),o=Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t);return {right:[a,i,0],up:[i*r,-a*r,o],fwd:[i*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(),Qe(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),aa(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,qo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return be(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];be(t,this._localPixelInverse,[e.x,e.y,0,1]),be(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a=this.globeRadiusPx,s=[t[0]/r,t[1]/r,t[2]/r+a],l=[o[0]/i-s[0],o[1]/i-s[1],o[2]/i+a-s[2]],c=Math.hypot(l[0],l[1],l[2])||1,h=[l[0]/c,l[1]/c,l[2]/c],f=$r(s,h,a);if(!f)return null;let u=this._globeBasis,d=[f[0]/a,f[1]/a,f[2]/a],m=[d[0]*u.east[0]+d[1]*u.south[0]+d[2]*u.up[0],d[0]*u.east[1]+d[1]*u.south[1]+d[2]*u.up[1],d[0]*u.east[2]+d[1]*u.south[2]+d[2]*u.up[2]];return Qr(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),i=this._globeBasis,a=$o(e,t),s=[a[0]*i.east[0]+a[1]*i.east[1]+a[2]*i.east[2],a[0]*i.south[0]+a[1]*i.south[1]+a[2]*i.south[2],a[0]*i.up[0]+a[1]*i.up[1]+a[2]*i.up[2]];return s[0]*r.dir[0]+s[1]*r.dir[1]+s[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*Sc,r=U();if(!Ue(r,this._viewProjPx))return;let i=this._cameraPosPx,a=[],s=[0,0,0,0];for(let C of [-1,1])for(let v of [-1,1])for(let _ of [-1,1]){if(be(s,r,[C,v,_,1]),s[3]===0)continue;let w=s[0]/s[3],x=s[1]/s[3],E=w-i[0],F=x-i[1],M=Math.hypot(E,F);if(M>o){let D=o/M;w=i[0]+E*D,x=i[1]+F*D;}a.push({x:w,y:x,z:0});}if(!a.length)return;let l=Yo(e),c=Math.abs(l[2])>.999?[0,1,0]:[0,0,1],h=this._shadowView;na(h,[this._centerX,this._centerY,0],[this._centerX+l[0],this._centerY+l[1],l[2]],c);let f=Math.min(t*this._pixelsPerMeter,o),u=1/0,d=1/0,m=1/0,p=-1/0,b=-1/0,g=-1/0,y=[0,0,0,0];for(let C of a)for(let v of [0,f])be(y,h,[C.x,C.y,v,1]),y[0]<u&&(u=y[0]),y[0]>p&&(p=y[0]),y[1]<d&&(d=y[1]),y[1]>b&&(b=y[1]),y[2]<m&&(m=y[2]),y[2]>g&&(g=y[2]);let A=f+1,B=this._shadowProj;ra(B,u,p,d,b,-g-A,-m+A),Me(this._shadowVP,B,h),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 Ke(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Qe(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,i=this._shadowTile;return Ke(i,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(i,i,r,r,1),Qe(this._shadowTile32,i)}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,i=t.minY*this._worldSize,a=t.maxY*this._worldSize,s=sa*this._pixelsPerMeter;for(let l of this._frustumPlanes){let c=l[0]>0?r:o,h=l[1]>0?a:i,f=l[2]>0?s:0;if(l[0]*c+l[1]*h+l[2]*f+l[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let i=e*this._worldSize,a=t*this._worldSize,s=o*this._pixelsPerMeter,l=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*i+c[1]*a+c[2]*s+c[3]<-l)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,i]=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-i,0,i-sa*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=ot(this._zoom);this._worldSize=e,this._pixelsPerMeter=Jr(1,this._center.lat)*e,this._centerX=ce(this._center.lng)*e,this._centerY=fe(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Oe(this._pitch),i=-Oe(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(Ee(Math.PI-s-l,.01,Math.PI-.01)),h=Math.cos(Math.PI/2-r)*c+a,f=Math.min(h*1.01,a*30),u=o/50;if(this.projection==="globe"&&this._zoom<dt){let y=Qo(e);u=Math.max(a-y*1.6,a*.02),f=a+y*2.4;}let d=this._viewMatrix;Ve(d,U(),1,-1,1),Ke(d,d,0,0,-a),Yr(d,d,r),Zr(d,d,i),Ke(d,d,-this._centerX,-this._centerY,0);let m=U();oa(m,this._fov,t/o,u,f),Me(this._viewProjPx,m,d);let p=U();Ve(p,d,1,1,this._pixelsPerMeter),Me(this._projMatrix,m,p);let b=this._localView;Ve(b,U(),1,-1,1),Ke(b,b,0,0,-a),Yr(b,b,r),Zr(b,b,i),Me(this._localProj,m,b),this._globeBasis=qr(this._center.lng,this._center.lat);let g=U();Ve(g,U(),t/2,-o/2,1),Ke(g,g,1,-1,0),Me(this._pixelMatrix,g,this._projMatrix),Ue(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"),Me(this._localPixel,g,this._localProj),Ue(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=U();if(!Ue(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(!Ue(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 h=[0,0,0,0];be(h,e,[c,l,s,1]);let f=h[3]||1e-9;t.push([h[0]/f,h[1]/f,h[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 h=t[s],f=t[l],u=t[c],d=f[0]-h[0],m=f[1]-h[1],p=f[2]-h[2],b=u[0]-h[0],g=u[1]-h[1],y=u[2]-h[2],A=m*y-p*g,B=p*b-d*y,C=d*g-m*b,v=Math.hypot(A,B,C)||1;A/=v,B/=v,C/=v;let _=new Float64Array(4);return _[0]=A,_[1]=B,_[2]=C,_[3]=-(A*h[0]+B*h[1]+C*h[2]),_});let r=0,i=0,a=0;for(let s of t)r+=s[0]/8,i+=s[1]/8,a+=s[2]/8;for(let s of this._frustumPlanes)s[0]*r+s[1]*i+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(){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 i=Math.floor(r.x/this._worldSize);i<t&&(t=i),i>o&&(o=i);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:Ee(t,-3,3),max:Ee(o,-3,3)}}};var Lc={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},ca=2,Tc=100,Hc=.5,kc=.1,Pc=25,fa=n=>Math.abs(n.y)>Math.abs(n.x);function ha(n,e,t){let o=Math.hypot(n.x,n.y)>=ca,r=Math.hypot(e.x,e.y)>=ca;return !o&&!r?void 0:!o||!r?t<Tc?void 0:false:n.y>0==e.y>0&&fa(n)&&fa(e)}function ua(n,e){let t=(n-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var Rc=160,en=4,er=class{constructor(e,t,o,r,i={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new P;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=Ee(-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={...Lc,...i},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,i=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:i,startAngle:Math.atan2(r,o),minDist:i,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},i={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(i.x,i.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?ha(r,i,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+i.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*Hc,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),i=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",h=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&h>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=kc&&(e.zoomActive=true),e.zoomActive)){let f=Math.log2(r/h);f!==0&&(this.tr.zoom=this.tr.zoom+f,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let f=Pc/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(ua(i,e.startAngle))>=f&&(e.rotateActive=true),e.rotateActive){let u=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=ua(i,u);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>Rc;)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,i=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,i);if(a<.05)return;a>en&&(r=r/a*en,i=i/a*en);let s=performance.now(),l=()=>{if(this.disposed)return;let c=performance.now(),h=Math.min(c-s,34);s=c;let f=Math.exp(-25e-4*h*10);if(r*=f,i*=f,Math.hypot(r,i)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let u={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*h,-i*h,u),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 Be=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let i=e.gl,a=i.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferData(i.ARRAY_BUFFER,t,r?i.DYNAMIC_DRAW:i.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);}},de=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);}},he=class{constructor(e,t,o){this.ctx=e;let r=e.gl,i=r.createVertexArray();if(!i)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=i,e.bindVAO(i);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 Oc=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],Ce=class{constructor(e,t,o,r,i={}){this.ctx=e;this.name=t;this.uniforms=new P;this.attribs=new P;let a=e.gl,s=zc(i),l=ma(a,a.VERTEX_SHADER,da(o,s),`${t}.vert`),c=ma(a,a.FRAGMENT_SHADER,da(r,s),`${t}.frag`),h=a.createProgram();if(!h)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(h,l),a.attachShader(h,c),Oc.forEach((f,u)=>a.bindAttribLocation(h,u,f)),a.linkProgram(h),a.detachShader(h,l),a.detachShader(h,c),a.deleteShader(l),a.deleteShader(c),!a.getProgramParameter(h,a.LINK_STATUS)){let f=a.getProgramInfoLog(h);throw a.deleteProgram(h),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${f}`)}this.program=h,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let i=e.getActiveUniform(this.program,r);if(!i)continue;let a=i.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,i.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(this.program,r);i&&this.attribs.set(i.name,e.getAttribLocation(this.program,i.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 i=this.loc(e);i&&this.ctx.gl.uniform3f(i,t,o,r);}setVec4(e,t,o,r,i){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,i);}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 zc(n){let e=[];for(let[t,o]of Object.entries(n))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
1
|
+
var OsmGL=(function(exports){'use strict';var _c=Object.defineProperty;var No=(n,e)=>()=>(n&&(e=n(n=0)),e);var Yi=(n,e)=>{for(var t in e)_c(n,t,{get:e[t],enumerable:true});};var Xh,Tl=No(()=>{Xh=(function(){var n="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FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(u){t=u.instance,t.exports.__wasm_call_ctors(),t.exports.meshopt_encodeVertexVersion(0),t.exports.meshopt_encodeIndexVersion(1);});function r(u){for(var d=new Uint8Array(u.length),m=0;m<u.length;++m){var p=u.charCodeAt(m);d[m]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,m=0;m<u.length;++m)d[b++]=d[m]<60?e[d[m]]:(d[m]-60)*64+d[++m];return d.buffer.slice(0,b)}function i(u){if(!u)throw new Error("Assertion failed")}function a(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function s(u,d,m){var p=t.exports.sbrk,b=p(u.length*4),g=p(d*4),y=new Uint8Array(t.exports.memory.buffer),A=a(u);y.set(A,b),m&&m(b,b,u.length,d);var B=t.exports.meshopt_optimizeVertexFetchRemap(g,b,u.length,d);y=new Uint8Array(t.exports.memory.buffer);var C=new Uint32Array(d);new Uint8Array(C.buffer).set(y.subarray(g,g+d*4)),A.set(y.subarray(b,b+u.length*4)),p(b-p(0));for(var v=0;v<u.length;++v)u[v]=C[u[v]];return [C,B]}function l(u,d,m,p,b){var g=t.exports.sbrk,y=g(d),A=g(p*b),B=new Uint8Array(t.exports.memory.buffer);B.set(a(m),A);var C=u(y,d,A,p,b),v=new Uint8Array(C);return v.set(B.subarray(y,y+C)),g(y-g(0)),v}function c(u){for(var d=0,m=0;m<u.length;++m){var p=u[m];d=d<p?p:d;}return d}function h(u,d){if(i(d==2||d==4),d==4)return new Uint32Array(u.buffer,u.byteOffset,u.byteLength/4);var m=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/2);return new Uint32Array(m)}function f(u,d,m,p,b,g){var y=t.exports.sbrk,A=y(m*p),B=y(m*g),C=new Uint8Array(t.exports.memory.buffer);C.set(a(d),B),u(A,m,p,b,B);var v=new Uint8Array(m*p);return v.set(C.subarray(A,A+m*p)),y(A-y(0)),v}return {ready:o,supported:true,reorderMesh:function(u,d,m){var p=d?m?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return s(u,c(u)+1,p)},encodeVertexBuffer:function(u,d,m){i(m>0&&m<=256),i(m%4==0);var p=t.exports.meshopt_encodeVertexBufferBound(d,m);return l(t.exports.meshopt_encodeVertexBuffer,p,u,d,m)},encodeIndexBuffer:function(u,d,m){i(m==2||m==4),i(d%3==0);var p=h(u,m),b=t.exports.meshopt_encodeIndexBufferBound(d,c(p)+1);return l(t.exports.meshopt_encodeIndexBuffer,b,p,d,4)},encodeIndexSequence:function(u,d,m){i(m==2||m==4);var p=h(u,m),b=t.exports.meshopt_encodeIndexSequenceBound(d,c(p)+1);return l(t.exports.meshopt_encodeIndexSequence,b,p,d,4)},encodeGltfBuffer:function(u,d,m,p){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return i(b[p]),b[p](u,d,m)},encodeFilterOct:function(u,d,m,p){return i(m==4||m==8),i(p>=1&&p<=16),f(t.exports.meshopt_encodeFilterOct,u,d,m,p,16)},encodeFilterQuat:function(u,d,m,p){return i(m==8),i(p>=4&&p<=16),f(t.exports.meshopt_encodeFilterQuat,u,d,m,p,16)},encodeFilterExp:function(u,d,m,p){return i(m>0&&m%4==0),i(p>=1&&p<=24),f(t.exports.meshopt_encodeFilterExp,u,d,m,p,m)}}})();});var jh,Hl=No(()=>{jh=(function(){var n="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",e="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",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),o=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var r=n;WebAssembly.validate(t)&&(r=e);var i,a=WebAssembly.instantiate(s(r),{}).then(function(f){i=f.instance,i.exports.__wasm_call_ctors();});function s(f){for(var u=new Uint8Array(f.length),d=0;d<f.length;++d){var m=f.charCodeAt(d);u[d]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62;}for(var p=0,d=0;d<f.length;++d)u[p++]=u[d]<60?o[u[d]]:(u[d]-60)*64+u[++d];return u.buffer.slice(0,p)}function l(f,u,d,m,p,b){var g=i.exports.sbrk,y=d+3&-4,A=g(y*m),B=g(p.length),C=new Uint8Array(i.exports.memory.buffer);C.set(p,B);var v=f(A,d,m,B,p.length);if(v==0&&b&&b(A,y,m),u.set(C.subarray(A,A+d*m)),g(A-g(0)),v!=0)throw new Error("Malformed buffer data: "+v)}var c={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return {ready:a,supported:true,decodeVertexBuffer:function(f,u,d,m,p){l(i.exports.meshopt_decodeVertexBuffer,f,u,d,m,i.exports[c[p]]);},decodeIndexBuffer:function(f,u,d,m){l(i.exports.meshopt_decodeIndexBuffer,f,u,d,m);},decodeIndexSequence:function(f,u,d,m){l(i.exports.meshopt_decodeIndexSequence,f,u,d,m);},decodeGltfBuffer:function(f,u,d,m,p,b){l(i.exports[h[p]],f,u,d,m,i.exports[c[b]]);}}})();});var Yh,kl=No(()=>{Yh=(function(){var n="B9h79tEBBBECd9gEUEU9gEUB9gBB9gQUUUUUUU99UUEU9gVUUUUUB9gLUUUUE999gIUUUE999gLUUUUEU9gIUUUEUIMXDILVORBWWBEWLVE9wEIIVIEBEOWEUECJ/JEKR7OO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BBZ9tw79o9v9wT9f79p9t9w29p9m95BEx9tw79o9v9wT9f79p9t9w29p9m959T9j9h2wBLA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBVL79iv9rBOdWEBCEKDdQQ+stXDBK/48yIkUp99hU8jJJJJBCJ/BB9rGQ8kJJJJBAQCkFCBC/kBZ1JJJB8aCUALCDTGKALCffffI0eGXCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQAMbDWAQApCEFbD94AXCBYD/s1JJBhJJJJBBHSAQCkFAQYD94GpCDTFASbDBAQASbDXAQApCEFbD94CUADCITADCffffE0eCBYD/s1JJBhJJJJBBHZAQCkFAQYD94GpCDTFAZbDBAQAZbDZAQApCEFbD94AQCWFAEADALCBZ+CJJJBAXCBYD/s1JJBhJJJJBBHhAQCkFAQYD94GpCDTFAhbDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHoAQCkFAQYD94GpCDTFAobDBAQApCEFbD94ALCD4ALFHaCEHcINAcGpCETHcApAa6MBKCBHxCUApCDTGaApCffffI0eCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94AcCfEAaZ1JJJBHlDNALtMBAVCD4HkApCUFHqINAIAxAk2CDTFGyYDLGpCh4Ap7C+f+B+dd2AyYDBGpCh4Ap7C/d/o+b8j27AyYDWGpCh4Ap7C+3f/n8n27HaCBHpDNDNINAlAaAqgGaCDTFG8aYDBGcCUsMEAIAcAk2CDTFAyCXZ+LJJJBtMDApCEFGpAaFHaApAq9NMBXDKKA8aAxbDBAxHcKAhAxCDTFAcbDBAxCEFGxAL9HMBKCBHpAoHcINAcApbDBAcCLFHcALApCEFGp9HMBKCBHpAhHcAoHaINDNApAcYDBGqsMBAaAoAqCDTFGqYDBbDBAqApbDBKAcCLFHcAaCLFHaALApCEFGp9HMBKKCBHaALCBYD/s1JJBhJJJJBBHyAQCkFAQYD94GpCDTFAybDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GcCDTFApbDBAQAcCEFbD94AXCBYD/s1JJBhJJJJBBHcAQCkFAQYD94GqCDTFAcbDBAQAqCEFbD94ApCfEAKZ1JJJBHeAcCfEAKZ1JJJBH3DNALtMBAZCWFH5INDNAMAaCDTGpFYDBG8etMBAZASApFYDBCITFH8fA3ApFHAAeApFHxCBHkINDNDNA8fAkCITFYDBGlAa9HMBAxAabDBAAAabDBXEKDNAMAlCDTGKFYDBGHtMBAZASAKFYDBCITGpFYDBAasMEAHCUFH8aA5ApFHcCBHpINA8aApsMEApCEFHpAcYDBHqAcCWFHcAqAa9HMBKApAH6MEKA3AKFGpAaAlApYDBCUsebDBAxAlAaAxYDBCUsebDBKAkCEFGkA8e9HMBKKAaCEFGaAL9HMBKAhHcAoHaA3HqAeHkCBHpINDNDNApAcYDBG8a9HMBDNApAaYDBG8a9HMBAkYDBH8aDNAqYDBGlCU9HMBA8aCU9HMBAyApFCB86BBXIKAyApFHxDNApAlsMBApA8asMBAxCE86BBXIKAxCL86BBXDKDNApAoA8aCDTGlFYDB9HMBDNAqYDBGxCUsMBApAxsMBAkYDBGKCUsMBApAKsMBA3AlFYDBG8eCUsMBA8eA8asMBAeAlFYDBGlCUsMBAlA8asMBDNAhAxCDTFYDBAhAlCDTFYDB9HMBAhAKCDTFYDBAhA8eCDTFYDB9HMBAyApFCD86BBXLKAyApFCL86BBXIKAyApFCL86BBXDKAyApFCL86BBXEKAyApFAyA8aFrBB86BBKAcCLFHcAaCLFHaAqCLFHqAkCLFHkALApCEFGp9HMBKAWCEgtMBAyHpALHcINDNAprBBCE9HMBApCL86BBKApCEFHpAcCUFGcMBKKCBHkCUALCX2ALC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHMAQCkFAQYD94GpCDTFAMbDBAQApCEFbD94AMAIALAVZ+DJJJB8aCUALC8s2GcALC/d/o/F8u0eCBYD/s1JJBhJJJJBBHpAQCkFAQYD94GaCDTFApbDBAQAaCEFbD94ApCBAcZ1JJJBHZDNADtMBAEHcINDNAMAcCLFYDBG8aCX2FGpiDBAMAcYDBGlCX2FGaiDBGG+TG8jAMAcCWFYDBGxCX2FGqCLFiDBAaCLFiDBG8k+TG8lnAqiDBAG+TG8mApCLFiDBA8k+TG8nn+TGYAYnA8nAqCWFiDBAaCWFiDBG8p+TGinA8lApCWFiDBA8p+TG8nn+TG8lA8lnA8nA8mnAiA8jn+TG8jA8jnmm+RG8mjBBBB9etMBAYA8m+VHYA8jA8m+VH8jA8lA8m+VH8lKAZAhAlCDTFYDBC8s2FGpA8lA8m+RG8mA8lnnG8nApiDBmuDBApA8jA8mA8jnG8rnGiApiDLmuDLApAYA8mAYnG8snGrApiDWmuDWApA8rA8lnG8rApiDXmuDXApA8sA8lnG8uApiDZmuDZApA8sA8jnG8sApiDcmuDcApA8lA8mAYA8pnA8lAGnA8kA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApAYAGnGYApiDAmuDAApAGA8knGGApiD8kmuD8kApA8mApiDYmuDYAZAhA8aCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAZAhAxCDTFYDBC8s2FGpA8nApiDBmuDBApAiApiDLmuDLApArApiDWmuDWApA8rApiDXmuDXApA8uApiDZmuDZApA8sApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApAYApiDAmuDAApAGApiD8kmuD8kApA8mApiDYmuDYAcCXFHcAkCIFGkAD6MBKCBH8aAEHxINCBHcINAyAEAcC+81JJBFYDBGlA8aFCDTFYDBGaFrBBHpDNDNAyAxAcFYDBGqFrBBGkC99FCfEgCPE0MBApCEsMBApCD9HMEKDNAkCUFCfEgCE0MBAeAqCDTFYDBAa9HMEKDNApCUFCfEgCE0MBA3AaCDTFYDBAq9HMEKDNAkCV2ApFC+g1JJBFrBBtMBAhAaCDTFYDBAhAqCDTFYDB0MEKjBBACjBBJzApCEseH8mAkCEsHKAEAlCDTC+81JJBFYDBA8aFCDTFYDBHlDNAMAaCX2FGpCWFiDBAMAqCX2FGkCWFiDBG8k+TG8lA8lnApiDBAkiDBG8p+TG8jA8jnApCLFiDBAkCLFiDBG8n+TGYAYnmm+RGGjBBBB9etMBA8lAG+VH8lAYAG+VHYA8jAG+VH8jKjBBACA8mAKeH8sDNAMAlCX2FGpiDWA8k+TG8mA8lA8mA8lnApiDBA8p+TGrA8jnAYApiDLA8n+TG8rnmmGin+TG8mA8mnArA8jAin+TG8lA8lnA8rAYAin+TG8jA8jnmm+RGYjBBBB9etMBA8mAY+VH8mA8jAY+VH8jA8lAY+VH8lKAZAhAqCDTFYDBC8s2FGpA8lA8sAGnGYA8lnnGiApiDBmuDBApA8jAYA8jnG8snGrApiDLmuDLApA8mAYA8mnGGnG8rApiDWmuDWApA8sA8lnG8sApiDXmuDXApAGA8lnG8uApiDZmuDZApAGA8jnG8vApiDcmuDcApA8lAYA8mA8knA8lA8pnA8nA8jnmm+MG8knGGnG8lApiDkmuDkApA8jAGnG8jApiD3muD3ApA8mAGnG8mApiDAmuDAApAGA8knGGApiD8kmuD8kApAYApiDYmuDYAZAhAaCDTFYDBC8s2FGpAiApiDBmuDBApArApiDLmuDLApA8rApiDWmuDWApA8sApiDXmuDXApA8uApiDZmuDZApA8vApiDcmuDcApA8lApiDkmuDkApA8jApiD3muD3ApA8mApiDAmuDAApAGApiD8kmuD8kApAYApiDYmuDYKAcCLFGcCX9HMBKAxCXFHxA8aCIFG8aAD6MBKKDNABAEsMBABAEADCDTZ+HJJJB8aKCUADCX2ADC/V+q/V+qE0eCBYD/s1JJBhJJJJBBHAAQCkFAQYD94GpCDTFAAbDBAQApCEFbD94CUADCDTADCffffI0eCBYD/s1JJBhJJJJBBH5AQCkFAQYD94GpCDTFA5bDBAQApCEFbD94AXCBYD/s1JJBhJJJJBBHIAQCkFAQYD94GpCDTFAIbDBAQApCEFbD94ALCBYD/s1JJBhJJJJBBH8wAQCkFAQYD94GpCDTFA8wbDBAQApCEFbD94jBBBBHrDNADAO9NMBARARnH8sAACWFH8xAQYDZH8yAQYDXH8zAQYDWH80jBBBBHrINAQCWFABADGSALAhZ+CJJJBCBHHABHxCBHKINCBHpINDNAhAxApFYDBGaCDTGEFYDBGkAhABApC+81JJBFYDBAKFCDTFYDBGcCDTFYDBG8asMBAyAcFrBBGlCV2AyAaFrBBGqFC/Q1JJBFrBBGDAqCV2AlFG8eC/Q1JJBFrBBG8fvCfEgtMBDNA8eC+g1JJBFrBBtMBA8aAk0MEKDNAqAl9HMBAqCUFCfEgCE0MBAeAEFYDBAc9HMEKAAAHCX2FGqAcAaA8fCfEgGkebDLAqAaAcAkebDBAqADA8fgCfEgCB9HbDWAHCEFHHKApCLFGpCX9HMBKAxCXFHxAKCIFGKAS6MBKDNDNAHtMBAAHcAHH8aINAcCWFGljBBBBjBBJzAZAhAcYDBGaCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAcCLFGEYDBGqCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnGYjBBBBjBBJzAZAhAqAaAlYDBGkeGlCDTFYDBC8s2FGpiDYG8l+VA8ljBBBB9beApiDWAMAaAqAkeGxCX2FGkCWFiDBG8lnApiDZAkiDBG8jnApiDAmG8mA8mmmA8lnApiDLAkCLFiDBG8mnApiDcA8lnApiD3mG8lA8lmmA8mnApiDBA8jnApiDXA8mnApiDkmG8lA8lmmA8jnApiD8kmmm+LnG8lAYA8l9fGpeuDBAEAqAxApebDBAcAaAlApebDBAcCXFHcA8aCUFG8aMBKAQCJEFCBCJ/ABZ1JJJB8aA8xHpAHHcINAQCJEFApYDBCo4C/8zgFGaAaYDBCEFbDBApCXFHpAcCUFGcMBKCBHpCBHcINAQCJEFApFGaYDBHqAaAcbDBAqAcFHcApCLFGpCJ/AB9HMBKCBHpA8xHcINAQCJEFAcYDBCo4C/8zgFGaAaYDBGaCEFbDBA5AaCDTFApbDBAcCXFHcAHApCEFGp9HMBKASAO9rGaCI9uH81DNALtMBCBHpAIHcINAcApbDBAcCLFHcALApCEFGp9HMBKKCBHbA8wCBALZ1JJJBH83AaCo9uHuA81CE4H85CBH86CBHKDNINAAA5AKCDTFYDBCX2FGxiDWG8jA8s9eMEA86A819PMEjffUUH8lDNA85AH9PMBAAA5A85CDTFYDBCX2FiDWjBB/AznH8lKDNA8jA8l9etMBA86Au0MDKDNA83AhAxYDLG87CDTG88FYDBGaFG89rBBA83AhAxYDBGECDTG8+FYDBGzFGNrBBvMBDNA80AzCDTGpFYDBGqtMBA8yA8zApFYDBCITFHpAMAaCX2FG8eCWFHDA8eCLFHXAMAzCX2FG8fCWFHVA8fCLFHWCBHcCEHlDNINDNAIApYDBCDTFYDBGkAasMBAIApCLFYDBCDTFYDBG8aAasMBAMA8aCX2FG8aiDBAMAkCX2FGkiDBG8m+TG8lAWiDBAkCLFiDBGY+TGGnA8fiDBA8m+TG8kA8aCLFiDBAY+TG8jn+TA8lAXiDBAY+TG8pnA8eiDBA8m+TG8nA8jn+TnA8jAViDBAkCWFiDBGY+TGinAGA8aCWFiDBAY+TG8mn+TA8jADiDBAY+TGYnA8pA8mn+TnA8mA8knAiA8ln+TA8mA8nnAYA8ln+TnmmjBBBB9dMDKApCWFHpAcCEFGcAq6HlAqAc9HMBKKAlCEgtMBA85CEFH85XEKAxCWFHqAZAaC8s2FGpAZAzC8s2FGciDBApiDBmuDBApAciDLApiDLmuDLApAciDWApiDWmuDWApAciDXApiDXmuDXApAciDZApiDZmuDZApAciDcApiDcmuDcApAciDkApiDkmuDkApAciD3ApiD3muD3ApAciDAApiDAmuDAApAciD8kApiD8kmuD8kApAciDYApiDYmuDYDNDNDNDNAyAEFGcrBBC9+FpDEBDKAEHpINAIApCDTGpFAabDBAoApFYDBGpAE9HMBXIKKAoA88FYDBHpAoA8+FYDBHEAIA8+FA87bDBApH87KAIAECDTFA87bDBKANCE86BBA89CE86BBAqiDBG8lArArA8l9deHrAbCEFHbCECDAcrBBCEseA86FH86KAKCEFGKAH9HMBKKAbtMBDNALtMBCBHcAeHpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBAeAqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKCBHcA3HpINDNApYDBGaCUsMBDNAcAIAaCDTGqFYDBGa9HMBA3AqFYDBHaKApAabDBKApCLFHpALAcCEFGc9HMBKKCBHDABHpCBHkINDNAIApYDBCDTFYDBGcAIApCLFYDBCDTFYDBGasMBAcAIApCWFYDBCDTFYDBGqsMBAaAqsMBABADCDTFG8aAcbDBA8aCLFAabDBA8aCWFAqbDBADCIFHDKApCXFHpAkCIFGkAS9PMDXBKKASHDXDKADAO0MBKKDNAdtMBAdAr+RuDBKAQYD94GpCDTAQCkFFC98FHhDNINAptMEAhYDBCBYD/w1JJBh+BJJJBBAhC98FHhApCUFHpXBKKAQCJ/BBF8kJJJJBADK/PLEOUABYDBCBAICDTZ1JJJB8aADCI9uHVDNADtMBABYDBHODNALtMBAEHRADHWINAOALARYDBCDTFYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBXDKKAEHRADHWINAOARYDBCDTFGdAdYDBCEFbDBARCLFHRAWCUFGWMBKKDNAItMBABYDBHRABYDLHWCBHdAIHOINAWAdbDBAWCLFHWARYDBAdFHdARCLFHRAOCUFGOMBKKDNADCI6MBAVCEAVCE0eHQABYDLHVABYDWHRINAECWFYDBHWAECLFYDBHdAEYDBHODNALtMBALAWCDTFYDBHWALAdCDTFYDBHdALAOCDTFYDBHOKARAVAOCDTFGDYDBCITFAdbDBARADYDBCITFAWbDLADADYDBCEFbDBARAVAdCDTFGDYDBCITFAWbDBARADYDBCITFAObDLADADYDBCEFbDBARAVAWCDTFGWYDBCITFAObDBARAWYDBCITFAdbDLAWAWYDBCEFbDBAECXFHEAQCUFGQMBKKDNAItMBABYDLHRABYDBHWINARARYDBAWYDB9rbDBAWCLFHWARCLFHRAICUFGIMBKKK+3LDOUV998jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNADtMBAICD4HVDNABtMBAVCDTHOCBHRAEHWINABARCX2FGIAEARAV2CDTFGdiDBuDBAIAdiDLuDLAIAdiDWuDWCBHIINALCZFAIFGdAWAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAWAOFHWARCEFGRAD9HMBXDKKAVCDTHRCBHWINCBHIINALCZFAIFGdAEAIFiDBGQAdiDBGKAKAQ9eeuDBALAIFGdAQAdiDBGKAKAQ9deuDBAICLFGICX9HMBKAEARFHEAWCEFGWAD9HMBKKALiDBALiDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(u){t=u.instance,t.exports.__wasm_call_ctors();});function r(u){for(var d=new Uint8Array(u.length),m=0;m<u.length;++m){var p=u.charCodeAt(m);d[m]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,m=0;m<u.length;++m)d[b++]=d[m]<60?e[d[m]]:(d[m]-60)*64+d[++m];return d.buffer.slice(0,b)}function i(u){if(!u)throw new Error("Assertion failed")}function a(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function s(u,d){var m=t.exports.sbrk,p=m(u.length*4),b=m(d*4),g=new Uint8Array(t.exports.memory.buffer),y=a(u);g.set(y,p);var A=t.exports.meshopt_optimizeVertexFetchRemap(b,p,u.length,d);g=new Uint8Array(t.exports.memory.buffer);var B=new Uint32Array(d);new Uint8Array(B.buffer).set(g.subarray(b,b+d*4)),y.set(g.subarray(p,p+u.length*4)),m(p-m(0));for(var C=0;C<u.length;++C)u[C]=B[u[C]];return [B,A]}function l(u){for(var d=0,m=0;m<u.length;++m){var p=u[m];d=d<p?p:d;}return d}function c(u,d,m,p,b,g,y,A,B){var C=t.exports.sbrk,v=C(4),_=C(m*4),w=C(b*g),x=C(m*4),E=new Uint8Array(t.exports.memory.buffer);E.set(a(p),w),E.set(a(d),x);var F=u(_,x,m,w,b,g,y,A,B,v);E=new Uint8Array(t.exports.memory.buffer);var M=new Uint32Array(F);a(M).set(E.subarray(_,_+F*4));var D=new Float32Array(1);return a(D).set(E.subarray(v,v+4)),C(v-C(0)),[M,D[0]]}function h(u,d,m,p){var b=t.exports.sbrk,g=b(m*p),y=new Uint8Array(t.exports.memory.buffer);y.set(a(d),g);var A=u(g,m,p);return b(g-b(0)),A}var f={LockBorder:1};return {ready:o,supported:true,compactMesh:function(u){i(u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),i(u.length%3==0);var d=u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return s(d,l(u)+1)},simplify:function(u,d,m,p,b,g){i(u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),i(u.length%3==0),i(d instanceof Float32Array),i(d.length%m==0),i(m>=3),i(p%3==0);for(var y=0,A=0;A<(g?g.length:0);++A)y|=f[g[A]];var B=u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u),C=c(t.exports.meshopt_simplify,B,u.length,d,d.length,m*4,p,b,y);return C[0]=u instanceof Uint32Array?C[0]:new u.constructor(C[0]),C},getScale:function(u,d){return i(u instanceof Float32Array),i(u.length%d==0),h(t.exports.meshopt_simplifyScale,u,u.length,d*4)}}})();});var Pl={};Yi(Pl,{MeshoptDecoder:()=>jh,MeshoptEncoder:()=>Xh,MeshoptSimplifier:()=>Yh});var Rl=No(()=>{Tl();Hl();kl();});var k=Map,te=Set;var tt=class{constructor(){this.listeners=new k;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new te),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(i){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:`,i);}return this}removeAllListeners(){this.listeners.clear();}};var Ee=(n,e,t)=>n<e?e:n>t?t:n;var Oe=n=>n*Math.PI/180,Zi=n=>n*180/Math.PI;function xt(n){let e=((n+180)%360+360)%360-180;return e===-180?180:e}var Ko=n=>1-Math.pow(1-n,3);function pe(n){let e=n.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(i=>parseInt(i+i,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 i=0;i<o.length;i+=2)r.push(parseInt(o.slice(i,i+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 Fe(n){return [n[0]*n[3],n[1]*n[3],n[2]*n[3],n[3]]}var Uo=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 k;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=Ec(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 i=this._viewport;i[0]===e&&i[1]===t&&i[2]===o&&i[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,i=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),i|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),i|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),i|=r.STENCIL_BUFFER_BIT),i&&r.clear(i);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function Ec(n){let e=n.getExtension("EXT_texture_filter_anisotropic")??n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=n.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),maxVertexAttribs:n.getParameter(n.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!n.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?n.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!n.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(n.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var ht=512,Jo=40075016686e-3,Qi=85.051129;function re(n){return Array.isArray(n)?{lng:n[0],lat:n[1]}:n}var ot=n=>512*Math.pow(2,n),Xo=n=>Math.max(-Qi,Math.min(Qi,n));function ce(n){return (180+n)/360}function fe(n){let e=Xo(n);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Le(n){return n*360-180}function De(n){let e=180-n*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function ze(n){return Jo*Math.cos(n*Math.PI/180)}function Jr(n,e){return n/ze(e)}function zm(n,e){return n*ze(e)}function Vm(n,e){return Jr(1,n)*ot(e)}function Wm(n,e){return ze(n)/ot(e)}function qi(n,e){let t=Math.pow(2,n);return ze(De((e+.5)/t))/t}function jo(n){return Jo/Math.pow(2,n)}function $i(n,e,t){let o=jo(n),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Zt=class n{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 n;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof n)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=re(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=re(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:ce(this.west),maxX:ce(this.east),minY:fe(this.north),maxY:fe(this.south)}}};function Xr(n,e){if(n.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,ea),r=Math.max(e.height-t.top-t.bottom,ea),i=n.toMercator(),a=e.bearing??0,s=-a*Math.PI/180,l=Math.cos(s),c=Math.sin(s),h=(i.minX+i.maxX)/2,f=(i.minY+i.maxY)/2,u=0,d=0;for(let[A,B]of [[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]){let C=(A-h)*l-(B-f)*c,v=(A-h)*c+(B-f)*l;u=Math.max(u,Math.abs(C)*2),d=Math.max(d,Math.abs(v)*2);}let m=Math.min(o/Math.max(u,1e-12),r/Math.max(d,1e-12)),p=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),b=ot(p),g=(t.left-t.right)/2/b,y=(t.top-t.bottom)/2/b;return {center:{lng:Le(h-(g*l+y*c)),lat:De(f-(-g*c+y*l))},zoom:p,bearing:a}}var ea=32;function K(){let n=new Float64Array(16);return n[0]=n[5]=n[10]=n[15]=1,n}function Ze(n){return n.fill(0),n[0]=n[5]=n[10]=n[15]=1,n}function Me(n,e,t){let o=e[0],r=e[1],i=e[2],a=e[3],s=e[4],l=e[5],c=e[6],h=e[7],f=e[8],u=e[9],d=e[10],m=e[11],p=e[12],b=e[13],g=e[14],y=e[15];for(let A=0;A<4;A++){let B=t[A*4],C=t[A*4+1],v=t[A*4+2],_=t[A*4+3];n[A*4]=B*o+C*s+v*f+_*p,n[A*4+1]=B*r+C*l+v*u+_*b,n[A*4+2]=B*i+C*c+v*d+_*g,n[A*4+3]=B*a+C*h+v*m+_*y;}return n}function Ke(n,e,t,o,r){return n!==e&&n.set(e),n[12]=e[0]*t+e[4]*o+e[8]*r+e[12],n[13]=e[1]*t+e[5]*o+e[9]*r+e[13],n[14]=e[2]*t+e[6]*o+e[10]*r+e[14],n[15]=e[3]*t+e[7]*o+e[11]*r+e[15],n}function Ve(n,e,t,o,r){for(let i=0;i<4;i++)n[i]=e[i]*t,n[4+i]=e[4+i]*o,n[8+i]=e[8+i]*r,n[12+i]=e[12+i];return n}function Yr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[4],a=e[5],s=e[6],l=e[7],c=e[8],h=e[9],f=e[10],u=e[11];return n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=i*r+c*o,n[5]=a*r+h*o,n[6]=s*r+f*o,n[7]=l*r+u*o,n[8]=c*r-i*o,n[9]=h*r-a*o,n[10]=f*r-s*o,n[11]=u*r-l*o,n}function Zr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[0],a=e[1],s=e[2],l=e[3],c=e[4],h=e[5],f=e[6],u=e[7];return n!==e&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=i*r+c*o,n[1]=a*r+h*o,n[2]=s*r+f*o,n[3]=l*r+u*o,n[4]=c*r-i*o,n[5]=h*r-a*o,n[6]=f*r-s*o,n[7]=u*r-l*o,n}function oa(n,e,t,o,r){let i=1/Math.tan(e/2);return n.fill(0),n[0]=i/t,n[5]=i,n[11]=-1,n[10]=(r+o)/(o-r),n[14]=2*r*o/(o-r),n}function ra(n,e,t,o,r,i,a){let s=1/(e-t),l=1/(o-r),c=1/(i-a);return n.fill(0),n[0]=-2*s,n[5]=-2*l,n[10]=2*c,n[12]=(e+t)*s,n[13]=(r+o)*l,n[14]=(a+i)*c,n[15]=1,n}function Ue(n,e){let t=e[0],o=e[1],r=e[2],i=e[3],a=e[4],s=e[5],l=e[6],c=e[7],h=e[8],f=e[9],u=e[10],d=e[11],m=e[12],p=e[13],b=e[14],g=e[15],y=t*s-o*a,A=t*l-r*a,B=t*c-i*a,C=o*l-r*s,v=o*c-i*s,_=r*c-i*l,w=h*p-f*m,x=h*b-u*m,E=h*g-d*m,F=f*b-u*p,M=f*g-d*p,D=u*g-d*b,L=y*D-A*M+B*F+C*E-v*x+_*w;return L?(L=1/L,n[0]=(s*D-l*M+c*F)*L,n[1]=(r*M-o*D-i*F)*L,n[2]=(p*_-b*v+g*C)*L,n[3]=(u*v-f*_-d*C)*L,n[4]=(l*E-a*D-c*x)*L,n[5]=(t*D-r*E+i*x)*L,n[6]=(b*B-m*_-g*A)*L,n[7]=(h*_-u*B+d*A)*L,n[8]=(a*M-s*E+c*w)*L,n[9]=(o*E-t*M-i*w)*L,n[10]=(m*v-p*B+g*y)*L,n[11]=(f*B-h*v-d*y)*L,n[12]=(s*x-a*F-l*w)*L,n[13]=(t*F-o*x+r*w)*L,n[14]=(p*A-m*C-b*y)*L,n[15]=(h*C-f*A+u*y)*L,n):null}function be(n,e,t){let[o,r,i,a]=t;return n[0]=e[0]*o+e[4]*r+e[8]*i+e[12]*a,n[1]=e[1]*o+e[5]*r+e[9]*i+e[13]*a,n[2]=e[2]*o+e[6]*r+e[10]*i+e[14]*a,n[3]=e[3]*o+e[7]*r+e[11]*i+e[15]*a,n}function Qe(n,e){for(let t=0;t<16;t++)n[t]=e[t];return n}function Yo(n){let e=Math.hypot(n[0],n[1],n[2])||1;return [n[0]/e,n[1]/e,n[2]/e]}function ta(n,e){return [n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function Mc(n,e){return [n[0]-e[0],n[1]-e[1],n[2]-e[2]]}function jr(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function na(n,e,t,o){let r=Yo(Mc(t,e)),i=Yo(ta(r,o)),a=ta(i,r);return n[0]=i[0],n[1]=a[0],n[2]=-r[0],n[3]=0,n[4]=i[1],n[5]=a[1],n[6]=-r[1],n[7]=0,n[8]=i[2],n[9]=a[2],n[10]=-r[2],n[11]=0,n[12]=-jr(i,e),n[13]=-jr(a,e),n[14]=jr(r,e),n[15]=1,n}var Qt=60,Zo=4.5,dt=6,Qo=n=>n/(2*Math.PI);function qo(n){if(n<=Zo)return 0;if(n>=dt)return 1;let e=(n-Zo)/(dt-Zo);return e*e*(3-2*e)}function $o(n,e){let t=n*Math.PI/180,o=Xo(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Qr(n){let e=Math.hypot(n[0],n[1],n[2])||1,t=n[0]/e,o=n[1]/e,r=n[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function Fc(n,e){return $o(Le(n),De(e))}function qr(n,e){let t=n*Math.PI/180,o=Xo(e)*Math.PI/180,r=Math.cos(o),i=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[i*Math.sin(t),r,i*Math.cos(t)],up:[r*Math.sin(t),-i,r*Math.cos(t)]}}function ia(n,e,t){let o=n[0]*e,r=n[1]*e,i=n[2]*e;return [o*t.east[0]+r*t.east[1]+i*t.east[2],o*t.south[0]+r*t.south[1]+i*t.south[2],o*t.up[0]+r*t.up[1]+i*t.up[2]-e]}function Dc(n,e,t,o,r){let i=n-t;return i>.5&&(i-=1),i<-0.5&&(i+=1),[i*r,(e-o)*r,0]}function aa(n,e,t,o,r,i,a,s){let l=ia(Fc(n,e),r,a);if(s<=0)return l;let c=Dc(n,e,t,o,i);return [l[0]+(c[0]-l[0])*s,l[1]+(c[1]-l[1])*s,l[2]+(c[2]-l[2])*s]}function $r(n,e,t){let o=n[0]*e[0]+n[1]*e[1]+n[2]*e[2],r=n[0]**2+n[1]**2+n[2]**2-t*t,i=o*o-r;if(i<0)return null;let a=-o-Math.sqrt(i);return a<0?null:[n[0]+e[0]*a,n[1]+e[1]*a,n[2]+e[2]*a]}var sa=1e3,Sc=2,la=84,Ic=.42,qt=class n{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=Oe(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=K();this._viewProjPx=K();this._viewMatrix=K();this._pixelMatrix=K();this._pixelMatrixInverse=K();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=K();this._localView=K();this._localProj=K();this._localPixel=K();this._localPixelInverse=K();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=K();this._shadowView=K();this._shadowProj=K();this._shadowVP=K();this._shadowVPm=K();this._shadowTile=K();this._shadowObject=K();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=Ic*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=Ee(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=xt(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<dt?Math.min(this.maxPitch,Qt):this.maxPitch,o=Ee(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Zi(this._fov)}set fov(e){let t=Oe(Ee(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 n;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(ce(e.lng),fe(e.lat));a[2]+=t*this._pixelsPerMeter;let s=this.localToPoint(a);if(s)return s}let o=[ce(e.lng)*this._worldSize,fe(e.lat)*this._worldSize,t,1],r=[0,0,0,0];be(r,this._pixelMatrix,o);let i=r[3]||1e-9;return {x:r[0]/i,y:r[1]/i}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let i=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Le(e/this._worldSize),lat:De(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(i[2]+=o*this._pixelsPerMeter,this.localToPoint(i)):null}let r=[0,0,0,0];return be(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:Le(t.x/this._worldSize),lat:De(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];be(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),be(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},s={x:o[0]/i,y:o[1]/i,z:o[2]/i},l=s.z-a.z,c=Math.abs(l)<1e-9?1:(0-a.z)/l,h=Ee(c,-1e6,1e6);return {x:a.x+(s.x-a.x)*h,y:a.y+(s.y-a.y)*h}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let s=this.globeUnproject(t);if(!s)return;let l=xt(this._center.lng+(e.lng-s.lng)),c=Ee(this._center.lat+(e.lat-s.lat),-la,la);this._center={lng:l,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ce(e.lng)*this._worldSize,y:fe(e.lat)*this._worldSize},i=r.x-o.x,a=r.y-o.y;this._center={lng:Le((this._centerX+i)/this._worldSize),lat:De((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,i=this._tileMatrix;return Ke(i,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(i,i,r,r,1),Qe(this._f32,i)}tileMatrix64(e,t,o=K()){this._ensure();let r=e.bounds(),i=(r.maxX-r.minX)*this._worldSize/t;return Ke(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ve(o,o,i,i,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ke(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Qe(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Oe(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Oe(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<dt}get globeFlatMix(){return this._ensure(),qo(this._zoom)}get globeRadiusPx(){return this._ensure(),Qo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=K();if(!Ue(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],i=t[14]+e,a=Math.hypot(o,r,i)||1;return {dir:[o/a,r/a,i/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,i])=>{let a=[0,0,0,0],s=[0,0,0,0];be(a,this._localPixelInverse,[r,i,0,1]),be(s,this._localPixelInverse,[r,i,1,1]);let l=a[3]||1e-9,c=s[3]||1e-9,h=s[0]/c-a[0]/l,f=s[1]/c-a[1]/l,u=s[2]/c-a[2]/l,d=Math.hypot(h,f,u)||1;return [h/d,f/d,u/d]})}cameraRay(){this._ensure();let e=Oe(this._pitch),t=Oe(this._bearing),o=Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t);return {right:[a,i,0],up:[i*r,-a*r,o],fwd:[i*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(),Qe(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),aa(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,qo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return be(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];be(t,this._localPixelInverse,[e.x,e.y,0,1]),be(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a=this.globeRadiusPx,s=[t[0]/r,t[1]/r,t[2]/r+a],l=[o[0]/i-s[0],o[1]/i-s[1],o[2]/i+a-s[2]],c=Math.hypot(l[0],l[1],l[2])||1,h=[l[0]/c,l[1]/c,l[2]/c],f=$r(s,h,a);if(!f)return null;let u=this._globeBasis,d=[f[0]/a,f[1]/a,f[2]/a],m=[d[0]*u.east[0]+d[1]*u.south[0]+d[2]*u.up[0],d[0]*u.east[1]+d[1]*u.south[1]+d[2]*u.up[1],d[0]*u.east[2]+d[1]*u.south[2]+d[2]*u.up[2]];return Qr(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),i=this._globeBasis,a=$o(e,t),s=[a[0]*i.east[0]+a[1]*i.east[1]+a[2]*i.east[2],a[0]*i.south[0]+a[1]*i.south[1]+a[2]*i.south[2],a[0]*i.up[0]+a[1]*i.up[1]+a[2]*i.up[2]];return s[0]*r.dir[0]+s[1]*r.dir[1]+s[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*Sc,r=K();if(!Ue(r,this._viewProjPx))return;let i=this._cameraPosPx,a=[],s=[0,0,0,0];for(let C of [-1,1])for(let v of [-1,1])for(let _ of [-1,1]){if(be(s,r,[C,v,_,1]),s[3]===0)continue;let w=s[0]/s[3],x=s[1]/s[3],E=w-i[0],F=x-i[1],M=Math.hypot(E,F);if(M>o){let D=o/M;w=i[0]+E*D,x=i[1]+F*D;}a.push({x:w,y:x,z:0});}if(!a.length)return;let l=Yo(e),c=Math.abs(l[2])>.999?[0,1,0]:[0,0,1],h=this._shadowView;na(h,[this._centerX,this._centerY,0],[this._centerX+l[0],this._centerY+l[1],l[2]],c);let f=Math.min(t*this._pixelsPerMeter,o),u=1/0,d=1/0,m=1/0,p=-1/0,b=-1/0,g=-1/0,y=[0,0,0,0];for(let C of a)for(let v of [0,f])be(y,h,[C.x,C.y,v,1]),y[0]<u&&(u=y[0]),y[0]>p&&(p=y[0]),y[1]<d&&(d=y[1]),y[1]>b&&(b=y[1]),y[2]<m&&(m=y[2]),y[2]>g&&(g=y[2]);let A=f+1,B=this._shadowProj;ra(B,u,p,d,b,-g-A,-m+A),Me(this._shadowVP,B,h),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 Ke(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ve(r,r,this._worldSize,this._worldSize,1),Qe(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,i=this._shadowTile;return Ke(i,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ve(i,i,r,r,1),Qe(this._shadowTile32,i)}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,i=t.minY*this._worldSize,a=t.maxY*this._worldSize,s=sa*this._pixelsPerMeter;for(let l of this._frustumPlanes){let c=l[0]>0?r:o,h=l[1]>0?a:i,f=l[2]>0?s:0;if(l[0]*c+l[1]*h+l[2]*f+l[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let i=e*this._worldSize,a=t*this._worldSize,s=o*this._pixelsPerMeter,l=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*i+c[1]*a+c[2]*s+c[3]<-l)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,i]=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-i,0,i-sa*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=ot(this._zoom);this._worldSize=e,this._pixelsPerMeter=Jr(1,this._center.lat)*e,this._centerX=ce(this._center.lng)*e,this._centerY=fe(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Oe(this._pitch),i=-Oe(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(Ee(Math.PI-s-l,.01,Math.PI-.01)),h=Math.cos(Math.PI/2-r)*c+a,f=Math.min(h*1.01,a*30),u=o/50;if(this.projection==="globe"&&this._zoom<dt){let y=Qo(e);u=Math.max(a-y*1.6,a*.02),f=a+y*2.4;}let d=this._viewMatrix;Ve(d,K(),1,-1,1),Ke(d,d,0,0,-a),Yr(d,d,r),Zr(d,d,i),Ke(d,d,-this._centerX,-this._centerY,0);let m=K();oa(m,this._fov,t/o,u,f),Me(this._viewProjPx,m,d);let p=K();Ve(p,d,1,1,this._pixelsPerMeter),Me(this._projMatrix,m,p);let b=this._localView;Ve(b,K(),1,-1,1),Ke(b,b,0,0,-a),Yr(b,b,r),Zr(b,b,i),Me(this._localProj,m,b),this._globeBasis=qr(this._center.lng,this._center.lat);let g=K();Ve(g,K(),t/2,-o/2,1),Ke(g,g,1,-1,0),Me(this._pixelMatrix,g,this._projMatrix),Ue(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"),Me(this._localPixel,g,this._localProj),Ue(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=K();if(!Ue(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=K();if(!Ue(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 h=[0,0,0,0];be(h,e,[c,l,s,1]);let f=h[3]||1e-9;t.push([h[0]/f,h[1]/f,h[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 h=t[s],f=t[l],u=t[c],d=f[0]-h[0],m=f[1]-h[1],p=f[2]-h[2],b=u[0]-h[0],g=u[1]-h[1],y=u[2]-h[2],A=m*y-p*g,B=p*b-d*y,C=d*g-m*b,v=Math.hypot(A,B,C)||1;A/=v,B/=v,C/=v;let _=new Float64Array(4);return _[0]=A,_[1]=B,_[2]=C,_[3]=-(A*h[0]+B*h[1]+C*h[2]),_});let r=0,i=0,a=0;for(let s of t)r+=s[0]/8,i+=s[1]/8,a+=s[2]/8;for(let s of this._frustumPlanes)s[0]*r+s[1]*i+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(){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 i=Math.floor(r.x/this._worldSize);i<t&&(t=i),i>o&&(o=i);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:Ee(t,-3,3),max:Ee(o,-3,3)}}};var Lc={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},ca=2,Tc=100,Hc=.5,kc=.1,Pc=25,fa=n=>Math.abs(n.y)>Math.abs(n.x);function ha(n,e,t){let o=Math.hypot(n.x,n.y)>=ca,r=Math.hypot(e.x,e.y)>=ca;return !o&&!r?void 0:!o||!r?t<Tc?void 0:false:n.y>0==e.y>0&&fa(n)&&fa(e)}function ua(n,e){let t=(n-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var Rc=160,en=4,er=class{constructor(e,t,o,r,i={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new k;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=Ee(-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={...Lc,...i},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,i=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:i,startAngle:Math.atan2(r,o),minDist:i,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},i={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(i.x,i.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?ha(r,i,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+i.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*Hc,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),i=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",h=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&h>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=kc&&(e.zoomActive=true),e.zoomActive)){let f=Math.log2(r/h);f!==0&&(this.tr.zoom=this.tr.zoom+f,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let f=Pc/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(ua(i,e.startAngle))>=f&&(e.rotateActive=true),e.rotateActive){let u=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=ua(i,u);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>Rc;)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,i=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,i);if(a<.05)return;a>en&&(r=r/a*en,i=i/a*en);let s=performance.now(),l=()=>{if(this.disposed)return;let c=performance.now(),h=Math.min(c-s,34);s=c;let f=Math.exp(-25e-4*h*10);if(r*=f,i*=f,Math.hypot(r,i)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let u={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*h,-i*h,u),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 Be=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let i=e.gl,a=i.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferData(i.ARRAY_BUFFER,t,r?i.DYNAMIC_DRAW:i.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);}},de=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);}},he=class{constructor(e,t,o){this.ctx=e;let r=e.gl,i=r.createVertexArray();if(!i)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=i,e.bindVAO(i);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 Oc=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],Ce=class{constructor(e,t,o,r,i={}){this.ctx=e;this.name=t;this.uniforms=new k;this.attribs=new k;let a=e.gl,s=zc(i),l=ma(a,a.VERTEX_SHADER,da(o,s),`${t}.vert`),c=ma(a,a.FRAGMENT_SHADER,da(r,s),`${t}.frag`),h=a.createProgram();if(!h)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(h,l),a.attachShader(h,c),Oc.forEach((f,u)=>a.bindAttribLocation(h,u,f)),a.linkProgram(h),a.detachShader(h,l),a.detachShader(h,c),a.deleteShader(l),a.deleteShader(c),!a.getProgramParameter(h,a.LINK_STATUS)){let f=a.getProgramInfoLog(h);throw a.deleteProgram(h),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${f}`)}this.program=h,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let i=e.getActiveUniform(this.program,r);if(!i)continue;let a=i.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,i.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(this.program,r);i&&this.attribs.set(i.name,e.getAttribLocation(this.program,i.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 i=this.loc(e);i&&this.ctx.gl.uniform3f(i,t,o,r);}setVec4(e,t,o,r,i){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,i);}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 zc(n){let e=[];for(let[t,o]of Object.entries(n))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
2
2
|
`)}function da(n,e){if(!e)return n;let t=n.match(/^\s*#version[^\n]*\n/);return t?n.slice(0,t[0].length)+e+`
|
|
3
3
|
`+n.slice(t[0].length):`${e}
|
|
4
4
|
${n}`}function ma(n,e,t,o){let r=n.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(n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){let i=n.getShaderInfoLog(r)??"";throw n.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
|
${i}
|
|
6
6
|
${Vc(t)}`)}return r}function Vc(n){return n.split(`
|
|
7
7
|
`).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
|
|
8
|
-
`)}var oo=new Set,tn=false;function Re(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;oo.size&&oo.clear();let i=ya(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let s=0,l=0,c=0;if(o&&(i=Jc(n,e,i,t)),n.length>80*t){s=n[0],l=n[1];let h=s,f=l;for(let u=t;u<r;u+=t){let d=n[u],m=n[u+1];d<s&&(s=d),m<l&&(l=m),d>h&&(h=d),m>f&&(f=m);}c=Math.max(h-s,f-l),c=c!==0?32767/c:0;}return on(i,a,s,l,c),a}function ya(n,e,t,o,r){let i=null;if(r===af(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=ga(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=ga(a/o|0,n[a],n[a+1],i);return i&&ro(i,i.next)&&(io(i),i=i.next),i}function pt(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&(oo.size===0||!oo.has(o))&&(ro(o,o.next)||ge(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),tn=true,io(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function on(n,e,t,o,r){r&&$c(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let s=n.prev,l=n.next;if(ge(s,n,l)<0&&(r?Nc(n,t,o,r):Wc(n))){e.push(s.i,n.i,l.i),io(n),n=l,i=l;continue}if(n=l,n===i){if(tn=false,n=pt(n),tn){i=n;continue}if(!a){n=Kc(n,e),i=n,a=true;continue}Uc(n,e,t,o,r);break}}}function Wc(n){let e=n.prev,t=n,o=n.next,r=e.x,i=t.x,a=o.x,s=e.y,l=t.y,c=o.y,h=Math.min(r,i,a),f=Math.min(s,l,c),u=Math.max(r,i,a),d=Math.max(s,l,c),m=o.next;for(;m!==e;){if(m.x>=h&&m.x<=u&&m.y>=f&&m.y<=d&&!(r===m.x&&s===m.y)&&nr(r,s,i,l,a,c,m.x,m.y)&&ge(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function Nc(n,e,t,o){let r=n.prev,i=n,a=n.next,s=r.x,l=i.x,c=a.x,h=r.y,f=i.y,u=a.y,d=Math.min(s,l,c),m=Math.min(h,f,u),p=Math.max(s,l,c),b=Math.max(h,f,u),g=sn(d,m,e,t,o),y=sn(p,b,e,t,o),A=n.prevZ;for(;A&&A.z>=g;){if(A.x>=d&&A.x<=p&&A.y>=m&&A.y<=b&&A!==a&&!(s===A.x&&h===A.y)&&nr(s,h,l,f,c,u,A.x,A.y)&&ge(A.prev,A,A.next)>=0)return false;A=A.prevZ;}let B=n.nextZ;for(;B&&B.z<=y;){if(B.x>=d&&B.x<=p&&B.y>=m&&B.y<=b&&B!==a&&!(s===B.x&&h===B.y)&&nr(s,h,l,f,c,u,B.x,B.y)&&ge(B.prev,B,B.next)>=0)return false;B=B.nextZ;}return true}function Kc(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;Ca(r,t,t.next,i,false)&&no(r,i)&&no(i,r)&&(e.push(r.i,t.i,i.i),io(t),io(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?pt(t):t}function Uc(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&of(i,a)){let s=va(i,a);i=pt(i,i.next),s=pt(s,s.next),on(i,e,t,o,r),on(s,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var rn=false;function Jc(n,e,t,o){let r=[];for(let i=0,a=e.length;i<a;i++){let s=e[i]*o,l=i<a-1?e[i+1]*o:n.length,c=ya(n,s,l,o,false);c===c.next&&oo.add(c),r.push(tf(c));}r.sort(Xc),Yc(n.length/o,e.length),Ba(t,t),rn=true;for(let i=0;i<r.length;i++)t=jc(r[i],t);return rn=false,pt(t)}function Xc(n,e){return n.x-e.x||n.y-e.y||(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)}function jc(n,e){let t=Qc(n,e);if(!t)return e;let o=va(t,n),r=o.next;return Ba(t,r.next),pt(o,o.next),pt(t,t.next)}var Aa=16,me=new Float64Array(0),rr=0,nn=[],an=[];function Yc(n,e){let t=Math.ceil((n+2*e)/Aa)+e+2;me.length<t*4&&(me=new Float64Array(t*4)),rr=0;}function Ba(n,e){let t=n;do{let o=rr++;nn[o]=t;let r=1/0,i=1/0,a=-1/0,s=-1/0,l=0;do{let h=t.next;t.z=o,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>s&&(s=t.y),h.x<r&&(r=h.x),h.x>a&&(a=h.x),h.y<i&&(i=h.y),h.y>s&&(s=h.y),t=h;}while(++l<Aa&&t!==e);an[o]=t;let c=o*4;me[c]=r,me[c+1]=i,me[c+2]=a,me[c+3]=s;}while(t!==e)}function Zc(n,e){let t=n.z*4;e.x<me[t]&&(me[t]=e.x),e.y<me[t+1]&&(me[t+1]=e.y),e.x>me[t+2]&&(me[t+2]=e.x),e.y>me[t+3]&&(me[t+3]=e.y);}function pa(n){let e=an[n];for(;e.prev.next!==e;)e=e.next;return an[n]=e,e}function ba(n){let e=nn[n];for(;e.prev.next!==e;)e=e.next;return nn[n]=e,e}function Qc(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if(ro(n,t))return t;for(let u=0,d=0;u<rr;u++,d+=4){if(r<me[d+1]||r>me[d+3]||me[d]>o||me[d+2]<=i)continue;let m=pa(u);t=ba(u);do{if(t.prev.next===t){if(ro(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=o&&p>i&&(i=p,a=t.x<t.next.x?t:t.next,p===o))return a}}t=t.next;}while(t!==m)}if(!a)return null;let s=a.x,l=a.y,c=Math.min(r,l),h=Math.max(r,l),f=1/0;for(let u=0,d=0;u<rr;u++,d+=4){if(me[d+2]<s||me[d]>o||me[d+3]<c||me[d+1]>h)continue;let m=pa(u);t=ba(u);do{if(t.prev.next===t&&o>=t.x&&t.x>=s&&o!==t.x&&nr(r<l?o:i,r,s,l,r<l?i:o,r,t.x,t.y)){let p=Math.abs(r-t.y)/(o-t.x);(no(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(p<f||p===f&&(t.x>a.x||t.x===a.x&&qc(a,t)))&&(a=t,f=p);}t=t.next;}while(t!==m)}return a}function qc(n,e){return ge(n.prev,n,e.prev)<0&&ge(e.next,n,n.next)<0}var Pe=[],$t=[],mt=new Uint32Array(0),eo=new Uint32Array(0),to=new Uint32Array(256);function $c(n,e,t,o){let r=n,i=0;do r.z=sn(r.x,r.y,e,t,o),Pe[i++]=r,r=r.next;while(r!==n);ef(i);let a=null;for(let s=0;s<i;s++){let l=Pe[s];l.prevZ=a,a&&(a.nextZ=l),a=l;}a.nextZ=null;}function ef(n){if(n<=32){for(let e=1;e<n;e++){let t=Pe[e],o=t.z,r=e-1;for(;r>=0&&Pe[r].z>o;)Pe[r+1]=Pe[r],r--;Pe[r+1]=t;}return}mt.length<n&&(mt=new Uint32Array(n),eo=new Uint32Array(n),$t=new Array(n));for(let e=0;e<n;e++)mt[e]=Pe[e].z;tr(n,Pe,mt,$t,eo,0),tr(n,$t,eo,Pe,mt,8),tr(n,Pe,mt,$t,eo,16),tr(n,$t,eo,Pe,mt,24);}function tr(n,e,t,o,r,i){to.fill(0);for(let s=0;s<n;s++)to[t[s]>>>i&255]++;let a=0;for(let s=0;s<256;s++){let l=to[s];to[s]=a,a+=l;}for(let s=0;s<n;s++){let l=t[s],c=to[l>>>i&255]++;o[c]=e[s],r[c]=l;}}function sn(n,e,t,o,r){return n=(n-t)*r|0,e=(e-o)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function tf(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function nr(n,e,t,o,r,i,a,s){return (r-a)*(e-s)>=(n-a)*(i-s)&&(n-a)*(o-s)>=(t-a)*(e-s)&&(t-a)*(i-s)>=(r-a)*(o-s)}function of(n,e){let t=ro(n,e)&&ge(n.prev,n,n.next)>0&&ge(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||no(n,e)&&no(e,n)&&(ge(n.prev,n,e.prev)!==0||ge(n,e.prev,e)!==0))&&!rf(n,e)&&(t||nf(n,e))}function ge(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function ro(n,e){return n.x===e.x&&n.y===e.y}function Ca(n,e,t,o,r=true){let i=ge(n,e,t),a=ge(n,e,o),s=ge(t,o,n),l=ge(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(s>0&&l<0||s<0&&l>0)?true:r?!!(i===0&&or(n,t,e)||a===0&&or(n,o,e)||s===0&&or(t,n,o)||l===0&&or(t,e,o)):false}function or(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function rf(n,e){let t=Math.min(n.x,e.x),o=Math.max(n.x,e.x),r=Math.min(n.y,e.y),i=Math.max(n.y,e.y),a=n;do{let s=a.next;if(a.x>o&&s.x>o||a.x<t&&s.x<t||a.y>i&&s.y>i||a.y<r&&s.y<r){a=s;continue}if(a.i!==n.i&&s.i!==n.i&&a.i!==e.i&&s.i!==e.i&&Ca(a,s,n,e))return true;a=s;}while(a!==n);return false}function no(n,e){return ge(n.prev,n,n.next)<0?ge(n,e,n.next)>=0&&ge(n,n.prev,e)>=0:ge(n,e,n.prev)<0||ge(n,n.next,e)<0}function nf(n,e){let t=n,o=false,r=(n.x+e.x)/2,i=(n.y+e.y)/2;do{let a=t.next;t.y>i!=a.y>i&&r<(a.x-t.x)*(i-t.y)/(a.y-t.y)+t.x&&(o=!o),t=a;}while(t!==n);return o}function va(n,e){let t=ln(n.i,n.x,n.y),o=ln(e.i,e.x,e.y),r=n.next,i=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,o.next=t,t.prev=o,i.next=o,o.prev=i,o}function ga(n,e,t,o){let r=ln(n,e,t);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function io(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ),rn&&Zc(n.prev,n.next);}function ln(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function af(n,e,t,o){let r=0;for(let i=e,a=t-o;i<t;i+=o)r+=(n[a]-n[i])*(n[i+1]+n[a+1]),a=i;return r}var wa=23283064365386963e-26,sf=12,xa=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),cn=0,ir=1,ao=2,ar=5,bt=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length;}readFields(e,t,o=this.length){for(;this.pos<o;){let r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r);}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,true);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,true);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getUint32(this.pos+4,true)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getInt32(this.pos+4,true)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,true);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,true);return this.pos+=8,e}readVarint(e){let t=this.buf,o,r;return r=t[this.pos++],o=r&127,r<128||(r=t[this.pos++],o|=(r&127)<<7,r<128)||(r=t[this.pos++],o|=(r&127)<<14,r<128)||(r=t[this.pos++],o|=(r&127)<<21,r<128)?o:(r=t[this.pos],o|=(r&15)<<28,lf(o,e,this))}readVarint64(){return this.readVarint(true)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return !!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=sf&&xa?xa.decode(this.buf.subarray(t,e)):Cf(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===ao?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===cn)for(;this.buf[this.pos++]>127;);else if(t===ao)this.pos=this.readVarint()+this.pos;else if(t===ar)this.pos+=4;else if(t===ir)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t);}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let o=new Uint8Array(t);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=t;}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*wa),true),this.pos+=8;}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*wa),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){cf(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)));}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2);}writeBoolean(e){this.writeVarint(+e);}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let t=this.pos;this.pos=vf(this.buf,e,this.pos);let o=this.pos-t;o>=128&&_a(t,o,this),this.pos=t-1,this.writeVarint(o),this.pos+=o;}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,true),this.pos+=4;}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,true),this.pos+=8;}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let o=0;o<t;o++)this.buf[this.pos++]=e[o];}writeRawMessage(e,t){this.pos++;let o=this.pos;e(t,this);let r=this.pos-o;r>=128&&_a(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,ao),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,hf,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,df,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,bf,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,mf,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,pf,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,gf,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,yf,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Af,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Bf,t);}writeBytesField(e,t){this.writeTag(e,ao),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,ar),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,ar),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,ir),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,ir),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,cn),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,cn),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,ao),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,ar),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,ir),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function lf(n,e,t){let o=t.buf,r,i;if(i=o[t.pos++],r=(i&112)>>4,i<128||(i=o[t.pos++],r|=(i&127)<<3,i<128)||(i=o[t.pos++],r|=(i&127)<<10,i<128)||(i=o[t.pos++],r|=(i&127)<<17,i<128)||(i=o[t.pos++],r|=(i&127)<<24,i<128)||(i=o[t.pos++],r|=(i&1)<<31,i<128))return _t(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function _t(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function cf(n,e){let t,o;if(n>=0?(t=n%4294967296|0,o=n/4294967296|0):(t=~(-n%4294967296),o=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,o=o+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ff(t,o,e),uf(o,e);}function ff(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127;}function uf(n,e){let t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))));}function _a(n,e,t){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(o);for(let r=t.pos-1;r>=n;r--)t.buf[r+o]=t.buf[r];}function hf(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function df(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function mf(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function pf(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function bf(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function gf(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function yf(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function Af(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function Bf(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function Cf(n,e,t){let o="",r=e;for(;r<t;){let i=n[r],a=null,s=i>239?4:i>223?3:i>191?2:1;if(r+s>t)break;let l,c,h;s===1?i<128&&(a=i):s===2?(l=n[r+1],(l&192)===128&&(a=(i&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(a=(i&15)<<12|(l&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=n[r+1],c=n[r+2],h=n[r+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(a=(i&15)<<18|(l&63)<<12|(c&63)<<6|h&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),r+=s;}return o}function vf(n,e,t){for(let o=0,r,i;o<e.length;o++){if(r=e.charCodeAt(o),r>55295&&r<57344)if(i)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,i=r;continue}else r=i-55296<<10|r-56320|65536,i=null;else {r>56319||o+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):i=r;continue}else i&&(n[t++]=239,n[t++]=191,n[t++]=189,i=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128);}return t}var lo=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(lo||{}),sr=class n{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,i){let a=new n(e,o,r,i);return e.readFields(wf,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,i=0,a=0,s=0,l=[],c=[];for(;e.pos<o;){if(i<=0){let h=e.readVarint();r=h&7,i=h>>3;}if(i--,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,i=-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]>i&&(i=a[s+1]);return [t,o,r,i]}};function wf(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?xf(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function xf(n,e){let t=n.readVarint()+n.pos;for(;n.pos<t;){let o=e.keys[n.readVarint()],r=e.values[n.readVarint()];o!==void 0&&(e.properties[o]=r);}}var lr=class n{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 n(e);return e.readFields(_f,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 sr.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function _f(n,e,t){t&&(n===15?e.version=t.readVarint():n===1?e.name=t.readString():n===5?e.extent=t.readVarint():n===2?e.featureOffsets.push(t.pos):n===3?e.keys.push(t.readString()):n===4&&e.values.push(Ef(t)));}function Ef(n){let e=n.readVarint()+n.pos,t=null;for(;n.pos<e;){let o=n.readVarint()>>3;o===1?t=n.readString():o===2?t=n.readFloat():o===3?t=n.readDouble():o===4?t=n.readVarint64():o===5?t=n.readVarint():o===6?t=n.readSVarint():o===7?t=n.readBoolean():n.skip(o);}return t}var so=class{constructor(e){this.layers={};new bt(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=lr.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function gt(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=Mf(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 Mf(n){let e=0;for(let t=0,o=n.length-2;t<n.length;o=t,t+=2)e+=(n[o]-n[t])*(n[t+1]+n[o+1]);return e/2}function V(n,e,t){return n===void 0?t:typeof n=="number"?n:Ea(n.stops,e,(o,r,i)=>o+(r-o)*i,t)}function ke(n,e,t){return n===void 0?t:typeof n=="string"?pe(n):Ea(n.stops,e,(o,r,i)=>{let a=pe(o),s=pe(r);return [a[0]+(s[0]-a[0])*i,a[1]+(s[1]-a[1])*i,a[2]+(s[2]-a[2])*i,a[3]+(s[3]-a[3])*i]},t)}function Ea(n,e,t,o){if(!n.length)return o;if(e<=n[0][0])return t(n[0][1],n[0][1],0);let r=n[n.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let i=1;i<n.length;i++){let[a,s]=n[i];if(e>a)continue;let[l,c]=n[i-1],h=a-l,f=h===0?0:(e-l)/h;return t(c,s,f)}return o}function ve(n,e){if(!n)return true;let t=n[0];switch(t){case "all":return n.slice(1).every(o=>ve(o,e));case "any":return n.slice(1).some(o=>ve(o,e));case "!":return !ve(n[1],e);case "has":return e[n[1]]!=null;case "!has":return e[n[1]]==null;case "in":{let o=e[n[1]];return o==null?false:n.slice(2).includes(o)}case "!in":{let o=e[n[1]];return o==null?true:!n.slice(2).includes(o)}default:{let o=e[n[1]],r=n[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 Ff=Math.PI/8,Df=.35,Sf=32,Fa=.25,Da=.5,Sa=.07;function Je(n,e){let t=e.radius;if(!(t>0))return n;let o=n.length/2-1;if(o<3)return n;let r=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??Df,0),a=e.extent,s=[];for(let l=0;l<o;l++){let c=n[l*2],h=n[l*2+1],f=n[(l+o-1)%o*2],u=n[(l+o-1)%o*2+1],d=n[(l+1)%o*2],m=n[(l+1)%o*2+1],p=c-f,b=h-u,g=d-c,y=m-h,A=Math.hypot(p,b),B=Math.hypot(g,y);if(A<1e-6||B<1e-6){s.push(c,h);continue}let C=p/A,v=b/A,_=g/B,w=y/B;if(e.keep?.[l]){s.push(c,h);continue}let x=C*_+v*w;if(x>.985){s.push(c,h);continue}if(a!==void 0&&(c<=0||c>=a||h<=0||h>=a)){s.push(c,h);continue}let E=Math.min(t,A*Ma,B*Ma);if(E<t*i){s.push(c,h);continue}let F=c-C*E,M=h-v*E,D=c+_*E,S=h+w*E,L=Math.acos(Math.max(-1,Math.min(1,x))),k=Math.min(Ff,Math.PI/2/r),I=Math.ceil(L/k-1e-6),G=e.maxChord&&e.maxChord>0?Math.ceil(E/Math.tan(L/2)*L/e.maxChord):0,H=Math.max(1,Math.min(Sf,Math.max(Math.min(r,I),G)));s.push(F,M);for(let z=1;z<H;z++){let K=z/H,R=1-K;s.push(R*R*F+2*R*K*c+K*K*D,R*R*M+2*R*K*h+K*K*S);}s.push(D,S);}return s.length<6?n:(s.push(s[0],s[1]),s)}var Ma=.4;var Se=n=>n/64;function qe(n,e,t=0){let o=Ia(n.outer,e,t);if(!o)return null;let r=[];for(let i of n.holes){let a=Ia(i,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Ia(n,e,t){let o=[];for(let r=0;r<n.length-2;r+=2)o.push(n[r],n[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let i=o;o=[];let a=i.length/2;if(a===0)return null;for(let s=0;s<a;s++){let l=i[s*2],c=i[s*2+1],h=i[(s+a-1)%a*2],f=i[(s+a-1)%a*2+1],u=La(l,c,r,e,t),d=La(h,f,r,e,t);if(u!==d){let m=If(h,f,l,c,r,e,t),p=r===0?-t:r===1?e+t:h+(l-h)*m,b=r===2?-t:r===3?e+t:f+(c-f)*m;o.push(p,b);}u&&o.push(l,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function La(n,e,t,o,r){return t===0?n>=-r:t===1?n<=o+r:t===2?e>=-r:e<=o+r}function If(n,e,t,o,r,i,a){return r===0?(-a-n)/(t-n):r===1?(i+a-n)/(t-n):r===2?(-a-e)/(o-e):(i+a-e)/(o-e)}function cr(n,e,t,o,r,i=0){let a=-i,s=r+i;return n===a&&t===a||n===s&&t===s||e===a&&o===a||e===s&&o===s}function fn(n,e){for(let t=0;t<n.length;t+=2)if(n[t]<=0||n[t]>=e||n[t+1]<=0||n[t+1]>=e)return true;return false}var Ta=1,Te=18,Dt=32,Ft=8,za=65535/Dt,Lf=9,Tf=1,Hf=0,kf=1,Pf=2;var Ha=0,Rf=1,ka=2,Gf=3,Va=.47;function dn(n,e,t,o={},r){let i=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Va,{b:a,ensure:s,take:l}=Wa(Math.max(1024,n.length*48));for(let c of n.features()){if(c.type!==3||!ve(t,c.properties))continue;let h=iu(c.properties),f=au(c.properties,h);if(h<=f)continue;let u=lu(c.properties)??Number(c.id??0),d=nu(u>>>0),m=ru(d,c.properties),p=ou(c.properties,h),b=gt(c.loadGeometry()),g=r?b.some(y=>{let A=qe(y,e,Se(e));return A?fn(A.outer,e):false}):false;for(let y of b){if(r&&g){let A=cu(y,e,h,f,u,d,m,p);A&&r.push(A);}Ua(a,y,s,{extent:e,metersPerUnit:i,height:h,minHeight:f,featureId:u,seed:d,tint:m,facade:p,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return l(e)}function Wa(n){let e=n,t=new ArrayBuffer(e*Te),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*Te);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=>{if(!o.indices.length)return null;let s=new Uint32Array(o.indices),l=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:s.buffer,featureIds:l.buffer,vertexCount:o.vertexCount,indexCount:s.length,extent:a}}}}function Na(n,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:Va,{b:r,ensure:i,take:a}=Wa(Math.max(1024,n.length*64));for(let{rings:s,seam:l}of n)Ua(r,s,i,{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 mn=(n,e)=>n|e<<2,Pa=n=>Math.max(-32768,Math.min(32767,n)),un=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,za)*Dt)));function Et(n,e,t,o,r,i,a,s,l,c,h=0,f=0,u=0){let d=n.vertOffset;return n.verts.setInt16(d,Pa(Math.round(e*Ft)),true),n.verts.setInt16(d+2,Pa(Math.round(t*Ft)),true),n.verts.setUint16(d+4,Math.round(Math.min(o,za)*Dt),true),n.vertsU8[d+6]=l,n.vertsU8[d+7]=s,n.verts.setInt8(d+8,hn(Math.round(r*127))),n.verts.setInt8(d+9,hn(Math.round(i*127))),n.verts.setInt8(d+10,hn(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,un(h),true),n.verts.setUint16(d+14,un(f),true),n.verts.setUint16(d+16,un(u),true),n.vertOffset+=Te,n.vertexCount++}function Ra(n,e,t,o,r,i,a,s,l,c){let h=e.length/2;if(h<3)return;let f=mn(Hf,a),u=zf(e,s),d=o-t,m=new Float64Array(h*2),p=new Uint8Array(h);{let b=new Float64Array(h*2);for(let g=0;g<h-1;g++){let y=e[g*2+2]-e[g*2],A=e[g*2+3]-e[g*2+1],B=Math.hypot(y,A)||1;b[g*2]=A/B,b[g*2+1]=-y/B;}for(let g=0;g<h-1;g++){let y=(g+h-2)%(h-1),A=b[y*2]*b[g*2]+b[y*2+1]*b[g*2+1],B=b[y*2]+b[g*2],C=b[y*2+1]+b[g*2+1],v=Math.hypot(B,C);A>.5&&v>1e-6&&(m[g*2]=B/v,m[g*2+1]=C/v,p[g]=1);}}for(let b=0;b<h-1;b++){let g=e[b*2],y=e[b*2+1],A=e[b*2+2],B=e[b*2+3];if(g===A&&y===B||c[b])continue;let C=A-g,v=B-y,_=Math.hypot(C,v)||1,w=v/_,x=-C/_,E=u.offset[b],F=u.width[b],M=[0,1];if(l){for(let S=0;S<l.length;S++)for(let L=S+1;L<l.length;L++){let k=yt(l[S],g,y)-yt(l[L],g,y),I=yt(l[S],A,B)-yt(l[L],A,B);if(k===I)continue;let G=k/(k-I);G>1e-4&&G<1-1e-4&&M.push(G);}M.sort((S,L)=>S-L);}let D=(S,L)=>{if(!l)return o;let k=1/0;for(let I of l)k=Math.min(k,yt(I,S,L));return Math.max(o,k)};for(let S=0;S+1<M.length;S++){let L=M[S],k=M[S+1];if(k-L<1e-6)continue;let I=g+C*L,G=y+v*L,H=g+C*k,z=y+v*k,K=E+_*L*s,R=E+_*k*s,O=(b+1)%(h-1),N=p[b]?m[b*2]:w,W=p[b]?m[b*2+1]:x,Y=p[O]?m[O*2]:w,Q=p[O]?m[O*2+1]:x,ee=w+(N-w)*(1-L),q=x+(W-x)*(1-L),J=w+(Y-w)*k,ne=x+(Q-x)*k,se=Math.hypot(ee,q)||1,oe=Math.hypot(J,ne)||1,X=ee/se,j=q/se,ie=J/oe,ae=ne/oe;n.ensure(4);let ue=Et(n,I,G,t,X,j,0,0,i,f,K,F,d),le=Et(n,H,z,t,ie,ae,0,0,i,f,R,F,d),Ae=Et(n,I,G,D(I,G),X,j,0,255,i,f,K,F,d),_e=Et(n,H,z,D(H,z),ie,ae,0,255,i,f,R,F,d);n.indices.push(ue,_e,le,ue,Ae,_e),n.featureIds.push(r,r);}}}var Of=.9976;function zf(n,e){let t=n.length/2-1,o=[];for(let l=0;l<t;l++){let c=n[l*2+2]-n[l*2],h=n[l*2+3]-n[l*2+1],f=Math.hypot(c,h);o.push(f>0?{x:c/f,y:h/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>=Of,i=0;for(;i<t&&r((i-1+t)%t,i);)i++;i>=t&&(i=0);let a=new Array(t).fill(0),s=new Array(t).fill(0);for(let l=0;l<t;){let c=(i+l)%t,h=[c],f=o[c].len,u=l+1;for(;u<t;){let m=(i+u)%t;if(!r((i+u-1)%t,m))break;h.push(m),f+=o[m].len,u++;}let d=0;for(let m of h)a[m]=d,s[m]=f,d+=o[m].len;l=u;}return {offset:a,width:s}}function Vf(n,e,t,o,r,i,a){let s=[],l=[];for(let u=0;u<e.length;u++)s.push(e[u]);for(let u of t){l.push(s.length/2);for(let d=0;d<u.length;d++)s.push(u[d]);}let c=Re(s,l.length?l:void 0,2);if(!c.length)return;let h=mn(kf,a),f=n.vertexCount;for(let u=0;u<s.length;u+=2)Et(n,s[u],s[u+1],o,0,0,1,255,i,h);for(let u=0;u<c.length;u+=3)n.indices.push(f+c[u],f+c[u+2],f+c[u+1]),n.featureIds.push(r);}function Wf(n){let e=Nf(n);if(e.length<3)return null;let t=Math.abs(Kf(n));if(t<=0)return null;let o=null,r=1/0;for(let i=0;i<e.length;i++){let a=(i+1)%e.length,s=e[a].x-e[i].x,l=e[a].y-e[i].y,c=Math.hypot(s,l);if(c<1e-6)continue;s/=c,l/=c;let h=1/0,f=-1/0,u=1/0,d=-1/0;for(let B of e){let C=B.x*s+B.y*l,v=-B.x*l+B.y*s;C<h&&(h=C),C>f&&(f=C),v<u&&(u=v),v>d&&(d=v);}let m=f-h,p=d-u,b=m*p;if(b<=0||b>=r)continue;r=b;let g=(h+f)/2,y=(u+d)/2,A=m>=p;o={cx:g*s-y*l,cy:g*l+y*s,ax:A?s:-l,ay:A?l:s,halfLong:(A?m:p)/2,halfShort:(A?p:m)/2,fill:t/b};}return o}function Nf(n){let e=[];for(let i=0;i<n.length-2;i+=2)e.push({x:n[i],y:n[i+1]});if(e.length<3)return e;e.sort((i,a)=>i.x===a.x?i.y-a.y:i.x-a.x);let t=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i);}let r=[];for(let i=e.length-1;i>=0;i--){let a=e[i];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 Kf(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var Uf=Math.tan(30*Math.PI/180),Jf=3.5,Xf=.9;function jf(n,e,t,o,r){if(e.fill<.86)return null;let i=e.halfShort*2*r,a=e.halfLong*2*r,s=i*a,l=e.halfShort>0?e.halfLong/e.halfShort:99,c=Yf(n);if(!c){if(t>15||s>600||i<3)return null;let h=o%1e3/1e3;s<30?c=h<.5?"skillion":"gabled":l<1.25?c=h<.35?"pyramidal":"hipped":c=h<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Yf(n){let e=String(n.roof_shape??n["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 yt=(n,e,t)=>n.a*e+n.b*t+n.c;function Zf(n,e,t,o){let r=n.length/2;if(r<3)return [];let i=[],a=s=>[n[s*2],n[s*2+1]];for(let s=0;s<r;s++){let[l,c]=a(s),[h,f]=a((s+r-1)%r),u=e*l+t*c+o,d=e*h+t*f+o;if(u<=0!=d<=0){let m=d/(d-u);i.push(h+(l-h)*m,f+(c-f)*m);}u<=0&&i.push(l,c);}return i}function Qf(n,e){let t=.5/Math.max(e,1e-6),o=n.length/2-1;if(o<5)return n;let r=[],i=0;r.push(n[0],n[1]);for(let a=1;a<o;a++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1],f=c-s,u=h-l,d=Math.hypot(f,u),m=d>1e-6;if(m){for(let p=i+1;p<a;p++)if(Math.abs((n[p*2]-s)*u-(n[p*2+1]-l)*f)/d>=t){m=false;break}}m||(r.push(n[(a-1)*2],n[(a-1)*2+1]),i=a-1);}return r.length/2<3?n:(r.push(r[0],r[1]),r)}function Ka(n,e,t){let{ax:o,ay:r,halfLong:i}=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=n.length/2-1;for(let l=0;l<s;l++){let c=n[l*2],h=n[l*2+1],f=n[(l+1)%s*2],u=n[(l+1)%s*2+1],d=f-c,m=u-h,p=Math.hypot(d,m);if(p<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/p)<.86)continue;let b=-m/p,g=d/p;a.push({a:b,b:g,c:-(b*c+g*h)});}return !a.length&&i>0?Ka(n,e,"hipped"):a}function qf(n,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<n.length;r++){let i=t;for(let a=0;a<n.length&&i.length>=6;a++)a!==r&&(i=Zf(i,n[r].a-n[a].a,n[r].b-n[a].b,n[r].c-n[a].c));o.push(i.length>=6?i:[]);}return o}function $f(n,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i=0;i<r.length;i+=2){let a=yt(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function eu(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function tu(n,e,t,o,r,i,a,s){let l=mn(Pf,a);for(let c=0;c<t.length;c++){let h=e[c];if(!h||h.length<6)continue;let f=Re(h,void 0,2);if(!f.length)continue;let u=-t[c].a/s,d=-t[c].b/s,m=Math.hypot(u,d,1),p={x:u/m,y:d/m,z:1/m};n.ensure(h.length/2);let b=n.vertexCount;for(let g=0;g<h.length;g+=2){let y=Math.max(o,yt(t[c],h[g],h[g+1]));Et(n,h[g],h[g+1],y,p.x,p.y,p.z,255,i,l);}for(let g=0;g<f.length;g+=3)n.indices.push(b+f[g],b+f[g+2],b+f[g+1]),n.featureIds.push(r);}}function ou(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Gf:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ka:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Ha:e>=40?ka:Rf}function ru(n,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+(n%121-60)))}function nu(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function iu(n){let e=Mt(n.render_height)??Mt(n.height)??su(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,Tf):Lf}function au(n,e){let t=Mt(n.render_min_height)??Mt(n.min_height)??Mt(n.base)??0;return t>0&&t<e?t:0}function su(n){let e=Mt(n);return e&&e>0?e*3:null}function Mt(n){if(typeof n=="number"&&isFinite(n))return n;if(typeof n=="string"){let e=parseFloat(n);if(isFinite(e))return e}return null}var hn=n=>n>127?127:n<-127?-127:n;function lu(n){let e=n.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 Ga(n,e){let t=n.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:n,cut:o};let r=(a,s)=>a===0?1:a===e?2:s===0?3:s===e?4:0,i=n.slice();for(let a=0;a<t;a++){let s=n[a*2],l=n[a*2+1],c=r(s,l);if(!c)continue;let h=(a+t-1)%t,f=(a+1)%t,u=r(n[h*2],n[h*2+1])===c,d=r(n[f*2],n[f*2+1])===c;d&&(o[a]=true);let m=u===d?-1:u?f:h;if(m<0)continue;let p=s-n[m*2],b=l-n[m*2+1],g=Math.hypot(p,b);g<1e-6||(i[a*2]=s+p/g*Ta,i[a*2+1]=l+b/g*Ta);}return i[t*2]=i[0],i[t*2+1]=i[1],{ring:i,cut:o}}function Ua(n,e,t,o){let{extent:r,metersPerUnit:i,height:a,minHeight:s,featureId:l,seed:c,tint:h,facade:f}=o,u=o.whole?e:qe(e,r,Se(r));if(!u)return;let d=o.cornerRadius/i,m={radius:d,segments:o.cornerSegments,minCutRatio:0,maxChord:i>0?Da/i:0,...o.whole?{}:{extent:r,margin:Se(r)}},p=d>0?{outer:Je(u.outer,m),holes:u.holes.map(F=>Je(F,m))}:u,b=o.whole?p:qe(p,r);if(!b)return;let g=F=>({ring:F,cut:new Array(Math.max(F.length/2-1,0)).fill(false)}),y=o.whole?g(b.outer):Ga(b.outer,r),A=b.holes.map(F=>o.whole?g(F):Ga(F,r)),B={outer:y.ring,holes:A.map(F=>F.ring)},C=o.whole?true:fn(B.outer,r),v=B.outer.length/2+B.holes.reduce((F,M)=>F+M.length/2,0);t(v*5+32);let _=B.holes.length||C?null:Wf(B.outer),w=_?jf(o.props,_,a,c,i):null,x=null,E=[];if(w&&_){let F=Ka(Qf(B.outer,i),_,w.shape);E=qf(F,B.outer);let M=$f(F,E);if(M>1e-6){let D=Math.min(Math.max(M*i*Uf,Xf),Jf);x=eu(F,D/M,a);}}Ra(n,B.outer,s,a,l,h,f,i,x,y.cut);for(let F=0;F<B.holes.length;F++)Ra(n,B.holes[F],s,a,l,h,f,i,null,A[F].cut);x?tu(n,E,x,a,l,h,f,i):Vf(n,B.outer,B.holes,a,l,h,f);}function Oa(n,e){let t=Se(e),o=Math.max(n.length/2-1,0),r=new Array(o);for(let i=0;i<o;i++)r[i]=cr(n[i*2],n[i*2+1],n[i*2+2],n[i*2+3],e,t);return r}function cu(n,e,t,o,r,i,a,s){let l=qe(n,e,Se(e));if(!l)return null;let c=Oa(l.outer,e);return {osmId:r,height:t,minHeight:o,seed:i,tint:a,facade:s,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(h=>Oa(h,e))}}var rt=4;function pn(n,e,t,o,r){let i=o*o,a=[],s=h=>n[h*2],l=h=>n[h*2+1],c=(h,f)=>{let u=n.length/2;return n.push((s(h)+s(f))/2,(l(h)+l(f))/2),u};for(let h=0;h<e.length;h+=3){a.push([t+e[h],t+e[h+1],t+e[h+2]]);let f=0;for(;a.length&&!(++f>2e4);){let[u,d,m]=a.pop(),p=(s(u)-s(d))**2+(l(u)-l(d))**2,b=(s(d)-s(m))**2+(l(d)-l(m))**2,g=(s(m)-s(u))**2+(l(m)-l(u))**2,y=Math.max(p,b,g);if(y<=i){r.push(u,d,m);continue}if(y===p){let A=c(u,d);a.push([u,A,m],[A,d,m]);}else if(y===b){let A=c(d,m);a.push([d,A,u],[A,m,u]);}else {let A=c(m,u);a.push([m,A,d],[A,u,d]);}}}}function bn(n,e,t=0,o,r=false,i=4096){let a=[],s=[],l=[];for(let d of n.features()){if(d.type!==3||!ve(e,d.properties))continue;let m=d.properties.osm_id,p=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,b=Number.isFinite(p)?p:Number(d.id??0);for(let g of gt(d.loadGeometry())){let y=r?qe(g,i):g;if(!y)continue;let A=[],B=[],C=o?Je(y.outer,o):y.outer;for(let w=0;w<C.length;w++)A.push(C[w]);for(let w of y.holes){let x=o?Je(w,o):w;B.push(A.length/2);for(let E=0;E<x.length;E++)A.push(x[E]);}let v=Re(A,B.length?B:void 0,2);if(!v.length)continue;let _=a.length/2;for(let w=0;w<A.length;w++)a.push(A[w]);if(t>0){let w=[];pn(a,v,_,t,w);for(let x=0;x<w.length;x+=3)s.push(w[x],w[x+2],w[x+1]),l.push(b);continue}for(let w=0;w<v.length;w+=3)s.push(_+v[w],_+v[w+2],_+v[w+1]),l.push(b);}}if(!s.length)return null;let c=a.length/2,h=new Int16Array(a),f=new Uint32Array(s);return {featureIds:new Float64Array(l).buffer,vertices:h.buffer,indices:f.buffer,vertexCount:c,indexCount:f.length}}var Sn={};Yi(Sn,{default:()=>Su});var Xe=class{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null;}};function fu(n,e){return n>e?1:n<e?-1:0}function nt(n,e,t){let o=new Xe(null,null),r=o,i=o;for(;;){let a=t(n,e.key);if(a<0){if(e.left===null)break;if(t(n,e.left.key)<0){let s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}i.left=e,i=e,e=e.left;}else if(a>0){if(e.right===null)break;if(t(n,e.right.key)>0){let s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right;}else break}return r.right=e.left,i.left=e.right,e.left=o.right,e.right=o.left,e}function gn(n,e,t,o){let r=new Xe(n,e);if(t===null)return r.left=r.right=null,r;t=nt(n,t,o);let i=o(n,t.key);return i<0?(r.left=t.left,r.right=t,t.left=null):i>=0&&(r.right=t.right,r.left=t,t.right=null),r}function Ja(n,e,t){let o=null,r=null;if(e){e=nt(n,e,t);let i=t(e.key,n);i===0?(o=e.left,r=e.right):i<0?(r=e.right,e.right=null,o=e):(o=e.left,e.left=null,r=e);}return {left:o,right:r}}function uu(n,e,t){return e===null?n:(n===null||(e=nt(n.key,e,t),e.left=n),e)}function yn(n,e,t,o,r){if(n){o(`${e}${t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${r(n)}
|
|
9
|
-
`);let i=e+(t?" ":"\u2502 ");n.left&&yn(n.left,i,false,o,r),n.right&&yn(n.right,i,true,o,r);}}var St=class{constructor(e=fu){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=gn(e,t,this._root,this._comparator)}add(e,t){let o=new Xe(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=nt(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=nt(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=nt(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=nt(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=nt(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,s=this._root,l;for(;i.length!==0||s;)if(s)i.push(s),s=s.left;else {if(s=i.pop(),l=a(s.key,t),l>0)break;if(a(s.key,e)>=0&&o.call(r,s))return this;s=s.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return du(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&Cn(e,t,0,r-1,i),this._root===null)this._root=An(e,t,0,r),this._size=r;else {let a=mu(this.toList(),hu(e,t),i);r=this._size+r,this._root=Bn({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return yn(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=Ja(e,this._root,r);r(e,t)<0?a=gn(t,o,a,r):i=gn(t,o,i,r),this._root=uu(i,a,r);}split(e){return Ja(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function An(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],s=e[i],l=new Xe(a,s);return l.left=An(n,e,t,i),l.right=An(n,e,i+1,o),l}return null}function hu(n,e){let t=new Xe(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Xe(n[r],e[r]);return o.next=null,t.next}function du(n){let e=n,t=[],o=false,r=new Xe(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function Bn(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=Bn(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=Bn(n,r+1,t),a}return null}function mu(n,e,t){let o=new Xe(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function Cn(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,s=o+1;for(;;){do a++;while(r(n[a],i)<0);do s--;while(r(n[s],i)>0);if(a>=s)break;let l=n[a];n[a]=n[s],n[s]=l,l=e[a],e[a]=e[s],e[s]=l;}Cn(n,e,t,s,r),Cn(n,e,s+1,o,r);}var $=11102230246251565e-32,ye=134217729,co=(3+8*$)*$;function At(n,e,t,o,r){let i,a,s,l,c=e[0],h=o[0],f=0,u=0;h>c==h>-c?(i=c,c=e[++f]):(i=h,h=o[++u]);let d=0;if(f<n&&u<t)for(h>c==h>-c?(a=c+i,s=i-(a-c),c=e[++f]):(a=h+i,s=i-(a-h),h=o[++u]),i=a,s!==0&&(r[d++]=s);f<n&&u<t;)h>c==h>-c?(a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++f]):(a=i+h,l=a-i,s=i-(a-l)+(h-l),h=o[++u]),i=a,s!==0&&(r[d++]=s);for(;f<n;)a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++f],i=a,s!==0&&(r[d++]=s);for(;u<t;)a=i+h,l=a-i,s=i-(a-l)+(h-l),h=o[++u],i=a,s!==0&&(r[d++]=s);return (i!==0||d===0)&&(r[d++]=i),d}function fo(n,e){let t=e[0];for(let o=1;o<n;o++)t+=e[o];return t}function T(n){return new Float64Array(n)}var pu=(3+16*$)*$,bu=(2+12*$)*$,gu=(9+64*$)*$*$,It=T(4),Xa=T(8),ja=T(12),Ya=T(16),Ie=T(4);function yu(n,e,t,o,r,i,a){let s,l,c,h,f,u,d,m,p,b,g,y,A,B,C,v,_,w,x=n-r,E=t-r,F=e-i,M=o-i;B=x*M,u=ye*x,d=u-(u-x),m=x-d,u=ye*M,p=u-(u-M),b=M-p,C=m*b-(B-d*p-m*p-d*b),v=F*E,u=ye*F,d=u-(u-F),m=F-d,u=ye*E,p=u-(u-E),b=E-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,It[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,It[1]=A-(g+f)+(f-v),w=y+g,f=w-y,It[2]=y-(w-f)+(g-f),It[3]=w;let D=fo(4,It),S=bu*a;if(D>=S||-D>=S||(f=n-x,s=n-(x+f)+(f-r),f=t-E,c=t-(E+f)+(f-r),f=e-F,l=e-(F+f)+(f-i),f=o-M,h=o-(M+f)+(f-i),s===0&&l===0&&c===0&&h===0)||(S=gu*a+co*Math.abs(D),D+=x*h+M*s-(F*c+E*l),D>=S||-D>=S))return D;B=s*M,u=ye*s,d=u-(u-s),m=s-d,u=ye*M,p=u-(u-M),b=M-p,C=m*b-(B-d*p-m*p-d*b),v=l*E,u=ye*l,d=u-(u-l),m=l-d,u=ye*E,p=u-(u-E),b=E-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let L=At(4,It,4,Ie,Xa);B=x*h,u=ye*x,d=u-(u-x),m=x-d,u=ye*h,p=u-(u-h),b=h-p,C=m*b-(B-d*p-m*p-d*b),v=F*c,u=ye*F,d=u-(u-F),m=F-d,u=ye*c,p=u-(u-c),b=c-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let k=At(L,Xa,4,Ie,ja);B=s*h,u=ye*s,d=u-(u-s),m=s-d,u=ye*h,p=u-(u-h),b=h-p,C=m*b-(B-d*p-m*p-d*b),v=l*c,u=ye*l,d=u-(u-l),m=l-d,u=ye*c,p=u-(u-c),b=c-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let I=At(k,ja,4,Ie,Ya);return Ya[I-1]}function vn(n,e,t,o,r,i){let a=(e-i)*(t-r),s=(n-r)*(o-i),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=pu*c?l:-yu(n,e,t,o,r,i,c)}var uo=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,wn=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;let t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,o=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,i=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return {ll:{x:t,y:r},ur:{x:o,y:i}}},it=Number.EPSILON;it===void 0&&(it=Math.pow(2,-52));var Bu=it*it,Qa=(n,e)=>{if(-it<n&&n<it&&-it<e&&e<it)return 0;let t=n-e;return t*t<Bu*n*e?0:n<e?-1:1},xn=class{constructor(){this.reset();}reset(){this.xRounder=new ur,this.yRounder=new ur;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},ur=class{constructor(){this.tree=new St,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&Qa(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&Qa(t.key,r.key)===0?(this.tree.remove(e),r.key):e}},ho=new xn,fr=(n,e)=>n.x*e.y-n.y*e.x,os=(n,e)=>n.x*e.x+n.y*e.y,qa=(n,e,t)=>{let o=vn(n.x,n.y,e.x,e.y,t.x,t.y);return o>0?-1:o<0?1:0},hr=n=>Math.sqrt(os(n,n)),Cu=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return fr(r,o)/hr(r)/hr(o)},vu=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return os(r,o)/hr(r)/hr(o)},$a=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},es=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},wu=(n,e,t,o)=>{if(e.x===0)return es(t,o,n.x);if(o.x===0)return es(n,e,t.x);if(e.y===0)return $a(t,o,n.y);if(o.y===0)return $a(n,e,t.y);let r=fr(e,o);if(r==0)return null;let i={x:t.x-n.x,y:t.y-n.y},a=fr(i,e)/r,s=fr(i,o)/r,l=n.x+s*e.x,c=t.x+a*o.x,h=n.y+s*e.y,f=t.y+a*o.y,u=(l+c)/2,d=(h+f)/2;return {x:u,y:d}},Ge=class n{static compare(e,t){let o=n.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Lt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t;}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");let t=e.point.events;for(let o=0,r=t.length;o<r;o++){let i=t[o];this.point.events.push(i),i.point=this.point;}this.checkForConsuming();}checkForConsuming(){let e=this.point.events.length;for(let t=0;t<e;t++){let o=this.point.events[t];if(o.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){let i=this.point.events[r];i.consumedBy===void 0&&o.otherSE.point.events===i.otherSE.point.events&&o.segment.consume(i.segment);}}}getAvailableLinkedEvents(){let e=[];for(let t=0,o=this.point.events.length;t<o;t++){let r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r);}return e}getLeftmostComparator(e){let t=new Map,o=r=>{let i=r.otherSE;t.set(r,{sine:Cu(this.point,e.point,i.point),cosine:vu(this.point,e.point,i.point)});};return (r,i)=>{t.has(r)||o(r),t.has(i)||o(i);let{sine:a,cosine:s}=t.get(r),{sine:l,cosine:c}=t.get(i);return a>=0&&l>=0?s<c?1:s>c?-1:0:a<0&&l<0?s<c?-1:s>c?1:0:l<a?-1:l>a?1:0}}},xu=0,Lt=class n{static compare(e,t){let o=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,a=t.rightSE.point.x;if(a<o)return 1;if(i<r)return -1;let s=e.leftSE.point.y,l=t.leftSE.point.y,c=e.rightSE.point.y,h=t.rightSE.point.y;if(o<r){if(l<s&&l<c)return 1;if(l>s&&l>c)return -1;let f=e.comparePoint(t.leftSE.point);if(f<0)return 1;if(f>0)return -1;let u=t.comparePoint(e.rightSE.point);return u!==0?u:-1}if(o>r){if(s<l&&s<h)return -1;if(s>l&&s>h)return 1;let f=t.comparePoint(e.leftSE.point);if(f!==0)return f;let u=e.comparePoint(t.rightSE.point);return u<0?1:u>0?-1:1}if(s<l)return -1;if(s>l)return 1;if(i<a){let f=t.comparePoint(e.rightSE.point);if(f!==0)return f}if(i>a){let f=e.comparePoint(t.rightSE.point);if(f<0)return 1;if(f>0)return -1}if(i!==a){let f=c-s,u=i-o,d=h-l,m=a-r;if(f>u&&d<m)return 1;if(f<u&&d>m)return -1}return i>a?1:i<a||c<h?-1:c>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,o,r){this.id=++xu,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=r;}static fromRing(e,t,o){let r,i,a,s=Ge.comparePoints(e,t);if(s<0)r=e,i=t,a=1;else if(s>0)r=t,i=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let l=new Ge(r,true),c=new Ge(i,false);return new n(l,c,[o],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE;}bbox(){let e=this.leftSE.point.y,t=this.rightSE.point.y;return {ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return {x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;let t=this.leftSE.point,o=this.rightSE.point,r=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x<t.x?1:-1;let i=(e.y-t.y)/r.y,a=t.x+i*r.x;if(e.x===a)return 0;let s=(e.x-t.x)/r.x,l=t.y+s*r.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){let t=this.bbox(),o=e.bbox(),r=wn(t,o);if(r===null)return null;let i=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,l=e.rightSE.point,c=uo(t,s)&&this.comparePoint(s)===0,h=uo(o,i)&&e.comparePoint(i)===0,f=uo(t,l)&&this.comparePoint(l)===0,u=uo(o,a)&&e.comparePoint(a)===0;if(h&&c)return u&&!f?a:!u&&f?l:null;if(h)return f&&i.x===l.x&&i.y===l.y?null:i;if(c)return u&&a.x===s.x&&a.y===s.y?null:s;if(u&&f)return null;if(u)return a;if(f)return l;let d=wu(i,this.vector(),s,e.vector());return d===null||!uo(r,d)?null:ho.round(d.x,d.y)}split(e){let t=[],o=e.events!==void 0,r=new Ge(e,true),i=new Ge(e,false),a=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);let s=new n(r,a,this.rings.slice(),this.windings.slice());return Ge.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ge.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=true,this.rightSE.isLeft=false;for(let t=0,o=this.windings.length;t<o;t++)this.windings[t]*=-1;}consume(e){let t=this,o=e;for(;t.consumedBy;)t=t.consumedBy;for(;o.consumedBy;)o=o.consumedBy;let r=n.compare(t,o);if(r!==0){if(r>0){let i=t;t=o,o=i;}if(t.prev===o){let i=t;t=o,o=i;}for(let i=0,a=o.rings.length;i<a;i++){let s=o.rings[i],l=o.windings[i],c=t.rings.indexOf(s);c===-1?(t.rings.push(s),t.windings.push(l)):t.windings[c]+=l;}o.rings=null,o.windings=null,o.consumedBy=t,o.leftSE.consumedBy=t.leftSE,o.rightSE.consumedBy=t.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 e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState();}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let t=this._afterState.rings,o=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let c=this.rings[s],h=this.windings[s],f=t.indexOf(c);f===-1?(t.push(c),o.push(h)):o[f]+=h;}let i=[],a=[];for(let s=0,l=t.length;s<l;s++){if(o[s]===0)continue;let c=t[s],h=c.poly;if(a.indexOf(h)===-1)if(c.isExterior)i.push(h);else {a.indexOf(h)===-1&&a.push(h);let f=i.indexOf(c.poly);f!==-1&&i.splice(f,1);}}for(let s=0,l=i.length;s<l;s++){let c=i[s].multiPoly;r.indexOf(c)===-1&&r.push(c);}return this._afterState}isInResult(){if(this.consumedBy)return false;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(We.type){case "union":{let o=e.length===0,r=t.length===0;this._isInResult=o!==r;break}case "intersection":{let o,r;e.length<t.length?(o=e.length,r=t.length):(o=t.length,r=e.length),this._isInResult=r===We.numMultiPolys&&o<r;break}case "xor":{let o=Math.abs(e.length-t.length);this._isInResult=o%2===1;break}case "difference":{let o=r=>r.length===1&&r[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${We.type}`)}return this._isInResult}},dr=class{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let r=ho.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let a=1,s=e.length;a<s;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=ho.round(e[a][0],e[a][1]);l.x===i.x&&l.y===i.y||(this.segments.push(Lt.fromRing(i,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),i=l);}(r.x!==i.x||r.y!==i.y)&&this.segments.push(Lt.fromRing(i,r,this));}getSweepEvents(){let e=[];for(let t=0,o=this.segments.length;t<o;t++){let r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE);}return e}},_n=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new dr(e[0],this,true),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 o=1,r=e.length;o<r;o++){let i=new dr(e[o],this,false);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i);}this.multiPoly=t;}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},mr=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e]);}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 o=0,r=e.length;o<r;o++){let i=new _n(e[o],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i);}this.isSubject=t;}getSweepEvents(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},En=class n{static factory(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.isInResult()||i.ringOut)continue;let a=null,s=i.leftSE,l=i.rightSE,c=[s],h=s.point,f=[];for(;a=s,s=l,c.push(s),s.point!==h;)for(;;){let u=s.getAvailableLinkedEvents();if(u.length===0){let p=c[0].point,b=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(u.length===1){l=u[0].otherSE;break}let d=null;for(let p=0,b=f.length;p<b;p++)if(f[p].point===s.point){d=p;break}if(d!==null){let p=f.splice(d)[0],b=c.splice(p.index);b.unshift(b[0].otherSE),t.push(new n(b.reverse()));continue}f.push({index:c.length,point:s.point});let m=s.getLeftmostComparator(a);l=u.sort(m)[0].otherSE;break}t.push(new n(c));}return t}constructor(e){this.events=e;for(let t=0,o=e.length;t<o;t++)e[t].segment.ringOut=this;this.poly=null;}getGeom(){let e=this.events[0].point,t=[e];for(let c=1,h=this.events.length-1;c<h;c++){let f=this.events[c].point,u=this.events[c+1].point;qa(f,e,u)!==0&&(t.push(f),e=f);}if(t.length===1)return null;let o=t[0],r=t[1];qa(o,e,r)===0&&t.shift(),t.push(t[0]);let i=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,l=[];for(let c=a;c!=s;c+=i)l.push([t[c].x,t[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true;}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,i=this.events.length;r<i;r++){let a=this.events[r];Ge.compare(e,a)>0&&(e=a);}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null;}}},pr=class{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[];}addInterior(e){this.interiorRings.push(e),e.poly=this;}getGeom(){let e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getGeom();r!==null&&e.push(r);}return e}},Mn=class{constructor(e){this.rings=e,this.polys=this._composePolys(e);}getGeom(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getGeom();r!==null&&e.push(r);}return e}_composePolys(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.poly)if(i.isExteriorRing())t.push(new pr(i));else {let a=i.enclosingRing();a.poly||t.push(new pr(a)),a.poly.addInterior(i);}}return t}},Fn=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt.compare;this.queue=e,this.tree=new St(t),this.segments=[];}process(e){let t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;let r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i=r,a=r,s,l;for(;s===void 0;)i=this.tree.prev(i),i===null?s=null:i.key.consumedBy===void 0&&(s=i.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){let c=null;if(s){let f=s.getIntersection(t);if(f!==null&&(t.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f))){let u=this._splitSafely(s,f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}}let h=null;if(l){let f=l.getIntersection(t);if(f!==null&&(t.isAnEndpoint(f)||(h=f),!l.isAnEndpoint(f))){let u=this._splitSafely(l,f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}}if(c!==null||h!==null){let f=null;c===null?f=h:h===null?f=c:f=Ge.comparePoints(c,h)<=0?c:h,this.queue.remove(t.rightSE),o.push(t.rightSE);let u=t.split(f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}o.length>0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=s);}else {if(s&&l){let c=s.getIntersection(l);if(c!==null){if(!s.isAnEndpoint(c)){let h=this._splitSafely(s,c);for(let f=0,u=h.length;f<u;f++)o.push(h[f]);}if(!l.isAnEndpoint(c)){let h=this._splitSafely(l,c);for(let f=0,u=h.length;f<u;f++)o.push(h[f]);}}}this.tree.remove(t);}return o}_splitSafely(e,t){this.tree.remove(e);let o=e.rightSE;this.queue.remove(o);let r=e.split(t);return r.push(o),e.consumedBy===void 0&&this.tree.add(e),r}},ts=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,_u=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Dn=class{run(e,t,o){We.type=e,ho.reset();let r=[new mr(t,true)];for(let f=0,u=o.length;f<u;f++)r.push(new mr(o[f],false));if(We.numMultiPolys=r.length,We.type==="difference"){let f=r[0],u=1;for(;u<r.length;)wn(r[u].bbox,f.bbox)!==null?u++:r.splice(u,1);}if(We.type==="intersection")for(let f=0,u=r.length;f<u;f++){let d=r[f];for(let m=f+1,p=r.length;m<p;m++)if(wn(d.bbox,r[m].bbox)===null)return []}let i=new St(Ge.compare);for(let f=0,u=r.length;f<u;f++){let d=r[f].getSweepEvents();for(let m=0,p=d.length;m<p;m++)if(i.insert(d[m]),i.size>ts)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let a=new Fn(i),s=i.size,l=i.pop();for(;l;){let f=l.key;if(i.size===s){let d=f.segment;throw new Error(`Unable to pop() ${f.isLeft?"left":"right"} SweepEvent [${f.point.x}, ${f.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(i.size>ts)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>_u)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let u=a.process(f);for(let d=0,m=u.length;d<m;d++){let p=u[d];p.consumedBy===void 0&&i.insert(p);}s=i.size,l=i.pop();}ho.reset();let c=En.factory(a.segments);return new Mn(c).getGeom()}},We=new Dn,Eu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("union",n,t)},Mu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("intersection",n,t)},Fu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("xor",n,t)},Du=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("difference",n,t)},Su={union:Eu,intersection:Mu,xor:Fu,difference:Du};var rs=Sn,In=rs.union??rs.default?.union??null;In||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 ns(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t],n[t+1]]);return e}function is(n){let e=[];for(let o of n)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 br(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.lift??0,s=o.get(a);s?s.push(i):o.set(a,[i]);}let r=[];for(let[i,a]of o){if(a.length<2){r.push(...a);continue}let l=(t>0&&e?a.map(f=>({outer:e(f.outer,-t)??f.outer,holes:f.holes.map(u=>e(u,t)??u)})):a).map(f=>[ns(f.outer),...f.holes.map(ns)]),c;try{if(!In)throw new Error("\u043D\u0435\u0442 union");c=In(l[0],...l.slice(1));}catch{r.push(...a);continue}let h=c;if(!Array.isArray(h)||h.length===0){r.push(...a);continue}for(let f of h){if(!f.length)continue;let u=is(f[0]);if(u.length<8)continue;let d=[];for(let m=1;m<f.length;m++){let p=is(f[m]);p.length>=8&&d.push(p);}r.push(i?{outer:u,holes:d,lift:i}:{outer:u,holes:d});}}return r}var Tt=16,hs=64,ds=0,Iu=1,as=2,Lu=3,mo=1,Tu=.6;function Rn(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=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,h=Math.max(512,n.length*24),f=new ArrayBuffer(h*Tt),u={view:new DataView(f),bytes:new Uint8Array(f),offset:0,count:0,indices:[],extent:e,ensure(M){if(u.count+M<=h)return;h=Math.max(h*2,u.count+M);let D=new ArrayBuffer(h*Tt);new Uint8Array(D).set(u.bytes.subarray(0,u.offset)),f=D,u.view=new DataView(D),u.bytes=new Uint8Array(D);}},d=[],m=[],p=new Map;for(let M of n.features()){if(M.type!==3||!ve(t,M.properties))continue;let D=o.liftBy?.(M.properties)??0,S=M.properties.osm_id,L=typeof S=="number"?S:typeof S=="string"?Number(S):NaN,k=Number.isFinite(L)?L:Number(M.id??0);for(let I of gt(M.loadGeometry())){let G=qe(I,e,Se(e));G&&(d.push(D?{...G,lift:D}:G),m.push(k));}}let b=new Set,g=Math.max(o.weld??Tu,0),y=br(d,(M,D)=>Tn(M,D,e,b),g/r),A=g>0?y.map(M=>({...M,outer:us(M.outer,g/r,e),holes:M.holes.map(D=>us(D,g/r,e))})):y;for(let M of A){ls(M.outer,p);for(let D of M.holes)ls(D,p);}o.onShapes?.(A);let B=Hu(A,d,m),C=new Set;for(let[M,D]of p)D>1&&C.add(M);let v=[],_={radius:c,segments:o.cornerSegments,extent:e,margin:Se(e),minCutRatio:0,maxChord:Fa/r},w=[];for(let M of A){let D=u.indices.length,S=v.length,L=c>0?{outer:Je(M.outer,{..._,keep:cs(M.outer,C)}),holes:M.holes.map(O=>Je(O,{..._,keep:cs(O,C)}))}:M,k=s>0?Tn(L.outer,s,e,C):L.outer,I=L.holes.map(O=>s>0?Tn(O,-s,e,C):O),G=M.lift??0,H=i+G,z=a+G;fs(u,k??L.outer,I.map((O,N)=>O??L.holes[N]),H,ds,o.maxSegment??0);let K=H,R=H-l;k&&s>0&&l>0&&Ln(u,k,L.outer,K,R,Iu,e,C),R!==z&&Ln(u,L.outer,L.outer,R,z,as,e,C);for(let O of L.holes)if(R!==z&&Ln(u,O,O,R,z,as,e,C),H<z){let N=u.indices.length;fs(u,O,[],z,Lu);for(let W=N;W<u.indices.length;W++)v.push(u.indices[W]);u.indices.length=N;}w.push(D,u.indices.length,S,v.length);}if(!u.indices.length&&!v.length)return null;let x=u.indices.length;for(let M=0;M<w.length;M+=4)w[M+2]+=x,w[M+3]+=x;let E=[];for(let M of B){E.push(M.length);for(let D of M)E.push(D);}let F=new Uint32Array(x+v.length);return F.set(u.indices,0),F.set(v,x),{vertices:f.slice(0,u.offset),indices:F.buffer,vertexCount:u.count,indexCount:F.length,extent:e,capIndexOffset:x,shapeFeatures:new Float64Array(E).buffer,shapeRanges:new Uint32Array(w).buffer}}function Hu(n,e,t){let o=n.map(()=>[]);if(!n.length)return o;let r=n.map(i=>ss(i.outer));for(let i=0;i<e.length;i++){let a=ku(e[i].outer);if(!a)continue;let s=-1;for(let l=0;l<n.length;l++){let c=r[l];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!Pn(n[l].outer,a[0],a[1]))continue;let h=false;for(let f of n[l].holes)if(Pn(f,a[0],a[1])){h=true;break}if(!h){s=l;break}}if(s<0){let l=ss(e[i].outer),c=0;for(let h=0;h<n.length;h++){let f=r[h],u=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=u>0&&d>0?u*d:0;m>c&&(c=m,s=h);}}s<0&&(s=0),o[s].includes(t[i])||o[s].push(t[i]);}return o}function ss(n){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let i=0;i<n.length;i+=2)n[i]<e&&(e=n[i]),n[i]>o&&(o=n[i]),n[i+1]<t&&(t=n[i+1]),n[i+1]>r&&(r=n[i+1]);return [e,t,o,r]}function ku(n){let e=n.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let i=(r+1)%e;t+=n[r*2]*n[i*2+1]-n[i*2]*n[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let i=(r+e-1)%e*2,a=r*2,s=(r+1)%e*2,l=(n[a]-n[i])*(n[s+1]-n[i+1])-(n[a+1]-n[i+1])*(n[s]-n[i]);if(l===0||l>0!==o)continue;let c=(n[i]+n[a]+n[s])/3,h=(n[i+1]+n[a+1]+n[s+1])/3;if(Pn(n,c,h))return [c,h]}return null}function Pn(n,e,t){let o=false,r=n.length/2-1;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1];l>t!=h>t&&e<(c-s)*(t-l)/(h-l)+s&&(o=!o);}return o}function Ht(n,e,t,o){let r=`${Math.round(n*100)},${Math.round(e*100)}`,i=`${Math.round(t*100)},${Math.round(o*100)}`;return r<i?`${r}|${i}`:`${i}|${r}`}function ls(n,e){for(let t=0;t+3<n.length;t+=2){let o=Ht(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function cs(n,e){if(!e.size)return;let t=n.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let i=Ht(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=Ht(n[r*2],n[r*2+1],n[(r+1)%t*2],n[(r+1)%t*2+1]);(e.has(i)||e.has(a))&&(o[r]=true);}return o}function po(n,e,t,o,r,i,a,s){let l=n.offset;return n.view.setFloat32(l,e,true),n.view.setFloat32(l+4,t,true),n.view.setInt16(l+8,Pu(Math.round(o*hs)),true),n.view.setInt8(l+10,kn(Math.round(r*127))),n.view.setInt8(l+11,kn(Math.round(i*127))),n.view.setInt8(l+12,kn(Math.round(a*127))),n.bytes[l+13]=s,n.view.setInt8(l+14,e<=0?-mo:e>=n.extent?mo:0),n.view.setInt8(l+15,t<=0?-mo:t>=n.extent?mo:0),n.offset+=Tt,n.count++}function fs(n,e,t,o,r=ds,i=0){let a=[],s=[];for(let f=0;f<e.length;f++)a.push(e[f]);for(let f of t){s.push(a.length/2);for(let u=0;u<f.length;u++)a.push(f[u]);}let l=Re(a,s.length?s:void 0,2);if(!l.length)return;let c=l;if(i>0){let f=[];pn(a,l,0,i,f),c=f;}n.ensure(a.length/2);let h=n.count;for(let f=0;f<a.length;f+=2)po(n,a[f],a[f+1],o,0,0,1,r);for(let f=0;f<c.length;f+=3)n.indices.push(h+c[f],h+c[f+2],h+c[f+1]);}function Ln(n,e,t,o,r,i,a,s){let l=Math.min(e.length,t.length)/2;if(!(l<3)){n.ensure((l-1)*4);for(let c=0;c<l-1;c++){let h=t[c*2],f=t[c*2+1],u=t[c*2+2],d=t[c*2+3];if(h===u&&f===d||cr(h,f,u,d,a,Se(a))||s.has(Ht(h,f,u,d)))continue;let m=u-h,p=d-f,b=Math.hypot(m,p)||1,g=p/b,y=-m/b,A=o-r,B=Math.hypot(e[c*2]-h,e[c*2+1]-f)||0,C=0;if(B>1e-6&&A!==0){let E=1/Math.hypot(1,A/B);C=B/Math.hypot(B,A)*Math.sign(A),g*=E,y*=E;}let v=po(n,e[c*2],e[c*2+1],o,g,y,C,i),_=po(n,e[c*2+2],e[c*2+3],o,g,y,C,i),w=po(n,h,f,r,g,y,C,i),x=po(n,u,d,r,g,y,C,i);n.indices.push(w,_,x,w,v,_);}}}function Tn(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let h=0;h<r;h++){let f=n[h*2],u=n[h*2+1],d=n[(h+r-1)%r*2],m=n[(h+r-1)%r*2+1],p=n[(h+1)%r*2],b=n[(h+1)%r*2+1],g=Math.hypot(f-d,u-m)||1,y=Math.hypot(p-f,b-u)||1,A=(u-m)/g,B=-(f-d)/g,C=(b-u)/y,v=-(p-f)/y,_=A+C,w=B+v,x=Math.hypot(_,w);if(x<1e-6){i.push(f,u);continue}_/=x,w/=x;let E=Math.min(1/Math.max(_*A+w*B,.35),3),F=f-_*e*E,M=u-w*e*E,D=Ht(d,m,f,u),S=Ht(f,u,p,b);if(o.has(D)||o.has(S)){i.push(f,u);continue}let L=-Se(t),k=t+Se(t);((G,H)=>G<=L||G>=k||H<=L||H>=k)(f,u)&&(F=f,M=u),i.push(F,M);}i.push(i[0],i[1]);let a=Math.abs(Hn(n)),s=Hn(i);if(Math.sign(s)!==Math.sign(Hn(n))||Math.abs(s)<a*.25)return null;let l=-Se(t),c=t+Se(t);for(let h=0;h<i.length;h+=2)i[h]=Math.max(l,Math.min(c,i[h])),i[h+1]=Math.max(l,Math.min(c,i[h+1]));return i}function Hn(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var kn=n=>n>127?127:n<-127?-127:n,Pu=n=>n>32767?32767:n<-32768?-32768:n;function us(n,e,t){if(!(e>0))return n;let o=Se(t),r=-o,i=t+o,a=n;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),h=l;for(let u=0;u<l&&!(h<=5);u++){let d=a[u*2],m=a[u*2+1];if(d<=r||d>=i||m<=r||m>=i)continue;let p=(u+l-1)%l;for(;!c[p]&&p!==u;)p=(p+l-1)%l;let b=(u+1)%l;for(;!c[b]&&b!==u;)b=(b+1)%l;if(p===u||b===u)break;let g=a[p*2],y=a[p*2+1],A=a[b*2]-g,B=a[b*2+1]-y,C=Math.hypot(A,B);C<1e-6||Math.abs((d-g)*B-(m-y)*A)/C<e&&(c[u]=false,h--);}if(h===l)break;let f=[];for(let u=0;u<l;u++)c[u]&&f.push(a[u*2],a[u*2+1]);f.push(f[0],f[1]),a=f;}return a}var Ru=100;function Gn(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function On(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let h=0;h<i.length;h+=2)i[h]<a&&(a=i[h]),i[h]>l&&(l=i[h]),i[h+1]<s&&(s=i[h+1]),i[h+1]>c&&(c=i[h+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}n.cells=[];}}function Gu(n){n.cells=Array.from({length:1024},()=>[]);let e=n.extent/32;for(let t=0;t<n.shapes.length;t++){let o=n.shapes[t],r=kt(Math.floor(o.minX/e)),i=kt(Math.floor(o.maxX/e)),a=kt(Math.floor(o.minY/e)),s=kt(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=i;c++)n.cells[l*32+c].push(t);}}var ps=n=>n.shapes.length===0;function gr(n,e,t){!n.cells.length&&n.shapes.length&&Gu(n);let o=n.extent/32,r=n.cells[kt(Math.floor(t/o))*32+kt(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let s=n.shapes[a];if(s.level<=i||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!ms(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(ms(c,e,t)){l=true;break}l||(i=s.level);}return Math.min(Math.round(i*100),127)}function zn(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=gr(n,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],h=e[s+2],f=e[s+3],u=gr(n,h,f);if(u!==a&&i>0){let d=Math.hypot(h-l,f-c),m=Math.min(Math.ceil(d/i),64),p=a;for(let b=1;b<m;b++){let g=b/m,y=l+(h-l)*g,A=c+(f-c)*g,B=gr(n,y,A);B!==p&&(t.push(y,A),o.push(B),p=B);}}t.push(h,f),o.push(u),a=u;}return {pts:t,levels:o}}var kt=n=>n<0?0:n>31?31:n;function ms(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1];l>t!=h>t&&e<(c-s)*(t-l)/(h-l)+s&&(o=!o);}return o}var Ou=5;function Bt(n){let e=n.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=n.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var at=20;function Vn(n,e,t=0,o,r=0,i={}){let{level:a}=i,s=Math.max(256,n.length*24),l=new ArrayBuffer(s*at),c=new DataView(l),h=0,f=[],u=[],d=C=>{if(h+C<=s)return;s=Math.max(s*2,h+C);let v=new ArrayBuffer(s*at);new Uint8Array(v).set(new Uint8Array(l,0,h*at)),l=v,c=new DataView(v);},m=(C,v,_,w,x,E,F,M=0,D=0,S=0)=>{let L=h*at;return c.setInt16(L,C,true),c.setInt16(L+2,v,true),c.setInt16(L+4,_,true),c.setInt16(L+6,w,true),c.setInt8(L+8,x),c.setInt8(L+9,E),c.setInt8(L+10,M),c.setInt8(L+11,D),c.setFloat32(L+12,F,true),c.setFloat32(L+16,S,true),h++},p=0,b=0,g=r>0?12/r:0,y=g>0?Ku(n):null;for(let C of n.features()){if(C.type!==2&&C.type!==3||!ve(e,C.properties)||a!==void 0&&Bt(C.properties)!==a)continue;let v=C.properties.osm_id,_=typeof v=="number"?v:typeof v=="string"?Number(v):NaN;b=Number.isFinite(_)?_:Number(C.id??0);let w=C.properties.width;p=typeof w=="number"&&w>.5&&w<100?w:0;let x=C.type===3;for(let E of C.loadGeometry()){let F=t>0?Vu(bs(E),t):bs(E);if(F.length<4)continue;let M=o&&!ps(o)?zn(o,F):null,D=M?M.pts:F,S=M?.levels,L=D.length/2;if(L<2)continue;let k=Bt(C.properties),I=yr(Math.round(D[0]),Math.round(D[1])),G=yr(Math.round(D[L*2-2]),Math.round(D[L*2-1])),H=null,z=p;if(y&&p>0&&!x){let R=0;for(let Q=0;Q<L-1;Q++)R+=Math.hypot(D[Q*2+2]-D[Q*2],D[Q*2+3]-D[Q*2+1]);z=ys(k,p,I,G,y);let O=Q=>Math.min(y.width.get(Q)??0,z*2),N=O(I)-z,W=O(G)-z,Y=Math.min(g,R/2);if(Y>0&&(N>0||W>0)){H=ee=>{let q=0;return N>0&&ee<Y&&(q=N*(1-ee/Y)),W>0&&R-ee<Y&&(q=Math.max(q,W*(1-(R-ee)/Y))),z+q};let Q=[];for(let ee of [Y,R-Y])ee>.01&&ee<R-.01&&Q.push(ee);if(Q.length){let ee=zu(D,S,Q);D=ee.pts,S=ee.levels,L=D.length/2;}}}d((L-1)*4);let K=0;for(let R=0;R<L-1;R++){let O=D[R*2],N=D[R*2+1],W=D[R*2+2],Y=D[R*2+3],Q=Math.hypot(W-O,Y-N);if(x&&Nu(O,N,W,Y,n.extent)){K+=Q;continue}let ee=Wu(O,N,W,Y,n.extent);if(!ee){K+=Q;continue}let[q,J,ne,se]=ee,oe=Math.hypot(q-O,J-N),X=Math.hypot(ne-q,se-J),j=Math.hypot(W-ne,Y-se),ie=K+oe,ae=S?S[R]:0,ue=S?S[R+1]:0,le=H?H(ie):z,Ae=H?H(ie+X):z,_e=m(q,J,ne,se,0,-1,ie,ae,ue,le),we=m(q,J,ne,se,0,1,ie,ae,ue,le),ut=m(q,J,ne,se,1,1,ie,ae,ue,Ae),wt=m(q,J,ne,se,1,-1,ie,ae,ue,Ae);K+=oe+X+j,f.push(_e,we,ut,_e,ut,wt),u.push(b,b);}}}if(!f.length)return null;let A=new Uint32Array(f),B=new Float64Array(u);return {vertices:l.slice(0,h*at),indices:A.buffer,vertexCount:h,indexCount:A.length,featureIds:B.buffer}}function zu(n,e,t){let o=[...t].sort((l,c)=>l-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<n.length;l+=2){let c=n[l],h=n[l+1],f=n[l+2],u=n[l+3],d=Math.hypot(f-c,u-h);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,h+(u-h)*m),i&&e&&i.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*m)),s++;}a+=d,r.push(f,u),i&&e&&i.push(e[l/2+1]);}return {pts:r,levels:i}}function Vu(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],s=n[o+3];t.push(r,i);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-i)/e));for(let c=1;c<l;c++){let h=c/l;t.push(r+(a-r)*h,i+(s-i)*h);}}return t.push(n[n.length-2],n[n.length-1]),t}function bs(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}function Wu(n,e,t,o,r){let i=t-n,a=o-e,s=0,l=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[h,f]of c){if(h===0){if(f<0)return null;continue}let u=f/h;if(h<0){if(u>l)return null;u>s&&(s=u);}else {if(u<s)return null;u<l&&(l=u);}}return l-s<1e-6?null:[Math.round(n+i*s),Math.round(e+a*s),Math.round(n+i*l),Math.round(e+a*l)]}function Nu(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}var gs=new WeakMap,yr=(n,e)=>(n+512)*65536+(e+512);function ys(n,e,t,o,r){if(n===0||e<=0)return e;let i=8*4294967296,a=Math.max(r.raw.get(t+i)??0,r.raw.get(o+i)??0);return a>0&&e>a?a:e}function Ku(n){let e=gs.get(n);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of n.features()){if(r.type!==2)continue;let i=r.properties.width,a=typeof i=="number"&&i>.5&&i<100?i:0,s=Bt(r.properties);for(let l of r.loadGeometry()){if(l.length<4)continue;let c=yr(Math.round(l[0]),Math.round(l[1])),h=yr(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let f of [c,h]){let u=f+(s+8)*4294967296;t.ends.set(u,(t.ends.get(u)??0)+1),a>0&&t.raw.set(u,Math.max(t.raw.get(u)??0,a));}o.push({h:c,t:h,lv:s,w:a});}}for(let r of o){let i=ys(r.lv,r.w,r.h,r.t,t);if(!(i<=0))for(let a of [r.h,r.t]){let s=t.width.get(a);(s===void 0||i>s)&&t.width.set(a,i);}}return gs.set(n,t),t}function Wn(n){if(!n.length)return null;for(let t of n)if(!t.cut.some(Boolean))return [{outer:t.ring,holes:t.holes??[]}];if(n.length<2)return null;let e=br(n.map(t=>({outer:t.ring,holes:t.holes??[]})));return e.length?e:null}var Ar=class{constructor(){this.meshes=new P;this.stitched=new te;this.hiddenByTile=new P;this.changed=new te;this.signature="";this.meshSig=new P;this.cache=new P;}update(e,t,o){let r=new P,i=0,a="";for(let[f,u]of e.loadedTiles()){if(u.id.z!==o.zoom)continue;let d=u.data?.seams;if(d?.length){a+=f+";",i=u.data?.buckets?.[t]?.extent??i;for(let m of d){let p=r.get(m.osmId);p?p.push({seam:m,tile:u.id}):r.set(m.osmId,[{seam:m,tile:u.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!i||!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 P,l=new P,c=new P,h=new te;for(let[f,u]of r){h.add(f);let d=u.map(g=>g.tile.dataKey).sort().join(","),m=this.cache.get(f);if(!m||m.sig!==d){let g=u[0].tile,y=u.map(({seam:B,tile:C})=>({ring:As(B.outer,C,g,i),holes:B.holes.map(v=>As(v,C,g,i)),cut:B.outerCut})),A=Wn(y);if(A?.length)m={sig:d,shapes:A,owner:g,seam:u[0].seam,tiles:u.map(B=>B.tile.dataKey)},this.cache.set(f,m);else if(!m)continue}let p=m.owner.dataKey;l.set(p,m.owner);let b=s.get(p)??[];for(let g of m.shapes)b.push({rings:{outer:g.outer,holes:g.holes},seam:m.seam});s.set(p,b),c.set(p,(c.get(p)??"")+f+":"+m.sig+";"),this.stitched.add(f);for(let g of [...m.tiles,...u.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()])h.has(f)||this.cache.delete(f);for(let[f,u]of s){let d=c.get(f);if(this.meshSig.get(f)===d&&this.meshes.has(f))continue;let m=Na(u,i,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/i: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 As(n,e,t,o){let r=(e.x-t.x)*o,i=(e.y-t.y)*o,a=new Array(n.length);for(let s=0;s<n.length;s+=2)a[s]=n[s]+r,a[s+1]=n[s+1]+i;return a}var Nn={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Kn={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Bs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 Cs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 vs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 ws={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",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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 xs={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:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var _s={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 Es={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 Ms={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:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Fs={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 Ds={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 Ss={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 Is={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 Ls={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 Ts={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 Hs={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 ks={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 Ps={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 Rs={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 Gs={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 Os={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 zs={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 Vs={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 Ws={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 Ns={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 Ks={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 Us={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 Js={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 Xs={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 js={"3d":Ms,cartoon:Fs,cyberpunk:Ds,dawn:Ss,dusk:Is,earth:Ls,future:Ts,"glass-refined":Hs,glass:ks,"harmony-black":Ps,"harmony-blue":Rs,"harmony-green":Gs,lunar:Os,matte:zs,minimal:Vs,ocean:Ws,premium:Ns,realistic:Ks,space:Us,volcano:Js,white:Xs};function Br(n,e){let t=new Set(e.hidden??[]),o=n.layers.map(r=>{let i=e.paint?.[r.id],a={...r,paint:i?{...r.paint,...i}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))n.layers.some(i=>i.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 {...n,name:e.name,background:e.background??n.background,light:{...n.light,...e.light},sky:{...n.sky,...e.sky},model3dKey:e.model3dKey??n.model3dKey,layers:o}}var Z="base",Ys="\u241F",je=(n,e)=>n+"\u241F"+String(e);var Pt=class{constructor(e=Un){this.splitValues={};this.spec=e,this.light={...Kn,...e.light??{}},this.sky={...Nn,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return pe(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let s=this.layers.find(h=>h.id===i.from)?.paint?.color,l=ke(s,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return ke(i,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=Z){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??Z)===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??Z))]}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"]]))]}},Un=Bs,Ah=Cs,Bh=vs,Ch=ws;function vh(n,e){if(typeof n!="string")return n;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);if(!t)return n;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function Zs(n,e,t,o){let r=n.paint?.building;return r?{...n,name:e,paint:{...n.paint,building:{...r,windowColor:vh(r.color,t),windowGlow:0,...o}}}:{...n,name:e}}var Ye={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:xs,mono:_s,pale:Es,...js};Ye["3d-tone"]=Zs(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"]=Zs(Ye.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function Cr(n,e=Un){if(typeof n!="string")return Br(e,n);if(n==="day")return e;let t=Ye[n];return t?Br(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${n}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(Ye).join(", ")}`),e)}var bo=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),i=o.createFramebuffer();if(!r||!i)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=i,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,i),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 Qs(n){let e=n.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 n.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),n.bindTexture(7,null),t}var go=`
|
|
8
|
+
`)}var oo=new Set,tn=false;function Re(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;oo.size&&oo.clear();let i=ya(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let s=0,l=0,c=0;if(o&&(i=Jc(n,e,i,t)),n.length>80*t){s=n[0],l=n[1];let h=s,f=l;for(let u=t;u<r;u+=t){let d=n[u],m=n[u+1];d<s&&(s=d),m<l&&(l=m),d>h&&(h=d),m>f&&(f=m);}c=Math.max(h-s,f-l),c=c!==0?32767/c:0;}return on(i,a,s,l,c),a}function ya(n,e,t,o,r){let i=null;if(r===af(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=ga(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=ga(a/o|0,n[a],n[a+1],i);return i&&ro(i,i.next)&&(io(i),i=i.next),i}function pt(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&(oo.size===0||!oo.has(o))&&(ro(o,o.next)||ge(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),tn=true,io(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function on(n,e,t,o,r){r&&$c(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let s=n.prev,l=n.next;if(ge(s,n,l)<0&&(r?Nc(n,t,o,r):Wc(n))){e.push(s.i,n.i,l.i),io(n),n=l,i=l;continue}if(n=l,n===i){if(tn=false,n=pt(n),tn){i=n;continue}if(!a){n=Kc(n,e),i=n,a=true;continue}Uc(n,e,t,o,r);break}}}function Wc(n){let e=n.prev,t=n,o=n.next,r=e.x,i=t.x,a=o.x,s=e.y,l=t.y,c=o.y,h=Math.min(r,i,a),f=Math.min(s,l,c),u=Math.max(r,i,a),d=Math.max(s,l,c),m=o.next;for(;m!==e;){if(m.x>=h&&m.x<=u&&m.y>=f&&m.y<=d&&!(r===m.x&&s===m.y)&&nr(r,s,i,l,a,c,m.x,m.y)&&ge(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function Nc(n,e,t,o){let r=n.prev,i=n,a=n.next,s=r.x,l=i.x,c=a.x,h=r.y,f=i.y,u=a.y,d=Math.min(s,l,c),m=Math.min(h,f,u),p=Math.max(s,l,c),b=Math.max(h,f,u),g=sn(d,m,e,t,o),y=sn(p,b,e,t,o),A=n.prevZ;for(;A&&A.z>=g;){if(A.x>=d&&A.x<=p&&A.y>=m&&A.y<=b&&A!==a&&!(s===A.x&&h===A.y)&&nr(s,h,l,f,c,u,A.x,A.y)&&ge(A.prev,A,A.next)>=0)return false;A=A.prevZ;}let B=n.nextZ;for(;B&&B.z<=y;){if(B.x>=d&&B.x<=p&&B.y>=m&&B.y<=b&&B!==a&&!(s===B.x&&h===B.y)&&nr(s,h,l,f,c,u,B.x,B.y)&&ge(B.prev,B,B.next)>=0)return false;B=B.nextZ;}return true}function Kc(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;Ca(r,t,t.next,i,false)&&no(r,i)&&no(i,r)&&(e.push(r.i,t.i,i.i),io(t),io(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?pt(t):t}function Uc(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&of(i,a)){let s=va(i,a);i=pt(i,i.next),s=pt(s,s.next),on(i,e,t,o,r),on(s,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var rn=false;function Jc(n,e,t,o){let r=[];for(let i=0,a=e.length;i<a;i++){let s=e[i]*o,l=i<a-1?e[i+1]*o:n.length,c=ya(n,s,l,o,false);c===c.next&&oo.add(c),r.push(tf(c));}r.sort(Xc),Yc(n.length/o,e.length),Ba(t,t),rn=true;for(let i=0;i<r.length;i++)t=jc(r[i],t);return rn=false,pt(t)}function Xc(n,e){return n.x-e.x||n.y-e.y||(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)}function jc(n,e){let t=Qc(n,e);if(!t)return e;let o=va(t,n),r=o.next;return Ba(t,r.next),pt(o,o.next),pt(t,t.next)}var Aa=16,me=new Float64Array(0),rr=0,nn=[],an=[];function Yc(n,e){let t=Math.ceil((n+2*e)/Aa)+e+2;me.length<t*4&&(me=new Float64Array(t*4)),rr=0;}function Ba(n,e){let t=n;do{let o=rr++;nn[o]=t;let r=1/0,i=1/0,a=-1/0,s=-1/0,l=0;do{let h=t.next;t.z=o,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>s&&(s=t.y),h.x<r&&(r=h.x),h.x>a&&(a=h.x),h.y<i&&(i=h.y),h.y>s&&(s=h.y),t=h;}while(++l<Aa&&t!==e);an[o]=t;let c=o*4;me[c]=r,me[c+1]=i,me[c+2]=a,me[c+3]=s;}while(t!==e)}function Zc(n,e){let t=n.z*4;e.x<me[t]&&(me[t]=e.x),e.y<me[t+1]&&(me[t+1]=e.y),e.x>me[t+2]&&(me[t+2]=e.x),e.y>me[t+3]&&(me[t+3]=e.y);}function pa(n){let e=an[n];for(;e.prev.next!==e;)e=e.next;return an[n]=e,e}function ba(n){let e=nn[n];for(;e.prev.next!==e;)e=e.next;return nn[n]=e,e}function Qc(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if(ro(n,t))return t;for(let u=0,d=0;u<rr;u++,d+=4){if(r<me[d+1]||r>me[d+3]||me[d]>o||me[d+2]<=i)continue;let m=pa(u);t=ba(u);do{if(t.prev.next===t){if(ro(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=o&&p>i&&(i=p,a=t.x<t.next.x?t:t.next,p===o))return a}}t=t.next;}while(t!==m)}if(!a)return null;let s=a.x,l=a.y,c=Math.min(r,l),h=Math.max(r,l),f=1/0;for(let u=0,d=0;u<rr;u++,d+=4){if(me[d+2]<s||me[d]>o||me[d+3]<c||me[d+1]>h)continue;let m=pa(u);t=ba(u);do{if(t.prev.next===t&&o>=t.x&&t.x>=s&&o!==t.x&&nr(r<l?o:i,r,s,l,r<l?i:o,r,t.x,t.y)){let p=Math.abs(r-t.y)/(o-t.x);(no(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(p<f||p===f&&(t.x>a.x||t.x===a.x&&qc(a,t)))&&(a=t,f=p);}t=t.next;}while(t!==m)}return a}function qc(n,e){return ge(n.prev,n,e.prev)<0&&ge(e.next,n,n.next)<0}var Pe=[],$t=[],mt=new Uint32Array(0),eo=new Uint32Array(0),to=new Uint32Array(256);function $c(n,e,t,o){let r=n,i=0;do r.z=sn(r.x,r.y,e,t,o),Pe[i++]=r,r=r.next;while(r!==n);ef(i);let a=null;for(let s=0;s<i;s++){let l=Pe[s];l.prevZ=a,a&&(a.nextZ=l),a=l;}a.nextZ=null;}function ef(n){if(n<=32){for(let e=1;e<n;e++){let t=Pe[e],o=t.z,r=e-1;for(;r>=0&&Pe[r].z>o;)Pe[r+1]=Pe[r],r--;Pe[r+1]=t;}return}mt.length<n&&(mt=new Uint32Array(n),eo=new Uint32Array(n),$t=new Array(n));for(let e=0;e<n;e++)mt[e]=Pe[e].z;tr(n,Pe,mt,$t,eo,0),tr(n,$t,eo,Pe,mt,8),tr(n,Pe,mt,$t,eo,16),tr(n,$t,eo,Pe,mt,24);}function tr(n,e,t,o,r,i){to.fill(0);for(let s=0;s<n;s++)to[t[s]>>>i&255]++;let a=0;for(let s=0;s<256;s++){let l=to[s];to[s]=a,a+=l;}for(let s=0;s<n;s++){let l=t[s],c=to[l>>>i&255]++;o[c]=e[s],r[c]=l;}}function sn(n,e,t,o,r){return n=(n-t)*r|0,e=(e-o)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function tf(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function nr(n,e,t,o,r,i,a,s){return (r-a)*(e-s)>=(n-a)*(i-s)&&(n-a)*(o-s)>=(t-a)*(e-s)&&(t-a)*(i-s)>=(r-a)*(o-s)}function of(n,e){let t=ro(n,e)&&ge(n.prev,n,n.next)>0&&ge(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||no(n,e)&&no(e,n)&&(ge(n.prev,n,e.prev)!==0||ge(n,e.prev,e)!==0))&&!rf(n,e)&&(t||nf(n,e))}function ge(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function ro(n,e){return n.x===e.x&&n.y===e.y}function Ca(n,e,t,o,r=true){let i=ge(n,e,t),a=ge(n,e,o),s=ge(t,o,n),l=ge(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(s>0&&l<0||s<0&&l>0)?true:r?!!(i===0&&or(n,t,e)||a===0&&or(n,o,e)||s===0&&or(t,n,o)||l===0&&or(t,e,o)):false}function or(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function rf(n,e){let t=Math.min(n.x,e.x),o=Math.max(n.x,e.x),r=Math.min(n.y,e.y),i=Math.max(n.y,e.y),a=n;do{let s=a.next;if(a.x>o&&s.x>o||a.x<t&&s.x<t||a.y>i&&s.y>i||a.y<r&&s.y<r){a=s;continue}if(a.i!==n.i&&s.i!==n.i&&a.i!==e.i&&s.i!==e.i&&Ca(a,s,n,e))return true;a=s;}while(a!==n);return false}function no(n,e){return ge(n.prev,n,n.next)<0?ge(n,e,n.next)>=0&&ge(n,n.prev,e)>=0:ge(n,e,n.prev)<0||ge(n,n.next,e)<0}function nf(n,e){let t=n,o=false,r=(n.x+e.x)/2,i=(n.y+e.y)/2;do{let a=t.next;t.y>i!=a.y>i&&r<(a.x-t.x)*(i-t.y)/(a.y-t.y)+t.x&&(o=!o),t=a;}while(t!==n);return o}function va(n,e){let t=ln(n.i,n.x,n.y),o=ln(e.i,e.x,e.y),r=n.next,i=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,o.next=t,t.prev=o,i.next=o,o.prev=i,o}function ga(n,e,t,o){let r=ln(n,e,t);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function io(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ),rn&&Zc(n.prev,n.next);}function ln(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function af(n,e,t,o){let r=0;for(let i=e,a=t-o;i<t;i+=o)r+=(n[a]-n[i])*(n[i+1]+n[a+1]),a=i;return r}var wa=23283064365386963e-26,sf=12,xa=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),cn=0,ir=1,ao=2,ar=5,bt=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length;}readFields(e,t,o=this.length){for(;this.pos<o;){let r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r);}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,true);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,true);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getUint32(this.pos+4,true)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getInt32(this.pos+4,true)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,true);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,true);return this.pos+=8,e}readVarint(e){let t=this.buf,o,r;return r=t[this.pos++],o=r&127,r<128||(r=t[this.pos++],o|=(r&127)<<7,r<128)||(r=t[this.pos++],o|=(r&127)<<14,r<128)||(r=t[this.pos++],o|=(r&127)<<21,r<128)?o:(r=t[this.pos],o|=(r&15)<<28,lf(o,e,this))}readVarint64(){return this.readVarint(true)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return !!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=sf&&xa?xa.decode(this.buf.subarray(t,e)):Cf(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===ao?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===cn)for(;this.buf[this.pos++]>127;);else if(t===ao)this.pos=this.readVarint()+this.pos;else if(t===ar)this.pos+=4;else if(t===ir)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t);}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let o=new Uint8Array(t);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=t;}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*wa),true),this.pos+=8;}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*wa),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){cf(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)));}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2);}writeBoolean(e){this.writeVarint(+e);}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let t=this.pos;this.pos=vf(this.buf,e,this.pos);let o=this.pos-t;o>=128&&_a(t,o,this),this.pos=t-1,this.writeVarint(o),this.pos+=o;}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,true),this.pos+=4;}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,true),this.pos+=8;}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let o=0;o<t;o++)this.buf[this.pos++]=e[o];}writeRawMessage(e,t){this.pos++;let o=this.pos;e(t,this);let r=this.pos-o;r>=128&&_a(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,ao),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,hf,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,df,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,bf,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,mf,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,pf,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,gf,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,yf,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Af,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Bf,t);}writeBytesField(e,t){this.writeTag(e,ao),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,ar),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,ar),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,ir),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,ir),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,cn),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,cn),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,ao),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,ar),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,ir),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function lf(n,e,t){let o=t.buf,r,i;if(i=o[t.pos++],r=(i&112)>>4,i<128||(i=o[t.pos++],r|=(i&127)<<3,i<128)||(i=o[t.pos++],r|=(i&127)<<10,i<128)||(i=o[t.pos++],r|=(i&127)<<17,i<128)||(i=o[t.pos++],r|=(i&127)<<24,i<128)||(i=o[t.pos++],r|=(i&1)<<31,i<128))return _t(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function _t(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function cf(n,e){let t,o;if(n>=0?(t=n%4294967296|0,o=n/4294967296|0):(t=~(-n%4294967296),o=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,o=o+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ff(t,o,e),uf(o,e);}function ff(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127;}function uf(n,e){let t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))));}function _a(n,e,t){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(o);for(let r=t.pos-1;r>=n;r--)t.buf[r+o]=t.buf[r];}function hf(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function df(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function mf(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function pf(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function bf(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function gf(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function yf(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function Af(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function Bf(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function Cf(n,e,t){let o="",r=e;for(;r<t;){let i=n[r],a=null,s=i>239?4:i>223?3:i>191?2:1;if(r+s>t)break;let l,c,h;s===1?i<128&&(a=i):s===2?(l=n[r+1],(l&192)===128&&(a=(i&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(a=(i&15)<<12|(l&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=n[r+1],c=n[r+2],h=n[r+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(a=(i&15)<<18|(l&63)<<12|(c&63)<<6|h&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),r+=s;}return o}function vf(n,e,t){for(let o=0,r,i;o<e.length;o++){if(r=e.charCodeAt(o),r>55295&&r<57344)if(i)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,i=r;continue}else r=i-55296<<10|r-56320|65536,i=null;else {r>56319||o+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):i=r;continue}else i&&(n[t++]=239,n[t++]=191,n[t++]=189,i=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128);}return t}var lo=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(lo||{}),sr=class n{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,i){let a=new n(e,o,r,i);return e.readFields(wf,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,i=0,a=0,s=0,l=[],c=[];for(;e.pos<o;){if(i<=0){let h=e.readVarint();r=h&7,i=h>>3;}if(i--,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,i=-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]>i&&(i=a[s+1]);return [t,o,r,i]}};function wf(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?xf(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function xf(n,e){let t=n.readVarint()+n.pos;for(;n.pos<t;){let o=e.keys[n.readVarint()],r=e.values[n.readVarint()];o!==void 0&&(e.properties[o]=r);}}var lr=class n{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 n(e);return e.readFields(_f,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 sr.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function _f(n,e,t){t&&(n===15?e.version=t.readVarint():n===1?e.name=t.readString():n===5?e.extent=t.readVarint():n===2?e.featureOffsets.push(t.pos):n===3?e.keys.push(t.readString()):n===4&&e.values.push(Ef(t)));}function Ef(n){let e=n.readVarint()+n.pos,t=null;for(;n.pos<e;){let o=n.readVarint()>>3;o===1?t=n.readString():o===2?t=n.readFloat():o===3?t=n.readDouble():o===4?t=n.readVarint64():o===5?t=n.readVarint():o===6?t=n.readSVarint():o===7?t=n.readBoolean():n.skip(o);}return t}var so=class{constructor(e){this.layers={};new bt(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=lr.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function gt(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=Mf(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 Mf(n){let e=0;for(let t=0,o=n.length-2;t<n.length;o=t,t+=2)e+=(n[o]-n[t])*(n[t+1]+n[o+1]);return e/2}function W(n,e,t){return n===void 0?t:typeof n=="number"?n:Ea(n.stops,e,(o,r,i)=>o+(r-o)*i,t)}function ke(n,e,t){return n===void 0?t:typeof n=="string"?pe(n):Ea(n.stops,e,(o,r,i)=>{let a=pe(o),s=pe(r);return [a[0]+(s[0]-a[0])*i,a[1]+(s[1]-a[1])*i,a[2]+(s[2]-a[2])*i,a[3]+(s[3]-a[3])*i]},t)}function Ea(n,e,t,o){if(!n.length)return o;if(e<=n[0][0])return t(n[0][1],n[0][1],0);let r=n[n.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let i=1;i<n.length;i++){let[a,s]=n[i];if(e>a)continue;let[l,c]=n[i-1],h=a-l,f=h===0?0:(e-l)/h;return t(c,s,f)}return o}function ve(n,e){if(!n)return true;let t=n[0];switch(t){case "all":return n.slice(1).every(o=>ve(o,e));case "any":return n.slice(1).some(o=>ve(o,e));case "!":return !ve(n[1],e);case "has":return e[n[1]]!=null;case "!has":return e[n[1]]==null;case "in":{let o=e[n[1]];return o==null?false:n.slice(2).includes(o)}case "!in":{let o=e[n[1]];return o==null?true:!n.slice(2).includes(o)}default:{let o=e[n[1]],r=n[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 Ff=Math.PI/8,Df=.35,Sf=32,Fa=.25,Da=.5,Sa=.07;function Je(n,e){let t=e.radius;if(!(t>0))return n;let o=n.length/2-1;if(o<3)return n;let r=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??Df,0),a=e.extent,s=[];for(let l=0;l<o;l++){let c=n[l*2],h=n[l*2+1],f=n[(l+o-1)%o*2],u=n[(l+o-1)%o*2+1],d=n[(l+1)%o*2],m=n[(l+1)%o*2+1],p=c-f,b=h-u,g=d-c,y=m-h,A=Math.hypot(p,b),B=Math.hypot(g,y);if(A<1e-6||B<1e-6){s.push(c,h);continue}let C=p/A,v=b/A,_=g/B,w=y/B;if(e.keep?.[l]){s.push(c,h);continue}let x=C*_+v*w;if(x>.985){s.push(c,h);continue}if(a!==void 0&&(c<=0||c>=a||h<=0||h>=a)){s.push(c,h);continue}let E=Math.min(t,A*Ma,B*Ma);if(E<t*i){s.push(c,h);continue}let F=c-C*E,M=h-v*E,D=c+_*E,L=h+w*E,I=Math.acos(Math.max(-1,Math.min(1,x))),S=Math.min(Ff,Math.PI/2/r),P=Math.ceil(I/S-1e-6),z=e.maxChord&&e.maxChord>0?Math.ceil(E/Math.tan(I/2)*I/e.maxChord):0,H=Math.max(1,Math.min(Sf,Math.max(Math.min(r,P),z)));s.push(F,M);for(let R=1;R<H;R++){let N=R/H,O=1-N;s.push(O*O*F+2*O*N*c+N*N*D,O*O*M+2*O*N*h+N*N*L);}s.push(D,L);}return s.length<6?n:(s.push(s[0],s[1]),s)}var Ma=.4;var Se=n=>n/64;function qe(n,e,t=0){let o=Ia(n.outer,e,t);if(!o)return null;let r=[];for(let i of n.holes){let a=Ia(i,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Ia(n,e,t){let o=[];for(let r=0;r<n.length-2;r+=2)o.push(n[r],n[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let i=o;o=[];let a=i.length/2;if(a===0)return null;for(let s=0;s<a;s++){let l=i[s*2],c=i[s*2+1],h=i[(s+a-1)%a*2],f=i[(s+a-1)%a*2+1],u=La(l,c,r,e,t),d=La(h,f,r,e,t);if(u!==d){let m=If(h,f,l,c,r,e,t),p=r===0?-t:r===1?e+t:h+(l-h)*m,b=r===2?-t:r===3?e+t:f+(c-f)*m;o.push(p,b);}u&&o.push(l,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function La(n,e,t,o,r){return t===0?n>=-r:t===1?n<=o+r:t===2?e>=-r:e<=o+r}function If(n,e,t,o,r,i,a){return r===0?(-a-n)/(t-n):r===1?(i+a-n)/(t-n):r===2?(-a-e)/(o-e):(i+a-e)/(o-e)}function cr(n,e,t,o,r,i=0){let a=-i,s=r+i;return n===a&&t===a||n===s&&t===s||e===a&&o===a||e===s&&o===s}function fn(n,e){for(let t=0;t<n.length;t+=2)if(n[t]<=0||n[t]>=e||n[t+1]<=0||n[t+1]>=e)return true;return false}var Ta=1,Te=18,Dt=32,Ft=8,za=65535/Dt,Lf=9,Tf=1,Hf=0,kf=1,Pf=2;var Ha=0,Rf=1,ka=2,Gf=3,Va=.47;function dn(n,e,t,o={},r){let i=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Va,{b:a,ensure:s,take:l}=Wa(Math.max(1024,n.length*48));for(let c of n.features()){if(c.type!==3||!ve(t,c.properties))continue;let h=iu(c.properties),f=au(c.properties,h);if(h<=f)continue;let u=lu(c.properties)??Number(c.id??0),d=nu(u>>>0),m=ru(d,c.properties),p=ou(c.properties,h),b=gt(c.loadGeometry()),g=r?b.some(y=>{let A=qe(y,e,Se(e));return A?fn(A.outer,e):false}):false;for(let y of b){if(r&&g){let A=cu(y,e,h,f,u,d,m,p);A&&r.push(A);}Ua(a,y,s,{extent:e,metersPerUnit:i,height:h,minHeight:f,featureId:u,seed:d,tint:m,facade:p,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return l(e)}function Wa(n){let e=n,t=new ArrayBuffer(e*Te),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*Te);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=>{if(!o.indices.length)return null;let s=new Uint32Array(o.indices),l=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:s.buffer,featureIds:l.buffer,vertexCount:o.vertexCount,indexCount:s.length,extent:a}}}}function Na(n,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:Va,{b:r,ensure:i,take:a}=Wa(Math.max(1024,n.length*64));for(let{rings:s,seam:l}of n)Ua(r,s,i,{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 mn=(n,e)=>n|e<<2,Pa=n=>Math.max(-32768,Math.min(32767,n)),un=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,za)*Dt)));function Et(n,e,t,o,r,i,a,s,l,c,h=0,f=0,u=0){let d=n.vertOffset;return n.verts.setInt16(d,Pa(Math.round(e*Ft)),true),n.verts.setInt16(d+2,Pa(Math.round(t*Ft)),true),n.verts.setUint16(d+4,Math.round(Math.min(o,za)*Dt),true),n.vertsU8[d+6]=l,n.vertsU8[d+7]=s,n.verts.setInt8(d+8,hn(Math.round(r*127))),n.verts.setInt8(d+9,hn(Math.round(i*127))),n.verts.setInt8(d+10,hn(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,un(h),true),n.verts.setUint16(d+14,un(f),true),n.verts.setUint16(d+16,un(u),true),n.vertOffset+=Te,n.vertexCount++}function Ra(n,e,t,o,r,i,a,s,l,c){let h=e.length/2;if(h<3)return;let f=mn(Hf,a),u=zf(e,s),d=o-t,m=new Float64Array(h*2),p=new Uint8Array(h);{let b=new Float64Array(h*2);for(let g=0;g<h-1;g++){let y=e[g*2+2]-e[g*2],A=e[g*2+3]-e[g*2+1],B=Math.hypot(y,A)||1;b[g*2]=A/B,b[g*2+1]=-y/B;}for(let g=0;g<h-1;g++){let y=(g+h-2)%(h-1),A=b[y*2]*b[g*2]+b[y*2+1]*b[g*2+1],B=b[y*2]+b[g*2],C=b[y*2+1]+b[g*2+1],v=Math.hypot(B,C);A>.5&&v>1e-6&&(m[g*2]=B/v,m[g*2+1]=C/v,p[g]=1);}}for(let b=0;b<h-1;b++){let g=e[b*2],y=e[b*2+1],A=e[b*2+2],B=e[b*2+3];if(g===A&&y===B||c[b])continue;let C=A-g,v=B-y,_=Math.hypot(C,v)||1,w=v/_,x=-C/_,E=u.offset[b],F=u.width[b],M=[0,1];if(l){for(let L=0;L<l.length;L++)for(let I=L+1;I<l.length;I++){let S=yt(l[L],g,y)-yt(l[I],g,y),P=yt(l[L],A,B)-yt(l[I],A,B);if(S===P)continue;let z=S/(S-P);z>1e-4&&z<1-1e-4&&M.push(z);}M.sort((L,I)=>L-I);}let D=(L,I)=>{if(!l)return o;let S=1/0;for(let P of l)S=Math.min(S,yt(P,L,I));return Math.max(o,S)};for(let L=0;L+1<M.length;L++){let I=M[L],S=M[L+1];if(S-I<1e-6)continue;let P=g+C*I,z=y+v*I,H=g+C*S,R=y+v*S,N=E+_*I*s,O=E+_*S*s,G=(b+1)%(h-1),V=p[b]?m[b*2]:w,J=p[b]?m[b*2+1]:x,X=p[G]?m[G*2]:w,Q=p[G]?m[G*2+1]:x,ee=w+(V-w)*(1-I),q=x+(J-x)*(1-I),U=w+(X-w)*S,ae=x+(Q-x)*S,se=Math.hypot(ee,q)||1,oe=Math.hypot(U,ae)||1,j=ee/se,Y=q/se,ne=U/oe,ie=ae/oe;n.ensure(4);let ue=Et(n,P,z,t,j,Y,0,0,i,f,N,F,d),le=Et(n,H,R,t,ne,ie,0,0,i,f,O,F,d),Ae=Et(n,P,z,D(P,z),j,Y,0,255,i,f,N,F,d),_e=Et(n,H,R,D(H,R),ne,ie,0,255,i,f,O,F,d);n.indices.push(ue,_e,le,ue,Ae,_e),n.featureIds.push(r,r);}}}var Of=.9976;function zf(n,e){let t=n.length/2-1,o=[];for(let l=0;l<t;l++){let c=n[l*2+2]-n[l*2],h=n[l*2+3]-n[l*2+1],f=Math.hypot(c,h);o.push(f>0?{x:c/f,y:h/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>=Of,i=0;for(;i<t&&r((i-1+t)%t,i);)i++;i>=t&&(i=0);let a=new Array(t).fill(0),s=new Array(t).fill(0);for(let l=0;l<t;){let c=(i+l)%t,h=[c],f=o[c].len,u=l+1;for(;u<t;){let m=(i+u)%t;if(!r((i+u-1)%t,m))break;h.push(m),f+=o[m].len,u++;}let d=0;for(let m of h)a[m]=d,s[m]=f,d+=o[m].len;l=u;}return {offset:a,width:s}}function Vf(n,e,t,o,r,i,a){let s=[],l=[];for(let u=0;u<e.length;u++)s.push(e[u]);for(let u of t){l.push(s.length/2);for(let d=0;d<u.length;d++)s.push(u[d]);}let c=Re(s,l.length?l:void 0,2);if(!c.length)return;let h=mn(kf,a),f=n.vertexCount;for(let u=0;u<s.length;u+=2)Et(n,s[u],s[u+1],o,0,0,1,255,i,h);for(let u=0;u<c.length;u+=3)n.indices.push(f+c[u],f+c[u+2],f+c[u+1]),n.featureIds.push(r);}function Wf(n){let e=Nf(n);if(e.length<3)return null;let t=Math.abs(Kf(n));if(t<=0)return null;let o=null,r=1/0;for(let i=0;i<e.length;i++){let a=(i+1)%e.length,s=e[a].x-e[i].x,l=e[a].y-e[i].y,c=Math.hypot(s,l);if(c<1e-6)continue;s/=c,l/=c;let h=1/0,f=-1/0,u=1/0,d=-1/0;for(let B of e){let C=B.x*s+B.y*l,v=-B.x*l+B.y*s;C<h&&(h=C),C>f&&(f=C),v<u&&(u=v),v>d&&(d=v);}let m=f-h,p=d-u,b=m*p;if(b<=0||b>=r)continue;r=b;let g=(h+f)/2,y=(u+d)/2,A=m>=p;o={cx:g*s-y*l,cy:g*l+y*s,ax:A?s:-l,ay:A?l:s,halfLong:(A?m:p)/2,halfShort:(A?p:m)/2,fill:t/b};}return o}function Nf(n){let e=[];for(let i=0;i<n.length-2;i+=2)e.push({x:n[i],y:n[i+1]});if(e.length<3)return e;e.sort((i,a)=>i.x===a.x?i.y-a.y:i.x-a.x);let t=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i);}let r=[];for(let i=e.length-1;i>=0;i--){let a=e[i];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 Kf(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var Uf=Math.tan(30*Math.PI/180),Jf=3.5,Xf=.9;function jf(n,e,t,o,r){if(e.fill<.86)return null;let i=e.halfShort*2*r,a=e.halfLong*2*r,s=i*a,l=e.halfShort>0?e.halfLong/e.halfShort:99,c=Yf(n);if(!c){if(t>15||s>600||i<3)return null;let h=o%1e3/1e3;s<30?c=h<.5?"skillion":"gabled":l<1.25?c=h<.35?"pyramidal":"hipped":c=h<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Yf(n){let e=String(n.roof_shape??n["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 yt=(n,e,t)=>n.a*e+n.b*t+n.c;function Zf(n,e,t,o){let r=n.length/2;if(r<3)return [];let i=[],a=s=>[n[s*2],n[s*2+1]];for(let s=0;s<r;s++){let[l,c]=a(s),[h,f]=a((s+r-1)%r),u=e*l+t*c+o,d=e*h+t*f+o;if(u<=0!=d<=0){let m=d/(d-u);i.push(h+(l-h)*m,f+(c-f)*m);}u<=0&&i.push(l,c);}return i}function Qf(n,e){let t=.5/Math.max(e,1e-6),o=n.length/2-1;if(o<5)return n;let r=[],i=0;r.push(n[0],n[1]);for(let a=1;a<o;a++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1],f=c-s,u=h-l,d=Math.hypot(f,u),m=d>1e-6;if(m){for(let p=i+1;p<a;p++)if(Math.abs((n[p*2]-s)*u-(n[p*2+1]-l)*f)/d>=t){m=false;break}}m||(r.push(n[(a-1)*2],n[(a-1)*2+1]),i=a-1);}return r.length/2<3?n:(r.push(r[0],r[1]),r)}function Ka(n,e,t){let{ax:o,ay:r,halfLong:i}=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=n.length/2-1;for(let l=0;l<s;l++){let c=n[l*2],h=n[l*2+1],f=n[(l+1)%s*2],u=n[(l+1)%s*2+1],d=f-c,m=u-h,p=Math.hypot(d,m);if(p<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/p)<.86)continue;let b=-m/p,g=d/p;a.push({a:b,b:g,c:-(b*c+g*h)});}return !a.length&&i>0?Ka(n,e,"hipped"):a}function qf(n,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<n.length;r++){let i=t;for(let a=0;a<n.length&&i.length>=6;a++)a!==r&&(i=Zf(i,n[r].a-n[a].a,n[r].b-n[a].b,n[r].c-n[a].c));o.push(i.length>=6?i:[]);}return o}function $f(n,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i=0;i<r.length;i+=2){let a=yt(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function eu(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function tu(n,e,t,o,r,i,a,s){let l=mn(Pf,a);for(let c=0;c<t.length;c++){let h=e[c];if(!h||h.length<6)continue;let f=Re(h,void 0,2);if(!f.length)continue;let u=-t[c].a/s,d=-t[c].b/s,m=Math.hypot(u,d,1),p={x:u/m,y:d/m,z:1/m};n.ensure(h.length/2);let b=n.vertexCount;for(let g=0;g<h.length;g+=2){let y=Math.max(o,yt(t[c],h[g],h[g+1]));Et(n,h[g],h[g+1],y,p.x,p.y,p.z,255,i,l);}for(let g=0;g<f.length;g+=3)n.indices.push(b+f[g],b+f[g+2],b+f[g+1]),n.featureIds.push(r);}}function ou(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Gf:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ka:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Ha:e>=40?ka:Rf}function ru(n,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+(n%121-60)))}function nu(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function iu(n){let e=Mt(n.render_height)??Mt(n.height)??su(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,Tf):Lf}function au(n,e){let t=Mt(n.render_min_height)??Mt(n.min_height)??Mt(n.base)??0;return t>0&&t<e?t:0}function su(n){let e=Mt(n);return e&&e>0?e*3:null}function Mt(n){if(typeof n=="number"&&isFinite(n))return n;if(typeof n=="string"){let e=parseFloat(n);if(isFinite(e))return e}return null}var hn=n=>n>127?127:n<-127?-127:n;function lu(n){let e=n.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 Ga(n,e){let t=n.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:n,cut:o};let r=(a,s)=>a===0?1:a===e?2:s===0?3:s===e?4:0,i=n.slice();for(let a=0;a<t;a++){let s=n[a*2],l=n[a*2+1],c=r(s,l);if(!c)continue;let h=(a+t-1)%t,f=(a+1)%t,u=r(n[h*2],n[h*2+1])===c,d=r(n[f*2],n[f*2+1])===c;d&&(o[a]=true);let m=u===d?-1:u?f:h;if(m<0)continue;let p=s-n[m*2],b=l-n[m*2+1],g=Math.hypot(p,b);g<1e-6||(i[a*2]=s+p/g*Ta,i[a*2+1]=l+b/g*Ta);}return i[t*2]=i[0],i[t*2+1]=i[1],{ring:i,cut:o}}function Ua(n,e,t,o){let{extent:r,metersPerUnit:i,height:a,minHeight:s,featureId:l,seed:c,tint:h,facade:f}=o,u=o.whole?e:qe(e,r,Se(r));if(!u)return;let d=o.cornerRadius/i,m={radius:d,segments:o.cornerSegments,minCutRatio:0,maxChord:i>0?Da/i:0,...o.whole?{}:{extent:r,margin:Se(r)}},p=d>0?{outer:Je(u.outer,m),holes:u.holes.map(F=>Je(F,m))}:u,b=o.whole?p:qe(p,r);if(!b)return;let g=F=>({ring:F,cut:new Array(Math.max(F.length/2-1,0)).fill(false)}),y=o.whole?g(b.outer):Ga(b.outer,r),A=b.holes.map(F=>o.whole?g(F):Ga(F,r)),B={outer:y.ring,holes:A.map(F=>F.ring)},C=o.whole?true:fn(B.outer,r),v=B.outer.length/2+B.holes.reduce((F,M)=>F+M.length/2,0);t(v*5+32);let _=B.holes.length||C?null:Wf(B.outer),w=_?jf(o.props,_,a,c,i):null,x=null,E=[];if(w&&_){let F=Ka(Qf(B.outer,i),_,w.shape);E=qf(F,B.outer);let M=$f(F,E);if(M>1e-6){let D=Math.min(Math.max(M*i*Uf,Xf),Jf);x=eu(F,D/M,a);}}Ra(n,B.outer,s,a,l,h,f,i,x,y.cut);for(let F=0;F<B.holes.length;F++)Ra(n,B.holes[F],s,a,l,h,f,i,null,A[F].cut);x?tu(n,E,x,a,l,h,f,i):Vf(n,B.outer,B.holes,a,l,h,f);}function Oa(n,e){let t=Se(e),o=Math.max(n.length/2-1,0),r=new Array(o);for(let i=0;i<o;i++)r[i]=cr(n[i*2],n[i*2+1],n[i*2+2],n[i*2+3],e,t);return r}function cu(n,e,t,o,r,i,a,s){let l=qe(n,e,Se(e));if(!l)return null;let c=Oa(l.outer,e);return {osmId:r,height:t,minHeight:o,seed:i,tint:a,facade:s,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(h=>Oa(h,e))}}var rt=4;function pn(n,e,t,o,r){let i=o*o,a=[],s=h=>n[h*2],l=h=>n[h*2+1],c=(h,f)=>{let u=n.length/2;return n.push((s(h)+s(f))/2,(l(h)+l(f))/2),u};for(let h=0;h<e.length;h+=3){a.push([t+e[h],t+e[h+1],t+e[h+2]]);let f=0;for(;a.length&&!(++f>2e4);){let[u,d,m]=a.pop(),p=(s(u)-s(d))**2+(l(u)-l(d))**2,b=(s(d)-s(m))**2+(l(d)-l(m))**2,g=(s(m)-s(u))**2+(l(m)-l(u))**2,y=Math.max(p,b,g);if(y<=i){r.push(u,d,m);continue}if(y===p){let A=c(u,d);a.push([u,A,m],[A,d,m]);}else if(y===b){let A=c(d,m);a.push([d,A,u],[A,m,u]);}else {let A=c(m,u);a.push([m,A,d],[A,u,d]);}}}}function bn(n,e,t=0,o,r=false,i=4096){let a=[],s=[],l=[];for(let d of n.features()){if(d.type!==3||!ve(e,d.properties))continue;let m=d.properties.osm_id,p=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,b=Number.isFinite(p)?p:Number(d.id??0);for(let g of gt(d.loadGeometry())){let y=r?qe(g,i):g;if(!y)continue;let A=[],B=[],C=o?Je(y.outer,o):y.outer;for(let w=0;w<C.length;w++)A.push(C[w]);for(let w of y.holes){let x=o?Je(w,o):w;B.push(A.length/2);for(let E=0;E<x.length;E++)A.push(x[E]);}let v=Re(A,B.length?B:void 0,2);if(!v.length)continue;let _=a.length/2;for(let w=0;w<A.length;w++)a.push(A[w]);if(t>0){let w=[];pn(a,v,_,t,w);for(let x=0;x<w.length;x+=3)s.push(w[x],w[x+2],w[x+1]),l.push(b);continue}for(let w=0;w<v.length;w+=3)s.push(_+v[w],_+v[w+2],_+v[w+1]),l.push(b);}}if(!s.length)return null;let c=a.length/2,h=new Int16Array(a),f=new Uint32Array(s);return {featureIds:new Float64Array(l).buffer,vertices:h.buffer,indices:f.buffer,vertexCount:c,indexCount:f.length}}var Sn={};Yi(Sn,{default:()=>Su});var Xe=class{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null;}};function fu(n,e){return n>e?1:n<e?-1:0}function nt(n,e,t){let o=new Xe(null,null),r=o,i=o;for(;;){let a=t(n,e.key);if(a<0){if(e.left===null)break;if(t(n,e.left.key)<0){let s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}i.left=e,i=e,e=e.left;}else if(a>0){if(e.right===null)break;if(t(n,e.right.key)>0){let s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right;}else break}return r.right=e.left,i.left=e.right,e.left=o.right,e.right=o.left,e}function gn(n,e,t,o){let r=new Xe(n,e);if(t===null)return r.left=r.right=null,r;t=nt(n,t,o);let i=o(n,t.key);return i<0?(r.left=t.left,r.right=t,t.left=null):i>=0&&(r.right=t.right,r.left=t,t.right=null),r}function Ja(n,e,t){let o=null,r=null;if(e){e=nt(n,e,t);let i=t(e.key,n);i===0?(o=e.left,r=e.right):i<0?(r=e.right,e.right=null,o=e):(o=e.left,e.left=null,r=e);}return {left:o,right:r}}function uu(n,e,t){return e===null?n:(n===null||(e=nt(n.key,e,t),e.left=n),e)}function yn(n,e,t,o,r){if(n){o(`${e}${t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${r(n)}
|
|
9
|
+
`);let i=e+(t?" ":"\u2502 ");n.left&&yn(n.left,i,false,o,r),n.right&&yn(n.right,i,true,o,r);}}var St=class{constructor(e=fu){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=gn(e,t,this._root,this._comparator)}add(e,t){let o=new Xe(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=nt(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=nt(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=nt(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=nt(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=nt(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,s=this._root,l;for(;i.length!==0||s;)if(s)i.push(s),s=s.left;else {if(s=i.pop(),l=a(s.key,t),l>0)break;if(a(s.key,e)>=0&&o.call(r,s))return this;s=s.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return du(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&Cn(e,t,0,r-1,i),this._root===null)this._root=An(e,t,0,r),this._size=r;else {let a=mu(this.toList(),hu(e,t),i);r=this._size+r,this._root=Bn({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return yn(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=Ja(e,this._root,r);r(e,t)<0?a=gn(t,o,a,r):i=gn(t,o,i,r),this._root=uu(i,a,r);}split(e){return Ja(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function An(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],s=e[i],l=new Xe(a,s);return l.left=An(n,e,t,i),l.right=An(n,e,i+1,o),l}return null}function hu(n,e){let t=new Xe(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Xe(n[r],e[r]);return o.next=null,t.next}function du(n){let e=n,t=[],o=false,r=new Xe(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function Bn(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=Bn(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=Bn(n,r+1,t),a}return null}function mu(n,e,t){let o=new Xe(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function Cn(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,s=o+1;for(;;){do a++;while(r(n[a],i)<0);do s--;while(r(n[s],i)>0);if(a>=s)break;let l=n[a];n[a]=n[s],n[s]=l,l=e[a],e[a]=e[s],e[s]=l;}Cn(n,e,t,s,r),Cn(n,e,s+1,o,r);}var $=11102230246251565e-32,ye=134217729,co=(3+8*$)*$;function At(n,e,t,o,r){let i,a,s,l,c=e[0],h=o[0],f=0,u=0;h>c==h>-c?(i=c,c=e[++f]):(i=h,h=o[++u]);let d=0;if(f<n&&u<t)for(h>c==h>-c?(a=c+i,s=i-(a-c),c=e[++f]):(a=h+i,s=i-(a-h),h=o[++u]),i=a,s!==0&&(r[d++]=s);f<n&&u<t;)h>c==h>-c?(a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++f]):(a=i+h,l=a-i,s=i-(a-l)+(h-l),h=o[++u]),i=a,s!==0&&(r[d++]=s);for(;f<n;)a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++f],i=a,s!==0&&(r[d++]=s);for(;u<t;)a=i+h,l=a-i,s=i-(a-l)+(h-l),h=o[++u],i=a,s!==0&&(r[d++]=s);return (i!==0||d===0)&&(r[d++]=i),d}function fo(n,e){let t=e[0];for(let o=1;o<n;o++)t+=e[o];return t}function T(n){return new Float64Array(n)}var pu=(3+16*$)*$,bu=(2+12*$)*$,gu=(9+64*$)*$*$,It=T(4),Xa=T(8),ja=T(12),Ya=T(16),Ie=T(4);function yu(n,e,t,o,r,i,a){let s,l,c,h,f,u,d,m,p,b,g,y,A,B,C,v,_,w,x=n-r,E=t-r,F=e-i,M=o-i;B=x*M,u=ye*x,d=u-(u-x),m=x-d,u=ye*M,p=u-(u-M),b=M-p,C=m*b-(B-d*p-m*p-d*b),v=F*E,u=ye*F,d=u-(u-F),m=F-d,u=ye*E,p=u-(u-E),b=E-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,It[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,It[1]=A-(g+f)+(f-v),w=y+g,f=w-y,It[2]=y-(w-f)+(g-f),It[3]=w;let D=fo(4,It),L=bu*a;if(D>=L||-D>=L||(f=n-x,s=n-(x+f)+(f-r),f=t-E,c=t-(E+f)+(f-r),f=e-F,l=e-(F+f)+(f-i),f=o-M,h=o-(M+f)+(f-i),s===0&&l===0&&c===0&&h===0)||(L=gu*a+co*Math.abs(D),D+=x*h+M*s-(F*c+E*l),D>=L||-D>=L))return D;B=s*M,u=ye*s,d=u-(u-s),m=s-d,u=ye*M,p=u-(u-M),b=M-p,C=m*b-(B-d*p-m*p-d*b),v=l*E,u=ye*l,d=u-(u-l),m=l-d,u=ye*E,p=u-(u-E),b=E-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let I=At(4,It,4,Ie,Xa);B=x*h,u=ye*x,d=u-(u-x),m=x-d,u=ye*h,p=u-(u-h),b=h-p,C=m*b-(B-d*p-m*p-d*b),v=F*c,u=ye*F,d=u-(u-F),m=F-d,u=ye*c,p=u-(u-c),b=c-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let S=At(I,Xa,4,Ie,ja);B=s*h,u=ye*s,d=u-(u-s),m=s-d,u=ye*h,p=u-(u-h),b=h-p,C=m*b-(B-d*p-m*p-d*b),v=l*c,u=ye*l,d=u-(u-l),m=l-d,u=ye*c,p=u-(u-c),b=c-p,_=m*b-(v-d*p-m*p-d*b),g=C-_,f=C-g,Ie[0]=C-(g+f)+(f-_),y=B+g,f=y-B,A=B-(y-f)+(g-f),g=A-v,f=A-g,Ie[1]=A-(g+f)+(f-v),w=y+g,f=w-y,Ie[2]=y-(w-f)+(g-f),Ie[3]=w;let P=At(S,ja,4,Ie,Ya);return Ya[P-1]}function vn(n,e,t,o,r,i){let a=(e-i)*(t-r),s=(n-r)*(o-i),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=pu*c?l:-yu(n,e,t,o,r,i,c)}var uo=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,wn=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;let t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,o=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,i=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return {ll:{x:t,y:r},ur:{x:o,y:i}}},it=Number.EPSILON;it===void 0&&(it=Math.pow(2,-52));var Bu=it*it,Qa=(n,e)=>{if(-it<n&&n<it&&-it<e&&e<it)return 0;let t=n-e;return t*t<Bu*n*e?0:n<e?-1:1},xn=class{constructor(){this.reset();}reset(){this.xRounder=new ur,this.yRounder=new ur;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},ur=class{constructor(){this.tree=new St,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&Qa(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&Qa(t.key,r.key)===0?(this.tree.remove(e),r.key):e}},ho=new xn,fr=(n,e)=>n.x*e.y-n.y*e.x,os=(n,e)=>n.x*e.x+n.y*e.y,qa=(n,e,t)=>{let o=vn(n.x,n.y,e.x,e.y,t.x,t.y);return o>0?-1:o<0?1:0},hr=n=>Math.sqrt(os(n,n)),Cu=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return fr(r,o)/hr(r)/hr(o)},vu=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return os(r,o)/hr(r)/hr(o)},$a=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},es=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},wu=(n,e,t,o)=>{if(e.x===0)return es(t,o,n.x);if(o.x===0)return es(n,e,t.x);if(e.y===0)return $a(t,o,n.y);if(o.y===0)return $a(n,e,t.y);let r=fr(e,o);if(r==0)return null;let i={x:t.x-n.x,y:t.y-n.y},a=fr(i,e)/r,s=fr(i,o)/r,l=n.x+s*e.x,c=t.x+a*o.x,h=n.y+s*e.y,f=t.y+a*o.y,u=(l+c)/2,d=(h+f)/2;return {x:u,y:d}},Ge=class n{static compare(e,t){let o=n.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Lt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t;}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");let t=e.point.events;for(let o=0,r=t.length;o<r;o++){let i=t[o];this.point.events.push(i),i.point=this.point;}this.checkForConsuming();}checkForConsuming(){let e=this.point.events.length;for(let t=0;t<e;t++){let o=this.point.events[t];if(o.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){let i=this.point.events[r];i.consumedBy===void 0&&o.otherSE.point.events===i.otherSE.point.events&&o.segment.consume(i.segment);}}}getAvailableLinkedEvents(){let e=[];for(let t=0,o=this.point.events.length;t<o;t++){let r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r);}return e}getLeftmostComparator(e){let t=new Map,o=r=>{let i=r.otherSE;t.set(r,{sine:Cu(this.point,e.point,i.point),cosine:vu(this.point,e.point,i.point)});};return (r,i)=>{t.has(r)||o(r),t.has(i)||o(i);let{sine:a,cosine:s}=t.get(r),{sine:l,cosine:c}=t.get(i);return a>=0&&l>=0?s<c?1:s>c?-1:0:a<0&&l<0?s<c?-1:s>c?1:0:l<a?-1:l>a?1:0}}},xu=0,Lt=class n{static compare(e,t){let o=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,a=t.rightSE.point.x;if(a<o)return 1;if(i<r)return -1;let s=e.leftSE.point.y,l=t.leftSE.point.y,c=e.rightSE.point.y,h=t.rightSE.point.y;if(o<r){if(l<s&&l<c)return 1;if(l>s&&l>c)return -1;let f=e.comparePoint(t.leftSE.point);if(f<0)return 1;if(f>0)return -1;let u=t.comparePoint(e.rightSE.point);return u!==0?u:-1}if(o>r){if(s<l&&s<h)return -1;if(s>l&&s>h)return 1;let f=t.comparePoint(e.leftSE.point);if(f!==0)return f;let u=e.comparePoint(t.rightSE.point);return u<0?1:u>0?-1:1}if(s<l)return -1;if(s>l)return 1;if(i<a){let f=t.comparePoint(e.rightSE.point);if(f!==0)return f}if(i>a){let f=e.comparePoint(t.rightSE.point);if(f<0)return 1;if(f>0)return -1}if(i!==a){let f=c-s,u=i-o,d=h-l,m=a-r;if(f>u&&d<m)return 1;if(f<u&&d>m)return -1}return i>a?1:i<a||c<h?-1:c>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,o,r){this.id=++xu,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=r;}static fromRing(e,t,o){let r,i,a,s=Ge.comparePoints(e,t);if(s<0)r=e,i=t,a=1;else if(s>0)r=t,i=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let l=new Ge(r,true),c=new Ge(i,false);return new n(l,c,[o],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE;}bbox(){let e=this.leftSE.point.y,t=this.rightSE.point.y;return {ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return {x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;let t=this.leftSE.point,o=this.rightSE.point,r=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x<t.x?1:-1;let i=(e.y-t.y)/r.y,a=t.x+i*r.x;if(e.x===a)return 0;let s=(e.x-t.x)/r.x,l=t.y+s*r.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){let t=this.bbox(),o=e.bbox(),r=wn(t,o);if(r===null)return null;let i=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,l=e.rightSE.point,c=uo(t,s)&&this.comparePoint(s)===0,h=uo(o,i)&&e.comparePoint(i)===0,f=uo(t,l)&&this.comparePoint(l)===0,u=uo(o,a)&&e.comparePoint(a)===0;if(h&&c)return u&&!f?a:!u&&f?l:null;if(h)return f&&i.x===l.x&&i.y===l.y?null:i;if(c)return u&&a.x===s.x&&a.y===s.y?null:s;if(u&&f)return null;if(u)return a;if(f)return l;let d=wu(i,this.vector(),s,e.vector());return d===null||!uo(r,d)?null:ho.round(d.x,d.y)}split(e){let t=[],o=e.events!==void 0,r=new Ge(e,true),i=new Ge(e,false),a=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);let s=new n(r,a,this.rings.slice(),this.windings.slice());return Ge.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ge.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=true,this.rightSE.isLeft=false;for(let t=0,o=this.windings.length;t<o;t++)this.windings[t]*=-1;}consume(e){let t=this,o=e;for(;t.consumedBy;)t=t.consumedBy;for(;o.consumedBy;)o=o.consumedBy;let r=n.compare(t,o);if(r!==0){if(r>0){let i=t;t=o,o=i;}if(t.prev===o){let i=t;t=o,o=i;}for(let i=0,a=o.rings.length;i<a;i++){let s=o.rings[i],l=o.windings[i],c=t.rings.indexOf(s);c===-1?(t.rings.push(s),t.windings.push(l)):t.windings[c]+=l;}o.rings=null,o.windings=null,o.consumedBy=t,o.leftSE.consumedBy=t.leftSE,o.rightSE.consumedBy=t.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 e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState();}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let t=this._afterState.rings,o=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let c=this.rings[s],h=this.windings[s],f=t.indexOf(c);f===-1?(t.push(c),o.push(h)):o[f]+=h;}let i=[],a=[];for(let s=0,l=t.length;s<l;s++){if(o[s]===0)continue;let c=t[s],h=c.poly;if(a.indexOf(h)===-1)if(c.isExterior)i.push(h);else {a.indexOf(h)===-1&&a.push(h);let f=i.indexOf(c.poly);f!==-1&&i.splice(f,1);}}for(let s=0,l=i.length;s<l;s++){let c=i[s].multiPoly;r.indexOf(c)===-1&&r.push(c);}return this._afterState}isInResult(){if(this.consumedBy)return false;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(We.type){case "union":{let o=e.length===0,r=t.length===0;this._isInResult=o!==r;break}case "intersection":{let o,r;e.length<t.length?(o=e.length,r=t.length):(o=t.length,r=e.length),this._isInResult=r===We.numMultiPolys&&o<r;break}case "xor":{let o=Math.abs(e.length-t.length);this._isInResult=o%2===1;break}case "difference":{let o=r=>r.length===1&&r[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${We.type}`)}return this._isInResult}},dr=class{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let r=ho.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let a=1,s=e.length;a<s;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=ho.round(e[a][0],e[a][1]);l.x===i.x&&l.y===i.y||(this.segments.push(Lt.fromRing(i,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),i=l);}(r.x!==i.x||r.y!==i.y)&&this.segments.push(Lt.fromRing(i,r,this));}getSweepEvents(){let e=[];for(let t=0,o=this.segments.length;t<o;t++){let r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE);}return e}},_n=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new dr(e[0],this,true),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 o=1,r=e.length;o<r;o++){let i=new dr(e[o],this,false);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i);}this.multiPoly=t;}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},mr=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e]);}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 o=0,r=e.length;o<r;o++){let i=new _n(e[o],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i);}this.isSubject=t;}getSweepEvents(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},En=class n{static factory(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.isInResult()||i.ringOut)continue;let a=null,s=i.leftSE,l=i.rightSE,c=[s],h=s.point,f=[];for(;a=s,s=l,c.push(s),s.point!==h;)for(;;){let u=s.getAvailableLinkedEvents();if(u.length===0){let p=c[0].point,b=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(u.length===1){l=u[0].otherSE;break}let d=null;for(let p=0,b=f.length;p<b;p++)if(f[p].point===s.point){d=p;break}if(d!==null){let p=f.splice(d)[0],b=c.splice(p.index);b.unshift(b[0].otherSE),t.push(new n(b.reverse()));continue}f.push({index:c.length,point:s.point});let m=s.getLeftmostComparator(a);l=u.sort(m)[0].otherSE;break}t.push(new n(c));}return t}constructor(e){this.events=e;for(let t=0,o=e.length;t<o;t++)e[t].segment.ringOut=this;this.poly=null;}getGeom(){let e=this.events[0].point,t=[e];for(let c=1,h=this.events.length-1;c<h;c++){let f=this.events[c].point,u=this.events[c+1].point;qa(f,e,u)!==0&&(t.push(f),e=f);}if(t.length===1)return null;let o=t[0],r=t[1];qa(o,e,r)===0&&t.shift(),t.push(t[0]);let i=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,l=[];for(let c=a;c!=s;c+=i)l.push([t[c].x,t[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true;}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,i=this.events.length;r<i;r++){let a=this.events[r];Ge.compare(e,a)>0&&(e=a);}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null;}}},pr=class{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[];}addInterior(e){this.interiorRings.push(e),e.poly=this;}getGeom(){let e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getGeom();r!==null&&e.push(r);}return e}},Mn=class{constructor(e){this.rings=e,this.polys=this._composePolys(e);}getGeom(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getGeom();r!==null&&e.push(r);}return e}_composePolys(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.poly)if(i.isExteriorRing())t.push(new pr(i));else {let a=i.enclosingRing();a.poly||t.push(new pr(a)),a.poly.addInterior(i);}}return t}},Fn=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt.compare;this.queue=e,this.tree=new St(t),this.segments=[];}process(e){let t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;let r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i=r,a=r,s,l;for(;s===void 0;)i=this.tree.prev(i),i===null?s=null:i.key.consumedBy===void 0&&(s=i.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){let c=null;if(s){let f=s.getIntersection(t);if(f!==null&&(t.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f))){let u=this._splitSafely(s,f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}}let h=null;if(l){let f=l.getIntersection(t);if(f!==null&&(t.isAnEndpoint(f)||(h=f),!l.isAnEndpoint(f))){let u=this._splitSafely(l,f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}}if(c!==null||h!==null){let f=null;c===null?f=h:h===null?f=c:f=Ge.comparePoints(c,h)<=0?c:h,this.queue.remove(t.rightSE),o.push(t.rightSE);let u=t.split(f);for(let d=0,m=u.length;d<m;d++)o.push(u[d]);}o.length>0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=s);}else {if(s&&l){let c=s.getIntersection(l);if(c!==null){if(!s.isAnEndpoint(c)){let h=this._splitSafely(s,c);for(let f=0,u=h.length;f<u;f++)o.push(h[f]);}if(!l.isAnEndpoint(c)){let h=this._splitSafely(l,c);for(let f=0,u=h.length;f<u;f++)o.push(h[f]);}}}this.tree.remove(t);}return o}_splitSafely(e,t){this.tree.remove(e);let o=e.rightSE;this.queue.remove(o);let r=e.split(t);return r.push(o),e.consumedBy===void 0&&this.tree.add(e),r}},ts=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,_u=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Dn=class{run(e,t,o){We.type=e,ho.reset();let r=[new mr(t,true)];for(let f=0,u=o.length;f<u;f++)r.push(new mr(o[f],false));if(We.numMultiPolys=r.length,We.type==="difference"){let f=r[0],u=1;for(;u<r.length;)wn(r[u].bbox,f.bbox)!==null?u++:r.splice(u,1);}if(We.type==="intersection")for(let f=0,u=r.length;f<u;f++){let d=r[f];for(let m=f+1,p=r.length;m<p;m++)if(wn(d.bbox,r[m].bbox)===null)return []}let i=new St(Ge.compare);for(let f=0,u=r.length;f<u;f++){let d=r[f].getSweepEvents();for(let m=0,p=d.length;m<p;m++)if(i.insert(d[m]),i.size>ts)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let a=new Fn(i),s=i.size,l=i.pop();for(;l;){let f=l.key;if(i.size===s){let d=f.segment;throw new Error(`Unable to pop() ${f.isLeft?"left":"right"} SweepEvent [${f.point.x}, ${f.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(i.size>ts)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>_u)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let u=a.process(f);for(let d=0,m=u.length;d<m;d++){let p=u[d];p.consumedBy===void 0&&i.insert(p);}s=i.size,l=i.pop();}ho.reset();let c=En.factory(a.segments);return new Mn(c).getGeom()}},We=new Dn,Eu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("union",n,t)},Mu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("intersection",n,t)},Fu=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("xor",n,t)},Du=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return We.run("difference",n,t)},Su={union:Eu,intersection:Mu,xor:Fu,difference:Du};var rs=Sn,In=rs.union??rs.default?.union??null;In||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 ns(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t],n[t+1]]);return e}function is(n){let e=[];for(let o of n)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 br(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.lift??0,s=o.get(a);s?s.push(i):o.set(a,[i]);}let r=[];for(let[i,a]of o){if(a.length<2){r.push(...a);continue}let l=(t>0&&e?a.map(f=>({outer:e(f.outer,-t)??f.outer,holes:f.holes.map(u=>e(u,t)??u)})):a).map(f=>[ns(f.outer),...f.holes.map(ns)]),c;try{if(!In)throw new Error("\u043D\u0435\u0442 union");c=In(l[0],...l.slice(1));}catch{r.push(...a);continue}let h=c;if(!Array.isArray(h)||h.length===0){r.push(...a);continue}for(let f of h){if(!f.length)continue;let u=is(f[0]);if(u.length<8)continue;let d=[];for(let m=1;m<f.length;m++){let p=is(f[m]);p.length>=8&&d.push(p);}r.push(i?{outer:u,holes:d,lift:i}:{outer:u,holes:d});}}return r}var Tt=16,hs=64,ds=0,Iu=1,as=2,Lu=3,mo=1,Tu=.6;function Rn(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=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,h=Math.max(512,n.length*24),f=new ArrayBuffer(h*Tt),u={view:new DataView(f),bytes:new Uint8Array(f),offset:0,count:0,indices:[],extent:e,ensure(M){if(u.count+M<=h)return;h=Math.max(h*2,u.count+M);let D=new ArrayBuffer(h*Tt);new Uint8Array(D).set(u.bytes.subarray(0,u.offset)),f=D,u.view=new DataView(D),u.bytes=new Uint8Array(D);}},d=[],m=[],p=new Map;for(let M of n.features()){if(M.type!==3||!ve(t,M.properties))continue;let D=o.liftBy?.(M.properties)??0,L=M.properties.osm_id,I=typeof L=="number"?L:typeof L=="string"?Number(L):NaN,S=Number.isFinite(I)?I:Number(M.id??0);for(let P of gt(M.loadGeometry())){let z=qe(P,e,Se(e));z&&(d.push(D?{...z,lift:D}:z),m.push(S));}}let b=new Set,g=Math.max(o.weld??Tu,0),y=br(d,(M,D)=>Tn(M,D,e,b),g/r),A=g>0?y.map(M=>({...M,outer:us(M.outer,g/r,e),holes:M.holes.map(D=>us(D,g/r,e))})):y;for(let M of A){ls(M.outer,p);for(let D of M.holes)ls(D,p);}o.onShapes?.(A);let B=Hu(A,d,m),C=new Set;for(let[M,D]of p)D>1&&C.add(M);let v=[],_={radius:c,segments:o.cornerSegments,extent:e,margin:Se(e),minCutRatio:0,maxChord:Fa/r},w=[];for(let M of A){let D=u.indices.length,L=v.length,I=c>0?{outer:Je(M.outer,{..._,keep:cs(M.outer,C)}),holes:M.holes.map(G=>Je(G,{..._,keep:cs(G,C)}))}:M,S=s>0?Tn(I.outer,s,e,C):I.outer,P=I.holes.map(G=>s>0?Tn(G,-s,e,C):G),z=M.lift??0,H=i+z,R=a+z;fs(u,S??I.outer,P.map((G,V)=>G??I.holes[V]),H,ds,o.maxSegment??0);let N=H,O=H-l;S&&s>0&&l>0&&Ln(u,S,I.outer,N,O,Iu,e,C),O!==R&&Ln(u,I.outer,I.outer,O,R,as,e,C);for(let G of I.holes)if(O!==R&&Ln(u,G,G,O,R,as,e,C),H<R){let V=u.indices.length;fs(u,G,[],R,Lu);for(let J=V;J<u.indices.length;J++)v.push(u.indices[J]);u.indices.length=V;}w.push(D,u.indices.length,L,v.length);}if(!u.indices.length&&!v.length)return null;let x=u.indices.length;for(let M=0;M<w.length;M+=4)w[M+2]+=x,w[M+3]+=x;let E=[];for(let M of B){E.push(M.length);for(let D of M)E.push(D);}let F=new Uint32Array(x+v.length);return F.set(u.indices,0),F.set(v,x),{vertices:f.slice(0,u.offset),indices:F.buffer,vertexCount:u.count,indexCount:F.length,extent:e,capIndexOffset:x,shapeFeatures:new Float64Array(E).buffer,shapeRanges:new Uint32Array(w).buffer}}function Hu(n,e,t){let o=n.map(()=>[]);if(!n.length)return o;let r=n.map(i=>ss(i.outer));for(let i=0;i<e.length;i++){let a=ku(e[i].outer);if(!a)continue;let s=-1;for(let l=0;l<n.length;l++){let c=r[l];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!Pn(n[l].outer,a[0],a[1]))continue;let h=false;for(let f of n[l].holes)if(Pn(f,a[0],a[1])){h=true;break}if(!h){s=l;break}}if(s<0){let l=ss(e[i].outer),c=0;for(let h=0;h<n.length;h++){let f=r[h],u=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=u>0&&d>0?u*d:0;m>c&&(c=m,s=h);}}s<0&&(s=0),o[s].includes(t[i])||o[s].push(t[i]);}return o}function ss(n){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let i=0;i<n.length;i+=2)n[i]<e&&(e=n[i]),n[i]>o&&(o=n[i]),n[i+1]<t&&(t=n[i+1]),n[i+1]>r&&(r=n[i+1]);return [e,t,o,r]}function ku(n){let e=n.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let i=(r+1)%e;t+=n[r*2]*n[i*2+1]-n[i*2]*n[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let i=(r+e-1)%e*2,a=r*2,s=(r+1)%e*2,l=(n[a]-n[i])*(n[s+1]-n[i+1])-(n[a+1]-n[i+1])*(n[s]-n[i]);if(l===0||l>0!==o)continue;let c=(n[i]+n[a]+n[s])/3,h=(n[i+1]+n[a+1]+n[s+1])/3;if(Pn(n,c,h))return [c,h]}return null}function Pn(n,e,t){let o=false,r=n.length/2-1;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1];l>t!=h>t&&e<(c-s)*(t-l)/(h-l)+s&&(o=!o);}return o}function Ht(n,e,t,o){let r=`${Math.round(n*100)},${Math.round(e*100)}`,i=`${Math.round(t*100)},${Math.round(o*100)}`;return r<i?`${r}|${i}`:`${i}|${r}`}function ls(n,e){for(let t=0;t+3<n.length;t+=2){let o=Ht(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function cs(n,e){if(!e.size)return;let t=n.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let i=Ht(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=Ht(n[r*2],n[r*2+1],n[(r+1)%t*2],n[(r+1)%t*2+1]);(e.has(i)||e.has(a))&&(o[r]=true);}return o}function po(n,e,t,o,r,i,a,s){let l=n.offset;return n.view.setFloat32(l,e,true),n.view.setFloat32(l+4,t,true),n.view.setInt16(l+8,Pu(Math.round(o*hs)),true),n.view.setInt8(l+10,kn(Math.round(r*127))),n.view.setInt8(l+11,kn(Math.round(i*127))),n.view.setInt8(l+12,kn(Math.round(a*127))),n.bytes[l+13]=s,n.view.setInt8(l+14,e<=0?-mo:e>=n.extent?mo:0),n.view.setInt8(l+15,t<=0?-mo:t>=n.extent?mo:0),n.offset+=Tt,n.count++}function fs(n,e,t,o,r=ds,i=0){let a=[],s=[];for(let f=0;f<e.length;f++)a.push(e[f]);for(let f of t){s.push(a.length/2);for(let u=0;u<f.length;u++)a.push(f[u]);}let l=Re(a,s.length?s:void 0,2);if(!l.length)return;let c=l;if(i>0){let f=[];pn(a,l,0,i,f),c=f;}n.ensure(a.length/2);let h=n.count;for(let f=0;f<a.length;f+=2)po(n,a[f],a[f+1],o,0,0,1,r);for(let f=0;f<c.length;f+=3)n.indices.push(h+c[f],h+c[f+2],h+c[f+1]);}function Ln(n,e,t,o,r,i,a,s){let l=Math.min(e.length,t.length)/2;if(!(l<3)){n.ensure((l-1)*4);for(let c=0;c<l-1;c++){let h=t[c*2],f=t[c*2+1],u=t[c*2+2],d=t[c*2+3];if(h===u&&f===d||cr(h,f,u,d,a,Se(a))||s.has(Ht(h,f,u,d)))continue;let m=u-h,p=d-f,b=Math.hypot(m,p)||1,g=p/b,y=-m/b,A=o-r,B=Math.hypot(e[c*2]-h,e[c*2+1]-f)||0,C=0;if(B>1e-6&&A!==0){let E=1/Math.hypot(1,A/B);C=B/Math.hypot(B,A)*Math.sign(A),g*=E,y*=E;}let v=po(n,e[c*2],e[c*2+1],o,g,y,C,i),_=po(n,e[c*2+2],e[c*2+3],o,g,y,C,i),w=po(n,h,f,r,g,y,C,i),x=po(n,u,d,r,g,y,C,i);n.indices.push(w,_,x,w,v,_);}}}function Tn(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let h=0;h<r;h++){let f=n[h*2],u=n[h*2+1],d=n[(h+r-1)%r*2],m=n[(h+r-1)%r*2+1],p=n[(h+1)%r*2],b=n[(h+1)%r*2+1],g=Math.hypot(f-d,u-m)||1,y=Math.hypot(p-f,b-u)||1,A=(u-m)/g,B=-(f-d)/g,C=(b-u)/y,v=-(p-f)/y,_=A+C,w=B+v,x=Math.hypot(_,w);if(x<1e-6){i.push(f,u);continue}_/=x,w/=x;let E=Math.min(1/Math.max(_*A+w*B,.35),3),F=f-_*e*E,M=u-w*e*E,D=Ht(d,m,f,u),L=Ht(f,u,p,b);if(o.has(D)||o.has(L)){i.push(f,u);continue}let I=-Se(t),S=t+Se(t);((z,H)=>z<=I||z>=S||H<=I||H>=S)(f,u)&&(F=f,M=u),i.push(F,M);}i.push(i[0],i[1]);let a=Math.abs(Hn(n)),s=Hn(i);if(Math.sign(s)!==Math.sign(Hn(n))||Math.abs(s)<a*.25)return null;let l=-Se(t),c=t+Se(t);for(let h=0;h<i.length;h+=2)i[h]=Math.max(l,Math.min(c,i[h])),i[h+1]=Math.max(l,Math.min(c,i[h+1]));return i}function Hn(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var kn=n=>n>127?127:n<-127?-127:n,Pu=n=>n>32767?32767:n<-32768?-32768:n;function us(n,e,t){if(!(e>0))return n;let o=Se(t),r=-o,i=t+o,a=n;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),h=l;for(let u=0;u<l&&!(h<=5);u++){let d=a[u*2],m=a[u*2+1];if(d<=r||d>=i||m<=r||m>=i)continue;let p=(u+l-1)%l;for(;!c[p]&&p!==u;)p=(p+l-1)%l;let b=(u+1)%l;for(;!c[b]&&b!==u;)b=(b+1)%l;if(p===u||b===u)break;let g=a[p*2],y=a[p*2+1],A=a[b*2]-g,B=a[b*2+1]-y,C=Math.hypot(A,B);C<1e-6||Math.abs((d-g)*B-(m-y)*A)/C<e&&(c[u]=false,h--);}if(h===l)break;let f=[];for(let u=0;u<l;u++)c[u]&&f.push(a[u*2],a[u*2+1]);f.push(f[0],f[1]),a=f;}return a}var Ru=100;function Gn(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function On(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let h=0;h<i.length;h+=2)i[h]<a&&(a=i[h]),i[h]>l&&(l=i[h]),i[h+1]<s&&(s=i[h+1]),i[h+1]>c&&(c=i[h+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}n.cells=[];}}function Gu(n){n.cells=Array.from({length:1024},()=>[]);let e=n.extent/32;for(let t=0;t<n.shapes.length;t++){let o=n.shapes[t],r=kt(Math.floor(o.minX/e)),i=kt(Math.floor(o.maxX/e)),a=kt(Math.floor(o.minY/e)),s=kt(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=i;c++)n.cells[l*32+c].push(t);}}var ps=n=>n.shapes.length===0;function gr(n,e,t){!n.cells.length&&n.shapes.length&&Gu(n);let o=n.extent/32,r=n.cells[kt(Math.floor(t/o))*32+kt(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let s=n.shapes[a];if(s.level<=i||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!ms(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(ms(c,e,t)){l=true;break}l||(i=s.level);}return Math.min(Math.round(i*100),127)}function zn(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=gr(n,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],h=e[s+2],f=e[s+3],u=gr(n,h,f);if(u!==a&&i>0){let d=Math.hypot(h-l,f-c),m=Math.min(Math.ceil(d/i),64),p=a;for(let b=1;b<m;b++){let g=b/m,y=l+(h-l)*g,A=c+(f-c)*g,B=gr(n,y,A);B!==p&&(t.push(y,A),o.push(B),p=B);}}t.push(h,f),o.push(u),a=u;}return {pts:t,levels:o}}var kt=n=>n<0?0:n>31?31:n;function ms(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],h=n[a*2+1];l>t!=h>t&&e<(c-s)*(t-l)/(h-l)+s&&(o=!o);}return o}var Ou=5;function Bt(n){let e=n.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=n.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var at=20;function Vn(n,e,t=0,o,r=0,i={}){let{level:a}=i,s=Math.max(256,n.length*24),l=new ArrayBuffer(s*at),c=new DataView(l),h=0,f=[],u=[],d=C=>{if(h+C<=s)return;s=Math.max(s*2,h+C);let v=new ArrayBuffer(s*at);new Uint8Array(v).set(new Uint8Array(l,0,h*at)),l=v,c=new DataView(v);},m=(C,v,_,w,x,E,F,M=0,D=0,L=0)=>{let I=h*at;return c.setInt16(I,C,true),c.setInt16(I+2,v,true),c.setInt16(I+4,_,true),c.setInt16(I+6,w,true),c.setInt8(I+8,x),c.setInt8(I+9,E),c.setInt8(I+10,M),c.setInt8(I+11,D),c.setFloat32(I+12,F,true),c.setFloat32(I+16,L,true),h++},p=0,b=0,g=r>0?12/r:0,y=g>0?Ku(n):null;for(let C of n.features()){if(C.type!==2&&C.type!==3||!ve(e,C.properties)||a!==void 0&&Bt(C.properties)!==a)continue;let v=C.properties.osm_id,_=typeof v=="number"?v:typeof v=="string"?Number(v):NaN;b=Number.isFinite(_)?_:Number(C.id??0);let w=C.properties.width;p=typeof w=="number"&&w>.5&&w<100?w:0;let x=C.type===3;for(let E of C.loadGeometry()){let F=t>0?Vu(bs(E),t):bs(E);if(F.length<4)continue;let M=o&&!ps(o)?zn(o,F):null,D=M?M.pts:F,L=M?.levels,I=D.length/2;if(I<2)continue;let S=Bt(C.properties),P=yr(Math.round(D[0]),Math.round(D[1])),z=yr(Math.round(D[I*2-2]),Math.round(D[I*2-1])),H=null,R=p;if(y&&p>0&&!x){let O=0;for(let Q=0;Q<I-1;Q++)O+=Math.hypot(D[Q*2+2]-D[Q*2],D[Q*2+3]-D[Q*2+1]);R=ys(S,p,P,z,y);let G=Q=>Math.min(y.width.get(Q)??0,R*2),V=G(P)-R,J=G(z)-R,X=Math.min(g,O/2);if(X>0&&(V>0||J>0)){H=ee=>{let q=0;return V>0&&ee<X&&(q=V*(1-ee/X)),J>0&&O-ee<X&&(q=Math.max(q,J*(1-(O-ee)/X))),R+q};let Q=[];for(let ee of [X,O-X])ee>.01&&ee<O-.01&&Q.push(ee);if(Q.length){let ee=zu(D,L,Q);D=ee.pts,L=ee.levels,I=D.length/2;}}}d((I-1)*4);let N=0;for(let O=0;O<I-1;O++){let G=D[O*2],V=D[O*2+1],J=D[O*2+2],X=D[O*2+3],Q=Math.hypot(J-G,X-V);if(x&&Nu(G,V,J,X,n.extent)){N+=Q;continue}let ee=Wu(G,V,J,X,n.extent);if(!ee){N+=Q;continue}let[q,U,ae,se]=ee,oe=Math.hypot(q-G,U-V),j=Math.hypot(ae-q,se-U),Y=Math.hypot(J-ae,X-se),ne=N+oe,ie=L?L[O]:0,ue=L?L[O+1]:0,le=H?H(ne):R,Ae=H?H(ne+j):R,_e=m(q,U,ae,se,0,-1,ne,ie,ue,le),we=m(q,U,ae,se,0,1,ne,ie,ue,le),ut=m(q,U,ae,se,1,1,ne,ie,ue,Ae),wt=m(q,U,ae,se,1,-1,ne,ie,ue,Ae);N+=oe+j+Y,f.push(_e,we,ut,_e,ut,wt),u.push(b,b);}}}if(!f.length)return null;let A=new Uint32Array(f),B=new Float64Array(u);return {vertices:l.slice(0,h*at),indices:A.buffer,vertexCount:h,indexCount:A.length,featureIds:B.buffer}}function zu(n,e,t){let o=[...t].sort((l,c)=>l-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<n.length;l+=2){let c=n[l],h=n[l+1],f=n[l+2],u=n[l+3],d=Math.hypot(f-c,u-h);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,h+(u-h)*m),i&&e&&i.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*m)),s++;}a+=d,r.push(f,u),i&&e&&i.push(e[l/2+1]);}return {pts:r,levels:i}}function Vu(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],s=n[o+3];t.push(r,i);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-i)/e));for(let c=1;c<l;c++){let h=c/l;t.push(r+(a-r)*h,i+(s-i)*h);}}return t.push(n[n.length-2],n[n.length-1]),t}function bs(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}function Wu(n,e,t,o,r){let i=t-n,a=o-e,s=0,l=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[h,f]of c){if(h===0){if(f<0)return null;continue}let u=f/h;if(h<0){if(u>l)return null;u>s&&(s=u);}else {if(u<s)return null;u<l&&(l=u);}}return l-s<1e-6?null:[Math.round(n+i*s),Math.round(e+a*s),Math.round(n+i*l),Math.round(e+a*l)]}function Nu(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}var gs=new WeakMap,yr=(n,e)=>(n+512)*65536+(e+512);function ys(n,e,t,o,r){if(n===0||e<=0)return e;let i=8*4294967296,a=Math.max(r.raw.get(t+i)??0,r.raw.get(o+i)??0);return a>0&&e>a?a:e}function Ku(n){let e=gs.get(n);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of n.features()){if(r.type!==2)continue;let i=r.properties.width,a=typeof i=="number"&&i>.5&&i<100?i:0,s=Bt(r.properties);for(let l of r.loadGeometry()){if(l.length<4)continue;let c=yr(Math.round(l[0]),Math.round(l[1])),h=yr(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let f of [c,h]){let u=f+(s+8)*4294967296;t.ends.set(u,(t.ends.get(u)??0)+1),a>0&&t.raw.set(u,Math.max(t.raw.get(u)??0,a));}o.push({h:c,t:h,lv:s,w:a});}}for(let r of o){let i=ys(r.lv,r.w,r.h,r.t,t);if(!(i<=0))for(let a of [r.h,r.t]){let s=t.width.get(a);(s===void 0||i>s)&&t.width.set(a,i);}}return gs.set(n,t),t}function Wn(n){if(!n.length)return null;for(let t of n)if(!t.cut.some(Boolean))return [{outer:t.ring,holes:t.holes??[]}];if(n.length<2)return null;let e=br(n.map(t=>({outer:t.ring,holes:t.holes??[]})));return e.length?e:null}var Ar=class{constructor(){this.meshes=new k;this.stitched=new te;this.hiddenByTile=new k;this.changed=new te;this.signature="";this.meshSig=new k;this.cache=new k;}update(e,t,o){let r=new k,i=0,a="";for(let[f,u]of e.loadedTiles()){if(u.id.z!==o.zoom)continue;let d=u.data?.seams;if(d?.length){a+=f+";",i=u.data?.buckets?.[t]?.extent??i;for(let m of d){let p=r.get(m.osmId);p?p.push({seam:m,tile:u.id}):r.set(m.osmId,[{seam:m,tile:u.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!i||!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 k,l=new k,c=new k,h=new te;for(let[f,u]of r){h.add(f);let d=u.map(g=>g.tile.dataKey).sort().join(","),m=this.cache.get(f);if(!m||m.sig!==d){let g=u[0].tile,y=u.map(({seam:B,tile:C})=>({ring:As(B.outer,C,g,i),holes:B.holes.map(v=>As(v,C,g,i)),cut:B.outerCut})),A=Wn(y);if(A?.length)m={sig:d,shapes:A,owner:g,seam:u[0].seam,tiles:u.map(B=>B.tile.dataKey)},this.cache.set(f,m);else if(!m)continue}let p=m.owner.dataKey;l.set(p,m.owner);let b=s.get(p)??[];for(let g of m.shapes)b.push({rings:{outer:g.outer,holes:g.holes},seam:m.seam});s.set(p,b),c.set(p,(c.get(p)??"")+f+":"+m.sig+";"),this.stitched.add(f);for(let g of [...m.tiles,...u.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()])h.has(f)||this.cache.delete(f);for(let[f,u]of s){let d=c.get(f);if(this.meshSig.get(f)===d&&this.meshes.has(f))continue;let m=Na(u,i,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/i: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 As(n,e,t,o){let r=(e.x-t.x)*o,i=(e.y-t.y)*o,a=new Array(n.length);for(let s=0;s<n.length;s+=2)a[s]=n[s]+r,a[s+1]=n[s+1]+i;return a}var Nn={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Kn={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Bs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 Cs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 vs={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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 ws={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",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,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{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 xs={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:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var _s={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 Es={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 Ms={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:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Fs={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 Ds={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 Ss={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 Is={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 Ls={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 Ts={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 Hs={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 ks={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 Ps={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 Rs={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 Gs={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 Os={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 zs={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 Vs={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 Ws={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 Ns={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 Ks={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 Us={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 Js={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 Xs={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 js={"3d":Ms,cartoon:Fs,cyberpunk:Ds,dawn:Ss,dusk:Is,earth:Ls,future:Ts,"glass-refined":Hs,glass:ks,"harmony-black":Ps,"harmony-blue":Rs,"harmony-green":Gs,lunar:Os,matte:zs,minimal:Vs,ocean:Ws,premium:Ns,realistic:Ks,space:Us,volcano:Js,white:Xs};function Br(n,e){let t=new Set(e.hidden??[]),o=n.layers.map(r=>{let i=e.paint?.[r.id],a={...r,paint:i?{...r.paint,...i}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))n.layers.some(i=>i.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 {...n,name:e.name,background:e.background??n.background,light:{...n.light,...e.light},sky:{...n.sky,...e.sky},model3dKey:e.model3dKey??n.model3dKey,layers:o}}var Z="base",Ys="\u241F",je=(n,e)=>n+"\u241F"+String(e);var Pt=class{constructor(e=Un){this.splitValues={};this.spec=e,this.light={...Kn,...e.light??{}},this.sky={...Nn,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return pe(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let s=this.layers.find(h=>h.id===i.from)?.paint?.color,l=ke(s,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return ke(i,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=Z){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??Z)===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??Z))]}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"]]))]}},Un=Bs,Ah=Cs,Bh=vs,Ch=ws;function vh(n,e){if(typeof n!="string")return n;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);if(!t)return n;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function Zs(n,e,t,o){let r=n.paint?.building;return r?{...n,name:e,paint:{...n.paint,building:{...r,windowColor:vh(r.color,t),windowGlow:0,...o}}}:{...n,name:e}}var Ye={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:xs,mono:_s,pale:Es,...js};Ye["3d-tone"]=Zs(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"]=Zs(Ye.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function Cr(n,e=Un){if(typeof n!="string")return Br(e,n);if(n==="day")return e;let t=Ye[n];return t?Br(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${n}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(Ye).join(", ")}`),e)}var bo=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),i=o.createFramebuffer();if(!r||!i)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=i,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,i),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 Qs(n){let e=n.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 n.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),n.bindTexture(7,null),t}var go=`
|
|
10
10
|
uniform vec3 u_ambient_color;
|
|
11
11
|
uniform float u_ambient_intensity;
|
|
12
12
|
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
|
|
@@ -2334,6 +2334,6 @@ void main() {
|
|
|
2334
2334
|
if (color.a <= 0.001) discard;
|
|
2335
2335
|
fragColor = color;
|
|
2336
2336
|
}
|
|
2337
|
-
`;var wr=n=>n.kind==="symbol",El=n=>n.kind==="placement";function $e(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],s=r[i+1],l=r[i+2],c=r[i+3],h=r[i+4],f=r[i+5];if(xh(e,t,a,s,l,c,h,f)||o>0&&(Qn(e,t,a,s,l,c)<=o||Qn(e,t,l,c,h,f)<=o||Qn(e,t,h,f,a,s)<=o))return true}return false}function xh(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),h=(n-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||h<0,u=l>0||c>0||h>0;return !(f&&u)}function Qn(n,e,t,o,r,i){let a=r-t,s=i-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*s)/l)):0;return Math.hypot(n-(t+a*c),e-(o+s*c))}function qn(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let s=0;s<o.length;s++){let l=o[s]*rt;a[s*2]=r.minX+t.getInt16(l,true)*i,a[s*2+1]=r.minY+t.getInt16(l+2,true)*i;}return a}function $n(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let h=n.indices[c]*Te;l[c*2]=a+o.getInt16(h,true)*i,l[c*2+1]=s+o.getInt16(h+2,true)*i;}return l}var _h={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Eh=40,Mh=10.5,Ml=2.5,Fh=16,Dh=4,Sh=7,yo=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,i,a,s,l=false){this.count=0;let c=t.zoom,h=r.layers.filter(B=>B.type==="symbol"&&B.layout?.placement==="map"&&r.layerVisibleAt(B,c));if(!h.length)return;let f=t.center,u=ce(f.lng),d=fe(f.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let p=[];for(let B of h){let C=o.get(B.source??Z);if(!C)continue;let v=r.bucketKeyFor(B);if(v===null)continue;let _=B.layout?.showFor==="highlight";if(_&&!this.highlightFootprint)continue;let w=m*1.5,E=B.layout?.arrowUnits==="meters"?m:1/t.worldSize,F=V(B.layout?.arrowLength,c,Eh)*E,M=V(B.layout?.arrowWidth,c,Mh)*E,D=V(B.layout?.arrowOutline,c,Ml)*E,S=V(B.layout?.arrowGap,c,Fh)*E,L=V(B.layout?.arrowDotRadius,c,Dh)*E,k=V(B.layout?.arrowDotGap,c,Sh)*E,I=ti(F,M,L,S-k),G=D>0?ti(F,M,L,S-k,D).outline:null,H={layer:B,verts:[],shape:I};for(let z of C.visibleTiles){let R=C.getTile(z)?.data?.buckets?.[v];if(!R||!wr(R))continue;let O=new Int16Array(R.anchors),N=R.rotations?new Int16Array(R.rotations):null,W=z.bounds(),Y=(W.maxX-W.minX)/R.extent,Q=W.minX,ee=W.minY;for(let q=0;q<O.length/2;q++){let J=Q+O[q*2]*Y,ne=ee+O[q*2+1]*Y;if(_&&!$e(this.highlightFootprint,J,ne,w))continue;let se=(N?N[q]:0)*Math.PI/180,oe=Math.sin(se),X=-Math.cos(se),j=J-u-oe*S,ie=ne-d-X*S;G&&oi(H,G,j,ie,oe,X),oi(H,I.outline,j,ie,oe,X),this.count++;}}H.verts.length&&p.push(H);}if(!p.length)return;let b=p[0].shape,g=b.outline.length/2,y=[],A=[];for(let B of p){let C=y.length/2/g;for(let v of B.verts)y.push(v);A.push({layer:B.layer,first:C,count:B.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,b,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),i.use(),s?.(i),l&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(u,d,0)),i.setMat4("u_matrix",t.objectMatrix(u,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let B of A){let C=B.layer.paint,v=V(C.opacity,c,1),_=ke(C.color,c,[.18,.45,.76,1]),w=ke(C.haloColor,c,[1,1,1,1]),x=V(B.layer.layout?.arrowOutline,c,Ml)>0;Ih(e,i,B,w,_,v,x,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let i=o.outline.length/2;if(this.vao&&t<=this.capacity&&i===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=i,this.indicesPerArrow=o.indices.length,this.vbo=new Be(e,new Uint8Array(this.capacity*i*8),_h,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*i;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new de(e,a),this.vao=new he(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 Ih(n,e,t,o,r,i,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",Fe([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=l)Fl(n,t.first+c,s);}e.setVec4v("u_color",Fe([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=l)Fl(n,t.first+c,s);}function Fl(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var Dl=4,ei=12;function ti(n,e,t,o,r=0){let i=n*.38,a=e*1.35,s=i*.3,l=e*.32,c=e/2,h=-n+l,f=[],u=(g,y)=>f.push(g,y);u(0,0),u(-i,a),u(-i+s,c),u(h,l);for(let g=1;g<Dl;g++){let y=g/Dl*Math.PI;u(h-Math.sin(y)*l,Math.cos(y)*l);}u(h,-l),u(-i+s,-c),u(-i,-a);let d=r>0?Lh(f,r):f,m=Re(f,void 0,2);if(t<=0)return {outline:d,indices:m};let p=d.length/2,b=t+r;for(let g=0;g<ei;g++){let y=g/ei*Math.PI*2;d.push(o+Math.cos(y)*b,Math.sin(y)*b);}for(let g=1;g<ei-1;g++)m.push(p,p+g,p+g+1);return {outline:d,indices:m}}function Lh(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=n[a*2]*n[s*2+1]-n[s*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let s=n[(a+t-1)%t*2],l=n[(a+t-1)%t*2+1],c=n[a*2],h=n[a*2+1],f=n[(a+1)%t*2],u=n[(a+1)%t*2+1],d=Math.hypot(c-s,h-l)||1,m=Math.hypot(f-c,u-h)||1,p=r*(h-l)/d,b=-r*(c-s)/d,g=r*(u-h)/m,y=-r*(f-c)/m,A=p+g,B=b+y,C=Math.hypot(A,B);if(C<1e-9){i.push(c,h);continue}A/=C,B/=C;let v=Math.min(1/Math.max(A*p+B*b,.35),3);i.push(c+A*e*v,h+B*e*v);}return i}function oi(n,e,t,o,r,i){let a=-i,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],h=e[l+1];n.verts.push(t+r*c+a*h,o+i*c+s*h);}}function Th(n,e,t,o,r,i=0,a=0){let s=t*Math.PI/180,l={verts:[]};return oi(l,ti(o,r,i,a).outline,n,e,Math.sin(s),-Math.cos(s)),l.verts}var Hh=5;function Sl(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var xr=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,s,l=false){if(!a.size)return;let c=i.layers.filter(h=>h.type==="raster"&&!!h.overlay===l&&i.layerVisibleAt(h,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 h of c){let f=a.get(h.source);if(!f)continue;let u=V(h.paint?.opacity,s,1);if(!(u<=.001)){r.setFloat("u_opacity",u),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),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=Hh&&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:Sl(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,i=r.createTexture();if(!i)return null;e.bindTexture(0,i),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:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,t.image.close(),t.image=null,i}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 kh="indoor-",Ao=class{constructor(){this.parts=null;this.stamp="";this.cache=new P;this.box=null;this.hidden=new te;this.collected=new te;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],i;for(let u of t.layers){if(!u.id.startsWith(kh)||u.type!=="fill"||!t.layerVisibleAt(u,o))continue;let d=t.bucketKeyFor(u);d&&(r.push(d),i??(i=e.get(u.source??Z)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(u=>u.dataKey+(i.getTile(u)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,h=-1/0,f=-1/0;for(let u of i.visibleTiles){let d=i.getTile(u)?.data?.buckets;if(d)for(let m of r){let p=d[m];if(!p||p.kind!=="fill")continue;let b=qn(p,u);s.push(b);for(let g=0;g<b.length;g+=2)b[g]<l&&(l=b[g]),b[g]>h&&(h=b[g]),b[g+1]<c&&(c=b[g+1]),b[g+1]>f&&(f=b[g+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,h,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),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,h=new P;for(let f=0;f*3<r.length;f++){let u=i[f];if(this.hidden.has(u))continue;let d=h.get(u);d||h.set(u,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let p=r[f*3+m]*Te,b=a.getInt16(p,true),g=a.getInt16(p+2,true);b<d[0]&&(d[0]=b),g<d[1]&&(d[1]=g),b>d[2]&&(d[2]=b),g>d[3]&&(d[3]=g);}}for(let[f,u]of h){let d=s.minX+(u[0]+u[2])/2*l,m=s.minY+(u[1]+u[3])/2*l;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||$e(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 i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,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 h=new Uint32Array(l.indices),f=new Float64Array(l.featureIds),u=[];for(let d=0;d*3<h.length;d++)this.hidden.has(f[d])||u.push(h[d*3],h[d*3+1],h[d*3+2]);if(u.length<h.length){let d=new de(e,new Uint32Array(u));c={vao:new he(e,[{buffer:i,locations:a}],d),ibo:d,count:u.length};}}return this.cache.set(r.dataKey,c),c}};var Il=35,Ph=70,Rh=.35,Gh=.5,Oh=1.1;function Rt(n,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=n.cameraToCenterDistance,r=Ee((n.pitch-Il)/(Ph-Il),0,1),i=t.fogRange[0]*(1-Rh*r)*o,a=t.fogRange[1]*(1-Gh*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*Oh:1/0;return {near:i,far:a,intensity:s,cutoff:l}}function ri(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let f=e.getTile(h),u=f&&Ll(f,t);if(!u||!Ue(s,n.tileMatrix64(h,u.extent))||(be(l,s,[r,i,-1,1]),be(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let d=l[0]/l[3],m=l[1]/l[3],p=l[2]/l[3],b=c[0]/c[3]-d,g=c[1]/c[3]-m,y=c[2]/c[3]-p,A=Vh(u,d,m,p,b,g,y);A&&(!a||A.t<a.distance)&&(a={featureId:A.featureId,tile:h,layerId:t,distance:A.t});}return a}function ni(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let f=e.getTile(h);if(f)for(let u of t){let d=f.data?.buckets?.[u];if(!d||d.kind!=="fill"||!d.featureIds||!Ue(s,n.tileMatrix64(h,d.extent))||(be(l,s,[r,i,-1,1]),be(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let m=l[0]/l[3],p=l[1]/l[3],b=l[2]/l[3],g=c[2]/c[3]-b;if(Math.abs(g)<1e-9)continue;let y=-b/g;if(y<0||y>1)continue;let A=m+(c[0]/c[3]-m)*y,B=p+(c[1]/c[3]-p)*y,C=zh(d,A,B);C!==null&&(!a||y<a.distance)&&(a={featureId:C,tile:h,layerId:u,distance:y});}}return a}function zh(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=l=>o.getInt16(l*rt,true),s=l=>o.getInt16(l*rt+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],h=r[l*3+1],f=r[l*3+2],u=a(c),d=s(c),m=a(h),p=s(h),b=a(f),g=s(f),y=(e-m)*(d-p)-(u-m)*(t-p),A=(e-b)*(p-g)-(m-b)*(t-g),B=(e-u)*(g-d)-(b-u)*(t-d),C=y<0||A<0||B<0,v=y>0||A>0||B>0;if(!(C&&v))return i[l]}return null}function Ll(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Vh(n,e,t,o,r,i,a){let s=new DataView(n.vertices),l=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),h=p=>s.getInt16(p*Te,true)/Ft,f=p=>s.getInt16(p*Te+2,true)/Ft,u=p=>s.getUint16(p*Te+4,true)/Dt,d=1/0,m=-1;for(let p=0;p+2<l.length;p+=3){let b=l[p],g=l[p+1],y=l[p+2],A=h(b),B=f(b),C=u(b),v=h(g)-A,_=f(g)-B,w=u(g)-C,x=h(y)-A,E=f(y)-B,F=u(y)-C,M=i*F-a*E,D=a*x-r*F,S=r*E-i*x,L=v*M+_*D+w*S;if(L>-1e-9&&L<1e-9)continue;let k=1/L,I=e-A,G=t-B,H=o-C,z=(I*M+G*D+H*S)*k;if(z<0||z>1)continue;let K=G*w-H*_,R=H*v-I*w,O=I*_-G*v,N=(r*K+i*R+a*O)*k;if(N<0||z+N>1)continue;let W=(x*K+E*R+F*O)*k;W<0||W>1||W>=d||(d=W,m=c[p/3]??0);}return m>=0?{featureId:m,t:d}:null}function _r(n,e,t){let o=Ll(n,e);return o?ii(o,t):null}function ii(n,e){if(!n.featureIds)return null;let t=new Uint32Array(n.indices),o=new Float64Array(n.featureIds),r=[];for(let i=0;i+2<t.length;i+=3)o[i/3]===e&&r.push(t[i],t[i+1],t[i+2]);return r.length?{vertices:n.vertices,indices:new Uint32Array(r)}:null}var Gt=24,ai=8,Wh=2,Nh=12,Er=8,Mr=8;function Bo(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Er+2)*2,o=e*t+n.length*(Mr+2)*2+8,r=e*(Er+2)*6+n.length*Mr*6+24,i=new ArrayBuffer(o*Gt),a=new DataView(i),s=new Uint32Array(r),l=0,c=0,h=(d,m,p,b,g,y)=>{let A=l*Gt;return a.setFloat32(A,d,true),a.setFloat32(A+4,m,true),a.setFloat32(A+8,p,true),a.setFloat32(A+12,b,true),a.setFloat32(A+16,g,true),a.setFloat32(A+20,y,true),l++},f=(d,m,p,b)=>{s[c++]=d,s[c++]=m,s[c++]=b,s[c++]=d,s[c++]=b,s[c++]=p;},u=(d,m,p,b,g,y,A)=>{let B=h(d,m,0,0,0,A),C=h(d,m,p,b,1,A);for(let v=1;v<=Mr;v++){let _=Math.PI*v/Mr,w=p*Math.cos(_)+g*Math.sin(_),x=b*Math.cos(_)+y*Math.sin(_),E=h(d,m,w,x,1,A);s[c++]=B,s[c++]=C,s[c++]=E,C=E;}};for(let d of n){let m=Kh(d),p=m.length/2;if(p<2)continue;let b=new Float64Array(p-1),g=new Float64Array(p-1);for(let v=0;v<p-1;v++){let _=m[v*2+2]-m[v*2],w=m[v*2+3]-m[v*2+1],x=Math.hypot(_,w)||1;b[v]=_/x,g[v]=w/x;}let y=0,A=-1,B=-1;for(let v=0;v<p;v++){let _=m[v*2],w=m[v*2+1];v>0&&(y+=Math.hypot(_-m[v*2-2],w-m[v*2-1]));let x=v>0?v-1:0,E=v<p-1?v:p-2,F=-g[x],M=b[x],D=-g[E],S=b[E],L=F+D,k=M+S,I=Math.hypot(L,k);I>1e-9?(L/=I,k/=I):(L=F,k=M);let G=L*D+k*S,H=G>1e-6?1/G:1/0,z=Math.acos(Math.min(1,Math.max(-1,b[x]*b[E]+g[x]*g[E])));if(!(z>Nh*Math.PI/180)&&H<=Wh){let R=h(_,w,L*H,k*H,1,y),O=h(_,w,-L*H,-k*H,-1,y);A>=0&&f(A,B,R,O),A=R,B=O;}else {let R=Math.max(1,Math.min(Er,Math.ceil(z/(Math.PI/Er)))),N=b[x]*g[E]-g[x]*b[E]>=0?1:-1,W=h(_,w,F,M,1,y),Y=h(_,w,-F,-M,-1,y);A>=0&&f(A,B,W,Y);for(let Q=1;Q<=R;Q++){let ee=N*z*(Q/R),q=Math.cos(ee),J=Math.sin(ee),ne=F*q-M*J,se=F*J+M*q,oe=h(_,w,ne,se,1,y),X=h(_,w,-ne,-se,-1,y);f(W,Y,oe,X),W=oe,Y=X;}A=W,B=Y;}}let C=p-2;u(m[0],m[1],-g[0],b[0],-b[0],-g[0],0),u(m[(p-1)*2],m[(p-1)*2+1],-g[C],b[C],b[C],g[C],y);}return c?{vertices:i.slice(0,l*Gt),indices:s.slice(0,c),vertexCount:l}:null}function si(n){if(!n.length||n[0].length<6)return null;let e=[],t=[];for(let i=0;i<n[0].length;i++)e.push(n[0][i]);for(let i=1;i<n.length;i++)if(!(n[i].length<6)){t.push(e.length/2);for(let a=0;a<n[i].length;a++)e.push(n[i][a]);}let o=Re(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let i=0;i<o.length;i+=3)r[i]=o[i],r[i+1]=o[i+2],r[i+2]=o[i+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Kh(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var Co=5126,Uh={stride:ai,attribs:[{name:"a_pos",size:2,type:Co,offset:0}]},ci={stride:Gt,attribs:[{name:"a_pos",size:2,type:Co,offset:0},{name:"a_extrude",size:2,type:Co,offset:8},{name:"a_side",size:1,type:Co,offset:16},{name:"a_dist",size:1,type:Co,offset:20}]},li=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();}},Jh=(n,e)=>[n[0],n[1],n[2],n[3]*e],vo=class{constructor(){this.objects=[];this.markers=[];this.gpu=new P;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,i,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,p)=>m.zIndex-p.zIndex);let h=e.gl.drawingBufferWidth,f=t.width>0?h/t.width:1,u=t.worldSize*f,d=null;for(let m of this.objects){if(!m.visible)continue;let p=m.ghostOpacity;if(c&&p<=0)continue;let b=this.gpuFor(e,m,r,a);if(!b)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:A,vao:B,ibo:C}of b.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let v=c?Jh(A.color,p):A.color;if(A.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",Fe(v)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),s?.(i),d=i);let _=A.width/2*f,w=u>1e-9?1/u:1;if(i.setVec4v("u_color",Fe(v)),i.setFloat("u_half_width",_),i.setFloat("u_offset",(A.offset??0)*f),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",w),i.setFloat("u_units_to_px",u),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[x,E]=A.dashArray;i.setVec2("u_dash",x*f,(x+E)*f);}if(A.arrow){i.setVec4v("u_arrow_color",Fe(A.arrowColor??[1,1,1,1]));let x=(A.arrowSize??5)*f;i.setVec3("u_arrow",(A.arrowPeriod??46)*f,Math.max(x*.4,1),Math.min(x,_*.72));}g&&i.setMat4("u_shadow_matrix",g),i.setMat4("u_matrix",y);}B.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=(a,s,l)=>e.worldPxToPoint(ce(a)*r,fe(s)*r,l);for(let a=this.objects.length-1;a>=0;a--){let s=this.objects[a];if(s.visible&&s.hitTest(t,i,o))return s}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e.rings())for(let s of a){let l=re(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>i&&(i=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.gpu.get(t.id);if(i&&i.revision===t.revision)return i;i?.destroy();let a=[];for(let l of t.build()){let c=l.kind==="fill"?Uh:ci,h=l.kind==="fill"?o:r,f=new Be(e,new Uint8Array(l.mesh.vertices),c),u=new de(e,l.mesh.indices),d=new he(e,[{buffer:f,locations:h}],u);a.push({part:l,vao:d,vbo:f,ibo:u});}let s=new li(t.revision,a);return this.gpu.set(t.id,s),a.length?s: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 Fr=32,Zh=1179937895,Qh=1313821514,qh=5130562,$h={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ed={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function fi(n){let{json:e,bin:t}=Gl(n),o=await od(e,t);return zl(e,t,o)}function td(n){let{json:e,bin:t}=Gl(n);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 zl(e,t,null)}function Gl(n){let e=new DataView(n);if(e.getUint32(0,true)!==Zh)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<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),s=r+8;a===Qh?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,s,i))):a===qh&&(o=new Uint8Array(n,s,i)),r=s+i+(4-i%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 od(n,e){let t=n.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 Promise.resolve().then(()=>(Rl(),Pl));await r.ready;let i=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),h=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(h,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),i.set(a,h);}return i}function Ol(n){let e=U();if(n.matrix){for(let w=0;w<16;w++)e[w]=n.matrix[w];return e}Ze(e);let[t,o,r]=n.translation??[0,0,0],[i,a,s,l]=n.rotation??[0,0,0,1],[c,h,f]=n.scale??[1,1,1],u=i+i,d=a+a,m=s+s,p=i*u,b=i*d,g=i*m,y=a*d,A=a*m,B=s*m,C=l*u,v=l*d,_=l*m;return e[0]=(1-(y+B))*c,e[1]=(b+_)*c,e[2]=(g-v)*c,e[4]=(b-_)*h,e[5]=(1-(p+B))*h,e[6]=(A+C)*h,e[8]=(g+v)*f,e[9]=(A-C)*f,e[10]=(1-(p+y))*f,e[12]=t,e[13]=o,e[14]=r,e}var rd={5120:127,5121:255,5122:32767,5123:65535};function nd(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],s=n[8],l=n[9],c=n[10],h=e*(i*c-a*l)-r*(t*c-o*l)+s*(t*a-o*i);if(Math.abs(h)<1e-20)return [1,0,0,0,1,0,0,0,1];let f=1/h;return [(i*c-a*l)*f,(a*s-r*c)*f,(r*l-i*s)*f,(o*l-t*c)*f,(e*c-o*s)*f,(t*s-e*l)*f,(t*a-o*i)*f,(o*r-e*a)*f,(e*i-t*r)*f]}function zl(n,e,t){let o=w=>{let x=t?.get(w);if(x)return x;let E=n.bufferViews?.[w];if(!E)return null;let F=E.byteOffset??0;return e.subarray(F,F+E.byteLength)},r=[],i=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],f=w=>{if(w===void 0)return null;let x=n.accessors?.[w];if(!x)return null;let E=ed[x.type]??1,F=new Float64Array(x.count*E),M=x.bufferView!==void 0?n.bufferViews?.[x.bufferView]:void 0;if(!M||x.bufferView===void 0)return {data:F,components:E};let D=o(x.bufferView);if(!D)return {data:F,components:E};let S=$h[x.componentType]??4,L=M.extensions?.EXT_meshopt_compression,k=L?L.byteStride:M.byteStride,I=k&&k>0?k:S*E,G=x.byteOffset??0,H=new DataView(D.buffer,D.byteOffset,D.byteLength),z=x.normalized?rd[x.componentType]??1:1;for(let K=0;K<x.count;K++)for(let R=0;R<E;R++){let O=G+K*I+R*S,N;switch(x.componentType){case 5120:N=H.getInt8(O);break;case 5121:N=H.getUint8(O);break;case 5122:N=H.getInt16(O,true);break;case 5123:N=H.getUint16(O,true);break;case 5125:N=H.getUint32(O,true);break;default:N=H.getFloat32(O,true);}F[K*E+R]=z===1?N:Math.max(N/z,-1);}return {data:F,components:E}},u=(w,x,E=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let F=f(w.attributes.POSITION);if(!F)return;let M=f(w.attributes.NORMAL),D=f(w.attributes.TEXCOORD_0),S=f(w.indices),L=r.length/3,k=F.data.length/3,I=nd(x),H=(w.material!==void 0?n.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,z=H?{ox:H.offset?.[0]??0,oy:H.offset?.[1]??0,sx:H.scale?.[0]??1,sy:H.scale?.[1]??1,rot:H.rotation??0}:null;for(let J=0;J<k;J++){let ne=F.data[J*3],se=F.data[J*3+1],oe=F.data[J*3+2],X=x[0]*ne+x[4]*se+x[8]*oe+x[12],j=x[1]*ne+x[5]*se+x[9]*oe+x[13],ie=x[2]*ne+x[6]*se+x[10]*oe+x[14];if(r.push(X,j,ie),X<c[0]&&(c[0]=X),j<c[1]&&(c[1]=j),ie<c[2]&&(c[2]=ie),X>h[0]&&(h[0]=X),j>h[1]&&(h[1]=j),ie>h[2]&&(h[2]=ie),M){let le=M.data[J*3],Ae=M.data[J*3+1],_e=M.data[J*3+2],we=I[0]*le+I[3]*Ae+I[6]*_e,ut=I[1]*le+I[4]*Ae+I[7]*_e,wt=I[2]*le+I[5]*Ae+I[8]*_e,Wo=Math.hypot(we,ut,wt);Wo>1e-12?(we/=Wo,ut/=Wo,wt/=Wo):(we=0,ut=1,wt=0),i.push(we,ut,wt);}else i.push(0,1,0);let ae=D?D.data[J*2]:0,ue=D?D.data[J*2+1]:0;if(z){if(z.rot!==0){let le=Math.cos(z.rot),Ae=Math.sin(z.rot),_e=le*ae+Ae*ue,we=-Ae*ae+le*ue;ae=_e,ue=we;}ae=ae*z.sx+z.ox,ue=ue*z.sy+z.oy;}a.push(ae,ue);}let K=s.length;if(S)for(let J=0;J<S.data.length;J++)s.push(L+S.data[J]);else for(let J=0;J<k;J++)s.push(L+J);let R=w.material!==void 0?n.materials?.[w.material]:void 0,O=R?.pbrMetallicRoughness,N=O?.metallicFactor!==void 0||O?.roughnessFactor!==void 0,W=O?.baseColorFactor??[1,1,1,1],Y=O?.baseColorTexture?.index,Q=Y!==void 0?n.textures?.[Y]?.source:void 0,ee=R?.emissiveFactor??[0,0,0],q=R?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:K,indexCount:s.length-K,baseColor:[W[0],W[1],W[2],W[3]??1],metallic:N?O?.metallicFactor??1:0,roughness:N?O?.roughnessFactor??1:1,emissive:[ee[0]*q,ee[1]*q,ee[2]*q],texture:Q??-1,doubleSided:R?.doubleSided===true,blend:R?.alphaMode==="BLEND",alphaCutoff:R?.alphaMode==="MASK"?R.alphaCutoff??.5:.02,node:E});},d=n.skins?.length?null:id(n,f),m=d?d.nodes:null,p=(w,x,E,F)=>{let M=n.nodes?.[w];if(!M)return;let D=Ol(M),S=U();Me(S,x,D);let L=U(),k=F,I=m?.get(w);if(I?(I.parentNode=F,I.parent=E.slice(),Ze(L),k=w):Me(L,E,D),M.mesh!==void 0)for(let H of n.meshes?.[M.mesh]?.primitives??[])u(H,L,k);let G=M.extensions?.KHR_lights_punctual?.light;if(G!==void 0){let H=n.extensions?.KHR_lights_punctual?.lights?.[G],z=H?.type;if(H&&(z==="point"||z==="spot"||z==="directional")){let K=-S[8],R=-S[9],O=-S[10],N=Math.hypot(K,R,O)||1,W=H.spot?.innerConeAngle??0,Y=H.spot?.outerConeAngle??Math.PI/4;b.push({type:z,color:[H.color?.[0]??1,H.color?.[1]??1,H.color?.[2]??1],intensity:H.intensity??1,range:H.range??0,position:[S[12],S[13],S[14]],direction:[K/N,R/N,O/N],cosInner:Math.cos(W),cosOuter:Math.cos(Y)});}}for(let H of M.children??[])p(H,S,L,k);},b=[],g=U();Ze(g);let y=U();Ze(y);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((w,x)=>x)??[];for(let w of A)p(w,g,y,-1);let B=[];for(let w of n.images??[]){if(w.bufferView===void 0){B.push(new Uint8Array(0));continue}let x=o(w.bufferView);B.push(x?x.slice():new Uint8Array(0));}let C=r.length/3,v=new ArrayBuffer(C*Fr),_=new Float32Array(v);for(let w=0;w<C;w++){let x=w*8;_[x]=r[w*3],_[x+1]=r[w*3+1],_[x+2]=r[w*3+2],_[x+3]=i[w*3],_[x+4]=i[w*3+1],_[x+5]=i[w*3+2],_[x+6]=a[w*2],_[x+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,h[0]=h[1]=h[2]=0),{vertices:v,indices:new Uint32Array(s),primitives:l,images:B,min:c,max:h,animation:d,lights:b}}function id(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,s=i.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[i.sampler];if(!l)continue;let c=e(l.input),h=e(l.output);if(!c||!h||!c.data.length)continue;let f=s==="rotation"?4:3,u=l.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*f);for(let b=0;b<d;b++){let g=u?(b*3+1)*f:b*f;for(let y=0;y<f;y++)m[b*f+y]=h.data[g+y];}let p=o.get(a)??{parentNode:-1,parent:Ze(U()),base:ad(n.nodes?.[a]),channels:[]};p.channels.push({path:s,times:Float32Array.from(c.data),values:m,step:l.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function ad(n){let e=n?.translation,t=n?.rotation,o=n?.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(n,e,t,o){let r=n.nodes.get(e);if(!r)return Ze(o);let i=U();sd(r,t,i);let a=U();if(Me(a,r.parent,i),r.parentNode<0)return Vl(o,a);let s=U();return ui(n,r.parentNode,t,s),Me(o,s,a)}var Vl=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function sd(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.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 h=Math.min(c+1,s-1),f=a.times[h]-a.times[c],u=a.step||f<=0?0:Math.min(Math.max((e-a.times[c])/f,0),1),d=c*l,m=h*l;if(a.path==="rotation"){let p=0;for(let y=0;y<4;y++)p+=a.values[d+y]*a.values[m+y];let b=p<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-u)+a.values[m+y]*b*u,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let p=a.path==="translation"?o:i;for(let b=0;b<3;b++)p[b]=a.values[d+b]*(1-u)+a.values[m+b]*u;}}return Vl(t,Ol({translation:o,rotation:r,scale:i}))}var He=5126,ld=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Wl={stride:Fr,attribs:[{name:"a_pos",size:3,type:He,offset:0},{name:"a_normal",size:3,type:He,offset:12},{name:"a_tex",size:2,type:He,offset:24}]},di=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);}},hi=256,Dr=41,Nl={stride:Dr*4,attribs:[{name:"a_i_m0",size:4,type:He,offset:0,divisor:1},{name:"a_i_m1",size:4,type:He,offset:16,divisor:1},{name:"a_i_m2",size:4,type:He,offset:32,divisor:1},{name:"a_i_m3",size:4,type:He,offset:48,divisor:1},{name:"a_i_s0",size:4,type:He,offset:64,divisor:1},{name:"a_i_s1",size:4,type:He,offset:80,divisor:1},{name:"a_i_s2",size:4,type:He,offset:96,divisor:1},{name:"a_i_s3",size:4,type:He,offset:112,divisor:1},{name:"a_i_n0",size:3,type:He,offset:128,divisor:1},{name:"a_i_n1",size:3,type:He,offset:140,divisor:1},{name:"a_i_n2",size:3,type:He,offset:152,divisor:1}]},wo=2,Ot=16,lt=class{constructor(){this.models=[];this.gpu=new P;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(hi*Dr);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,i,a,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",wo);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let h=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!h||!c.mesh)continue;let f=c.fade<1;o.setFloat("u_opacity",c.fade);let u=c.matrixFor(t);o.setMat4("u_matrix",u),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),h.vao.bind();for(let p of [false,true])if(!(f&&!p))for(let b of c.mesh.primitives){if(!f&&b.blend!==p)continue;o.setMat4("u_matrix",b.node>=0?c.matrixForNode(t,b.node,s):u),d&&o.setMat4("u_shadow_matrix",b.node>=0?this.shadowMatrixForNodeAt(t,c,b.node,s):d);let g=b.texture>=0?h.textures[b.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",b.alphaCutoff),g&&e.bindTexture(wo,g),o.setVec4v("u_base_color",b.baseColor),o.setVec3("u_emissive",b.emissive[0],b.emissive[1],b.emissive[2]),o.setFloat("u_metallic",b.metallic),o.setFloat("u_roughness",b.roughness),e.setCull(b.doubleSided?"none":"back"),e.setBlend(p?"premultiplied":"none"),e.setDepthMask(!p),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,e.gl.UNSIGNED_INT,b.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,i,a){let s=new P;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 h=s.get(c.url);h?h.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 h=this.gpuFor(e,c[0],r);if(!h||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new Be(e,this.instScratch,Nl,true)),h.instVao||(h.instVao=new he(e,[{buffer:h.vbo,locations:r},{buffer:this.instBuffer,locations:r}],h.ibo)),l||(o.use(),i(o),o.setInt("u_base_texture",wo),o.setFloat("u_opacity",1),l=true);let f=c[0].mesh;for(let u=0;u<c.length;u+=hi){let d=Math.min(hi,c.length-u);for(let m=0;m<d;m++){let p=c[u+m],b=m*Dr;this.instScratch.set(p.matrixFor(t),b);let g=a?this.shadowMatrix(t,p):ld;this.instScratch.set(g,b+16),this.instScratch.set(p.normalMatrix(),b+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,d*Dr)),e.bindVAO(h.instVao.vao);for(let m of f.primitives){let p=m.texture>=0?h.textures[m.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),p&&e.bindTexture(wo,p),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(h=>h.type!=="directional"),i=r.length<=Ot?r:[...r].sort((h,f)=>f.intensity-h.intensity).slice(0,Ot),a=new Float32Array(Ot*4),s=new Float32Array(Ot*4),l=new Float32Array(Ot*4),c=new Float32Array(Ot*4);i.forEach((h,f)=>{let u=f*4;a[u]=h.position[0],a[u+1]=h.position[1],a[u+2]=h.position[2],a[u+3]=h.range,s[u]=h.color[0]*h.intensity,s[u+1]=h.color[1]*h.intensity,s[u+2]=h.color[2]*h.intensity,s[u+3]=h.type==="spot"?1:0,l[u]=h.direction[0],l[u+1]=h.direction[1],l[u+2]=h.direction[2],c[u]=h.cosInner,c[u+1]=h.cosOuter;}),o={count:i.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(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+i*.5,i)}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 i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let s=this.shadowMatrix(t,i);o.setMat4("u_matrix",s),a.vao.bind();for(let l of i.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,i,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),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,i){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,i)}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 i=e.gl,a=new Be(e,new Uint8Array(t.mesh.vertices),Wl),s=new de(e,t.mesh.indices),l=new he(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(f=>{if(!f)return null;let u=i.createTexture();return u?(e.bindTexture(wo,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,f),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),u):null}),h=new di(l,a,s,c);return h.users=1,this.counted.add(t),this.gpu.set(t.url,h),h}static get layout(){return Wl}static get instanceLayout(){return Nl}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var mi=4,Kl=new te;function cd(n){Kl.has(n)||(Kl.add(n),console.warn(`[osmgl] ${n}`));}var fd=.5,ud=.01,hd=300,pi=127,dd=.5,zt=128,xo=5120,Sr=5121,_o=5122,Ul=5123,Eo=5126,md={stride:8,attribs:[{name:"a_pos",size:2,type:Eo,offset:0}]},bi={stride:rt,attribs:[{name:"a_pos",size:2,type:_o,offset:0}]},Jl={stride:at,attribs:[{name:"a_p0",size:2,type:_o,offset:0},{name:"a_p1",size:2,type:_o,offset:4},{name:"a_corner",size:2,type:xo,offset:8},{name:"a_ground",size:2,type:xo,offset:10},{name:"a_dist",size:1,type:Eo,offset:12},{name:"a_width",size:1,type:Eo,offset:16}]},Vt={stride:Te,attribs:[{name:"a_pos",size:2,type:_o,offset:0},{name:"a_height",size:1,type:Ul,offset:4},{name:"a_tint",size:1,type:Sr,normalized:true,offset:6},{name:"a_ao",size:1,type:Sr,normalized:true,offset:7},{name:"a_normal",size:3,type:xo,normalized:true,offset:8},{name:"a_kind",size:1,type:Sr,offset:11},{name:"a_wall",size:3,type:Ul,offset:12}]},pd={flat:0,water:1,foliage:2,sand:3,asphalt:4},bd=[1,9,14,26,3],Xl={stride:Tt,attribs:[{name:"a_pos",size:2,type:Eo,offset:0},{name:"a_level",size:1,type:_o,offset:8},{name:"a_normal",size:3,type:xo,normalized:true,offset:10},{name:"a_kind",size:1,type:Sr,offset:13},{name:"a_bleed",size:2,type:xo,offset:14}]},Ir=class{constructor(e,t,o,r,i,a,s=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=s;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},jl={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Mo=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new P;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new xr;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new P;this.lineLocs=new P;this.objectLine=null;this.objectLineLocs=new P;this.buildingLocs=new P;this.shadows={...jl};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new P;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 P;this.highlightKey="";this.groundArrows=new yo;this.highlightTris=new P;this.fillHighlightGpu=new P;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Ao;this.hiddenBuildings=new Set;this.seams=new Ar;this.seamGpu=new P;this.hiddenWithSeams=new P;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new P;this.hiddenStamp="";this.bucketIdCache=new P;this.surfaceCut=new P;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new lt;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new P;this.modelInstLocs=new P;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((i,a)=>i-a).join(","),t="";for(let[r,i]of this.seams.hiddenByTile)t+=`${r}=${e(i)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,i]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let s of i)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,i,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.surfaceCut.get(s);if(l!==void 0&&(l===null||l.vbo===i))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 h=new Float64Array(c.shapeFeatures),f=new Uint32Array(c.shapeRanges),u=[],d=0;for(let C=0;C<h.length;d++){let v=h[C++],_=v>0;for(let w=0;w<v;w++)if(!a.has(h[C+w])){_=false;break}C+=v,_&&u.push(d);}if(!u.length)return this.surfaceCut.set(s,null),null;let m=new Uint32Array(c.indices),p=c.capIndexOffset??m.length,b=new Uint8Array(m.length);for(let C of u){for(let v=f[C*4];v<f[C*4+1];v++)b[v]=1;for(let v=f[C*4+2];v<f[C*4+3];v++)b[v]=1;}let g=[];for(let C=0;C<p;C++)b[C]||g.push(m[C]);let y=g.length;for(let C=p;C<m.length;C++)b[C]||g.push(m[C]);let A=new de(e,new Uint32Array(g)),B={vao:new he(e,[{buffer:i,locations:this.surfaceLocs}],A),ibo:A,vbo:i,mainCount:y,capCount:g.length-y};return this.surfaceCut.set(s,B),B}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 i=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:i,vbo:o}),i}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,i,a,s=this.buildingLocs){if(!a||!a.size)return null;let l=r+"|"+o,c=this.hiddenCut.get(l);if(c!==void 0&&(c===null||c.vbo===i))return c;c&&(c.vao.destroy(),c.ibo.destroy());let h=t.data?.buckets?.[o];if(!h||!("featureIds"in h)||!h.featureIds)return null;let f=this.bucketIds(l,h.featureIds,i),[u,d]=a.size<f.size?[a,f]:[f,a],m=false;for(let A of u)if(d.has(A)){m=true;break}if(!m)return this.hiddenCut.set(l,null),null;let p=new Uint32Array(h.indices),b=new Float64Array(h.featureIds),g=[];for(let A=0;A*3<p.length;A++)a.has(b[A])||g.push(p[A*3],p[A*3+1],p[A*3+2]);let y=null;if(g.length<p.length){let A=new de(e,new Uint32Array(g));y={vao:new he(e,[{buffer:i,locations:s}],A),ibo:A,count:g.length,vbo:i};}return this.hiddenCut.set(l,y),y}init(e){this.symbols?.init(e),this.fill=new Ce(e,"fill",ml,pl),this.surface=new Ce(e,"surface",vl,wl),this.line=new Ce(e,"line",bl,gl),this.objectLine=new Ce(e,"objectLine",yl,Al),this.building=new Ce(e,"buildings",Bl,Cl),this.depth=new Ce(e,"depth",rl,jn),this.groundShadow=new Ce(e,"groundShadow",hl,dl),this.sky=new Ce(e,"sky",ll,cl),this.raster=new Ce(e,"raster",fl,ul),this.globeBody=new Ce(e,"globeBody",$s,el),this.globeClip=new Ce(e,"globeClip",tl,ol),this.globeMesh=gd(e,this.globeBody),this.model=new Ce(e,"model",il,Zn),this.modelInstanced=new Ce(e,"model-instanced",al,Zn),this.modelDepth=new Ce(e,"modelDepth",sl,jn);for(let i of lt.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...lt.layout.attribs,...lt.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=Qs(e);let t=new P([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new Be(e,new Float32Array([0,0,1,0,1,1,0,1]),md),r=new de(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new he(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of bi.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Xl.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of Jl.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of ci.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));for(let i of Vt.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));}render(e,t,o,r,i,a=new P){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.materialTime=i/1e3,this.materialAnimating=false,this.fog=Rt(t,r),this.patternScale=Jo/Math.max(ze(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),h=t.cameraPositionPx;this.cameraMeters=[h[0]/c,h[1]/c,h[2]/c];let f=b=>o.get(b.source??Z);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),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.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=b=>b.type==="line"&&V(b.paint.elevation,s,0)!==0,d=new Set;for(let b of r.layers){if(b.type==="raster"||b.type==="fill-extrusion"||b.type==="symbol"||b.overlay||u(b)||!r.layerVisibleAt(b,s))continue;let g=f(b);if(g){if(b.type==="line"&&b.network){if(d.has(b.network))continue;d.add(b.network),this.drawNetwork(e,t,r,f,b.network,s,y=>!y.overlay&&!u(y)&&r.layerVisibleAt(y,s));continue}if(b.type==="surface"){if(!this.flattened(g,r,b))continue;this.drawFill(e,t,g,r,b,s);continue}b.type==="fill"?this.drawFill(e,t,g,r,b,s):this.drawLine(e,t,g,r,b,s);}}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.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let b of r.layers){if(b.type!=="surface"||b.overlay||!r.layerVisibleAt(b,s))continue;let g=f(b);g&&(this.flattened(g,r,b)||this.drawSurface(e,t,g,r,b,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let b of r.layers){if(b.type==="raster"||!u(b)||b.overlay||!r.layerVisibleAt(b,s))continue;let g=f(b);if(g){if(b.type==="line"&&b.network){if(m.has(b.network))continue;m.add(b.network),this.drawNetwork(e,t,r,f,b.network,s,y=>!y.overlay&&u(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,g,r,b,s);}}this.drawOverlay(e,t,r,f,s,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let b of r.layers){if(b.type!=="fill-extrusion"||!r.layerVisibleAt(b,s))continue;let g=f(b);g&&(this.drawBuildings(e,t,g,r,b,s,i)&&(l=true),this.drawHighlight(e,t,g,r,b,s));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,b=>{this.applyShadowUniforms(b),this.applyFogUniforms(b,t,r),this.applyLight(b,r);},this.shadowActive,i/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,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),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s,true);let p=r.layers.filter(b=>b.type==="line"&&V(b.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(b,s));if(p.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let b of p){let g=f(b);g&&this.drawLine(e,t,g,r,b,s,V(b.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,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,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}renderShadowMap(e,t,o,r,i){if(this.shadowPlaceholder&&e.bindTexture(mi,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(f=>f.type==="fill-extrusion"&&!f.overlay&&r.layerVisibleAt(f,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new bo(e,this.shadows.resolution);let s=r.light;if(t.updateShadow(Wt(s.keyAzimuth,s.keyAltitude),hd),!t.shadowReady)return;let l=this.shadowTarget;l.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 h=this.depth;h.use();for(let f of a){let u=o.get(f.source??Z);if(!u)continue;let d=r.bucketKeyFor(f);if(d===null)continue;let m=V(f.paint.heightScale,t.zoom,1);(f.source??Z)===Z&&this.indoorMask.prepare(u,d);for(let p of u.visibleTiles){if(!this.drawsTile(t,r,f,p))continue;let b=u.getTile(p),g=b&&this.bucketFor(e,b,d,Vt,this.buildingLocs,"fill-extrusion");if(!g)continue;h.setFloat("u_height_scale",this.growScale(g,i,!u.warm)*m),h.setMat4("u_matrix",t.shadowTileMatrix(p,g.extent));let y=(f.source??Z)===Z,A=this.cutHidden(e,b,d,p.dataKey,g.buffer,this.hiddenFor(d,y,p.dataKey)),B=y?A??this.indoorMask.indicesFor(e,b,d,p,g.buffer,this.buildingLocs):A;B?(B.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,B.count,e.gl.UNSIGNED_INT,0)):(g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.indexCount,g.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=i/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),l.bindTexture(mi),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(l.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 i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Ne(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],i=[0,0,0,0];if(be(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[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(Oe(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(),Ne(r,"u_sky_color",o.sky.skyColor),Ne(r,"u_horizon_color",o.sky.horizonColor),yd(r,o.sky);let[i,a]=this.skyBand(t,o),s=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",i,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]),Ne(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let h=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",h,o.sky.starIntensity),h>.001){Ne(r,"u_space_color",o.sky.spaceColor),Ne(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[u,d,m,p]=t.localRayCorners();r.setVec3("u_ray_tl",u[0],u[1],u[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",p[0],p[1],p[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,i=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,i),e.setVec2("u_globe_center",t.centerPointPx.x/i,t.centerPointPx.y/i);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]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let i=o.bounds();e.setVec3("u_tile_merc",i.minX,i.minY,(i.maxX-i.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??Rt(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}Ne(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[i,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",i,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){let i=this.fog;if(!i)return true;let a=e.distanceToTile(r);return a>i.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let i of e.layers)i.type==="surface"?o=Math.min(o,(i.elevation-(i.bevelDrop??0))*this.reliefScale):i.type==="line"&&(o=Math.min(o,V(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(fd/Math.max(t.pixelsPerMeter,1e-9),ud);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,pi);}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(Z);if(!r||!this.fill||!this.quad)return;let i=r.visibleTiles;if(!i.length||i.length>pi)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 i)l++,this.stencilIds.set(c.dataKey,l),a.stencilFunc(a.ALWAYS,l,pi),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 i=o.get(Z);if(!i)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 i.visibleTiles){let h=t.tileMatrix(c,1);l.set(h);for(let f=0;f<4;f++)l[12+f]+=s*h[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 i=o.get(Z);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=Wt(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),h=pe(s.ambientColor),f=pe(s.keyColor),u=[0,0,0];for(let d=0;d<3;d++){let m=h[d]*s.ambientIntensity,p=f[d]*s.keyIntensity*c;u[d]=m>0?m/(m+p):1;}a.setVec3("u_shadow_ground",u[0],u[1],u[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",mi),!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 i=pe(this.shadows.color);e.setVec3("u_shadow_color",i[0],i[1],i[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,i,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,i))continue;let c=r(l);if(c){if(l.type==="surface"){this.flattened(c,o,l)?this.drawFill(e,t,c,o,l,i):this.drawSurface(e,t,c,o,l,i),s();continue}l.type==="fill"?this.drawFill(e,t,c,o,l,i):this.drawLine(e,t,c,o,l,i);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=i=>{let a=(i+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[l,c,h]=this.tileTint(t);e.setVec4("u_tile_tint",l,c,h,dd);}else e.setVec4("u_tile_tint",0,0,0,0);let r=jo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[i,a]=$i(t.z,t.x,t.y);e.setVec2("u_world_origin",i/this.patternScale,a/this.patternScale);let s=this.cameraMeters;e.setVec3("u_camera_local",s[0]-t.x*r,s[1]-t.y*r,s[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,i=this.detailScale<=0?0:pd[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,s=V(a.materialStrength,o,1)*this.detailScale,l=V(a.materialScale,o,bd[i]),c=V(a.materialSpeed,o,i===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,i,a){let s=this.fill,l=r.colorAt(i,a),c=V(i.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,i,a),s.setVec4v("u_color",Fe([l[0],l[1],l[2],l[3]*c]));let h=r.bucketKeyFor(i);if(h!==null){for(let f of o.visibleTiles){if(!this.drawsTile(t,r,i,f))continue;let u=o.getTile(f),d=u&&this.bucketFor(e,u,h,bi,this.fillLocs,"fill");if(!d)continue;this.clipToTile(e,f),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(f,d.extent)),this.applyTileScale(s,f,d.extent),this.applyTileMatrix(s,t,f,d.extent);let m=this.cutHidden(e,u,h,f.dataKey,d.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,i,a,s=0,l){let c=this.line,h=r.colorAt(i,a),f=V(i.paint.opacity,a,1)*(s||1),u=V(i.paint.width,a,1);if(f<=.001||u<=.01)return;let d=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,p=t.width>0?d/t.width:1,b=u/2*p;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",Fe([h[0],h[1],h[2],h[3]*f])),c.setFloat("u_center_w",t.cameraToCenterDistance);let g=V(i.paint.offset,a,0)*p,y=Math.max(V(i.paint.blur,a,0),0)*p;c.setFloat("u_elevation",V(i.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,m);let A=i.paint.dashArray,B=i.paint.arrow===true,C=i.paint.arrowStyle,v=B&&(C==="head"||C==="headOnly"),_=B&&C==="dash";if(c.setInt("u_pattern",_?5:A?1:C==="headOnly"&&B?4:v?3:B?2:0),A){let[x,E]=A;c.setVec2("u_dash",x*p,(x+E)*p);}if(B){let x=ke(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Fe(x));let E=V(i.paint.arrowPeriod,a,46)*p,F=V(i.paint.arrowSize,a,5)*p;if(_){let M=V(i.paint.arrowGap,a,24)*p,D=Math.max(E-M,1),S=Math.min(F,D),L=V(i.paint.arrowShaft,a,2)*p,k=V(i.paint.arrowHead,a,4)*p,I=V(i.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",L,S,k,D),c.setVec2("u_dash",I,E);}else v?c.setVec4("u_arrow",E,F,b,0):c.setVec4("u_arrow",E,Math.max(F*.4,1),Math.min(F,b*.72),0);}let w=r.bucketKeyFor(i);if(w!==null)for(let x of o.visibleTiles){if(!this.drawsTile(t,r,i,x))continue;let E=o.getTile(x);if(!E)continue;let F=i.network?l!==void 0?[je(i.id,l)]:(E.data?.levels??[]).map(M=>je(i.id,M)):[w];for(let M of F){let D=this.bucketFor(e,E,M,Jl,this.lineLocs,"line");if(!D)continue;let S=x.bounds(),L=(S.maxX-S.minX)*t.worldSize/D.extent*p;c.setFloat("u_tile_to_px",L);let k=L>1e-6?1/L:1;c.setFloat("u_half_width",b*k),c.setFloat("u_blur",y*k),c.setFloat("u_meters_to_units",t.pixelsPerMeter*k),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",V(i.paint.widthExtra,a,0)*k),c.setFloat("u_offset",g*k),c.setFloat("u_tile_per_px",k),this.applyTileScale(c,x,D.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,D.extent)),this.applyTileMatrix(c,t,x,D.extent);let I=this.cutHidden(e,E,M,x.dataKey,D.buffer,this.replacedIds(),this.lineLocs);I?(I.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,I.count,e.gl.UNSIGNED_INT,0)):(D.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,D.indexCount,D.indexType,0));}}}drawNetwork(e,t,o,r,i,a,s){let l=o.layers.filter(h=>h.type==="line"&&h.network===i&&s(h));if(!l.length)return;let c=new Set;for(let h of l){let f=r(h);if(f)for(let u of f.visibleTiles){let d=f.getTile(u);for(let m of d?.data?.levels??[])c.add(m);}}if(c.size)for(let h of [...c].sort((f,u)=>f-u))for(let f of l){let u=r(f);u&&this.drawLine(e,t,u,o,f,a,0,h);}}drawHighlight(e,t,o,r,i,a){let s=this.highlight;if(!s||!this.building||s.layerId!==i.id)return;let l=`${i.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=pe(s.color)??[.31,.79,.5,1],h=this.building;h.use(),this.applyShadowUniforms(h),this.applyFogUniforms(h,t,r),this.applyLight(h,r),h.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),h.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),h.setFloat("u_opacity",s.opacity),h.setFloat("u_ao_strength",V(i.paint.aoStrength,a,.4)),h.setFloat("u_tint_variation",0),h.setFloat("u_facade_detail",0),h.setFloat("u_window_glow",0),h.setFloat("u_roof_variation",0),h.setFloat("u_height_scale",V(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,zt,zt),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(zt);let u=this.seams.stitched.has(s.featureId);u&&this.drawSeamHighlight(e,t,h,s.featureId);for(let d of u?[]:o.visibleTiles){let m=o.getTile(d);if(!m)continue;let p=m.data?.buckets?.[i.id];if(!p)continue;let b=d.dataKey,g=this.highlightGpu.get(b);if(g===void 0){let y=_r(m,i.id,s.featureId);if(y){let A=new Be(e,new Uint8Array(y.vertices),Vt),B=new de(e,y.indices);g={vao:new he(e,[{buffer:A,locations:this.buildingLocs}],B),vbo:A,ibo:B,count:y.indices.length};}else g=null;this.highlightGpu.set(b,g);}g&&(this.applyTileScale(h,d,p.extent),this.shadowActive&&h.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),h.setMat4("u_matrix",t.tileMatrix(d,p.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 i=t.layers.find(l=>l.id===o.layerId),a=e.get(i?.source??Z);if(!a)return;let s=new te;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),h=c?.data?.buckets?.[o.layerId];if(!c||!h)continue;let f=_r(c,o.layerId,o.featureId);f&&this.highlightTris.set(l.dataKey,$n(f,h.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let s=r.layers.find(u=>u.id===i.layerId),l=s?o.get(s.source??Z):void 0;if(!s||!l)return;let c=i.bucketKey,h=pe(i.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",Fe([h[0],h[1],h[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,zt,zt),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(zt);for(let u of l.visibleTiles){let d=l.getTile(u),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let p=this.fillHighlightFor(e,m,u,i.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(u,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.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,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(u=>{u?.vao.destroy(),u?.ibo.destroy(),u?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),h=[];for(let u=0;u*3<l.length;u++)c[u]===r&&h.push(l[u*3],l[u*3+1],l[u*3+2]);let f=null;if(h.length){let u=new Be(e,new Uint8Array(t.vertices),bi),d=new de(e,new Uint32Array(h));f={vao:new he(e,[{buffer:u,locations:this.fillLocs}],d),vbo:u,ibo:d,count:h.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,i,a){let s=this.surface,l=r.colorAt(i,a,[.7,.8,.7,1]),c=V(i.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,i,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",V(i.paint.sideShade,a,.12));let h=i.elevation<(i.base??0),f=i.paint.sideColor?ke(i.paint.sideColor,a,l):l;s.setVec3("u_side_color",f[0],f[1],f[2]),s.setFloat("u_side_light",V(i.paint.sideLight,a,h?1:0)),s.setFloat("u_relief",this.reliefScale);let u=r.bucketKeyFor(i);if(u===null)return;let d=c>=1&&!i.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,i,g))continue;let y=o.getTile(g),A=y&&this.bucketFor(e,y,u,Xl,this.surfaceLocs,"surface");A&&m.push({id:g,bucket:A,cut:y?this.cutSurface(e,y,u,g.dataKey,A.buffer,this.replacedIds()):null});}let p=(g,y,A)=>{this.clipToTile(e,g),this.applyTileScale(s,g,y.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(g,y.extent)),this.applyTileMatrix(s,t,g,y.extent),(A??y).vao.bind();},b=m.filter(({bucket:g,cut:y})=>y?y.capCount>0:g.capIndexOffset<g.indexCount);if(b.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:g,bucket:y,cut:A}of b){p(g,y,A);let B=A?e.gl.UNSIGNED_INT:y.indexType,C=B===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,A?A.capCount:y.indexCount-y.capIndexOffset,B,(A?A.mainCount:y.capIndexOffset)*C);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:g,bucket:y,cut:A}of m)p(g,y,A),e.gl.drawElements(e.gl.TRIANGLES,A?A.mainCount:y.capIndexOffset,A?e.gl.UNSIGNED_INT:y.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,i,a,s){let l=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),h=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,f=V(i.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",h),l.setFloat("u_opacity",f),l.setFloat("u_ao_strength",V(i.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",V(i.paint.tintVariation,a,.07));let u=(B,C)=>i.paint[B]?r.colorAt({...i,paint:{...i.paint,color:i.paint[B]}},a,C):C,d=u("windowColor",[.62,.71,.8,1]),m=u("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",d[0],d[1],d[2]),l.setVec3("u_window_frame",m[0],m[1],m[2]),l.setFloat("u_facade_detail",V(i.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",V(i.paint.windowGlow,a,0)),l.setFloat("u_floor_height",V(i.paint.floorHeight,a,3.2)),l.setFloat("u_window_variation",V(i.paint.windowVariation,a,1)),l.setFloat("u_seam_strength",V(i.paint.seamStrength,a,1)),l.setFloat("u_window_recess",V(i.paint.windowRecess,a,.18)),l.setFloat("u_window_recess_shade",V(i.paint.windowRecessShade,a,.16)),l.setFloat("u_plinth_height",V(i.paint.plinthHeight,a,4)),l.setFloat("u_plinth_shade",V(i.paint.plinthShade,a,.14)),l.setFloat("u_roof_variation",V(i.paint.roofVariation,a,.3)),this.applyLight(l,r);let p=f>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let b=V(i.paint.heightScale,a,1),g=false,y=r.bucketKeyFor(i);if(y===null)return g;let A=(i.source??Z)===Z;if(A&&this.indoorMask.prepare(o,y),A&&o.visibleTiles.length){let B=o.visibleTiles[0].z;this.seams.update(o,y,{zoom:B,metersPerTile:jo(B),cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments})&&this.syncSeamGpu();}for(let B of o.visibleTiles){if(!this.drawsTile(t,r,i,B))continue;let C=o.getTile(B),v=C&&this.bucketFor(e,C,y,Vt,this.buildingLocs,"fill-extrusion");if(!v)continue;let _=this.growScale(v,s,!o.warm);_<1&&(g=true),l.setFloat("u_height_scale",_*b),this.applyTileScale(l,B,v.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(B,v.extent)),l.setMat4("u_matrix",t.tileMatrix(B,v.extent));let x=this.cutHidden(e,C,y,B.dataKey,v.buffer,this.hiddenFor(y,A,B.dataKey))??(C&&A?this.indoorMask.indicesFor(e,C,y,B,v.buffer,this.buildingLocs):null);x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.indexCount,v.indexType,0));}return A&&this.drawSeams(e,t,l,b),g}drawSeamHighlight(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=`${i}\u241F${r}`,c=this.highlightGpu.get(l);if(c===void 0){let h=ii(s,r);if(h){let f=new Be(e,new Uint8Array(h.vertices),Vt),u=new de(e,h.indices);c={vao:new he(e,[{buffer:f,locations:this.buildingLocs}],u),vbo:f,ibo:u,count:h.indices.length};}else c=null;this.highlightGpu.set(l,c);}c&&(this.applyTileScale(o,a,s.extent),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[i,{tile:a,mesh:s}]of this.seams.meshes){let l=this.seamGpu.get(i);if(!l){let c=new Be(e,new Uint8Array(s.vertices),Vt),h=new de(e,new Uint32Array(s.indices)),f=new he(e,[{buffer:c,locations:this.buildingLocs}],h);l=new Ir(f,c,h,s.indexCount,e.gl.UNSIGNED_INT,s.extent),this.seamGpu.set(i,l);}o.setFloat("u_height_scale",r),this.applyTileScale(o,a,s.extent),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);}}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?Ad(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Ne(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=Wt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Ne(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),Ne(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 i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,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 cd(`\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;let c=new Be(e,new Uint8Array(l.vertices),r),h=new de(e,new Uint32Array(l.indices)),f=new he(e,[{buffer:c,locations:i}],h),u=new Ir(f,c,h,h.count,h.type,l.extent,l.capIndexOffset??h.count);return t.buckets.set(o,u),u}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Lr=new P;function gd(n,e){let r=new Float32Array(66306),i=0;for(let u=0;u<=128;u++){let d=(u/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[i++]=m/256*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(256*128*6),s=0;for(let u=0;u<128;u++)for(let d=0;d<256;d++){let m=u*257+d,p=m+256+1;a[s++]=m,a[s++]=m+1,a[s++]=p,a[s++]=m+1,a[s++]=p+1,a[s++]=p;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:Eo,offset:0}]},c=new P([["a_lnglat",e.attribLocation("a_lnglat")]]),h=new Be(n,r,l),f=new de(n,a);return {vao:new he(n,[{buffer:h,locations:c}],f),vbo:h,ibo:f,count:a.length}}function yd(n,e){if(e.highColor){Ne(n,"u_high_color",e.highColor);return}let t=Lr.get(e.skyColor);t||(t=pe(e.skyColor),Lr.set(e.skyColor,t)),n.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Ne(n,e,t){let o=Lr.get(t);o||(o=pe(t),Lr.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Wt(n,e){let t=n*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 Ad(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Tr=1,Fo=class{constructor(e=1024){this.entries=new P;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 i=this.entries.get(e);if(i)return i;if(this.full||o>this.size)return null;if(this.shelfX+o+Tr>this.size&&(this.shelfY+=this.shelfHeight+Tr,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Tr>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+Tr,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 gi=.75,So=8,xe=3,et=24,Nt=256,Yl=255,Do=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new P;this.loaded=new te;this.inflight=new P;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/Nt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/Nt);if(r<=Yl&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new te;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/Nt);i>Yl||this.loaded.has(i)||t.add(i);}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*Nt}-${e*Nt+Nt-1}`),r=fetch(o,{credentials:"same-origin"}).then(i=>{if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.arrayBuffer()}).then(i=>{for(let a of Zl(i))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(i=>{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:`,i instanceof Error?i.message:i);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Zl(n){let e=new bt(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((s,l,c)=>{if(s!==3||!c)return;let h=c.readVarint()+c.pos,f={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((u,d,m)=>{m&&(u===1?f.id=m.readVarint():u===2?f.bitmap=m.readBytes():u===3?f.width=m.readVarint():u===4?f.height=m.readVarint():u===5?f.left=m.readSVarint():u===6?f.top=m.readSVarint():u===7&&(f.advance=m.readVarint()));},null,h),t.push(f);},null,a);},null),t}var Bd=.25,Kt=1e20;function yi(n,e,t){let o=e+xe*2,r=t+xe*2,i=o*r,a=new Float64Array(i),s=new Float64Array(i);a.fill(Kt),s.fill(0);for(let c=0;c<t;c++)for(let h=0;h<e;h++){let f=n[c*e+h]/255,u=(c+xe)*o+(h+xe);if(f>=1)a[u]=0,s[u]=Kt;else if(f>0){let d=.5-f;a[u]=d>0?d*d:0,s[u]=d<0?d*d:0;}else a[u]=Kt,s[u]=0;}Ql(a,o,r),Ql(s,o,r);let l=new Uint8Array(i);for(let c=0;c<i;c++){let h=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Cd(Math.round(255-255*(h/So+Bd)));}return {data:l,width:o,height:r}}function Ql(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=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]=n[c*e+l];ql(r,i,a,s,t);for(let c=0;c<t;c++)n[c*e+l]=i[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=n[l*e+c];ql(r,i,a,s,e);for(let c=0;c<e;c++)n[l*e+c]=i[c];}}function ql(n,e,t,o,r){t[0]=0,o[0]=-Kt,o[1]=Kt;for(let i=1,a=0;i<r;i++){let s=0;do{let l=t[a];s=(n[i]-n[l]+i*i-l*l)/(i-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=i,o[a]=s,o[a+1]=Kt;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let s=t[a];e[i]=(i-s)*(i-s)+n[s];}}var Cd=n=>n<0?0:n>255?255:n;var $l=48,Io=class{constructor(e={}){this.defs=e;this.sdfs=new P;this.pending=new te;this.failed=new te;}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),i=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round($l*(i>1?i:1))),s=Math.max(8,Math.round($l/(i<1?i:1))),l=await vd(o,a,s);return this.sdfs.set(e,yi(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 vd(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((f,u)=>{a.onload=()=>f(),a.onerror=()=>u(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=i;});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,h=new Uint8ClampedArray(e*t);for(let f=0;f<h.length;f++)h[f]=c[f*4+3];return h}finally{URL.revokeObjectURL(i);}}var Ct={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},wd={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[n,e]of Object.entries(wd)){let t=Ct[e];t?Ct[n]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${n}\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 xd=1.2;function Ai(n,e,t=16,o=0){let r=_d(n,t),i=[],a=[],s=0;for(let h of r){let f=0,u=0;for(let d of h){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(f+=p.advance,u++);}u>1&&(f+=o*(u-1)),a.push(f),f>s&&(s=f);}if(s===0)return null;let l=et*xd,c=r.length*l;for(let h=0;h<r.length;h++){let f=-a[h]/2,u=-c/2+h*l+l/2;for(let d of r[h]){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(p.width>0&&p.height>0&&p.bitmap&&i.push({glyph:p,x:f,y:u}),f+=p.advance+o);}}return i.length?{glyphs:i,width:s,height:c}:null}function _d(n,e){let t=n.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],i="";for(let a of o)i?i.length+1+a.length<=e?i+=" "+a:(r.push(i),i=a):i=a;return i&&r.push(i),r.slice(0,3)}function Bi(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,s=t+o,l=u=>u.x>=r&&u.x<=a&&u.y>=i&&u.y<=s,c=[],h=[],f=()=>{h.length>=2&&c.push(h),h=[];};for(let u=0;u+1<n.length;u++){let d=n[u],m=n[u+1],p=l(d),b=l(m);if(p&&b){h.length||h.push(d),h.push(m);continue}let g=Ed(d,m,r,i,a,s);if(!g){f();continue}h.length||h.push(g[0]),h.push(g[1]),b||f();}return f(),c}function Ed(n,e,t,o,r,i){let a=e.x-n.x,s=e.y-n.y,l=0,c=1,h=[[-a,n.x-t],[a,r-n.x],[-s,n.y-o],[s,i-n.y]];for(let[f,u]of h){if(f===0){if(u<0)return null;continue}let d=u/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:n.x+a*l,y:n.y+s*l},{x:n.x+a*c,y:n.y+s*c}]}var Md=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function vi(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=Id(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=i*s,c=o.fontSize?o.fontSize*.6:t/e.length,h=(o.fontSize??0)*.85,f=[],u=o.spacing??250,d=u>0&&u-t<u*.25?t+u*.25:u;if(o.accept)return Fd(n,r,e,t,d,c,a,h,o.accept);if(d>0&&l>=t+d){let p=Math.min(Math.floor((l-t)/d)+1,24),b=t+d*(p-1),g=(l-b)/2;for(let y=0;y<p;y++,g+=d){let A=g/s,B=Ci(n,r,e,t,A,c,a,h);B&&f.push({glyphs:B,path:B.map(C=>({x:C.x,y:C.y})),at:A});}if(f.length)return f}let m=(i-t)/2;for(let p of Md){let b=m+m*p,g=Ci(n,r,e,t,b,c,a,h);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:b}];if(m===0)break}return []}function Fd(n,e,t,o,r,i,a,s,l){let c=e[e.length-1],h=Math.max(o/3,r/8,12),f=[],u=-1/0;for(let d=0;d+o<=c;d+=h){if(d-u<r)continue;let m=Ci(n,e,t,o,d,i,a,s);if(!m)continue;let p={glyphs:m,path:m.map(b=>({x:b.x,y:b.y})),at:d};if(l(p)&&(f.push(p),u=d,f.length>=24))break}return f}function Ci(n,e,t,o,r,i,a,s){if(r<0||r+o>e[e.length-1]||!Dd(n,e,r,r+o,i,a))return null;let l=Lo(n,e,r),c=Lo(n,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return ec(n,e,t,r,s);let h=e[e.length-1];return ec([...n].reverse(),Ld(e),t,h-(r+o),s)}function Dd(n,e,t,o,r,i){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<n.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let h=Math.atan2(n[l].y-n[l-1].y,n[l].x-n[l-1].x),f=Math.atan2(n[l+1].y-n[l].y,n[l+1].x-n[l].x),u=Math.abs((f-h)*180/Math.PI+540)%360-180,d=Math.abs(u);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>i)return false}return true}function ec(n,e,t,o,r){let i=[];for(let c of t){let h=tc(n,e,o+c.offset,c.width);if(!h)return null;i.push(h);}if(!i.length)return null;if(r<=0)return i;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let f=Math.abs(Sd(i[c].angle,i[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 h=tc(n,e,s,t[c].width);if(!h)return null;a.push(h);}return a}function tc(n,e,t,o){let r=Lo(n,e,t+o/2);if(!r)return null;let i=Lo(n,e,t),a=Lo(n,e,t+o);if(!i||!a)return r;let s=a.x-i.x,l=a.y-i.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function Sd(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Id(n){let e=new Array(n.length);e[0]=0;for(let t=1;t<n.length;t++)e[t]=e[t-1]+Math.hypot(n[t].x-n[t-1].x,n[t].y-n[t-1].y);return e}function Ld(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function Lo(n,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 i=(t-e[o-1])/r,a=n[o-1],s=n[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*i,y:a.y+c*i,angle:Math.atan2(c,l)*180/Math.PI}}var xi=20,oc={stride:xi,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}]},Td=220,ct=64,rc=2,Hd=1.22,kd=128,Pd=.7;function Rd(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*et;let r=V(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Pd/(t/et)}var Gd=256,Od=200,wi="frame-circle",Ut=class n{constructor(e,t){this.shader=null;this.locations=new P;this.atlas=new Fo(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new P;this.fading=false;this.styleOrder=new P;this.glyphs=new Do(e,t),this.icons=new Io(Ct);}init(e){this.shader=new Ce(e,"symbol",xl,_l);for(let t of oc.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/Td;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(n.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?Od:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>n.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!i)return;let a=t.zoom,s=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,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.order(l);let c=new P,h=new P,f=new P;s.forEach((d,m)=>f.set(d.id,m));let u=0;for(let d of l){let m=this.place(d,a,c);if(!m)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:m.box,order:f.get(d.layer.id)??0});let p=h.get(d.layer.id);p||h.set(d.layer.id,p={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),p.verts.push(...m.verts),p.texs.push(...m.texs),p.iconVerts.push(...m.iconVerts),p.iconTexs.push(...m.iconTexs),p.frameVerts.push(...m.frameVerts),p.frameTexs.push(...m.frameTexs),u+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),u&&(this.styleOrder=f,this.draw(e,t,h,u,a));}collect(e,t,o,r){let i=[],s=this.padding,l=Rt(e,o).far,[c,h,f]=e.cameraPositionPx;for(let u of r){let d=(u.layout?.priority??0)*Gd,m=t.get(u.source??Z);if(!m)continue;let p=u.layout?.showFor==="highlight",b=u.layout?.placement==="map",{shift:g,drop:y}=b?sc(u,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let A=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,B=o.bucketKeyFor(u);if(B!==null)for(let C of m.visibleTiles){if(!o.layerVisibleAt(u,e.detailZoom(e.distanceToTile(C))))continue;let _=m.getTile(C)?.data?.buckets?.[B];if(!_||!wr(_))continue;let w=new Int16Array(_.anchors),x=new Uint8Array(_.priorities),E=_.rotations?new Int16Array(_.rotations):null,F=_.lines?new Int16Array(_.lines):null,M=_.lineStarts?new Uint32Array(_.lineStarts):null,D=C.bounds(),S=e.worldSize,L=(D.maxX-D.minX)*S/_.extent,k=D.minX*S,I=D.minY*S;for(let G=0;G<x.length;G++){let H=k+w[G*2]*L,z=I+w[G*2+1]*L;if(l!==1/0&&Math.hypot(H-c,z-h,f)>l||p&&!$e(this.highlightFootprint,H/S,z/S,A))continue;let K=H,R=z;if(b&&E){let Y=E[G]*Math.PI/180,Q=g;K-=Math.sin(Y)*Q,R+=Math.cos(Y)*Q;}let O=e.worldPxToPoint(K,R),N=F&&M?zd(e,F,M,G,k,I,L):void 0;if(u.layout?.textPlacement==="line"){if(!N)continue}else if(!O||O.x<s.left-64||O.y<s.top-64||O.x>e.width-s.right+64||O.y>e.height-s.bottom+64)continue;i.push({layer:u,screenX:O?O.x:N[0].x,screenY:(O?O.y:N[0].y)+y,text:_.texts[G]??"",icon:_.icons[G]??"",priority:x[G]+d,rotate:lc(u,E,G,e.bearing),mercX:H/S,mercY:z/S,line:N});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=n.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now),s=this.hoverKey!==null&&this.hoverKey===i,l=V(r.textSize,t,13),c=V(r.iconSize,t,16),h=r.iconTextGap??5,[f,u]=r.offset??[0,0],d=r.placement==="map",m=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let oe=`icon:${e.icon}`,X=this.atlas.get(oe);if(!X){let j=this.icons.get(e.icon);j?X=this.atlas.add(oe,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}X&&(m=X);}let p=null;if(m&&r.iconFrame==="circle"){let oe=`icon:${wi}`,X=this.atlas.get(oe);if(!X){let j=this.icons.get(wi);j?X=this.atlas.add(oe,j.data,j.width,j.height)??void 0:this.pendingIcons.add(wi);}X&&(p=X);}let b=p?Math.max(r.iconFrameScale??1.6,1):1,g=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),g=Ai(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Rd(e.layer,t,l)),!g&&!m)||!g&&!m)return null;let y=l/et,A=g?g.width*y:0,B=g?g.height*y:0;if(e.layer.layout?.textPlacement==="line")return g&&e.line?this.placeOnLine(e,g,y,B,o,t,a):null;let C=r.iconPlacement??"top",v=C==="behind"&&!!m&&!!g,_=C==="top"&&!!m&&!!g,w=m?m.width/Math.max(m.height,1):1,x=v?B+h*2:c,E=m?x*w:0,F=Math.max(E,m?c*b:0),M=Math.max(x,m?c*b:0),D=v?Math.max(E,A+h*2):_?Math.max(F,A):F+(m&&g?h:0)+A,S=v?Math.max(x,B):_?M+h+B:Math.max(m?M:0,B),L=e.screenX+f,k=e.screenY+u,I=rc+(r.collisionPadding??0),G={x1:L-D/2-I,y1:k-S/2-I,x2:L+D/2+I,y2:k+S/2+I},H=this.padding;if(G.x1<H.left||G.y1<H.top||G.x2>this.viewport.width-H.right||G.y2>this.viewport.height-H.bottom)return null;if(!r.allowOverlap){if(nc(o,G))return null;ic(o,G);}let z=[],K=[],R=[],O=[],N=[],W=[],Y=0,Q=L-D/2,ee=_?(M+h)/2:0,q=1/0,J=1/0,ne=-1/0,se=-1/0;if(g){let oe=_||v?L:Q+(m?F+h:0)+A/2;for(let X of g.glyphs){let j=X.glyph,ie=`g:${j.id}`,ae=this.atlas.get(ie);if(!ae&&(!j.bitmap||(ae=this.atlas.add(ie,j.bitmap,j.width+xe*2,j.height+xe*2)??void 0,!ae)))continue;let ue=oe+(X.x+j.left-xe)*y,le=k+ee+(X.y-j.top-xe)*y,Ae=ae.width*y,_e=ae.height*y;Hr(z,K,ue,le,Ae,_e,ae,0,a),Y++;let we=xe*y;q=Math.min(q,ue+we),J=Math.min(J,le+we),ne=Math.max(ne,ue+Ae-we),se=Math.max(se,le+_e-we);}if(_&&m&&J<1/0){let X=k-S/2+M+h-J;if(X!==0){for(let j=1;j<z.length;j+=4)z[j]+=X;J+=X,se+=X;}}}if(m){let oe=s?Hd:1,X=E*oe,j=x*oe,ie=(_?L-E/2:Q+(F-E)/2)-(X-E)/2,ae=(_?k-S/2+(M-x)/2:k-x/2)-(j-x)/2;if(p){let le=c*b*oe,Ae=ie+X/2-le/2,_e=ae+j/2-le/2,we=xe/Math.max(p.height-xe*2,1)*le;Hr(N,W,Ae-we,_e-we,le+we*2,le+we*2,p,0,a),Y++;}if(v&&ne>q){let le=h*1.6,Ae=h;X=(ne-q+le*2)*oe,j=(se-J+Ae*2)*oe,ie=q-le,ae=J-Ae;}let ue=xe/Math.max(m.height-xe*2,1)*j;Hr(R,O,ie-ue,ae-ue,X+ue*2,j+ue*2,m,e.rotate,a),Y++;}return Y?{verts:z,texs:K,iconVerts:R,iconTexs:O,frameVerts:N,frameTexs:W,quads:Y,box:G}:null}placeOnLine(e,t,o,r,i,a,s){let l=e.line,c=t.glyphs.map(E=>({offset:(E.x+t.width/2)*o,width:Math.max(E.glyph.advance,1)*o})),h=c.length?c[c.length-1].offset+c[c.length-1].width:0,f=e.layer.layout??{},u=[],d=[],m=[],p=0,b=r/2+rc,g=this.padding,y=E=>{let F=E.path.map(M=>({x1:M.x-b,y1:M.y-b,x2:M.x+b,y2:M.y+b}));for(let M of F)if(M.x1<g.left||M.y1<g.top||M.x2>this.viewport.width-g.right||M.y2>this.viewport.height-g.bottom||!f.allowOverlap&&nc(i,M))return false;if(!f.allowOverlap)for(let M of F)ic(i,M);return m.push(...F),true},A=-1/0,B=1/0;for(let E of t.glyphs)E.glyph.height<=0||(A=Math.max(A,E.glyph.top),B=Math.min(B,E.glyph.top-E.glyph.height));let C=Number.isFinite(A)?(A+B)/2*o:0,_=Bi(l,this.viewport.width,this.viewport.height,kd).flatMap(E=>vi(E,c,h,{spacing:f.symbolSpacing,fontSize:et*o,stableScale:Math.pow(2,Math.round(a)-a),accept:y}));if(!_.length)return null;for(let E of _)for(let F=0;F<t.glyphs.length;F++){let M=t.glyphs[F].glyph,D=E.glyphs[F],S=`g:${M.id}`,L=this.atlas.get(S);if(!L&&(!M.bitmap||(L=this.atlas.add(S,M.bitmap,M.width+xe*2,M.height+xe*2)??void 0,!L)))continue;let k=L.width*o,I=L.height*o,G=(M.height/2-M.top)*o+C,H=D.angle*Math.PI/180;Hr(u,d,D.x-k/2-Math.sin(H)*G,D.y-I/2+Math.cos(H)*G,k,I,L,D.angle,s),p++;}if(!p)return null;let w=m.map(E=>(E.x1+E.x2)/2),x=m.map(E=>(E.y1+E.y2)/2);return {verts:u,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:p,box:{x1:Math.min(...w)-b,y1:Math.min(...x)-b,x2:Math.max(...w)+b,y2:Math.max(...x)+b}}}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,i){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 h=new ArrayBuffer(r*4*xi),f=new Float32Array(h),u=new Uint16Array(h),d=[],m=0,p=(b,g,y,A)=>{let B=b.length/16;if(B){d.push({layer:y,role:A,first:m/4*6,count:B*6});for(let C=0;C<B*4;C++){let v=m*5;f[v]=b[C*4],f[v+1]=b[C*4+1],u[v*2+4]=g[C*2],u[v*2+5]=g[C*2+1],f[v+3]=b[C*4+2],f[v+4]=b[C*4+3],m++;}}};for(let b of this.inStyleOrder(o))p(b.frameVerts,b.frameTexs,b.layer,"frame"),p(b.iconVerts,b.iconTexs,b.layer,"icon"),p(b.verts,b.texs,b.layer,"text");l.update(new Uint8Array(h)),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",gi),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 b of d){let g=b.layer.paint,y=V(g.opacity,i,1),A=b.role==="icon",B=b.role==="frame",C=(F,M,D)=>B?M??F??D:A?F??D:D,v=ke(B?g.frameColor??g.haloColor??g.color:C(g.iconColor,void 0,g.color),i,[.15,.15,.15,1]),_=B?g.frameHaloColor:C(g.iconHaloColor,void 0,g.haloColor),w=ke(_??(B?g.iconColor??g.color:g.haloColor),i,[1,1,1,1]);B&&g.frameHaloColor===void 0&&(w[3]*=.35),B&&(v[3]*=V(g.frameOpacity,i,1));let x=V(B?g.frameHaloWidth??1.1:C(g.iconHaloWidth,void 0,g.haloWidth),i,1.2),E=V(b.layer.layout?.textSize,i,13);a.setVec4v("u_color",Fe([v[0],v[1],v[2],v[3]*y])),a.setVec4v("u_halo_color",Fe([w[0],w[1],w[2],w[3]*y])),a.setFloat("u_halo",x/(So*(E/et))),s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new Be(e,new Uint8Array(this.capacityQuads*4*xi),oc,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let i=r*4;o.set([i,i+1,i+2,i,i+2,i+3],r*6);}this.ibo=new de(e,o),this.vao=new he(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Hr(n,e,t,o,r,i,a,s=0,l=1){let c=i/Math.max(a.height,1);if(s){let h=s*Math.PI/180,f=Math.cos(h),u=Math.sin(h),d=t+r/2,m=o+i/2;for(let[p,b]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let g=p-d,y=b-m;n.push(d+g*f-y*u,m+g*u+y*f,c,l);}}else n.push(t,o,c,l,t+r,o,c,l,t+r,o+i,c,l,t,o+i,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 zd(n,e,t,o,r,i,a){if(o+1>=t.length)return;let s=t[o],l=t[o+1],c=[];for(let h=s;h<l;h++){let f=n.worldPxToPoint(r+e[h*2]*a,i+e[h*2+1]*a);if(!f)break;c.push(f);}return c.length>=2?c:void 0}var ac=(n,e)=>n*4096+e;function nc(n,e){let t=Math.floor(e.x1/ct),o=Math.floor(e.y1/ct),r=Math.floor(e.x2/ct),i=Math.floor(e.y2/ct);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=n.get(ac(a,s));if(l){for(let c of l)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function ic(n,e){let t=Math.floor(e.x1/ct),o=Math.floor(e.y1/ct),r=Math.floor(e.x2/ct),i=Math.floor(e.y2/ct);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=ac(a,s),c=n.get(l);c||n.set(l,c=[]),c.push(e);}}function sc(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=V(n.layout?.arrowLength,e,50)*r;return {shift:V(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function lc(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var Jt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new P;}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 Xt=class n{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 n(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 n(e,t,o,this.wrap),new n(e,t+1,o,this.wrap),new n(e,t,o+1,this.wrap),new n(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new n(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function Vd(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new Xt(t,l,s),h=c.bounds(),f=(h.minX+h.maxX)/2,u=(h.minY+h.maxY)/2,d=[[f,u],[h.minX,h.minY],[h.maxX,h.minY],[h.minX,h.maxY],[h.maxX,h.maxY]],m=false;for(let[b,g]of d)if(n.isOnGlobeFront(Le(b),De(g))){m=true;break}if(!m)continue;let p=false;for(let[b,g]of d){let y=n.localToPoint(n.globeLocal(b,g));if(y&&y.x>-a&&y.y>-a&&y.x<n.width+a&&y.y<n.height+a){p=true;break}}if(p&&(i.push(c),i.length>=r))return i}return i}function To(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,s=Math.min(Math.round(n.zoom),t);if(s<o)return [];if(n.globeActive)return Vd(n,e,s);let{min:l,max:c}=n.visibleWrapRange(),h=[],f=[];for(let d=l;d<=c;d++)f.push(new Xt(0,0,0,d));let u=0;for(;f.length&&!(++u>2e4||h.length>=i);){let d=f.pop();if(!n.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&h.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){h.push(d);continue}for(let p of d.children())f.push(p);}return h.sort((d,m)=>n.distanceToTile(d)-n.distanceToTile(m)),h}var Ei=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new P;}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;}},_i=6,Wd=24,kr=class extends tt{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 Jt(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.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 i=this.getTile(r)?.data?.splits?.[t];if(i)for(let a of i)o.includes(a)||o.push(a);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),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=To(t,this.opts),r=new te;for(let c of o)r.add(c.dataKey);for(let[c,h]of this.cache.entries())h.state==="loading"&&!r.has(c)&&(this.pool.abort(h.requestId),this.cache.delete(c));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);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 h=this.cache.peek(c.dataKey);return !!h&&h.state!=="loading"},r=(c,h)=>{let f=h.parent();for(let u=0;f&&u<=_i;u++){if(f.dataKey===c.dataKey)return true;f=f.parent();}return false},i=new P,a=[];for(let c of t)o(c)?i.set(c.dataKey,c):a.push(c);let s=this.descendantsOf(a);for(let c of a){let h=s.get(c.dataKey);if(h&&h.length){for(let m of h)i.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let f=c.parent(),u=null;for(let m=1;f&&m<=_i;m++,f=f.parent()){if(!o(f))continue;let p=f;if(m>1&&t.some(b=>b!==c&&o(b)&&r(p,b)))break;u=p;break}let d=u??c;i.set(d.dataKey,d);}let l=[];for(let[,c]of i){let h=c.parent(),f=false;for(let u=0;h&&u<=_i;u++){if(i.has(h.dataKey)){f=true;break}h=h.parent();}f||(l.push(c),this.cache.get(c.dataKey));}return l}descendantsOf(t){let o=new P;for(let i of t)o.set(i.dataKey,i);let r=new P;if(!o.size)return r;for(let[i,a]of this.cache.entries()){if(a.state==="loading")continue;let s=a.id.parent();for(let l=0;s&&l<Wd;l++){let c=o.get(s.dataKey);if(c){let h=r.get(c.dataKey);h?h.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 te;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let s=0;i&&s<4;s++){if(o.has(i.dataKey)){a=true;break}i=i.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 Ei(t);this.cache.set(t.dataKey,r);let i=Nd(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:i,zoom:t.z,metersPerTile:qi(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 i=0;r&&i<o;i++){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 Nd(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Pr=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;}},Ho=class extends tt{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Jt(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=To(t,this.opts);let o=new te;for(let r of this.visible)o.add(r.dataKey);for(let[r,i]of this.cache.entries())i.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 Pr(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(cc(this.opts.url,t),r.signal).then(i=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){i.close();return}o.image=i,o.state="loaded",this.emit("data",{tile:o});}).catch(i=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=i instanceof Error?i.message:String(i),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 cc(n,e){let t=n.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 Kd="osmgl-assets",jt="assets";var Rr=null;function uc(){return Rr||(Rr=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(Kd,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(jt)||t.createObjectStore(jt,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Rr)}function Ud(n){return uc().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(jt,"readonly").objectStore(jt).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Jd(n){uc().then(e=>{if(e)try{e.transaction(jt,"readwrite").objectStore(jt).put(n);}catch{}});}var fc=n=>{let e=atob(n),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Xd(n,e,t){let o=await crypto.subtle.importKey("raw",fc(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:fc(t),tagLength:128},o,n)}var ko=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 i=await this.resolve(e,o),a=`${i}:${t}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let i,a,s=await Ud(e);if(s)i=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",i=await c.arrayBuffer(),Jd({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;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 Xd(i,l.key,l.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.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 jd=1,Po=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-${jd++}`,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 fi(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 i=Math.max(o,0);return this.grow=this.shrinkFrom*(1-i*i*(3-2*i)),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])),i=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,i)*t}origin(){let e=re(this.coordinates);return {x:ce(e.lng),y:fe(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/ze(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=Fi(i(-this.rotation));this.rotationTiltX&&(a=ft(Mi(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=ft(Di(i(this.rotationTiltZ)),a));let s=ft(r,a),l=this.matrix;return Ze(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=re(this.coordinates),r=U();for(let a=0;a<16;a++)r[a]=e[a];let i=U();return Me(i,r,this.localMatrix(o.lat)),Qe(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=re(this.coordinates),i=ze(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*i,c=(s[1]/a-o.y)*i,h=s[2]/e.pixelsPerMeter-this.altitude,f=l,u=h,d=c,m=b=>b*Math.PI/180,p=Fi(m(-this.rotation));return this.rotationTiltX&&(p=ft(Mi(m(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=ft(Di(m(this.rotationTiltZ)),p)),[(p[0]*f+p[1]*u+p[2]*d)/t,(p[3]*f+p[4]*u+p[5]*d)/t,(p[6]*f+p[7]*u+p[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,s=re(this.coordinates),l=this.localMatrix(s.lat),c=l[0],h=l[1],f=l[8],u=l[9],d=c*u-h*f;if(Math.abs(d)<1e-30)return false;let m=(i*u-a*f)/d,p=(c*a-h*i)/d,b=1.05,g=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*b,B=(o.max[2]-o.min[2])/2*b;return Math.abs(m-g)<=A&&Math.abs(p-y)<=B}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 i=this.mesh?.animation;if(!i||!i.nodes.has(t))return this.matrixInSpace(e,r);let a=U();for(let f=0;f<16;f++)a[f]=e[f];let s=re(this.coordinates),l=U();Me(l,a,this.localMatrix(s.lat));let c=U();ui(i,t,i.duration>0?o%i.duration:0,c);let h=U();return Me(h,l,c),Qe(r,h)}normalMatrix(){let e=i=>i*Math.PI/180,t=Fi(e(-this.rotation));this.rotationTiltX&&(t=ft(Mi(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=ft(Di(e(this.rotationTiltZ)),t));let o=ft([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let i=0;i<9;i++)r[i]=o[i];return r}};function ft(n,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=n[r]*e[o*3]+n[3+r]*e[o*3+1]+n[6+r]*e[o*3+2];return t}var Mi=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},Fi=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},Di=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Or=class{constructor(){this.hit=new P;this.miss=new te;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(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let s=i.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,h=new Int16Array(a.vertices),f=new Uint32Array(a.indices),u=new Float64Array(a.featureIds),d=h.length/a.vertexCount;for(let m=0;m*3+2<f.length;m++){let p=f[m*3]*d,b=f[m*3+1]*d,g=f[m*3+2]*d;if(!tm(l,c,h[p],h[p+1],h[b],h[b+1],h[g],h[g+1]))continue;let y=u[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="";}},Yd=14,Zd=2e3,Qd=4e3,hc=160,qd=50,$d=4e3,Si=6,zr=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new P;this.loading=0;this.pending=[];this.known=new P;this.underBuilding=new Or;this.underVenue=new Or;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=hc;this.replacedBuildings=new te;this.replacedReal=new te;this.replacedVenues=new te;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 ko(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let l=e.layout??{},c=l.minZoom??Yd,h=l.loadRadius??Zd,f=Math.max(l.keepRadius??Qd,h),u=l.fullDetail===true,d=u?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),m=Math.max(8,Math.round((l.budget??hc)*this.budgetScale*d));this.budget=m,this.addModel=r;let p=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,i);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let g=o.center,y=u?0:this.lodFor(o.zoom,c);this.lod=y;let A="";for(let I of t.visibleTiles)A+=I.dataKey+(t.getTile(I)?.data?"+":"-");let B=this.rulesInScan;if(A!==this.tilesStamp){this.tilesStamp=A;let I=new te;B=0;for(let G of t.visibleTiles){let H=t.getTile(G)?.data?.buckets?.[e.id];if(!H||!El(H))continue;let z=new Int16Array(H.anchors),K=G.bounds(),R=K.maxX-K.minX,O=K.maxY-K.minY;for(let N=0;N<H.props.length;N++){let W=H.props[N],Y=vt(W.file,NaN);if(!Number.isFinite(Y))continue;let Q=String(W.kind??"model"),ee=Q==="rule"?`t-${W.rid}-${W.oid}`:`m-${W.mid}`;if(I.has(ee))continue;I.add(ee),Q==="rule"&&B++;let q=K.minX+z[N*2]/H.extent*R,J=K.minY+z[N*2+1]/H.extent*O,ne=em(q,J);this.known.set(ee,{id:ee,fileId:Y,lng:ne.lng,lat:ne.lat,mercX:q,mercY:J,altitude:vt(W.alt,0),scale:vt(W.scale,1),rotation:vt(W.rx,0),tiltX:vt(W.rz,0),tiltZ:vt(W.ry,0),kind:Q==="rule"?"rule":"model",target:dc(Q==="rule"?W.oid:W.replaces),replaces:p?Q==="rule"?Gr(W.oid):String(W.anchor??"replace")==="replace"?Gr(W.replaces_all).length?Gr(W.replaces_all):Gr(W.replaces):[]:[]});}}this.rulesInScan=B;}A!==this.foundStamp&&(this.foundStamp=A,this.found=[...this.known.values()],this.sortedAt=null);let C=this.found,v=new te;for(let I of C)I.kind==="model"&&I.target!==null&&v.add(I.target);let _=111320,w=Math.cos(g.lat*Math.PI/180),x=I=>Math.hypot((I.lng-g.lng)*_*w,(I.lat-g.lat)*_);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let E=new te,F=[],M=0,D=0;(this.sortedAt===null||Math.hypot((g.lng-this.sortedAt.lng)*_*w,(g.lat-this.sortedAt.lat)*_)>qd)&&(C.sort((I,G)=>x(I)-x(G)),this.sortedAt={lng:g.lng,lat:g.lat});let L=0;for(let I of C){let G=x(I);if(G>f){M++;continue}if(I.kind==="rule"&&I.target!==null&&v.has(I.target)){let R=this.entries.get(I.id);R&&R.model.retire();continue}let H=this.entries.get(I.id);if(L>=m){D++,H&&H.model.retire();continue}L++,E.add(I.id);let z=()=>{if(!I.replaces.length)return;for(let N of I.replaces){this.replacedBuildings.add(N),this.replacedReal.add(N);for(let W=0;W<10;W++)this.replacedBuildings.add(N*10+W);}let R=this.underBuilding.find(I,a);R!==null&&this.replacedBuildings.add(R);let O=this.underVenue.find(I,s);O!==null&&this.replacedVenues.add(O);},K=H;if(K){z(),K.distance=G,K.leftAt=0,K.model.revive(),y<K.lod&&!K.upgrading&&this.loading<Si&&this.upgrade(K,y,r,i);continue}if(G>h){M++;continue}if(this.loading>=Si){F.push(I),z();continue}z(),this.spawn(I,G,y,r);}for(let I of [...this.entries.values()])if(!E.has(I.placement.id)){if(I.leftAt===0){I.leftAt=b;continue}b-I.leftAt>$d&&I.model.retire();}for(let I of [...this.entries.values()])I.model.growTarget===0&&I.model.grow<=0&&this.release(I,i);if(this.known.size>4e3)for(let[I,G]of [...this.known.entries()])x(G)>f*3&&this.known.delete(I);let k=this.stats;k.found=C.length,k.kept=E.size,k.live=this.entries.size,k.tooFar=M,k.overBudget=D,k.queued=F.length,k.rules=B,k.loadingNow=this.loading,k.pendingNow=F.length,k.replaced=this.replacedReal.size,this.pending=F;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<Si&&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 i=this.makeModel(e.placement,t,true);e.upgrading=i,this.loading++,i.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,i.isLoaded&&(r(e.model),e.model=i,e.lod=t,o(i),this.onReady?.()));});}makeModel(e,t,o){let r=new Po({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,i=false){let a=this.makeModel(e,o,i);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;}},vt=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},Gr=n=>{if(n==null)return [];let e=[];for(let t of String(n).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},dc=n=>{let e=vt(n,NaN);return Number.isFinite(e)?e:null};function em(n,e){let t=n*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function tm(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),h=(n-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||h<0,u=l>0||c>0||h>0;return !(f&&u)}var om=200,rm={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Ro=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=rm[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??nm),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=re(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ce(t.lng)*o,fe(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=om;if(r.x<-i||r.y<-i||r.x>e.width+i||r.y>e.height+i){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";}},nm='<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 Go=class extends Ro{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 i=document.createElement("div");i.className="osmgl-popup-tip",o.appendChild(i);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 im=[["\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."]],mc=new Map(im);function Ii(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=mc.get(i.toLowerCase());return a?(t=true,i[0]===i[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):i});return !t||!e.filter(i=>mc.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Ti(n,e){let t=[],o=[],r=[],i=[],a=[],s=e.textPlacement==="line",l=[],c=[],h=[];for(let f of n.features()){if(!ve(e.filter,f.properties))continue;let u=f.loadGeometry(),d=lm(f.type,u);if(!d)continue;let m=e.textField?Li(e.textField,f.properties):"",p=m&&e.abbreviate?Ii(m):m,b=e.iconImage?Li(e.iconImage,f.properties):"";if(!(!p&&!b)){if(s){let g=sm(f.type,u);if(!g)continue;h.push({text:p,line:g});continue}t.push(d[0],d[1]),o.push(p),r.push(b),i.push(cm(f.properties)),a.push(e.iconRotate&&Math.round(Number(f.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:f,line:u}of am(h)){c.push(l.length/2);for(let d of u)l.push(d);t.push(Math.round(u[0]),Math.round(u[1])),o.push(f),r.push(""),i.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(i).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function am(n){let e=[],t=new Map,o=new Map,r=(i,a,s)=>`${i}\u241F${a}\u241F${s}`;for(let{text:i,line:a}of n){let s=r(i,a[0],a[1]),l=r(i,a[a.length-2],a[a.length-1]),c=t.get(l),h=o.get(s);if(h!==void 0){let f=e[h];if(f.line.push(...a.slice(2)),o.delete(s),o.set(r(i,f.line[f.line.length-2],f.line[f.line.length-1]),h),c!==void 0&&c!==h){let u=e[c];f.line.push(...u.line.slice(2)),u.line=[],t.delete(l),o.set(r(i,f.line[f.line.length-2],f.line[f.line.length-1]),h);}continue}if(c!==void 0){let f=e[c];f.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(i,f.line[0],f.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function sm(n,e){if(n!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let i=0;for(let a=0;a+3<r.length;a+=2)i+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);i>o&&(o=i,t=r);}return t}function lm(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,s=0,l=0;for(let c of e)for(let h=0;h+3<c.length;h+=2){let f=c[h+2]-c[h],u=c[h+3]-c[h+1],d=f*f+u*u;d>a&&(a=d,s=c[h]+f/2,l=c[h+1]+u/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,i=-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]>i&&(i=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function cm(n){let e=n.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Li(n,e){let t=Array.isArray(n)?n:[n];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 pc(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&ve(e,i.properties))for(let a of i.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function fm(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}async function bc(n,e){let t=performance.now(),o=fm(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(y,A,B,C,v=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:C,parseMs:v},diag:{status:y,bytes:A,layers:B,built:0}});if(!r.ok){if(r.status===404||r.status===204)return i(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${n.url}`)}let a=await r.arrayBuffer(),s=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],s);let l=performance.now(),c=new so(a),h=Object.keys(c.layers),f={},u=[],d={},m=new Set,p=[],g=n.plan.some(y=>y.type==="surface"&&(y.elevation??0)>0)&&n.plan.some(y=>y.type==="line"&&y.ground)?Gn(n.metersPerTile):void 0;for(let y of n.plan){if(!hm(y,n.zoom,n.sourceMaxZoom))continue;let A=c.layers[y.sourceLayer];if(!A)continue;let B=dm(n.zoom,A.extent);try{if(y.splitBy){let v=mm(A,y.splitBy,y.filter);if(!v.length)continue;let _=d[y.splitBy]??(d[y.splitBy]=[]);for(let w of v){_.includes(w)||_.push(w);let x={...y,splitBy:void 0,filter:bm(y.filter,y.splitBy,w)},E=Hi(x,A,B,n.metersPerTile,g,void 0,u);E&&(f[je(y.id,w)]=E);}continue}if(y.network&&y.type==="line"){for(let v of pm(A,y.filter)){let _=Hi(y,A,B,n.metersPerTile,g,v,u);_&&(f[je(y.id,v)]=_,m.add(v));}continue}let C=Hi(y,A,B,n.metersPerTile,g,void 0,u);C&&(f[y.id]=C);}catch(C){p.push(`${y.id}: ${C instanceof Error?C.message:String(C)}`);}}return {type:"loaded",id:n.id,buckets:f,...u.length?{seams:u}:{},...Object.keys(d).length?{splits:d}:{},...m.size?{levels:[...m].sort((y,A)=>y-A)}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:h,built:Object.keys(f).length,...p.length?{failed:p}:{}}}}function um(n){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let i=n[r];typeof i=="number"&&i>o&&(o=i);}return o}}function hm(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function dm(n,e){return n<=6?Math.max(64,e/24):0}function Hi(n,e,t,o,r,i,a){{if(n.type==="fill"){let l=o>0?o/e.extent:0,c=n.cornerRadius&&l>0?{radius:n.cornerRadius/l,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Sa/l}:void 0,h=bn(e,n.filter,t,c,n.clipToTile===true,e.extent);return h?{kind:"fill",...h,extent:e.extent}:null}if(n.type==="surface"){let l=Rn(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...r?{onShapes:c=>On(r,c,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:um(n.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(n.type==="line"){let l=Vn(e,n.filter,t,n.ground?r:void 0,o>0?o/e.extent:0,{level:i});return l?{kind:"line",...l,extent:e.extent}:null}if(n.type==="model"){let l=pc(e,n.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(n.type==="symbol"){let l=Ti(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let s=dn(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments},a);return s?{kind:"fill-extrusion",vertices:s.vertices,indices:s.indices,featureIds:s.featureIds,vertexCount:s.vertexCount,indexCount:s.indexCount,extent:s.extent}:null}}function mm(n,e,t){let o=[];for(let r of n.features()){if(!ve(t,r.properties))continue;let i=r.properties[e];typeof i!="string"&&typeof i!="number"||o.includes(i)||o.push(i);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}function pm(n,e){let t=[];for(let o of n.features()){if(!ve(e,o.properties))continue;let r=Bt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function bm(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var ki='"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 $(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,X,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),X=ge-Ee,b=ge-X,Q[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Q[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Q[2]=te-(be-b)+(X-b),Q[3]=be;let Te=$(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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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 $e{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 $e(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)&>(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)&>(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)&>(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&>(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,$r,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xr,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 Xe(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Xe(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 $r(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xr(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 $=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($,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*$+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=ji(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.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,$,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,$,v),$e=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,$,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,$,v);e.indices.push(Me,Ne,Ge,Me,$e,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($=>Ce($,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=$=>({ring:$,cut:new Array(Math.max($.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map($=>r.whole?I($):Fn($,i)),L={outer:A.ring,holes:k.map($=>$.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce(($,O)=>$+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 $=An(Ai(L.outer,o),N,T.shape);Y=Bi($,L.outer);let O=Li($,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti($,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let $=0;$<L.holes.length;$++)Rn(e,L.holes[$],c,u,f,m,g,o,null,k[$].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}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 ji(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f)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 Xi=wr(Un(),1),Dn=Xi,$t=Dn.union??Dn.default?.union??null;$t||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(!$t)throw new Error("\\u043D\\u0435\\u0442 union");h=$t(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,Yi=64,Wn=0,Zi=1,zn=2,Wi=3,St=1,Qi=.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??Qi,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){$n(O.outer,P);for(let G of O.holes)$n(G,P)}r.onShapes?.(k);let L=Ki(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:Xn(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:Xn(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&&Xt(x,Q,D.outer,le,K,Zi,t,V),K!==Z&&Xt(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&Xt(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Wi);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 $=new Uint32Array(j+U.length);return $.set(x.indices,0),$.set(U,j),{vertices:g.slice(0,x.offset),indices:$.buffer,vertexCount:x.count,indexCount:$.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ki(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=Ji(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 Ji(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 $n(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 Xn(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,qi(Math.round(r*Yi)),!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 Xt(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),$=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)&&($=g,O=x),o.push($,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,qi=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,$,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,$,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?io(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 $=n>0?to(Kn(Y),n):Kn(Y);if($.length<4)continue;let O=r&&!Vn(r)?On(r,$):null,G=O?O.pts:$,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=eo(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&&ro(q,he,me,ce,e.extent)){le+=fe;continue}let ae=no(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,$e=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,$e),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,$e);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 eo(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 to(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 no(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 ro(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 io(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 oo=[["\\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(oo);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=lo(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=uo(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(co(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of so(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 so(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 uo(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 lo(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 co(e){let t=e.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,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 fo="\\u241F",Jt=(e,t)=>e+fo+String(t);function ao(){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=ao(),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(!po(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=mo(e.zoom,k.extent);try{if(A.splitBy){let U=xo(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:yo(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 go(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 ho(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 po(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function mo(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:ho(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 xo(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 go(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 yo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var bo=e=>e.kind==="symbol",wo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(wo(n)){t.push(n.anchors);continue}if(bo(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 gm=2,Vr=class{constructor(e=Pi()){this.workers=[];this.blobUrl=null;this.pending=new P;this.queue=new P;this.busy=[];this.nextId=1;this.mainThreadAborts=new P;this.destroyed=false;try{let t=new Blob([ki],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=i=>this.onMessage(i.data),r.onerror=i=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",i.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++,i={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),bc(i,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:i,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]>=gm||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,i]of this.queue.entries())o&&i.priority>=o.priority||(t=r,o=i);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 Pi(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function gc(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Ri(n,e){let t=gc(n.zoom),o=[Math.round(n.zoom*100)/100,n.center.lat.toFixed(t),n.center.lng.toFixed(t)],r=Math.round(n.bearing*10)/10,i=Math.round(n.pitch*10)/10;(r!==0||i!==0)&&(o.push(r),i!==0&&o.push(i));let a=o.join("/");return e?`${e}=${a}`:a}function Gi(n,e){let t=n.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]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let s={center:{lng:a,lat:i},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 yc(n){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=n,window.history.replaceState(window.history.state,"",e.toString());}var Ac={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}},zo=n=>Ac[n]??Ac.high;function Bc(n){let e=n.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 Nr(n){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:i}=n;if(i==="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 i==="weak"?Wi(a)??a:i==="strong"&&!o?Cc(a)??a:a}function Kr(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let n=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=n.userAgentData?.mobile===true||e;return {cores:n.hardwareConcurrency||4,memory:n.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1,gpu:ym()}}function ym(){if(typeof document>"u")return "unknown";let n=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,n=e.getContext("webgl2")??e.getContext("webgl"),!n)return "software";let t=n.getExtension("WEBGL_debug_renderer_info"),o=t?n.getParameter(t.UNMASKED_RENDERER_WEBGL):n.getParameter(n.RENDERER);return typeof o=="string"?Bc(o):"unknown"}catch{return "unknown"}finally{n?.getExtension("WEBGL_lose_context")?.loseContext();}}function Vi(n,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),i=Math.max(n*e,1),a=Math.sqrt(o.maxCanvasPixels/i);return Math.max(Math.min(r,a),1)}function Wr(n){return n==="high"?3:n==="balanced"?2:n==="low"?1:0}function Cc(n){return n==="minimal"?"low":n==="low"?"balanced":n==="balanced"?"high":null}function Wi(n){return n==="high"?"balanced":n==="balanced"?"low":n==="low"?"minimal":null}var Oi=120,Am=40,Bm=.35,Cm=.02,vm=150,wm=30,xm=1,_m=1800,zi=30,Em=1.25,Oo=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Oi);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(zi);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)%Oi,this.filled<Oi&&this.filled++,this.steady++,this.steady===_m&&(this.attempts[this.current]=0),this.filled<Am)return null;let i=this.sum/this.filled;return i>=Bm?this.down(i):i>Cm?null:this.up(i)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%zi,this.recentFilled<zi&&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*Em)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=Wi(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=xm&&Wr(t)<Wr(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=Cc(this.current);if(!t||Wr(t)>Wr(this.ceiling))return null;let o=vm*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=wm;}};var Mm=1,Vo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Mm++}`,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,i=-1/0;for(let a of e)for(let s of a){let l=re(s),c=ce(l.lng),h=fe(l.lat);c<t&&(t=c),c>r&&(r=c),h<o&&(o=h),h>i&&(i=h);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+i)/2;}toLocal(e){let t=[];for(let o of e){let r=re(o);t.push(ce(r.lng)-this.originX,fe(r.lat)-this.originY);}return t}color(e,t){let o=pe(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}},Ki=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=Bo([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 i=this.colorRuns();if(!i.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 i){let l=Bo([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=pe(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,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=Ji(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(vc(e,i[a],i[a+1])<=r)return true;return false}},Ur=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=si(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(Ni(a))),i=Bo(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Ji(Ni(this.coordinates[0]??[]),this.altitude,t);if(!Xi(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Xi(e,Ji(Ni(this.coordinates[r]),this.altitude,t)))return false;return true}},Ui=class extends Ur{constructor(e){super({...e,coordinates:[Fm(e.center,e.radius,e.segments)]});}};function Fm(n,e,t){let o=re(n),r=e/ze(o.lat),i=ce(o.lng),a=fe(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let h=c/s*Math.PI*2;l.push([Le(i+Math.cos(h)*r),De(a+Math.sin(h)*r)]);}return l}function Ji(n,e,t){let o=[];for(let r of n){let i=re(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Ni(n){if(n.length<2)return n;let e=re(n[0]),t=re(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function vc(n,e,t){let o=t.x-e.x,r=t.y-e.y,i=o*o+r*r;if(i<1e-12)return Math.hypot(n.x-e.x,n.y-e.y);let a=((n.x-e.x)*o+(n.y-e.y)*r)/i;return a=a<0?0:a>1?1:a,Math.hypot(n.x-(e.x+a*o),n.y-(e.y+a*r))}function Xi(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,s=e[r].x,l=e[r].y;a>n.y!=l>n.y&&n.x<(s-i)*(n.y-a)/(l-a)+i&&(t=!t);}return t}var wc="objects3d",Yt="level",Dm=32,Sm=100,Im=250;function xc(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:{top:n?.top??0,right:n?.right??0,bottom:n?.bottom??0,left:n?.left??0}}function Lm(n){let e={...n};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 ji=class extends tt{constructor(t){super();this.options=t;this.transform=new qt;this.ctx=null;this.sources=new P;this.rasterSources=new P;this.renderer=new Mo;this.objects=new vo;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 P;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?Nr(Kr()):t.quality;this.governor=new Oo(r,r,Dm,Sm),this.quality=zo(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Pt(t.theme?Cr(t.theme,t.style):t.style),this.background=t.background?pe(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 i=document.createElement("div");i.className="osmgl-markers",i.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(i),this.markerHost=i,this.objects.setMarkerHost(i);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=re(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 Vr(t.workerCount??Math.min(Pi(),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 i=1/0;for(let a=1;a<t.length;a++)i=Math.min(i,t[a]-t[a-1]);this.governor.setRefresh(i);};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 Uo(t);let o=new Ut(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...Ct,...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(Z,{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 zr({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:wc,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??Z)===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),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(Lm):i}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 i=this.venuesForMask();t.update({id:wc,"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(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.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($e(a,c.x,c.y,s));}}else for(let s of t.models)s.setHidden(false);}buildingsForMask(){let t=this.sources.get(Z);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??Z)!==Z)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===Yt&&t.add(o.source??Z);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??Z;if(!t.has(r))continue;let i=this.sources.get(r),a=this._style.bucketKeyFor(o);if(i&&a!==null)return {source:i,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 i=new Ho({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,i),this.triggerRepaint(),this}let r=new kr(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===Z?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>this.emit("error",{message:i})),t===Z&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new er(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 i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.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),h=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(h),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:h,symbol:this.querySymbol(s,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;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=Vi(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=re(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=re(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,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},s={center:t.center!==void 0?re(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+xt((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,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?re(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+xt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=ot(r.zoom),l=(ce(a.center.lng)-ce(r.center.lng))*s,c=(fe(a.center.lat)-fe(r.center.lat))*s,h=Math.hypot(l,c),f=Math.max(o.width,o.height),u=f*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,p,b=null;if(h<1e-6){let y=Math.log(u/f);p=Math.abs(y)/d,b=A=>({u:0,w:f*Math.exp(d*Math.sign(y)*A)});}else {let y=w=>{let x=w===0?f:u,E=w===0?u:f;return (E*E-x*x+(w===0?1:-1)*m*m*h*h)/(2*x*m*h)},A=w=>Math.log(-y(w)+Math.sqrt(y(w)*y(w)+1)),B=A(0);p=(A(1)-B)/d;let v=w=>(Math.exp(w)+Math.exp(-w))/2,_=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);b=w=>{let x=d*w+B;return {u:f*v(B)*_(x)/m-f*Math.sinh(B)/m,w:f*v(B)/v(x)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:p,u1:h,curve:b,w0:f}},this.triggerRepaint(),this}setPadding(t){return this.padding=xc(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Zt;for(let[r,i]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:i}));return o}cameraForBounds(t,o={}){let r=this.transform,i=Xr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?xc(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return i?{...i,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let i={...r,duration:o.duration??600};return o.fly?this.flyTo(i):this.easeTo(i)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=Ee((t-o.start)/o.duration,0,1),i=o.fly?r:Ko(r),a=this.transform,s=re(o.from.center),l=re(o.to.center);if(o.fly){let{u:c,w:h}=o.fly.curve(o.fly.S*r),f=o.fly.u1>1e-6?Ee(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/h),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Ko(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Ko(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)*i,lat:s.lat+(l.lat-s.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,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(re(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Pt(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(i)),l=JSON.stringify(r.workerPlan(i));s!==l&&a.setPlan(this.planFor(i,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(Cr(t,this.options.style))}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 i=this._style.layers.find(s=>s.id===t);if(!i)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=i.layout??(i.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 i=this._style.layers.find(a=>a.id===t);return i?(i.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:Le(r.mercX),lat:De(r.mercY)},key:Ut.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 i=this.sources.get(r.source??Z);if(!i)continue;let a=ri(this.transform,i,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 P,i;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),i??(i=this.sources.get(s.source??Z)));}if(!i||!o.length)return null;let a=ni(this.transform,i,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=Ri({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,yc("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=Gi(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"?Nr(Kr()):t;return this.governor.reset(o,o),this.applyQuality(zo(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,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)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(i=>i.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(zo(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(i=>i.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=pe(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??Z)===o&&"splitBy"in i&&i.splitBy===Yt))for(let i of r.splitValues(Yt)){let a=Number(i);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Yt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Yt]:this._style.splitValues[Yt]=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(i=>i>=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 Go)}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(),i=t==="globe"?Math.min(o.maxPitch,Qt):o.maxPitch,a=o.zoom<r,s=o.pitch>i;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?i: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,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,h=!!s.getExtension("EXT_float_blend"),f=h?s.RGBA32F:s.RGBA16F,u=h?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(),p=s.createRenderbuffer();if(!d||!m||!p)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,f,l,c,0,s.RGBA,u,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,p),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,p);let b=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),b!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:d,rb:p,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return s.readPixels(t,o,r,i,s.RGBA,s.FLOAT,d),{data:d,format:h?"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),i=this.ctx;i.bindFramebuffer(null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.setDepthMask(true),i.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);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,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,h=c>0&&c<Im,f=h?c:0;this.continuousFrames=h?this.continuousFrames+1:0;let u=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(u),this.emit("render",{frameMs:s,intervalMs:f}),l&&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();}}},rB=ji;
|
|
2338
|
-
exports.AssetLoader=ko;exports.BASE_SOURCE=Z;exports.BUILDING_HEIGHT_SCALE=Dt;exports.BUILDING_POS_SCALE=Ft;exports.BUILDING_VERTEX_STRIDE=Te;exports.CITY_STYLE=Ch;exports.Circle=Ui;exports.DEFAULT_ICONS=Ct;exports.DEFAULT_LIGHT=Kn;exports.DEFAULT_SHADOWS=jl;exports.DEFAULT_SKY=Nn;exports.DEFAULT_STYLE=Un;exports.DepthTarget=bo;exports.EARTH_CIRCUMFERENCE=Jo;exports.FILL_VERTEX_STRIDE=rt;exports.GLOBE_MAX_PITCH=Qt;exports.GLOBE_ZOOM_MAX=dt;exports.GLOBE_ZOOM_MIN=Zo;exports.GLYPH_BORDER=xe;exports.GLYPH_SIZE=et;exports.GROUND_SCALE=Ru;exports.GeomType=lo;exports.GlyphSource=Do;exports.GroundArrows=yo;exports.IconSource=Io;exports.IndoorMask=Ao;exports.LEVEL_LIMIT=Ou;exports.LINE_VERTEX_STRIDE=at;exports.LayerRenderer=Mo;exports.LngLatBounds=Zt;exports.MAX_LATITUDE=Qi;exports.MODEL_VERTEX_STRIDE=Fr;exports.Map=ji;exports.MapObject=Vo;exports.Marker=Ro;exports.Model=Po;exports.ModelLayer=lt;exports.ObjectManager=vo;exports.Polygon=Ur;exports.Polyline=Ki;exports.Popup=Go;exports.QualityGovernor=Oo;exports.RELIEF_STYLE=Bh;exports.RUNTIME_FILL_STRIDE=ai;exports.RUNTIME_LINE_STRIDE=Gt;exports.RasterSource=Ho;exports.RasterTile=Pr;exports.SDF_EDGE=gi;exports.SDF_PX=So;exports.SOFT_STYLE=Ah;exports.SPLIT_SEP=Ys;exports.SURFACE_CUT_BLEED=mo;exports.SURFACE_LEVEL_SCALE=hs;exports.SURFACE_VERTEX_STRIDE=Tt;exports.SdfAtlas=Fo;exports.Style=Pt;exports.SymbolRenderer=Ut;exports.THEMES=Ye;exports.TILE_SIZE=ht;exports.TileID=Xt;exports.Transform=qt;exports.VectorTile=so;exports.VectorTileFeature=sr;exports.VectorTileLayer=lr;exports.abbreviateStreet=Ii;exports.addGround=On;exports.altitudeFromMercatorZ=zm;exports.applyTheme=Br;exports.arrowLabelOffset=sc;exports.arrowVertices=Th;exports.buildRuntimeFill=si;exports.buildRuntimeLine=Bo;exports.cameraForBounds=Xr;exports.circumferenceAtLatitude=ze;exports.clampLat=Xo;exports.clampPixelRatio=Vi;exports.classifyRenderer=Bc;exports.clipLineToRect=Bi;exports.coordinateDigits=gc;exports.coveringTiles=To;exports.createGround=Gn;exports.default=rB;exports.deviceHints=Kr;exports.distToSegment=vc;exports.evaluateColor=ke;exports.evaluateNumber=
|
|
2337
|
+
`;var wr=n=>n.kind==="symbol",El=n=>n.kind==="placement";function $e(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],s=r[i+1],l=r[i+2],c=r[i+3],h=r[i+4],f=r[i+5];if(xh(e,t,a,s,l,c,h,f)||o>0&&(Qn(e,t,a,s,l,c)<=o||Qn(e,t,l,c,h,f)<=o||Qn(e,t,h,f,a,s)<=o))return true}return false}function xh(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),h=(n-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||h<0,u=l>0||c>0||h>0;return !(f&&u)}function Qn(n,e,t,o,r,i){let a=r-t,s=i-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*s)/l)):0;return Math.hypot(n-(t+a*c),e-(o+s*c))}function qn(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let s=0;s<o.length;s++){let l=o[s]*rt;a[s*2]=r.minX+t.getInt16(l,true)*i,a[s*2+1]=r.minY+t.getInt16(l+2,true)*i;}return a}function $n(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let h=n.indices[c]*Te;l[c*2]=a+o.getInt16(h,true)*i,l[c*2+1]=s+o.getInt16(h+2,true)*i;}return l}var _h={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Eh=40,Mh=10.5,Ml=2.5,Fh=16,Dh=4,Sh=7,yo=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,i,a,s,l=false){this.count=0;let c=t.zoom,h=r.layers.filter(B=>B.type==="symbol"&&B.layout?.placement==="map"&&r.layerVisibleAt(B,c));if(!h.length)return;let f=t.center,u=ce(f.lng),d=fe(f.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let p=[];for(let B of h){let C=o.get(B.source??Z);if(!C)continue;let v=r.bucketKeyFor(B);if(v===null)continue;let _=B.layout?.showFor==="highlight";if(_&&!this.highlightFootprint)continue;let w=m*1.5,E=B.layout?.arrowUnits==="meters"?m:1/t.worldSize,F=W(B.layout?.arrowLength,c,Eh)*E,M=W(B.layout?.arrowWidth,c,Mh)*E,D=W(B.layout?.arrowOutline,c,Ml)*E,L=W(B.layout?.arrowGap,c,Fh)*E,I=W(B.layout?.arrowDotRadius,c,Dh)*E,S=W(B.layout?.arrowDotGap,c,Sh)*E,P=ti(F,M,I,L-S),z=D>0?ti(F,M,I,L-S,D).outline:null,H={layer:B,verts:[],shape:P};for(let R of C.visibleTiles){let O=C.getTile(R)?.data?.buckets?.[v];if(!O||!wr(O))continue;let G=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,J=R.bounds(),X=(J.maxX-J.minX)/O.extent,Q=J.minX,ee=J.minY;for(let q=0;q<G.length/2;q++){let U=Q+G[q*2]*X,ae=ee+G[q*2+1]*X;if(_&&!$e(this.highlightFootprint,U,ae,w))continue;let se=(V?V[q]:0)*Math.PI/180,oe=Math.sin(se),j=-Math.cos(se),Y=U-u-oe*L,ne=ae-d-j*L;z&&oi(H,z,Y,ne,oe,j),oi(H,P.outline,Y,ne,oe,j),this.count++;}}H.verts.length&&p.push(H);}if(!p.length)return;let b=p[0].shape,g=b.outline.length/2,y=[],A=[];for(let B of p){let C=y.length/2/g;for(let v of B.verts)y.push(v);A.push({layer:B.layer,first:C,count:B.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,b,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),i.use(),s?.(i),l&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(u,d,0)),i.setMat4("u_matrix",t.objectMatrix(u,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let B of A){let C=B.layer.paint,v=W(C.opacity,c,1),_=ke(C.color,c,[.18,.45,.76,1]),w=ke(C.haloColor,c,[1,1,1,1]),x=W(B.layer.layout?.arrowOutline,c,Ml)>0;Ih(e,i,B,w,_,v,x,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let i=o.outline.length/2;if(this.vao&&t<=this.capacity&&i===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=i,this.indicesPerArrow=o.indices.length,this.vbo=new Be(e,new Uint8Array(this.capacity*i*8),_h,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*i;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new de(e,a),this.vao=new he(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 Ih(n,e,t,o,r,i,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",Fe([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=l)Fl(n,t.first+c,s);}e.setVec4v("u_color",Fe([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=l)Fl(n,t.first+c,s);}function Fl(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var Dl=4,ei=12;function ti(n,e,t,o,r=0){let i=n*.38,a=e*1.35,s=i*.3,l=e*.32,c=e/2,h=-n+l,f=[],u=(g,y)=>f.push(g,y);u(0,0),u(-i,a),u(-i+s,c),u(h,l);for(let g=1;g<Dl;g++){let y=g/Dl*Math.PI;u(h-Math.sin(y)*l,Math.cos(y)*l);}u(h,-l),u(-i+s,-c),u(-i,-a);let d=r>0?Lh(f,r):f,m=Re(f,void 0,2);if(t<=0)return {outline:d,indices:m};let p=d.length/2,b=t+r;for(let g=0;g<ei;g++){let y=g/ei*Math.PI*2;d.push(o+Math.cos(y)*b,Math.sin(y)*b);}for(let g=1;g<ei-1;g++)m.push(p,p+g,p+g+1);return {outline:d,indices:m}}function Lh(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=n[a*2]*n[s*2+1]-n[s*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let s=n[(a+t-1)%t*2],l=n[(a+t-1)%t*2+1],c=n[a*2],h=n[a*2+1],f=n[(a+1)%t*2],u=n[(a+1)%t*2+1],d=Math.hypot(c-s,h-l)||1,m=Math.hypot(f-c,u-h)||1,p=r*(h-l)/d,b=-r*(c-s)/d,g=r*(u-h)/m,y=-r*(f-c)/m,A=p+g,B=b+y,C=Math.hypot(A,B);if(C<1e-9){i.push(c,h);continue}A/=C,B/=C;let v=Math.min(1/Math.max(A*p+B*b,.35),3);i.push(c+A*e*v,h+B*e*v);}return i}function oi(n,e,t,o,r,i){let a=-i,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],h=e[l+1];n.verts.push(t+r*c+a*h,o+i*c+s*h);}}function Th(n,e,t,o,r,i=0,a=0){let s=t*Math.PI/180,l={verts:[]};return oi(l,ti(o,r,i,a).outline,n,e,Math.sin(s),-Math.cos(s)),l.verts}var Hh=5;function Sl(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var xr=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,s,l=false){if(!a.size)return;let c=i.layers.filter(h=>h.type==="raster"&&!!h.overlay===l&&i.layerVisibleAt(h,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 h of c){let f=a.get(h.source);if(!f)continue;let u=W(h.paint?.opacity,s,1);if(!(u<=.001)){r.setFloat("u_opacity",u),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),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=Hh&&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:Sl(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,i=r.createTexture();if(!i)return null;e.bindTexture(0,i),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:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,t.image.close(),t.image=null,i}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 kh="indoor-",Ao=class{constructor(){this.parts=null;this.stamp="";this.cache=new k;this.box=null;this.hidden=new te;this.collected=new te;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],i;for(let u of t.layers){if(!u.id.startsWith(kh)||u.type!=="fill"||!t.layerVisibleAt(u,o))continue;let d=t.bucketKeyFor(u);d&&(r.push(d),i??(i=e.get(u.source??Z)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(u=>u.dataKey+(i.getTile(u)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,h=-1/0,f=-1/0;for(let u of i.visibleTiles){let d=i.getTile(u)?.data?.buckets;if(d)for(let m of r){let p=d[m];if(!p||p.kind!=="fill")continue;let b=qn(p,u);s.push(b);for(let g=0;g<b.length;g+=2)b[g]<l&&(l=b[g]),b[g]>h&&(h=b[g]),b[g+1]<c&&(c=b[g+1]),b[g+1]>f&&(f=b[g+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,h,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),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,h=new k;for(let f=0;f*3<r.length;f++){let u=i[f];if(this.hidden.has(u))continue;let d=h.get(u);d||h.set(u,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let p=r[f*3+m]*Te,b=a.getInt16(p,true),g=a.getInt16(p+2,true);b<d[0]&&(d[0]=b),g<d[1]&&(d[1]=g),b>d[2]&&(d[2]=b),g>d[3]&&(d[3]=g);}}for(let[f,u]of h){let d=s.minX+(u[0]+u[2])/2*l,m=s.minY+(u[1]+u[3])/2*l;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||$e(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 i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,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 h=new Uint32Array(l.indices),f=new Float64Array(l.featureIds),u=[];for(let d=0;d*3<h.length;d++)this.hidden.has(f[d])||u.push(h[d*3],h[d*3+1],h[d*3+2]);if(u.length<h.length){let d=new de(e,new Uint32Array(u));c={vao:new he(e,[{buffer:i,locations:a}],d),ibo:d,count:u.length};}}return this.cache.set(r.dataKey,c),c}};var Il=35,Ph=70,Rh=.35,Gh=.5,Oh=1.1;function Rt(n,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=n.cameraToCenterDistance,r=Ee((n.pitch-Il)/(Ph-Il),0,1),i=t.fogRange[0]*(1-Rh*r)*o,a=t.fogRange[1]*(1-Gh*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*Oh:1/0;return {near:i,far:a,intensity:s,cutoff:l}}function ri(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let f=e.getTile(h),u=f&&Ll(f,t);if(!u||!Ue(s,n.tileMatrix64(h,u.extent))||(be(l,s,[r,i,-1,1]),be(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let d=l[0]/l[3],m=l[1]/l[3],p=l[2]/l[3],b=c[0]/c[3]-d,g=c[1]/c[3]-m,y=c[2]/c[3]-p,A=Vh(u,d,m,p,b,g,y);A&&(!a||A.t<a.distance)&&(a={featureId:A.featureId,tile:h,layerId:t,distance:A.t});}return a}function ni(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let f=e.getTile(h);if(f)for(let u of t){let d=f.data?.buckets?.[u];if(!d||d.kind!=="fill"||!d.featureIds||!Ue(s,n.tileMatrix64(h,d.extent))||(be(l,s,[r,i,-1,1]),be(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let m=l[0]/l[3],p=l[1]/l[3],b=l[2]/l[3],g=c[2]/c[3]-b;if(Math.abs(g)<1e-9)continue;let y=-b/g;if(y<0||y>1)continue;let A=m+(c[0]/c[3]-m)*y,B=p+(c[1]/c[3]-p)*y,C=zh(d,A,B);C!==null&&(!a||y<a.distance)&&(a={featureId:C,tile:h,layerId:u,distance:y});}}return a}function zh(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=l=>o.getInt16(l*rt,true),s=l=>o.getInt16(l*rt+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],h=r[l*3+1],f=r[l*3+2],u=a(c),d=s(c),m=a(h),p=s(h),b=a(f),g=s(f),y=(e-m)*(d-p)-(u-m)*(t-p),A=(e-b)*(p-g)-(m-b)*(t-g),B=(e-u)*(g-d)-(b-u)*(t-d),C=y<0||A<0||B<0,v=y>0||A>0||B>0;if(!(C&&v))return i[l]}return null}function Ll(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Vh(n,e,t,o,r,i,a){let s=new DataView(n.vertices),l=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),h=p=>s.getInt16(p*Te,true)/Ft,f=p=>s.getInt16(p*Te+2,true)/Ft,u=p=>s.getUint16(p*Te+4,true)/Dt,d=1/0,m=-1;for(let p=0;p+2<l.length;p+=3){let b=l[p],g=l[p+1],y=l[p+2],A=h(b),B=f(b),C=u(b),v=h(g)-A,_=f(g)-B,w=u(g)-C,x=h(y)-A,E=f(y)-B,F=u(y)-C,M=i*F-a*E,D=a*x-r*F,L=r*E-i*x,I=v*M+_*D+w*L;if(I>-1e-9&&I<1e-9)continue;let S=1/I,P=e-A,z=t-B,H=o-C,R=(P*M+z*D+H*L)*S;if(R<0||R>1)continue;let N=z*w-H*_,O=H*v-P*w,G=P*_-z*v,V=(r*N+i*O+a*G)*S;if(V<0||R+V>1)continue;let J=(x*N+E*O+F*G)*S;J<0||J>1||J>=d||(d=J,m=c[p/3]??0);}return m>=0?{featureId:m,t:d}:null}function _r(n,e,t){let o=Ll(n,e);return o?ii(o,t):null}function ii(n,e){if(!n.featureIds)return null;let t=new Uint32Array(n.indices),o=new Float64Array(n.featureIds),r=[];for(let i=0;i+2<t.length;i+=3)o[i/3]===e&&r.push(t[i],t[i+1],t[i+2]);return r.length?{vertices:n.vertices,indices:new Uint32Array(r)}:null}var Gt=24,ai=8,Wh=2,Nh=12,Er=8,Mr=8;function Bo(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Er+2)*2,o=e*t+n.length*(Mr+2)*2+8,r=e*(Er+2)*6+n.length*Mr*6+24,i=new ArrayBuffer(o*Gt),a=new DataView(i),s=new Uint32Array(r),l=0,c=0,h=(d,m,p,b,g,y)=>{let A=l*Gt;return a.setFloat32(A,d,true),a.setFloat32(A+4,m,true),a.setFloat32(A+8,p,true),a.setFloat32(A+12,b,true),a.setFloat32(A+16,g,true),a.setFloat32(A+20,y,true),l++},f=(d,m,p,b)=>{s[c++]=d,s[c++]=m,s[c++]=b,s[c++]=d,s[c++]=b,s[c++]=p;},u=(d,m,p,b,g,y,A)=>{let B=h(d,m,0,0,0,A),C=h(d,m,p,b,1,A);for(let v=1;v<=Mr;v++){let _=Math.PI*v/Mr,w=p*Math.cos(_)+g*Math.sin(_),x=b*Math.cos(_)+y*Math.sin(_),E=h(d,m,w,x,1,A);s[c++]=B,s[c++]=C,s[c++]=E,C=E;}};for(let d of n){let m=Kh(d),p=m.length/2;if(p<2)continue;let b=new Float64Array(p-1),g=new Float64Array(p-1);for(let v=0;v<p-1;v++){let _=m[v*2+2]-m[v*2],w=m[v*2+3]-m[v*2+1],x=Math.hypot(_,w)||1;b[v]=_/x,g[v]=w/x;}let y=0,A=-1,B=-1;for(let v=0;v<p;v++){let _=m[v*2],w=m[v*2+1];v>0&&(y+=Math.hypot(_-m[v*2-2],w-m[v*2-1]));let x=v>0?v-1:0,E=v<p-1?v:p-2,F=-g[x],M=b[x],D=-g[E],L=b[E],I=F+D,S=M+L,P=Math.hypot(I,S);P>1e-9?(I/=P,S/=P):(I=F,S=M);let z=I*D+S*L,H=z>1e-6?1/z:1/0,R=Math.acos(Math.min(1,Math.max(-1,b[x]*b[E]+g[x]*g[E])));if(!(R>Nh*Math.PI/180)&&H<=Wh){let O=h(_,w,I*H,S*H,1,y),G=h(_,w,-I*H,-S*H,-1,y);A>=0&&f(A,B,O,G),A=O,B=G;}else {let O=Math.max(1,Math.min(Er,Math.ceil(R/(Math.PI/Er)))),V=b[x]*g[E]-g[x]*b[E]>=0?1:-1,J=h(_,w,F,M,1,y),X=h(_,w,-F,-M,-1,y);A>=0&&f(A,B,J,X);for(let Q=1;Q<=O;Q++){let ee=V*R*(Q/O),q=Math.cos(ee),U=Math.sin(ee),ae=F*q-M*U,se=F*U+M*q,oe=h(_,w,ae,se,1,y),j=h(_,w,-ae,-se,-1,y);f(J,X,oe,j),J=oe,X=j;}A=J,B=X;}}let C=p-2;u(m[0],m[1],-g[0],b[0],-b[0],-g[0],0),u(m[(p-1)*2],m[(p-1)*2+1],-g[C],b[C],b[C],g[C],y);}return c?{vertices:i.slice(0,l*Gt),indices:s.slice(0,c),vertexCount:l}:null}function si(n){if(!n.length||n[0].length<6)return null;let e=[],t=[];for(let i=0;i<n[0].length;i++)e.push(n[0][i]);for(let i=1;i<n.length;i++)if(!(n[i].length<6)){t.push(e.length/2);for(let a=0;a<n[i].length;a++)e.push(n[i][a]);}let o=Re(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let i=0;i<o.length;i+=3)r[i]=o[i],r[i+1]=o[i+2],r[i+2]=o[i+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Kh(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var Co=5126,Uh={stride:ai,attribs:[{name:"a_pos",size:2,type:Co,offset:0}]},ci={stride:Gt,attribs:[{name:"a_pos",size:2,type:Co,offset:0},{name:"a_extrude",size:2,type:Co,offset:8},{name:"a_side",size:1,type:Co,offset:16},{name:"a_dist",size:1,type:Co,offset:20}]},li=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();}},Jh=(n,e)=>[n[0],n[1],n[2],n[3]*e],vo=class{constructor(){this.objects=[];this.markers=[];this.gpu=new k;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,i,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,p)=>m.zIndex-p.zIndex);let h=e.gl.drawingBufferWidth,f=t.width>0?h/t.width:1,u=t.worldSize*f,d=null;for(let m of this.objects){if(!m.visible)continue;let p=m.ghostOpacity;if(c&&p<=0)continue;let b=this.gpuFor(e,m,r,a);if(!b)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:A,vao:B,ibo:C}of b.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let v=c?Jh(A.color,p):A.color;if(A.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",Fe(v)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),s?.(i),d=i);let _=A.width/2*f,w=u>1e-9?1/u:1;if(i.setVec4v("u_color",Fe(v)),i.setFloat("u_half_width",_),i.setFloat("u_offset",(A.offset??0)*f),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",w),i.setFloat("u_units_to_px",u),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[x,E]=A.dashArray;i.setVec2("u_dash",x*f,(x+E)*f);}if(A.arrow){i.setVec4v("u_arrow_color",Fe(A.arrowColor??[1,1,1,1]));let x=(A.arrowSize??5)*f;i.setVec3("u_arrow",(A.arrowPeriod??46)*f,Math.max(x*.4,1),Math.min(x,_*.72));}g&&i.setMat4("u_shadow_matrix",g),i.setMat4("u_matrix",y);}B.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=(a,s,l)=>e.worldPxToPoint(ce(a)*r,fe(s)*r,l);for(let a=this.objects.length-1;a>=0;a--){let s=this.objects[a];if(s.visible&&s.hitTest(t,i,o))return s}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e.rings())for(let s of a){let l=re(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>i&&(i=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.gpu.get(t.id);if(i&&i.revision===t.revision)return i;i?.destroy();let a=[];for(let l of t.build()){let c=l.kind==="fill"?Uh:ci,h=l.kind==="fill"?o:r,f=new Be(e,new Uint8Array(l.mesh.vertices),c),u=new de(e,l.mesh.indices),d=new he(e,[{buffer:f,locations:h}],u);a.push({part:l,vao:d,vbo:f,ibo:u});}let s=new li(t.revision,a);return this.gpu.set(t.id,s),a.length?s: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 Fr=32,Zh=1179937895,Qh=1313821514,qh=5130562,$h={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ed={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function fi(n){let{json:e,bin:t}=Gl(n),o=await od(e,t);return zl(e,t,o)}function td(n){let{json:e,bin:t}=Gl(n);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 zl(e,t,null)}function Gl(n){let e=new DataView(n);if(e.getUint32(0,true)!==Zh)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<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),s=r+8;a===Qh?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,s,i))):a===qh&&(o=new Uint8Array(n,s,i)),r=s+i+(4-i%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 od(n,e){let t=n.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 Promise.resolve().then(()=>(Rl(),Pl));await r.ready;let i=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),h=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(h,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),i.set(a,h);}return i}function Ol(n){let e=K();if(n.matrix){for(let w=0;w<16;w++)e[w]=n.matrix[w];return e}Ze(e);let[t,o,r]=n.translation??[0,0,0],[i,a,s,l]=n.rotation??[0,0,0,1],[c,h,f]=n.scale??[1,1,1],u=i+i,d=a+a,m=s+s,p=i*u,b=i*d,g=i*m,y=a*d,A=a*m,B=s*m,C=l*u,v=l*d,_=l*m;return e[0]=(1-(y+B))*c,e[1]=(b+_)*c,e[2]=(g-v)*c,e[4]=(b-_)*h,e[5]=(1-(p+B))*h,e[6]=(A+C)*h,e[8]=(g+v)*f,e[9]=(A-C)*f,e[10]=(1-(p+y))*f,e[12]=t,e[13]=o,e[14]=r,e}var rd={5120:127,5121:255,5122:32767,5123:65535};function nd(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],s=n[8],l=n[9],c=n[10],h=e*(i*c-a*l)-r*(t*c-o*l)+s*(t*a-o*i);if(Math.abs(h)<1e-20)return [1,0,0,0,1,0,0,0,1];let f=1/h;return [(i*c-a*l)*f,(a*s-r*c)*f,(r*l-i*s)*f,(o*l-t*c)*f,(e*c-o*s)*f,(t*s-e*l)*f,(t*a-o*i)*f,(o*r-e*a)*f,(e*i-t*r)*f]}function zl(n,e,t){let o=w=>{let x=t?.get(w);if(x)return x;let E=n.bufferViews?.[w];if(!E)return null;let F=E.byteOffset??0;return e.subarray(F,F+E.byteLength)},r=[],i=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],f=w=>{if(w===void 0)return null;let x=n.accessors?.[w];if(!x)return null;let E=ed[x.type]??1,F=new Float64Array(x.count*E),M=x.bufferView!==void 0?n.bufferViews?.[x.bufferView]:void 0;if(!M||x.bufferView===void 0)return {data:F,components:E};let D=o(x.bufferView);if(!D)return {data:F,components:E};let L=$h[x.componentType]??4,I=M.extensions?.EXT_meshopt_compression,S=I?I.byteStride:M.byteStride,P=S&&S>0?S:L*E,z=x.byteOffset??0,H=new DataView(D.buffer,D.byteOffset,D.byteLength),R=x.normalized?rd[x.componentType]??1:1;for(let N=0;N<x.count;N++)for(let O=0;O<E;O++){let G=z+N*P+O*L,V;switch(x.componentType){case 5120:V=H.getInt8(G);break;case 5121:V=H.getUint8(G);break;case 5122:V=H.getInt16(G,true);break;case 5123:V=H.getUint16(G,true);break;case 5125:V=H.getUint32(G,true);break;default:V=H.getFloat32(G,true);}F[N*E+O]=R===1?V:Math.max(V/R,-1);}return {data:F,components:E}},u=(w,x,E=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let F=f(w.attributes.POSITION);if(!F)return;let M=f(w.attributes.NORMAL),D=f(w.attributes.TEXCOORD_0),L=f(w.indices),I=r.length/3,S=F.data.length/3,P=nd(x),H=(w.material!==void 0?n.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,R=H?{ox:H.offset?.[0]??0,oy:H.offset?.[1]??0,sx:H.scale?.[0]??1,sy:H.scale?.[1]??1,rot:H.rotation??0}:null;for(let U=0;U<S;U++){let ae=F.data[U*3],se=F.data[U*3+1],oe=F.data[U*3+2],j=x[0]*ae+x[4]*se+x[8]*oe+x[12],Y=x[1]*ae+x[5]*se+x[9]*oe+x[13],ne=x[2]*ae+x[6]*se+x[10]*oe+x[14];if(r.push(j,Y,ne),j<c[0]&&(c[0]=j),Y<c[1]&&(c[1]=Y),ne<c[2]&&(c[2]=ne),j>h[0]&&(h[0]=j),Y>h[1]&&(h[1]=Y),ne>h[2]&&(h[2]=ne),M){let le=M.data[U*3],Ae=M.data[U*3+1],_e=M.data[U*3+2],we=P[0]*le+P[3]*Ae+P[6]*_e,ut=P[1]*le+P[4]*Ae+P[7]*_e,wt=P[2]*le+P[5]*Ae+P[8]*_e,Wo=Math.hypot(we,ut,wt);Wo>1e-12?(we/=Wo,ut/=Wo,wt/=Wo):(we=0,ut=1,wt=0),i.push(we,ut,wt);}else i.push(0,1,0);let ie=D?D.data[U*2]:0,ue=D?D.data[U*2+1]:0;if(R){if(R.rot!==0){let le=Math.cos(R.rot),Ae=Math.sin(R.rot),_e=le*ie+Ae*ue,we=-Ae*ie+le*ue;ie=_e,ue=we;}ie=ie*R.sx+R.ox,ue=ue*R.sy+R.oy;}a.push(ie,ue);}let N=s.length;if(L)for(let U=0;U<L.data.length;U++)s.push(I+L.data[U]);else for(let U=0;U<S;U++)s.push(I+U);let O=w.material!==void 0?n.materials?.[w.material]:void 0,G=O?.pbrMetallicRoughness,V=G?.metallicFactor!==void 0||G?.roughnessFactor!==void 0,J=G?.baseColorFactor??[1,1,1,1],X=G?.baseColorTexture?.index,Q=X!==void 0?n.textures?.[X]?.source:void 0,ee=O?.emissiveFactor??[0,0,0],q=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:N,indexCount:s.length-N,baseColor:[J[0],J[1],J[2],J[3]??1],metallic:V?G?.metallicFactor??1:0,roughness:V?G?.roughnessFactor??1:1,emissive:[ee[0]*q,ee[1]*q,ee[2]*q],texture:Q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:E});},d=n.skins?.length?null:id(n,f),m=d?d.nodes:null,p=(w,x,E,F)=>{let M=n.nodes?.[w];if(!M)return;let D=Ol(M),L=K();Me(L,x,D);let I=K(),S=F,P=m?.get(w);if(P?(P.parentNode=F,P.parent=E.slice(),Ze(I),S=w):Me(I,E,D),M.mesh!==void 0)for(let H of n.meshes?.[M.mesh]?.primitives??[])u(H,I,S);let z=M.extensions?.KHR_lights_punctual?.light;if(z!==void 0){let H=n.extensions?.KHR_lights_punctual?.lights?.[z],R=H?.type;if(H&&(R==="point"||R==="spot"||R==="directional")){let N=-L[8],O=-L[9],G=-L[10],V=Math.hypot(N,O,G)||1,J=H.spot?.innerConeAngle??0,X=H.spot?.outerConeAngle??Math.PI/4;b.push({type:R,color:[H.color?.[0]??1,H.color?.[1]??1,H.color?.[2]??1],intensity:H.intensity??1,range:H.range??0,position:[L[12],L[13],L[14]],direction:[N/V,O/V,G/V],cosInner:Math.cos(J),cosOuter:Math.cos(X)});}}for(let H of M.children??[])p(H,L,I,S);},b=[],g=K();Ze(g);let y=K();Ze(y);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((w,x)=>x)??[];for(let w of A)p(w,g,y,-1);let B=[];for(let w of n.images??[]){if(w.bufferView===void 0){B.push(new Uint8Array(0));continue}let x=o(w.bufferView);B.push(x?x.slice():new Uint8Array(0));}let C=r.length/3,v=new ArrayBuffer(C*Fr),_=new Float32Array(v);for(let w=0;w<C;w++){let x=w*8;_[x]=r[w*3],_[x+1]=r[w*3+1],_[x+2]=r[w*3+2],_[x+3]=i[w*3],_[x+4]=i[w*3+1],_[x+5]=i[w*3+2],_[x+6]=a[w*2],_[x+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,h[0]=h[1]=h[2]=0),{vertices:v,indices:new Uint32Array(s),primitives:l,images:B,min:c,max:h,animation:d,lights:b}}function id(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,s=i.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[i.sampler];if(!l)continue;let c=e(l.input),h=e(l.output);if(!c||!h||!c.data.length)continue;let f=s==="rotation"?4:3,u=l.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*f);for(let b=0;b<d;b++){let g=u?(b*3+1)*f:b*f;for(let y=0;y<f;y++)m[b*f+y]=h.data[g+y];}let p=o.get(a)??{parentNode:-1,parent:Ze(K()),base:ad(n.nodes?.[a]),channels:[]};p.channels.push({path:s,times:Float32Array.from(c.data),values:m,step:l.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function ad(n){let e=n?.translation,t=n?.rotation,o=n?.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(n,e,t,o){let r=n.nodes.get(e);if(!r)return Ze(o);let i=K();sd(r,t,i);let a=K();if(Me(a,r.parent,i),r.parentNode<0)return Vl(o,a);let s=K();return ui(n,r.parentNode,t,s),Me(o,s,a)}var Vl=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function sd(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.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 h=Math.min(c+1,s-1),f=a.times[h]-a.times[c],u=a.step||f<=0?0:Math.min(Math.max((e-a.times[c])/f,0),1),d=c*l,m=h*l;if(a.path==="rotation"){let p=0;for(let y=0;y<4;y++)p+=a.values[d+y]*a.values[m+y];let b=p<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-u)+a.values[m+y]*b*u,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let p=a.path==="translation"?o:i;for(let b=0;b<3;b++)p[b]=a.values[d+b]*(1-u)+a.values[m+b]*u;}}return Vl(t,Ol({translation:o,rotation:r,scale:i}))}var He=5126,ld=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Wl={stride:Fr,attribs:[{name:"a_pos",size:3,type:He,offset:0},{name:"a_normal",size:3,type:He,offset:12},{name:"a_tex",size:2,type:He,offset:24}]},di=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);}},hi=256,Dr=41,Nl={stride:Dr*4,attribs:[{name:"a_i_m0",size:4,type:He,offset:0,divisor:1},{name:"a_i_m1",size:4,type:He,offset:16,divisor:1},{name:"a_i_m2",size:4,type:He,offset:32,divisor:1},{name:"a_i_m3",size:4,type:He,offset:48,divisor:1},{name:"a_i_s0",size:4,type:He,offset:64,divisor:1},{name:"a_i_s1",size:4,type:He,offset:80,divisor:1},{name:"a_i_s2",size:4,type:He,offset:96,divisor:1},{name:"a_i_s3",size:4,type:He,offset:112,divisor:1},{name:"a_i_n0",size:3,type:He,offset:128,divisor:1},{name:"a_i_n1",size:3,type:He,offset:140,divisor:1},{name:"a_i_n2",size:3,type:He,offset:152,divisor:1}]},wo=2,Ot=16,lt=class{constructor(){this.models=[];this.gpu=new k;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(hi*Dr);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,i,a,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",wo);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let h=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!h||!c.mesh)continue;let f=c.fade<1;o.setFloat("u_opacity",c.fade);let u=c.matrixFor(t);o.setMat4("u_matrix",u),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),h.vao.bind();for(let p of [false,true])if(!(f&&!p))for(let b of c.mesh.primitives){if(!f&&b.blend!==p)continue;o.setMat4("u_matrix",b.node>=0?c.matrixForNode(t,b.node,s):u),d&&o.setMat4("u_shadow_matrix",b.node>=0?this.shadowMatrixForNodeAt(t,c,b.node,s):d);let g=b.texture>=0?h.textures[b.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",b.alphaCutoff),g&&e.bindTexture(wo,g),o.setVec4v("u_base_color",b.baseColor),o.setVec3("u_emissive",b.emissive[0],b.emissive[1],b.emissive[2]),o.setFloat("u_metallic",b.metallic),o.setFloat("u_roughness",b.roughness),e.setCull(b.doubleSided?"none":"back"),e.setBlend(p?"premultiplied":"none"),e.setDepthMask(!p),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,e.gl.UNSIGNED_INT,b.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,i,a){let s=new k;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 h=s.get(c.url);h?h.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 h=this.gpuFor(e,c[0],r);if(!h||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new Be(e,this.instScratch,Nl,true)),h.instVao||(h.instVao=new he(e,[{buffer:h.vbo,locations:r},{buffer:this.instBuffer,locations:r}],h.ibo)),l||(o.use(),i(o),o.setInt("u_base_texture",wo),o.setFloat("u_opacity",1),l=true);let f=c[0].mesh;for(let u=0;u<c.length;u+=hi){let d=Math.min(hi,c.length-u);for(let m=0;m<d;m++){let p=c[u+m],b=m*Dr;this.instScratch.set(p.matrixFor(t),b);let g=a?this.shadowMatrix(t,p):ld;this.instScratch.set(g,b+16),this.instScratch.set(p.normalMatrix(),b+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,d*Dr)),e.bindVAO(h.instVao.vao);for(let m of f.primitives){let p=m.texture>=0?h.textures[m.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),p&&e.bindTexture(wo,p),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(h=>h.type!=="directional"),i=r.length<=Ot?r:[...r].sort((h,f)=>f.intensity-h.intensity).slice(0,Ot),a=new Float32Array(Ot*4),s=new Float32Array(Ot*4),l=new Float32Array(Ot*4),c=new Float32Array(Ot*4);i.forEach((h,f)=>{let u=f*4;a[u]=h.position[0],a[u+1]=h.position[1],a[u+2]=h.position[2],a[u+3]=h.range,s[u]=h.color[0]*h.intensity,s[u+1]=h.color[1]*h.intensity,s[u+2]=h.color[2]*h.intensity,s[u+3]=h.type==="spot"?1:0,l[u]=h.direction[0],l[u+1]=h.direction[1],l[u+2]=h.direction[2],c[u]=h.cosInner,c[u+1]=h.cosOuter;}),o={count:i.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(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+i*.5,i)}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 i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let s=this.shadowMatrix(t,i);o.setMat4("u_matrix",s),a.vao.bind();for(let l of i.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,i,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),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,i){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,i)}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 i=e.gl,a=new Be(e,new Uint8Array(t.mesh.vertices),Wl),s=new de(e,t.mesh.indices),l=new he(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(f=>{if(!f)return null;let u=i.createTexture();return u?(e.bindTexture(wo,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,f),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),u):null}),h=new di(l,a,s,c);return h.users=1,this.counted.add(t),this.gpu.set(t.url,h),h}static get layout(){return Wl}static get instanceLayout(){return Nl}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var mi=4,Kl=new te;function cd(n){Kl.has(n)||(Kl.add(n),console.warn(`[osmgl] ${n}`));}var fd=.5,ud=.01,hd=300,pi=127,dd=.5,zt=128,xo=5120,Sr=5121,_o=5122,Ul=5123,Eo=5126,md={stride:8,attribs:[{name:"a_pos",size:2,type:Eo,offset:0}]},bi={stride:rt,attribs:[{name:"a_pos",size:2,type:_o,offset:0}]},Jl={stride:at,attribs:[{name:"a_p0",size:2,type:_o,offset:0},{name:"a_p1",size:2,type:_o,offset:4},{name:"a_corner",size:2,type:xo,offset:8},{name:"a_ground",size:2,type:xo,offset:10},{name:"a_dist",size:1,type:Eo,offset:12},{name:"a_width",size:1,type:Eo,offset:16}]},Vt={stride:Te,attribs:[{name:"a_pos",size:2,type:_o,offset:0},{name:"a_height",size:1,type:Ul,offset:4},{name:"a_tint",size:1,type:Sr,normalized:true,offset:6},{name:"a_ao",size:1,type:Sr,normalized:true,offset:7},{name:"a_normal",size:3,type:xo,normalized:true,offset:8},{name:"a_kind",size:1,type:Sr,offset:11},{name:"a_wall",size:3,type:Ul,offset:12}]},pd={flat:0,water:1,foliage:2,sand:3,asphalt:4},bd=[1,9,14,26,3],Xl={stride:Tt,attribs:[{name:"a_pos",size:2,type:Eo,offset:0},{name:"a_level",size:1,type:_o,offset:8},{name:"a_normal",size:3,type:xo,normalized:true,offset:10},{name:"a_kind",size:1,type:Sr,offset:13},{name:"a_bleed",size:2,type:xo,offset:14}]},Ir=class{constructor(e,t,o,r,i,a,s=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=s;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},jl={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Mo=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new k;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new xr;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new k;this.lineLocs=new k;this.objectLine=null;this.objectLineLocs=new k;this.buildingLocs=new k;this.shadows={...jl};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new k;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 k;this.highlightKey="";this.groundArrows=new yo;this.highlightTris=new k;this.fillHighlightGpu=new k;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Ao;this.hiddenBuildings=new Set;this.seams=new Ar;this.seamGpu=new k;this.hiddenWithSeams=new k;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new k;this.hiddenStamp="";this.bucketIdCache=new k;this.surfaceCut=new k;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new lt;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new k;this.modelInstLocs=new k;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((i,a)=>i-a).join(","),t="";for(let[r,i]of this.seams.hiddenByTile)t+=`${r}=${e(i)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,i]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let s of i)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,i,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.surfaceCut.get(s);if(l!==void 0&&(l===null||l.vbo===i))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 h=new Float64Array(c.shapeFeatures),f=new Uint32Array(c.shapeRanges),u=[],d=0;for(let C=0;C<h.length;d++){let v=h[C++],_=v>0;for(let w=0;w<v;w++)if(!a.has(h[C+w])){_=false;break}C+=v,_&&u.push(d);}if(!u.length)return this.surfaceCut.set(s,null),null;let m=new Uint32Array(c.indices),p=c.capIndexOffset??m.length,b=new Uint8Array(m.length);for(let C of u){for(let v=f[C*4];v<f[C*4+1];v++)b[v]=1;for(let v=f[C*4+2];v<f[C*4+3];v++)b[v]=1;}let g=[];for(let C=0;C<p;C++)b[C]||g.push(m[C]);let y=g.length;for(let C=p;C<m.length;C++)b[C]||g.push(m[C]);let A=new de(e,new Uint32Array(g)),B={vao:new he(e,[{buffer:i,locations:this.surfaceLocs}],A),ibo:A,vbo:i,mainCount:y,capCount:g.length-y};return this.surfaceCut.set(s,B),B}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 i=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:i,vbo:o}),i}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,i,a,s=this.buildingLocs){if(!a||!a.size)return null;let l=r+"|"+o,c=this.hiddenCut.get(l);if(c!==void 0&&(c===null||c.vbo===i))return c;c&&(c.vao.destroy(),c.ibo.destroy());let h=t.data?.buckets?.[o];if(!h||!("featureIds"in h)||!h.featureIds)return null;let f=this.bucketIds(l,h.featureIds,i),[u,d]=a.size<f.size?[a,f]:[f,a],m=false;for(let A of u)if(d.has(A)){m=true;break}if(!m)return this.hiddenCut.set(l,null),null;let p=new Uint32Array(h.indices),b=new Float64Array(h.featureIds),g=[];for(let A=0;A*3<p.length;A++)a.has(b[A])||g.push(p[A*3],p[A*3+1],p[A*3+2]);let y=null;if(g.length<p.length){let A=new de(e,new Uint32Array(g));y={vao:new he(e,[{buffer:i,locations:s}],A),ibo:A,count:g.length,vbo:i};}return this.hiddenCut.set(l,y),y}init(e){this.symbols?.init(e),this.fill=new Ce(e,"fill",ml,pl),this.surface=new Ce(e,"surface",vl,wl),this.line=new Ce(e,"line",bl,gl),this.objectLine=new Ce(e,"objectLine",yl,Al),this.building=new Ce(e,"buildings",Bl,Cl),this.depth=new Ce(e,"depth",rl,jn),this.groundShadow=new Ce(e,"groundShadow",hl,dl),this.sky=new Ce(e,"sky",ll,cl),this.raster=new Ce(e,"raster",fl,ul),this.globeBody=new Ce(e,"globeBody",$s,el),this.globeClip=new Ce(e,"globeClip",tl,ol),this.globeMesh=gd(e,this.globeBody),this.model=new Ce(e,"model",il,Zn),this.modelInstanced=new Ce(e,"model-instanced",al,Zn),this.modelDepth=new Ce(e,"modelDepth",sl,jn);for(let i of lt.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...lt.layout.attribs,...lt.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=Qs(e);let t=new k([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new Be(e,new Float32Array([0,0,1,0,1,1,0,1]),md),r=new de(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new he(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of bi.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Xl.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of Jl.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of ci.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));for(let i of Vt.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));}render(e,t,o,r,i,a=new k){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.materialTime=i/1e3,this.materialAnimating=false,this.fog=Rt(t,r),this.patternScale=Jo/Math.max(ze(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),h=t.cameraPositionPx;this.cameraMeters=[h[0]/c,h[1]/c,h[2]/c];let f=b=>o.get(b.source??Z);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),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.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=b=>b.type==="line"&&W(b.paint.elevation,s,0)!==0,d=new Set;for(let b of r.layers){if(b.type==="raster"||b.type==="fill-extrusion"||b.type==="symbol"||b.overlay||u(b)||!r.layerVisibleAt(b,s))continue;let g=f(b);if(g){if(b.type==="line"&&b.network){if(d.has(b.network))continue;d.add(b.network),this.drawNetwork(e,t,r,f,b.network,s,y=>!y.overlay&&!u(y)&&r.layerVisibleAt(y,s));continue}if(b.type==="surface"){if(!this.flattened(g,r,b))continue;this.drawFill(e,t,g,r,b,s);continue}b.type==="fill"?this.drawFill(e,t,g,r,b,s):this.drawLine(e,t,g,r,b,s);}}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.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let b of r.layers){if(b.type!=="surface"||b.overlay||!r.layerVisibleAt(b,s))continue;let g=f(b);g&&(this.flattened(g,r,b)||this.drawSurface(e,t,g,r,b,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let b of r.layers){if(b.type==="raster"||!u(b)||b.overlay||!r.layerVisibleAt(b,s))continue;let g=f(b);if(g){if(b.type==="line"&&b.network){if(m.has(b.network))continue;m.add(b.network),this.drawNetwork(e,t,r,f,b.network,s,y=>!y.overlay&&u(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,g,r,b,s);}}this.drawOverlay(e,t,r,f,s,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let b of r.layers){if(b.type!=="fill-extrusion"||!r.layerVisibleAt(b,s))continue;let g=f(b);g&&(this.drawBuildings(e,t,g,r,b,s,i)&&(l=true),this.drawHighlight(e,t,g,r,b,s));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,b=>{this.applyShadowUniforms(b),this.applyFogUniforms(b,t,r),this.applyLight(b,r);},this.shadowActive,i/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,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),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s,true);let p=r.layers.filter(b=>b.type==="line"&&W(b.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(b,s));if(p.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let b of p){let g=f(b);g&&this.drawLine(e,t,g,r,b,s,W(b.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,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,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}renderShadowMap(e,t,o,r,i){if(this.shadowPlaceholder&&e.bindTexture(mi,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(f=>f.type==="fill-extrusion"&&!f.overlay&&r.layerVisibleAt(f,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new bo(e,this.shadows.resolution);let s=r.light;if(t.updateShadow(Wt(s.keyAzimuth,s.keyAltitude),hd),!t.shadowReady)return;let l=this.shadowTarget;l.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 h=this.depth;h.use();for(let f of a){let u=o.get(f.source??Z);if(!u)continue;let d=r.bucketKeyFor(f);if(d===null)continue;let m=W(f.paint.heightScale,t.zoom,1);(f.source??Z)===Z&&this.indoorMask.prepare(u,d);for(let p of u.visibleTiles){if(!this.drawsTile(t,r,f,p))continue;let b=u.getTile(p),g=b&&this.bucketFor(e,b,d,Vt,this.buildingLocs,"fill-extrusion");if(!g)continue;h.setFloat("u_height_scale",this.growScale(g,i,!u.warm)*m),h.setMat4("u_matrix",t.shadowTileMatrix(p,g.extent));let y=(f.source??Z)===Z,A=this.cutHidden(e,b,d,p.dataKey,g.buffer,this.hiddenFor(d,y,p.dataKey)),B=y?A??this.indoorMask.indicesFor(e,b,d,p,g.buffer,this.buildingLocs):A;B?(B.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,B.count,e.gl.UNSIGNED_INT,0)):(g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.indexCount,g.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=i/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),l.bindTexture(mi),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(l.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 i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Ne(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],i=[0,0,0,0];if(be(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[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(Oe(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(),Ne(r,"u_sky_color",o.sky.skyColor),Ne(r,"u_horizon_color",o.sky.horizonColor),yd(r,o.sky);let[i,a]=this.skyBand(t,o),s=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",i,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]),Ne(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let h=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",h,o.sky.starIntensity),h>.001){Ne(r,"u_space_color",o.sky.spaceColor),Ne(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[u,d,m,p]=t.localRayCorners();r.setVec3("u_ray_tl",u[0],u[1],u[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",p[0],p[1],p[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,i=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,i),e.setVec2("u_globe_center",t.centerPointPx.x/i,t.centerPointPx.y/i);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]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let i=o.bounds();e.setVec3("u_tile_merc",i.minX,i.minY,(i.maxX-i.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??Rt(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}Ne(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[i,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",i,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){let i=this.fog;if(!i)return true;let a=e.distanceToTile(r);return a>i.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let i of e.layers)i.type==="surface"?o=Math.min(o,(i.elevation-(i.bevelDrop??0))*this.reliefScale):i.type==="line"&&(o=Math.min(o,W(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(fd/Math.max(t.pixelsPerMeter,1e-9),ud);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,pi);}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(Z);if(!r||!this.fill||!this.quad)return;let i=r.visibleTiles;if(!i.length||i.length>pi)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 i)l++,this.stencilIds.set(c.dataKey,l),a.stencilFunc(a.ALWAYS,l,pi),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 i=o.get(Z);if(!i)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 i.visibleTiles){let h=t.tileMatrix(c,1);l.set(h);for(let f=0;f<4;f++)l[12+f]+=s*h[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 i=o.get(Z);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=Wt(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),h=pe(s.ambientColor),f=pe(s.keyColor),u=[0,0,0];for(let d=0;d<3;d++){let m=h[d]*s.ambientIntensity,p=f[d]*s.keyIntensity*c;u[d]=m>0?m/(m+p):1;}a.setVec3("u_shadow_ground",u[0],u[1],u[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",mi),!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 i=pe(this.shadows.color);e.setVec3("u_shadow_color",i[0],i[1],i[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,i,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,i))continue;let c=r(l);if(c){if(l.type==="surface"){this.flattened(c,o,l)?this.drawFill(e,t,c,o,l,i):this.drawSurface(e,t,c,o,l,i),s();continue}l.type==="fill"?this.drawFill(e,t,c,o,l,i):this.drawLine(e,t,c,o,l,i);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=i=>{let a=(i+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[l,c,h]=this.tileTint(t);e.setVec4("u_tile_tint",l,c,h,dd);}else e.setVec4("u_tile_tint",0,0,0,0);let r=jo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[i,a]=$i(t.z,t.x,t.y);e.setVec2("u_world_origin",i/this.patternScale,a/this.patternScale);let s=this.cameraMeters;e.setVec3("u_camera_local",s[0]-t.x*r,s[1]-t.y*r,s[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,i=this.detailScale<=0?0:pd[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,s=W(a.materialStrength,o,1)*this.detailScale,l=W(a.materialScale,o,bd[i]),c=W(a.materialSpeed,o,i===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,i,a){let s=this.fill,l=r.colorAt(i,a),c=W(i.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,i,a),s.setVec4v("u_color",Fe([l[0],l[1],l[2],l[3]*c]));let h=r.bucketKeyFor(i);if(h!==null){for(let f of o.visibleTiles){if(!this.drawsTile(t,r,i,f))continue;let u=o.getTile(f),d=u&&this.bucketFor(e,u,h,bi,this.fillLocs,"fill");if(!d)continue;this.clipToTile(e,f),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(f,d.extent)),this.applyTileScale(s,f,d.extent),this.applyTileMatrix(s,t,f,d.extent);let m=this.cutHidden(e,u,h,f.dataKey,d.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,i,a,s=0,l){let c=this.line,h=r.colorAt(i,a),f=W(i.paint.opacity,a,1)*(s||1),u=W(i.paint.width,a,1);if(f<=.001||u<=.01)return;let d=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,p=t.width>0?d/t.width:1,b=u/2*p;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",Fe([h[0],h[1],h[2],h[3]*f])),c.setFloat("u_center_w",t.cameraToCenterDistance);let g=W(i.paint.offset,a,0)*p,y=Math.max(W(i.paint.blur,a,0),0)*p;c.setFloat("u_elevation",W(i.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,m);let A=i.paint.dashArray,B=i.paint.arrow===true,C=i.paint.arrowStyle,v=B&&(C==="head"||C==="headOnly"),_=B&&C==="dash";if(c.setInt("u_pattern",_?5:A?1:C==="headOnly"&&B?4:v?3:B?2:0),A){let[x,E]=A;c.setVec2("u_dash",x*p,(x+E)*p);}if(B){let x=ke(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Fe(x));let E=W(i.paint.arrowPeriod,a,46)*p,F=W(i.paint.arrowSize,a,5)*p;if(_){let M=W(i.paint.arrowGap,a,24)*p,D=Math.max(E-M,1),L=Math.min(F,D),I=W(i.paint.arrowShaft,a,2)*p,S=W(i.paint.arrowHead,a,4)*p,P=W(i.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",I,L,S,D),c.setVec2("u_dash",P,E);}else v?c.setVec4("u_arrow",E,F,b,0):c.setVec4("u_arrow",E,Math.max(F*.4,1),Math.min(F,b*.72),0);}let w=r.bucketKeyFor(i);if(w!==null)for(let x of o.visibleTiles){if(!this.drawsTile(t,r,i,x))continue;let E=o.getTile(x);if(!E)continue;let F=i.network?l!==void 0?[je(i.id,l)]:(E.data?.levels??[]).map(M=>je(i.id,M)):[w];for(let M of F){let D=this.bucketFor(e,E,M,Jl,this.lineLocs,"line");if(!D)continue;let L=x.bounds(),I=(L.maxX-L.minX)*t.worldSize/D.extent*p;c.setFloat("u_tile_to_px",I);let S=I>1e-6?1/I:1;c.setFloat("u_half_width",b*S),c.setFloat("u_blur",y*S),c.setFloat("u_meters_to_units",t.pixelsPerMeter*S),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",W(i.paint.widthExtra,a,0)*S),c.setFloat("u_offset",g*S),c.setFloat("u_tile_per_px",S),this.applyTileScale(c,x,D.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,D.extent)),this.applyTileMatrix(c,t,x,D.extent);let P=this.cutHidden(e,E,M,x.dataKey,D.buffer,this.replacedIds(),this.lineLocs);P?(P.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,P.count,e.gl.UNSIGNED_INT,0)):(D.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,D.indexCount,D.indexType,0));}}}drawNetwork(e,t,o,r,i,a,s){let l=o.layers.filter(h=>h.type==="line"&&h.network===i&&s(h));if(!l.length)return;let c=new Set;for(let h of l){let f=r(h);if(f)for(let u of f.visibleTiles){let d=f.getTile(u);for(let m of d?.data?.levels??[])c.add(m);}}if(c.size)for(let h of [...c].sort((f,u)=>f-u))for(let f of l){let u=r(f);u&&this.drawLine(e,t,u,o,f,a,0,h);}}drawHighlight(e,t,o,r,i,a){let s=this.highlight;if(!s||!this.building||s.layerId!==i.id)return;let l=`${i.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=pe(s.color)??[.31,.79,.5,1],h=this.building;h.use(),this.applyShadowUniforms(h),this.applyFogUniforms(h,t,r),this.applyLight(h,r),h.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),h.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),h.setFloat("u_opacity",s.opacity),h.setFloat("u_ao_strength",W(i.paint.aoStrength,a,.4)),h.setFloat("u_tint_variation",0),h.setFloat("u_facade_detail",0),h.setFloat("u_window_glow",0),h.setFloat("u_roof_variation",0),h.setFloat("u_height_scale",W(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,zt,zt),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(zt);let u=this.seams.stitched.has(s.featureId);u&&this.drawSeamHighlight(e,t,h,s.featureId);for(let d of u?[]:o.visibleTiles){let m=o.getTile(d);if(!m)continue;let p=m.data?.buckets?.[i.id];if(!p)continue;let b=d.dataKey,g=this.highlightGpu.get(b);if(g===void 0){let y=_r(m,i.id,s.featureId);if(y){let A=new Be(e,new Uint8Array(y.vertices),Vt),B=new de(e,y.indices);g={vao:new he(e,[{buffer:A,locations:this.buildingLocs}],B),vbo:A,ibo:B,count:y.indices.length};}else g=null;this.highlightGpu.set(b,g);}g&&(this.applyTileScale(h,d,p.extent),this.shadowActive&&h.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),h.setMat4("u_matrix",t.tileMatrix(d,p.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 i=t.layers.find(l=>l.id===o.layerId),a=e.get(i?.source??Z);if(!a)return;let s=new te;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),h=c?.data?.buckets?.[o.layerId];if(!c||!h)continue;let f=_r(c,o.layerId,o.featureId);f&&this.highlightTris.set(l.dataKey,$n(f,h.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let s=r.layers.find(u=>u.id===i.layerId),l=s?o.get(s.source??Z):void 0;if(!s||!l)return;let c=i.bucketKey,h=pe(i.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",Fe([h[0],h[1],h[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=e.gl;e.setStencilTest(true),f.stencilFunc(f.NOTEQUAL,zt,zt),f.stencilOp(f.KEEP,f.KEEP,f.REPLACE),f.stencilMask(zt);for(let u of l.visibleTiles){let d=l.getTile(u),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let p=this.fillHighlightFor(e,m,u,i.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(u,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.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,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(u=>{u?.vao.destroy(),u?.ibo.destroy(),u?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),h=[];for(let u=0;u*3<l.length;u++)c[u]===r&&h.push(l[u*3],l[u*3+1],l[u*3+2]);let f=null;if(h.length){let u=new Be(e,new Uint8Array(t.vertices),bi),d=new de(e,new Uint32Array(h));f={vao:new he(e,[{buffer:u,locations:this.fillLocs}],d),vbo:u,ibo:d,count:h.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,i,a){let s=this.surface,l=r.colorAt(i,a,[.7,.8,.7,1]),c=W(i.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,i,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",W(i.paint.sideShade,a,.12));let h=i.elevation<(i.base??0),f=i.paint.sideColor?ke(i.paint.sideColor,a,l):l;s.setVec3("u_side_color",f[0],f[1],f[2]),s.setFloat("u_side_light",W(i.paint.sideLight,a,h?1:0)),s.setFloat("u_relief",this.reliefScale);let u=r.bucketKeyFor(i);if(u===null)return;let d=c>=1&&!i.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,i,g))continue;let y=o.getTile(g),A=y&&this.bucketFor(e,y,u,Xl,this.surfaceLocs,"surface");A&&m.push({id:g,bucket:A,cut:y?this.cutSurface(e,y,u,g.dataKey,A.buffer,this.replacedIds()):null});}let p=(g,y,A)=>{this.clipToTile(e,g),this.applyTileScale(s,g,y.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(g,y.extent)),this.applyTileMatrix(s,t,g,y.extent),(A??y).vao.bind();},b=m.filter(({bucket:g,cut:y})=>y?y.capCount>0:g.capIndexOffset<g.indexCount);if(b.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:g,bucket:y,cut:A}of b){p(g,y,A);let B=A?e.gl.UNSIGNED_INT:y.indexType,C=B===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,A?A.capCount:y.indexCount-y.capIndexOffset,B,(A?A.mainCount:y.capIndexOffset)*C);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:g,bucket:y,cut:A}of m)p(g,y,A),e.gl.drawElements(e.gl.TRIANGLES,A?A.mainCount:y.capIndexOffset,A?e.gl.UNSIGNED_INT:y.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,i,a,s){let l=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),h=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,f=W(i.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",h),l.setFloat("u_opacity",f),l.setFloat("u_ao_strength",W(i.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",W(i.paint.tintVariation,a,.07));let u=(B,C)=>i.paint[B]?r.colorAt({...i,paint:{...i.paint,color:i.paint[B]}},a,C):C,d=u("windowColor",[.62,.71,.8,1]),m=u("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",d[0],d[1],d[2]),l.setVec3("u_window_frame",m[0],m[1],m[2]),l.setFloat("u_facade_detail",W(i.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",W(i.paint.windowGlow,a,0)),l.setFloat("u_floor_height",W(i.paint.floorHeight,a,3.2)),l.setFloat("u_window_variation",W(i.paint.windowVariation,a,1)),l.setFloat("u_seam_strength",W(i.paint.seamStrength,a,1)),l.setFloat("u_window_recess",W(i.paint.windowRecess,a,.18)),l.setFloat("u_window_recess_shade",W(i.paint.windowRecessShade,a,.16)),l.setFloat("u_plinth_height",W(i.paint.plinthHeight,a,4)),l.setFloat("u_plinth_shade",W(i.paint.plinthShade,a,.14)),l.setFloat("u_roof_variation",W(i.paint.roofVariation,a,.3)),this.applyLight(l,r);let p=f>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let b=W(i.paint.heightScale,a,1),g=false,y=r.bucketKeyFor(i);if(y===null)return g;let A=(i.source??Z)===Z;if(A&&this.indoorMask.prepare(o,y),A&&o.visibleTiles.length){let B=o.visibleTiles[0].z;this.seams.update(o,y,{zoom:B,metersPerTile:jo(B),cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments})&&this.syncSeamGpu();}for(let B of o.visibleTiles){if(!this.drawsTile(t,r,i,B))continue;let C=o.getTile(B),v=C&&this.bucketFor(e,C,y,Vt,this.buildingLocs,"fill-extrusion");if(!v)continue;let _=this.growScale(v,s,!o.warm);_<1&&(g=true),l.setFloat("u_height_scale",_*b),this.applyTileScale(l,B,v.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(B,v.extent)),l.setMat4("u_matrix",t.tileMatrix(B,v.extent));let x=this.cutHidden(e,C,y,B.dataKey,v.buffer,this.hiddenFor(y,A,B.dataKey))??(C&&A?this.indoorMask.indicesFor(e,C,y,B,v.buffer,this.buildingLocs):null);x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.indexCount,v.indexType,0));}return A&&this.drawSeams(e,t,l,b),g}drawSeamHighlight(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=`${i}\u241F${r}`,c=this.highlightGpu.get(l);if(c===void 0){let h=ii(s,r);if(h){let f=new Be(e,new Uint8Array(h.vertices),Vt),u=new de(e,h.indices);c={vao:new he(e,[{buffer:f,locations:this.buildingLocs}],u),vbo:f,ibo:u,count:h.indices.length};}else c=null;this.highlightGpu.set(l,c);}c&&(this.applyTileScale(o,a,s.extent),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[i,{tile:a,mesh:s}]of this.seams.meshes){let l=this.seamGpu.get(i);if(!l){let c=new Be(e,new Uint8Array(s.vertices),Vt),h=new de(e,new Uint32Array(s.indices)),f=new he(e,[{buffer:c,locations:this.buildingLocs}],h);l=new Ir(f,c,h,s.indexCount,e.gl.UNSIGNED_INT,s.extent),this.seamGpu.set(i,l);}o.setFloat("u_height_scale",r),this.applyTileScale(o,a,s.extent),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);}}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?Ad(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Ne(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=Wt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Ne(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),Ne(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 i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,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 cd(`\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;let c=new Be(e,new Uint8Array(l.vertices),r),h=new de(e,new Uint32Array(l.indices)),f=new he(e,[{buffer:c,locations:i}],h),u=new Ir(f,c,h,h.count,h.type,l.extent,l.capIndexOffset??h.count);return t.buckets.set(o,u),u}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Lr=new k;function gd(n,e){let r=new Float32Array(66306),i=0;for(let u=0;u<=128;u++){let d=(u/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[i++]=m/256*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(256*128*6),s=0;for(let u=0;u<128;u++)for(let d=0;d<256;d++){let m=u*257+d,p=m+256+1;a[s++]=m,a[s++]=m+1,a[s++]=p,a[s++]=m+1,a[s++]=p+1,a[s++]=p;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:Eo,offset:0}]},c=new k([["a_lnglat",e.attribLocation("a_lnglat")]]),h=new Be(n,r,l),f=new de(n,a);return {vao:new he(n,[{buffer:h,locations:c}],f),vbo:h,ibo:f,count:a.length}}function yd(n,e){if(e.highColor){Ne(n,"u_high_color",e.highColor);return}let t=Lr.get(e.skyColor);t||(t=pe(e.skyColor),Lr.set(e.skyColor,t)),n.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Ne(n,e,t){let o=Lr.get(t);o||(o=pe(t),Lr.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Wt(n,e){let t=n*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 Ad(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Tr=1,Fo=class{constructor(e=1024){this.entries=new k;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 i=this.entries.get(e);if(i)return i;if(this.full||o>this.size)return null;if(this.shelfX+o+Tr>this.size&&(this.shelfY+=this.shelfHeight+Tr,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Tr>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+Tr,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 gi=.75,So=8,xe=3,et=24,Nt=256,Yl=255,Do=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new k;this.loaded=new te;this.inflight=new k;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/Nt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/Nt);if(r<=Yl&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new te;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/Nt);i>Yl||this.loaded.has(i)||t.add(i);}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*Nt}-${e*Nt+Nt-1}`),r=fetch(o,{credentials:"same-origin"}).then(i=>{if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.arrayBuffer()}).then(i=>{for(let a of Zl(i))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(i=>{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:`,i instanceof Error?i.message:i);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Zl(n){let e=new bt(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((s,l,c)=>{if(s!==3||!c)return;let h=c.readVarint()+c.pos,f={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((u,d,m)=>{m&&(u===1?f.id=m.readVarint():u===2?f.bitmap=m.readBytes():u===3?f.width=m.readVarint():u===4?f.height=m.readVarint():u===5?f.left=m.readSVarint():u===6?f.top=m.readSVarint():u===7&&(f.advance=m.readVarint()));},null,h),t.push(f);},null,a);},null),t}var Bd=.25,Kt=1e20;function yi(n,e,t){let o=e+xe*2,r=t+xe*2,i=o*r,a=new Float64Array(i),s=new Float64Array(i);a.fill(Kt),s.fill(0);for(let c=0;c<t;c++)for(let h=0;h<e;h++){let f=n[c*e+h]/255,u=(c+xe)*o+(h+xe);if(f>=1)a[u]=0,s[u]=Kt;else if(f>0){let d=.5-f;a[u]=d>0?d*d:0,s[u]=d<0?d*d:0;}else a[u]=Kt,s[u]=0;}Ql(a,o,r),Ql(s,o,r);let l=new Uint8Array(i);for(let c=0;c<i;c++){let h=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Cd(Math.round(255-255*(h/So+Bd)));}return {data:l,width:o,height:r}}function Ql(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=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]=n[c*e+l];ql(r,i,a,s,t);for(let c=0;c<t;c++)n[c*e+l]=i[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=n[l*e+c];ql(r,i,a,s,e);for(let c=0;c<e;c++)n[l*e+c]=i[c];}}function ql(n,e,t,o,r){t[0]=0,o[0]=-Kt,o[1]=Kt;for(let i=1,a=0;i<r;i++){let s=0;do{let l=t[a];s=(n[i]-n[l]+i*i-l*l)/(i-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=i,o[a]=s,o[a+1]=Kt;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let s=t[a];e[i]=(i-s)*(i-s)+n[s];}}var Cd=n=>n<0?0:n>255?255:n;var $l=48,Io=class{constructor(e={}){this.defs=e;this.sdfs=new k;this.pending=new te;this.failed=new te;}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),i=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round($l*(i>1?i:1))),s=Math.max(8,Math.round($l/(i<1?i:1))),l=await vd(o,a,s);return this.sdfs.set(e,yi(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 vd(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((f,u)=>{a.onload=()=>f(),a.onerror=()=>u(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=i;});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,h=new Uint8ClampedArray(e*t);for(let f=0;f<h.length;f++)h[f]=c[f*4+3];return h}finally{URL.revokeObjectURL(i);}}var Ct={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},wd={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[n,e]of Object.entries(wd)){let t=Ct[e];t?Ct[n]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${n}\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 xd=1.2;function Ai(n,e,t=16,o=0){let r=_d(n,t),i=[],a=[],s=0;for(let h of r){let f=0,u=0;for(let d of h){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(f+=p.advance,u++);}u>1&&(f+=o*(u-1)),a.push(f),f>s&&(s=f);}if(s===0)return null;let l=et*xd,c=r.length*l;for(let h=0;h<r.length;h++){let f=-a[h]/2,u=-c/2+h*l+l/2;for(let d of r[h]){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(p.width>0&&p.height>0&&p.bitmap&&i.push({glyph:p,x:f,y:u}),f+=p.advance+o);}}return i.length?{glyphs:i,width:s,height:c}:null}function _d(n,e){let t=n.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],i="";for(let a of o)i?i.length+1+a.length<=e?i+=" "+a:(r.push(i),i=a):i=a;return i&&r.push(i),r.slice(0,3)}function Bi(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,s=t+o,l=u=>u.x>=r&&u.x<=a&&u.y>=i&&u.y<=s,c=[],h=[],f=()=>{h.length>=2&&c.push(h),h=[];};for(let u=0;u+1<n.length;u++){let d=n[u],m=n[u+1],p=l(d),b=l(m);if(p&&b){h.length||h.push(d),h.push(m);continue}let g=Ed(d,m,r,i,a,s);if(!g){f();continue}h.length||h.push(g[0]),h.push(g[1]),b||f();}return f(),c}function Ed(n,e,t,o,r,i){let a=e.x-n.x,s=e.y-n.y,l=0,c=1,h=[[-a,n.x-t],[a,r-n.x],[-s,n.y-o],[s,i-n.y]];for(let[f,u]of h){if(f===0){if(u<0)return null;continue}let d=u/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:n.x+a*l,y:n.y+s*l},{x:n.x+a*c,y:n.y+s*c}]}var Md=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function vi(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=Id(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=i*s,c=o.fontSize?o.fontSize*.6:t/e.length,h=(o.fontSize??0)*.85,f=[],u=o.spacing??250,d=u>0&&u-t<u*.25?t+u*.25:u;if(o.accept)return Fd(n,r,e,t,d,c,a,h,o.accept);if(d>0&&l>=t+d){let p=Math.min(Math.floor((l-t)/d)+1,24),b=t+d*(p-1),g=(l-b)/2;for(let y=0;y<p;y++,g+=d){let A=g/s,B=Ci(n,r,e,t,A,c,a,h);B&&f.push({glyphs:B,path:B.map(C=>({x:C.x,y:C.y})),at:A});}if(f.length)return f}let m=(i-t)/2;for(let p of Md){let b=m+m*p,g=Ci(n,r,e,t,b,c,a,h);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:b}];if(m===0)break}return []}function Fd(n,e,t,o,r,i,a,s,l){let c=e[e.length-1],h=Math.max(o/3,r/8,12),f=[],u=-1/0;for(let d=0;d+o<=c;d+=h){if(d-u<r)continue;let m=Ci(n,e,t,o,d,i,a,s);if(!m)continue;let p={glyphs:m,path:m.map(b=>({x:b.x,y:b.y})),at:d};if(l(p)&&(f.push(p),u=d,f.length>=24))break}return f}function Ci(n,e,t,o,r,i,a,s){if(r<0||r+o>e[e.length-1]||!Dd(n,e,r,r+o,i,a))return null;let l=Lo(n,e,r),c=Lo(n,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return ec(n,e,t,r,s);let h=e[e.length-1];return ec([...n].reverse(),Ld(e),t,h-(r+o),s)}function Dd(n,e,t,o,r,i){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<n.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let h=Math.atan2(n[l].y-n[l-1].y,n[l].x-n[l-1].x),f=Math.atan2(n[l+1].y-n[l].y,n[l+1].x-n[l].x),u=Math.abs((f-h)*180/Math.PI+540)%360-180,d=Math.abs(u);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>i)return false}return true}function ec(n,e,t,o,r){let i=[];for(let c of t){let h=tc(n,e,o+c.offset,c.width);if(!h)return null;i.push(h);}if(!i.length)return null;if(r<=0)return i;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let f=Math.abs(Sd(i[c].angle,i[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 h=tc(n,e,s,t[c].width);if(!h)return null;a.push(h);}return a}function tc(n,e,t,o){let r=Lo(n,e,t+o/2);if(!r)return null;let i=Lo(n,e,t),a=Lo(n,e,t+o);if(!i||!a)return r;let s=a.x-i.x,l=a.y-i.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function Sd(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Id(n){let e=new Array(n.length);e[0]=0;for(let t=1;t<n.length;t++)e[t]=e[t-1]+Math.hypot(n[t].x-n[t-1].x,n[t].y-n[t-1].y);return e}function Ld(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function Lo(n,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 i=(t-e[o-1])/r,a=n[o-1],s=n[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*i,y:a.y+c*i,angle:Math.atan2(c,l)*180/Math.PI}}var xi=20,oc={stride:xi,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}]},Td=220,ct=64,rc=2,Hd=1.22,kd=128,Pd=.7;function Rd(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return W(o,e,0)*et;let r=W(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Pd/(t/et)}var Gd=256,Od=200,wi="frame-circle",Ut=class n{constructor(e,t){this.shader=null;this.locations=new k;this.atlas=new Fo(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new k;this.fading=false;this.styleOrder=new k;this.glyphs=new Do(e,t),this.icons=new Io(Ct);}init(e){this.shader=new Ce(e,"symbol",xl,_l);for(let t of oc.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/Td;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(n.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?Od:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>n.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!i)return;let a=t.zoom,s=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,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.order(l);let c=new k,h=new k,f=new k;s.forEach((d,m)=>f.set(d.id,m));let u=0;for(let d of l){let m=this.place(d,a,c);if(!m)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:m.box,order:f.get(d.layer.id)??0});let p=h.get(d.layer.id);p||h.set(d.layer.id,p={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),p.verts.push(...m.verts),p.texs.push(...m.texs),p.iconVerts.push(...m.iconVerts),p.iconTexs.push(...m.iconTexs),p.frameVerts.push(...m.frameVerts),p.frameTexs.push(...m.frameTexs),u+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),u&&(this.styleOrder=f,this.draw(e,t,h,u,a));}collect(e,t,o,r){let i=[],s=this.padding,l=Rt(e,o).far,[c,h,f]=e.cameraPositionPx;for(let u of r){let d=(u.layout?.priority??0)*Gd,m=t.get(u.source??Z);if(!m)continue;let p=u.layout?.showFor==="highlight",b=u.layout?.placement==="map",{shift:g,drop:y}=b?sc(u,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let A=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,B=o.bucketKeyFor(u);if(B!==null)for(let C of m.visibleTiles){if(!o.layerVisibleAt(u,e.detailZoom(e.distanceToTile(C))))continue;let _=m.getTile(C)?.data?.buckets?.[B];if(!_||!wr(_))continue;let w=new Int16Array(_.anchors),x=new Uint8Array(_.priorities),E=_.rotations?new Int16Array(_.rotations):null,F=_.lines?new Int16Array(_.lines):null,M=_.lineStarts?new Uint32Array(_.lineStarts):null,D=C.bounds(),L=e.worldSize,I=(D.maxX-D.minX)*L/_.extent,S=D.minX*L,P=D.minY*L;for(let z=0;z<x.length;z++){let H=S+w[z*2]*I,R=P+w[z*2+1]*I;if(l!==1/0&&Math.hypot(H-c,R-h,f)>l||p&&!$e(this.highlightFootprint,H/L,R/L,A))continue;let N=H,O=R;if(b&&E){let X=E[z]*Math.PI/180,Q=g;N-=Math.sin(X)*Q,O+=Math.cos(X)*Q;}let G=e.worldPxToPoint(N,O),V=F&&M?zd(e,F,M,z,S,P,I):void 0;if(u.layout?.textPlacement==="line"){if(!V)continue}else if(!G||G.x<s.left-64||G.y<s.top-64||G.x>e.width-s.right+64||G.y>e.height-s.bottom+64)continue;i.push({layer:u,screenX:G?G.x:V[0].x,screenY:(G?G.y:V[0].y)+y,text:_.texts[z]??"",icon:_.icons[z]??"",priority:x[z]+d,rotate:lc(u,E,z,e.bearing),mercX:H/L,mercY:R/L,line:V});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=n.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now),s=this.hoverKey!==null&&this.hoverKey===i,l=W(r.textSize,t,13),c=W(r.iconSize,t,16),h=r.iconTextGap??5,[f,u]=r.offset??[0,0],d=r.placement==="map",m=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let oe=`icon:${e.icon}`,j=this.atlas.get(oe);if(!j){let Y=this.icons.get(e.icon);Y?j=this.atlas.add(oe,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(e.icon);}j&&(m=j);}let p=null;if(m&&r.iconFrame==="circle"){let oe=`icon:${wi}`,j=this.atlas.get(oe);if(!j){let Y=this.icons.get(wi);Y?j=this.atlas.add(oe,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(wi);}j&&(p=j);}let b=p?Math.max(r.iconFrameScale??1.6,1):1,g=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),g=Ai(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Rd(e.layer,t,l)),!g&&!m)||!g&&!m)return null;let y=l/et,A=g?g.width*y:0,B=g?g.height*y:0;if(e.layer.layout?.textPlacement==="line")return g&&e.line?this.placeOnLine(e,g,y,B,o,t,a):null;let C=r.iconPlacement??"top",v=C==="behind"&&!!m&&!!g,_=C==="top"&&!!m&&!!g,w=m?m.width/Math.max(m.height,1):1,x=v?B+h*2:c,E=m?x*w:0,F=Math.max(E,m?c*b:0),M=Math.max(x,m?c*b:0),D=v?Math.max(E,A+h*2):_?Math.max(F,A):F+(m&&g?h:0)+A,L=v?Math.max(x,B):_?M+h+B:Math.max(m?M:0,B),I=e.screenX+f,S=e.screenY+u,P=rc+(r.collisionPadding??0),z={x1:I-D/2-P,y1:S-L/2-P,x2:I+D/2+P,y2:S+L/2+P},H=this.padding;if(z.x1<H.left||z.y1<H.top||z.x2>this.viewport.width-H.right||z.y2>this.viewport.height-H.bottom)return null;if(!r.allowOverlap){if(nc(o,z))return null;ic(o,z);}let R=[],N=[],O=[],G=[],V=[],J=[],X=0,Q=I-D/2,ee=_?(M+h)/2:0,q=1/0,U=1/0,ae=-1/0,se=-1/0;if(g){let oe=_||v?I:Q+(m?F+h:0)+A/2;for(let j of g.glyphs){let Y=j.glyph,ne=`g:${Y.id}`,ie=this.atlas.get(ne);if(!ie&&(!Y.bitmap||(ie=this.atlas.add(ne,Y.bitmap,Y.width+xe*2,Y.height+xe*2)??void 0,!ie)))continue;let ue=oe+(j.x+Y.left-xe)*y,le=S+ee+(j.y-Y.top-xe)*y,Ae=ie.width*y,_e=ie.height*y;Hr(R,N,ue,le,Ae,_e,ie,0,a),X++;let we=xe*y;q=Math.min(q,ue+we),U=Math.min(U,le+we),ae=Math.max(ae,ue+Ae-we),se=Math.max(se,le+_e-we);}if(_&&m&&U<1/0){let j=S-L/2+M+h-U;if(j!==0){for(let Y=1;Y<R.length;Y+=4)R[Y]+=j;U+=j,se+=j;}}}if(m){let oe=s?Hd:1,j=E*oe,Y=x*oe,ne=(_?I-E/2:Q+(F-E)/2)-(j-E)/2,ie=(_?S-L/2+(M-x)/2:S-x/2)-(Y-x)/2;if(p){let le=c*b*oe,Ae=ne+j/2-le/2,_e=ie+Y/2-le/2,we=xe/Math.max(p.height-xe*2,1)*le;Hr(V,J,Ae-we,_e-we,le+we*2,le+we*2,p,0,a),X++;}if(v&&ae>q){let le=h*1.6,Ae=h;j=(ae-q+le*2)*oe,Y=(se-U+Ae*2)*oe,ne=q-le,ie=U-Ae;}let ue=xe/Math.max(m.height-xe*2,1)*Y;Hr(O,G,ne-ue,ie-ue,j+ue*2,Y+ue*2,m,e.rotate,a),X++;}return X?{verts:R,texs:N,iconVerts:O,iconTexs:G,frameVerts:V,frameTexs:J,quads:X,box:z}:null}placeOnLine(e,t,o,r,i,a,s){let l=e.line,c=t.glyphs.map(E=>({offset:(E.x+t.width/2)*o,width:Math.max(E.glyph.advance,1)*o})),h=c.length?c[c.length-1].offset+c[c.length-1].width:0,f=e.layer.layout??{},u=[],d=[],m=[],p=0,b=r/2+rc,g=this.padding,y=E=>{let F=E.path.map(M=>({x1:M.x-b,y1:M.y-b,x2:M.x+b,y2:M.y+b}));for(let M of F)if(M.x1<g.left||M.y1<g.top||M.x2>this.viewport.width-g.right||M.y2>this.viewport.height-g.bottom||!f.allowOverlap&&nc(i,M))return false;if(!f.allowOverlap)for(let M of F)ic(i,M);return m.push(...F),true},A=-1/0,B=1/0;for(let E of t.glyphs)E.glyph.height<=0||(A=Math.max(A,E.glyph.top),B=Math.min(B,E.glyph.top-E.glyph.height));let C=Number.isFinite(A)?(A+B)/2*o:0,_=Bi(l,this.viewport.width,this.viewport.height,kd).flatMap(E=>vi(E,c,h,{spacing:f.symbolSpacing,fontSize:et*o,stableScale:Math.pow(2,Math.round(a)-a),accept:y}));if(!_.length)return null;for(let E of _)for(let F=0;F<t.glyphs.length;F++){let M=t.glyphs[F].glyph,D=E.glyphs[F],L=`g:${M.id}`,I=this.atlas.get(L);if(!I&&(!M.bitmap||(I=this.atlas.add(L,M.bitmap,M.width+xe*2,M.height+xe*2)??void 0,!I)))continue;let S=I.width*o,P=I.height*o,z=(M.height/2-M.top)*o+C,H=D.angle*Math.PI/180;Hr(u,d,D.x-S/2-Math.sin(H)*z,D.y-P/2+Math.cos(H)*z,S,P,I,D.angle,s),p++;}if(!p)return null;let w=m.map(E=>(E.x1+E.x2)/2),x=m.map(E=>(E.y1+E.y2)/2);return {verts:u,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:p,box:{x1:Math.min(...w)-b,y1:Math.min(...x)-b,x2:Math.max(...w)+b,y2:Math.max(...x)+b}}}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,i){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 h=new ArrayBuffer(r*4*xi),f=new Float32Array(h),u=new Uint16Array(h),d=[],m=0,p=(b,g,y,A)=>{let B=b.length/16;if(B){d.push({layer:y,role:A,first:m/4*6,count:B*6});for(let C=0;C<B*4;C++){let v=m*5;f[v]=b[C*4],f[v+1]=b[C*4+1],u[v*2+4]=g[C*2],u[v*2+5]=g[C*2+1],f[v+3]=b[C*4+2],f[v+4]=b[C*4+3],m++;}}};for(let b of this.inStyleOrder(o))p(b.frameVerts,b.frameTexs,b.layer,"frame"),p(b.iconVerts,b.iconTexs,b.layer,"icon"),p(b.verts,b.texs,b.layer,"text");l.update(new Uint8Array(h)),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",gi),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 b of d){let g=b.layer.paint,y=W(g.opacity,i,1),A=b.role==="icon",B=b.role==="frame",C=(F,M,D)=>B?M??F??D:A?F??D:D,v=ke(B?g.frameColor??g.haloColor??g.color:C(g.iconColor,void 0,g.color),i,[.15,.15,.15,1]),_=B?g.frameHaloColor:C(g.iconHaloColor,void 0,g.haloColor),w=ke(_??(B?g.iconColor??g.color:g.haloColor),i,[1,1,1,1]);B&&g.frameHaloColor===void 0&&(w[3]*=.35),B&&(v[3]*=W(g.frameOpacity,i,1));let x=W(B?g.frameHaloWidth??1.1:C(g.iconHaloWidth,void 0,g.haloWidth),i,1.2),E=W(b.layer.layout?.textSize,i,13);a.setVec4v("u_color",Fe([v[0],v[1],v[2],v[3]*y])),a.setVec4v("u_halo_color",Fe([w[0],w[1],w[2],w[3]*y])),a.setFloat("u_halo",x/(So*(E/et))),s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new Be(e,new Uint8Array(this.capacityQuads*4*xi),oc,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let i=r*4;o.set([i,i+1,i+2,i,i+2,i+3],r*6);}this.ibo=new de(e,o),this.vao=new he(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Hr(n,e,t,o,r,i,a,s=0,l=1){let c=i/Math.max(a.height,1);if(s){let h=s*Math.PI/180,f=Math.cos(h),u=Math.sin(h),d=t+r/2,m=o+i/2;for(let[p,b]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let g=p-d,y=b-m;n.push(d+g*f-y*u,m+g*u+y*f,c,l);}}else n.push(t,o,c,l,t+r,o,c,l,t+r,o+i,c,l,t,o+i,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 zd(n,e,t,o,r,i,a){if(o+1>=t.length)return;let s=t[o],l=t[o+1],c=[];for(let h=s;h<l;h++){let f=n.worldPxToPoint(r+e[h*2]*a,i+e[h*2+1]*a);if(!f)break;c.push(f);}return c.length>=2?c:void 0}var ac=(n,e)=>n*4096+e;function nc(n,e){let t=Math.floor(e.x1/ct),o=Math.floor(e.y1/ct),r=Math.floor(e.x2/ct),i=Math.floor(e.y2/ct);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=n.get(ac(a,s));if(l){for(let c of l)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function ic(n,e){let t=Math.floor(e.x1/ct),o=Math.floor(e.y1/ct),r=Math.floor(e.x2/ct),i=Math.floor(e.y2/ct);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=ac(a,s),c=n.get(l);c||n.set(l,c=[]),c.push(e);}}function sc(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=W(n.layout?.arrowLength,e,50)*r;return {shift:W(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function lc(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var Jt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new k;}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 Xt=class n{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 n(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 n(e,t,o,this.wrap),new n(e,t+1,o,this.wrap),new n(e,t,o+1,this.wrap),new n(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new n(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function Vd(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new Xt(t,l,s),h=c.bounds(),f=(h.minX+h.maxX)/2,u=(h.minY+h.maxY)/2,d=[[f,u],[h.minX,h.minY],[h.maxX,h.minY],[h.minX,h.maxY],[h.maxX,h.maxY]],m=false;for(let[b,g]of d)if(n.isOnGlobeFront(Le(b),De(g))){m=true;break}if(!m)continue;let p=false;for(let[b,g]of d){let y=n.localToPoint(n.globeLocal(b,g));if(y&&y.x>-a&&y.y>-a&&y.x<n.width+a&&y.y<n.height+a){p=true;break}}if(p&&(i.push(c),i.length>=r))return i}return i}function To(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,s=Math.min(Math.round(n.zoom),t);if(s<o)return [];if(n.globeActive)return Vd(n,e,s);let{min:l,max:c}=n.visibleWrapRange(),h=[],f=[];for(let d=l;d<=c;d++)f.push(new Xt(0,0,0,d));let u=0;for(;f.length&&!(++u>2e4||h.length>=i);){let d=f.pop();if(!n.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&h.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){h.push(d);continue}for(let p of d.children())f.push(p);}return h.sort((d,m)=>n.distanceToTile(d)-n.distanceToTile(m)),h}var Ei=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new k;}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;}},_i=6,Wd=24,kr=class extends tt{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 Jt(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.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 i=this.getTile(r)?.data?.splits?.[t];if(i)for(let a of i)o.includes(a)||o.push(a);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),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=To(t,this.opts),r=new te;for(let c of o)r.add(c.dataKey);for(let[c,h]of this.cache.entries())h.state==="loading"&&!r.has(c)&&(this.pool.abort(h.requestId),this.cache.delete(c));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);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 h=this.cache.peek(c.dataKey);return !!h&&h.state!=="loading"},r=(c,h)=>{let f=h.parent();for(let u=0;f&&u<=_i;u++){if(f.dataKey===c.dataKey)return true;f=f.parent();}return false},i=new k,a=[];for(let c of t)o(c)?i.set(c.dataKey,c):a.push(c);let s=this.descendantsOf(a);for(let c of a){let h=s.get(c.dataKey);if(h&&h.length){for(let m of h)i.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let f=c.parent(),u=null;for(let m=1;f&&m<=_i;m++,f=f.parent()){if(!o(f))continue;let p=f;if(m>1&&t.some(b=>b!==c&&o(b)&&r(p,b)))break;u=p;break}let d=u??c;i.set(d.dataKey,d);}let l=[];for(let[,c]of i){let h=c.parent(),f=false;for(let u=0;h&&u<=_i;u++){if(i.has(h.dataKey)){f=true;break}h=h.parent();}f||(l.push(c),this.cache.get(c.dataKey));}return l}descendantsOf(t){let o=new k;for(let i of t)o.set(i.dataKey,i);let r=new k;if(!o.size)return r;for(let[i,a]of this.cache.entries()){if(a.state==="loading")continue;let s=a.id.parent();for(let l=0;s&&l<Wd;l++){let c=o.get(s.dataKey);if(c){let h=r.get(c.dataKey);h?h.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 te;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let s=0;i&&s<4;s++){if(o.has(i.dataKey)){a=true;break}i=i.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 Ei(t);this.cache.set(t.dataKey,r);let i=Nd(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:i,zoom:t.z,metersPerTile:qi(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 i=0;r&&i<o;i++){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 Nd(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Pr=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;}},Ho=class extends tt{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Jt(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=To(t,this.opts);let o=new te;for(let r of this.visible)o.add(r.dataKey);for(let[r,i]of this.cache.entries())i.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 Pr(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(cc(this.opts.url,t),r.signal).then(i=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){i.close();return}o.image=i,o.state="loaded",this.emit("data",{tile:o});}).catch(i=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=i instanceof Error?i.message:String(i),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 cc(n,e){let t=n.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 Kd="osmgl-assets",jt="assets";var Rr=null;function uc(){return Rr||(Rr=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(Kd,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(jt)||t.createObjectStore(jt,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Rr)}function Ud(n){return uc().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(jt,"readonly").objectStore(jt).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Jd(n){uc().then(e=>{if(e)try{e.transaction(jt,"readwrite").objectStore(jt).put(n);}catch{}});}var fc=n=>{let e=atob(n),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Xd(n,e,t){let o=await crypto.subtle.importKey("raw",fc(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:fc(t),tagLength:128},o,n)}var ko=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 i=await this.resolve(e,o),a=`${i}:${t}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let i,a,s=await Ud(e);if(s)i=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",i=await c.arrayBuffer(),Jd({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;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 Xd(i,l.key,l.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.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 jd=1,Po=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=K();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-${jd++}`,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 fi(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 i=Math.max(o,0);return this.grow=this.shrinkFrom*(1-i*i*(3-2*i)),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])),i=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,i)*t}origin(){let e=re(this.coordinates);return {x:ce(e.lng),y:fe(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/ze(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=Fi(i(-this.rotation));this.rotationTiltX&&(a=ft(Mi(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=ft(Di(i(this.rotationTiltZ)),a));let s=ft(r,a),l=this.matrix;return Ze(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=re(this.coordinates),r=K();for(let a=0;a<16;a++)r[a]=e[a];let i=K();return Me(i,r,this.localMatrix(o.lat)),Qe(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=re(this.coordinates),i=ze(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*i,c=(s[1]/a-o.y)*i,h=s[2]/e.pixelsPerMeter-this.altitude,f=l,u=h,d=c,m=b=>b*Math.PI/180,p=Fi(m(-this.rotation));return this.rotationTiltX&&(p=ft(Mi(m(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=ft(Di(m(this.rotationTiltZ)),p)),[(p[0]*f+p[1]*u+p[2]*d)/t,(p[3]*f+p[4]*u+p[5]*d)/t,(p[6]*f+p[7]*u+p[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,s=re(this.coordinates),l=this.localMatrix(s.lat),c=l[0],h=l[1],f=l[8],u=l[9],d=c*u-h*f;if(Math.abs(d)<1e-30)return false;let m=(i*u-a*f)/d,p=(c*a-h*i)/d,b=1.05,g=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*b,B=(o.max[2]-o.min[2])/2*b;return Math.abs(m-g)<=A&&Math.abs(p-y)<=B}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 i=this.mesh?.animation;if(!i||!i.nodes.has(t))return this.matrixInSpace(e,r);let a=K();for(let f=0;f<16;f++)a[f]=e[f];let s=re(this.coordinates),l=K();Me(l,a,this.localMatrix(s.lat));let c=K();ui(i,t,i.duration>0?o%i.duration:0,c);let h=K();return Me(h,l,c),Qe(r,h)}normalMatrix(){let e=i=>i*Math.PI/180,t=Fi(e(-this.rotation));this.rotationTiltX&&(t=ft(Mi(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=ft(Di(e(this.rotationTiltZ)),t));let o=ft([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let i=0;i<9;i++)r[i]=o[i];return r}};function ft(n,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=n[r]*e[o*3]+n[3+r]*e[o*3+1]+n[6+r]*e[o*3+2];return t}var Mi=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},Fi=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},Di=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Or=class{constructor(){this.hit=new k;this.miss=new te;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(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let s=i.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,h=new Int16Array(a.vertices),f=new Uint32Array(a.indices),u=new Float64Array(a.featureIds),d=h.length/a.vertexCount;for(let m=0;m*3+2<f.length;m++){let p=f[m*3]*d,b=f[m*3+1]*d,g=f[m*3+2]*d;if(!tm(l,c,h[p],h[p+1],h[b],h[b+1],h[g],h[g+1]))continue;let y=u[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="";}},Yd=14,Zd=2e3,Qd=4e3,hc=160,qd=50,$d=4e3,Si=6,zr=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new k;this.loading=0;this.pending=[];this.known=new k;this.underBuilding=new Or;this.underVenue=new Or;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=hc;this.replacedBuildings=new te;this.replacedReal=new te;this.replacedVenues=new te;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 ko(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let l=e.layout??{},c=l.minZoom??Yd,h=l.loadRadius??Zd,f=Math.max(l.keepRadius??Qd,h),u=l.fullBudget===true?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((l.budget??hc)*this.budgetScale*u));this.budget=d,this.addModel=r;let m=l.maskReplaced!==false,p=performance.now();if(o.zoom<c){for(let S of [...this.entries.values()])S.model.retire(),S.model.grow<=0&&this.release(S,i);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let b=o.center,g=l.fullDetail===true?0:this.lodFor(o.zoom,c);this.lod=g;let y="";for(let S of t.visibleTiles)y+=S.dataKey+(t.getTile(S)?.data?"+":"-");let A=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let S=new te;A=0;for(let P of t.visibleTiles){let z=t.getTile(P)?.data?.buckets?.[e.id];if(!z||!El(z))continue;let H=new Int16Array(z.anchors),R=P.bounds(),N=R.maxX-R.minX,O=R.maxY-R.minY;for(let G=0;G<z.props.length;G++){let V=z.props[G],J=vt(V.file,NaN);if(!Number.isFinite(J))continue;let X=String(V.kind??"model"),Q=X==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(S.has(Q))continue;S.add(Q),X==="rule"&&A++;let ee=R.minX+H[G*2]/z.extent*N,q=R.minY+H[G*2+1]/z.extent*O,U=em(ee,q);this.known.set(Q,{id:Q,fileId:J,lng:U.lng,lat:U.lat,mercX:ee,mercY:q,altitude:vt(V.alt,0),scale:vt(V.scale,1),rotation:vt(V.rx,0),tiltX:vt(V.rz,0),tiltZ:vt(V.ry,0),kind:X==="rule"?"rule":"model",target:dc(X==="rule"?V.oid:V.replaces),replaces:m?X==="rule"?Gr(V.oid):String(V.anchor??"replace")==="replace"?Gr(V.replaces_all).length?Gr(V.replaces_all):Gr(V.replaces):[]:[]});}}this.rulesInScan=A;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let B=this.found,C=new te;for(let S of B)S.kind==="model"&&S.target!==null&&C.add(S.target);let v=111320,_=Math.cos(b.lat*Math.PI/180),w=S=>Math.hypot((S.lng-b.lng)*v*_,(S.lat-b.lat)*v);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let x=new te,E=[],F=0,M=0;(this.sortedAt===null||Math.hypot((b.lng-this.sortedAt.lng)*v*_,(b.lat-this.sortedAt.lat)*v)>qd)&&(B.sort((S,P)=>w(S)-w(P)),this.sortedAt={lng:b.lng,lat:b.lat});let L=0;for(let S of B){let P=w(S);if(P>f){F++;continue}if(S.kind==="rule"&&S.target!==null&&C.has(S.target)){let N=this.entries.get(S.id);N&&N.model.retire();continue}let z=this.entries.get(S.id);if(L>=d){M++,z&&z.model.retire();continue}L++,x.add(S.id);let H=()=>{if(!S.replaces.length)return;for(let G of S.replaces){this.replacedBuildings.add(G),this.replacedReal.add(G);for(let V=0;V<10;V++)this.replacedBuildings.add(G*10+V);}let N=this.underBuilding.find(S,a);N!==null&&this.replacedBuildings.add(N);let O=this.underVenue.find(S,s);O!==null&&this.replacedVenues.add(O);},R=z;if(R){H(),R.distance=P,R.leftAt=0,R.model.revive(),g<R.lod&&!R.upgrading&&this.loading<Si&&this.upgrade(R,g,r,i);continue}if(P>h){F++;continue}if(this.loading>=Si){E.push(S),H();continue}H(),this.spawn(S,P,g,r);}for(let S of [...this.entries.values()])if(!x.has(S.placement.id)){if(S.leftAt===0){S.leftAt=p;continue}p-S.leftAt>$d&&S.model.retire();}for(let S of [...this.entries.values()])S.model.growTarget===0&&S.model.grow<=0&&this.release(S,i);if(this.known.size>4e3)for(let[S,P]of [...this.known.entries()])w(P)>f*3&&this.known.delete(S);let I=this.stats;I.found=B.length,I.kept=x.size,I.live=this.entries.size,I.tooFar=F,I.overBudget=M,I.queued=E.length,I.rules=A,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<Si&&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 i=this.makeModel(e.placement,t,true);e.upgrading=i,this.loading++,i.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,i.isLoaded&&(r(e.model),e.model=i,e.lod=t,o(i),this.onReady?.()));});}makeModel(e,t,o){let r=new Po({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,i=false){let a=this.makeModel(e,o,i);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;}},vt=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},Gr=n=>{if(n==null)return [];let e=[];for(let t of String(n).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},dc=n=>{let e=vt(n,NaN);return Number.isFinite(e)?e:null};function em(n,e){let t=n*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function tm(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),h=(n-t)*(s-o)-(a-t)*(e-o),f=l<0||c<0||h<0,u=l>0||c>0||h>0;return !(f&&u)}var om=200,rm={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Ro=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=rm[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??nm),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=re(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ce(t.lng)*o,fe(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=om;if(r.x<-i||r.y<-i||r.x>e.width+i||r.y>e.height+i){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";}},nm='<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 Go=class extends Ro{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 i=document.createElement("div");i.className="osmgl-popup-tip",o.appendChild(i);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 im=[["\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."]],mc=new Map(im);function Ii(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=mc.get(i.toLowerCase());return a?(t=true,i[0]===i[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):i});return !t||!e.filter(i=>mc.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Ti(n,e){let t=[],o=[],r=[],i=[],a=[],s=e.textPlacement==="line",l=[],c=[],h=[];for(let f of n.features()){if(!ve(e.filter,f.properties))continue;let u=f.loadGeometry(),d=lm(f.type,u);if(!d)continue;let m=e.textField?Li(e.textField,f.properties):"",p=m&&e.abbreviate?Ii(m):m,b=e.iconImage?Li(e.iconImage,f.properties):"";if(!(!p&&!b)){if(s){let g=sm(f.type,u);if(!g)continue;h.push({text:p,line:g});continue}t.push(d[0],d[1]),o.push(p),r.push(b),i.push(cm(f.properties)),a.push(e.iconRotate&&Math.round(Number(f.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:f,line:u}of am(h)){c.push(l.length/2);for(let d of u)l.push(d);t.push(Math.round(u[0]),Math.round(u[1])),o.push(f),r.push(""),i.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(i).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function am(n){let e=[],t=new Map,o=new Map,r=(i,a,s)=>`${i}\u241F${a}\u241F${s}`;for(let{text:i,line:a}of n){let s=r(i,a[0],a[1]),l=r(i,a[a.length-2],a[a.length-1]),c=t.get(l),h=o.get(s);if(h!==void 0){let f=e[h];if(f.line.push(...a.slice(2)),o.delete(s),o.set(r(i,f.line[f.line.length-2],f.line[f.line.length-1]),h),c!==void 0&&c!==h){let u=e[c];f.line.push(...u.line.slice(2)),u.line=[],t.delete(l),o.set(r(i,f.line[f.line.length-2],f.line[f.line.length-1]),h);}continue}if(c!==void 0){let f=e[c];f.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(i,f.line[0],f.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function sm(n,e){if(n!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let i=0;for(let a=0;a+3<r.length;a+=2)i+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);i>o&&(o=i,t=r);}return t}function lm(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,s=0,l=0;for(let c of e)for(let h=0;h+3<c.length;h+=2){let f=c[h+2]-c[h],u=c[h+3]-c[h+1],d=f*f+u*u;d>a&&(a=d,s=c[h]+f/2,l=c[h+1]+u/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,i=-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]>i&&(i=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function cm(n){let e=n.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Li(n,e){let t=Array.isArray(n)?n:[n];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 pc(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&ve(e,i.properties))for(let a of i.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function fm(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}async function bc(n,e){let t=performance.now(),o=fm(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(y,A,B,C,v=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:C,parseMs:v},diag:{status:y,bytes:A,layers:B,built:0}});if(!r.ok){if(r.status===404||r.status===204)return i(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${n.url}`)}let a=await r.arrayBuffer(),s=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],s);let l=performance.now(),c=new so(a),h=Object.keys(c.layers),f={},u=[],d={},m=new Set,p=[],g=n.plan.some(y=>y.type==="surface"&&(y.elevation??0)>0)&&n.plan.some(y=>y.type==="line"&&y.ground)?Gn(n.metersPerTile):void 0;for(let y of n.plan){if(!hm(y,n.zoom,n.sourceMaxZoom))continue;let A=c.layers[y.sourceLayer];if(!A)continue;let B=dm(n.zoom,A.extent);try{if(y.splitBy){let v=mm(A,y.splitBy,y.filter);if(!v.length)continue;let _=d[y.splitBy]??(d[y.splitBy]=[]);for(let w of v){_.includes(w)||_.push(w);let x={...y,splitBy:void 0,filter:bm(y.filter,y.splitBy,w)},E=Hi(x,A,B,n.metersPerTile,g,void 0,u);E&&(f[je(y.id,w)]=E);}continue}if(y.network&&y.type==="line"){for(let v of pm(A,y.filter)){let _=Hi(y,A,B,n.metersPerTile,g,v,u);_&&(f[je(y.id,v)]=_,m.add(v));}continue}let C=Hi(y,A,B,n.metersPerTile,g,void 0,u);C&&(f[y.id]=C);}catch(C){p.push(`${y.id}: ${C instanceof Error?C.message:String(C)}`);}}return {type:"loaded",id:n.id,buckets:f,...u.length?{seams:u}:{},...Object.keys(d).length?{splits:d}:{},...m.size?{levels:[...m].sort((y,A)=>y-A)}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:h,built:Object.keys(f).length,...p.length?{failed:p}:{}}}}function um(n){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let i=n[r];typeof i=="number"&&i>o&&(o=i);}return o}}function hm(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function dm(n,e){return n<=6?Math.max(64,e/24):0}function Hi(n,e,t,o,r,i,a){{if(n.type==="fill"){let l=o>0?o/e.extent:0,c=n.cornerRadius&&l>0?{radius:n.cornerRadius/l,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Sa/l}:void 0,h=bn(e,n.filter,t,c,n.clipToTile===true,e.extent);return h?{kind:"fill",...h,extent:e.extent}:null}if(n.type==="surface"){let l=Rn(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...r?{onShapes:c=>On(r,c,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:um(n.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(n.type==="line"){let l=Vn(e,n.filter,t,n.ground?r:void 0,o>0?o/e.extent:0,{level:i});return l?{kind:"line",...l,extent:e.extent}:null}if(n.type==="model"){let l=pc(e,n.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(n.type==="symbol"){let l=Ti(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let s=dn(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments},a);return s?{kind:"fill-extrusion",vertices:s.vertices,indices:s.indices,featureIds:s.featureIds,vertexCount:s.vertexCount,indexCount:s.indexCount,extent:s.extent}:null}}function mm(n,e,t){let o=[];for(let r of n.features()){if(!ve(t,r.properties))continue;let i=r.properties[e];typeof i!="string"&&typeof i!="number"||o.includes(i)||o.push(i);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}function pm(n,e){let t=[];for(let o of n.features()){if(!ve(e,o.properties))continue;let r=Bt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function bm(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var ki='"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 $(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,X,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),X=ge-Ee,b=ge-X,Q[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Q[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Q[2]=te-(be-b)+(X-b),Q[3]=be;let Te=$(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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-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 $e{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 $e(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)&>(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)&>(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)&>(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&>(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,$r,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xr,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 Xe(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Xe(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 $r(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xr(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 $=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($,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*$+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=ji(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.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,$,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,$,v),$e=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,$,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,$,v);e.indices.push(Me,Ne,Ge,Me,$e,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($=>Ce($,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=$=>({ring:$,cut:new Array(Math.max($.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map($=>r.whole?I($):Fn($,i)),L={outer:A.ring,holes:k.map($=>$.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce(($,O)=>$+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 $=An(Ai(L.outer,o),N,T.shape);Y=Bi($,L.outer);let O=Li($,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti($,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let $=0;$<L.holes.length;$++)Rn(e,L.holes[$],c,u,f,m,g,o,null,k[$].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}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 ji(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f)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 Xi=wr(Un(),1),Dn=Xi,$t=Dn.union??Dn.default?.union??null;$t||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(!$t)throw new Error("\\u043D\\u0435\\u0442 union");h=$t(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,Yi=64,Wn=0,Zi=1,zn=2,Wi=3,St=1,Qi=.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??Qi,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){$n(O.outer,P);for(let G of O.holes)$n(G,P)}r.onShapes?.(k);let L=Ki(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:Xn(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:Xn(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&&Xt(x,Q,D.outer,le,K,Zi,t,V),K!==Z&&Xt(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&Xt(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Wi);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 $=new Uint32Array(j+U.length);return $.set(x.indices,0),$.set(U,j),{vertices:g.slice(0,x.offset),indices:$.buffer,vertexCount:x.count,indexCount:$.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ki(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=Ji(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 Ji(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 $n(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 Xn(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,qi(Math.round(r*Yi)),!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 Xt(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),$=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)&&($=g,O=x),o.push($,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,qi=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,$,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,$,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?io(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 $=n>0?to(Kn(Y),n):Kn(Y);if($.length<4)continue;let O=r&&!Vn(r)?On(r,$):null,G=O?O.pts:$,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=eo(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&&ro(q,he,me,ce,e.extent)){le+=fe;continue}let ae=no(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,$e=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,$e),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,$e);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 eo(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 to(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 no(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 ro(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 io(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 oo=[["\\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(oo);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=lo(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=uo(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(co(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of so(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 so(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 uo(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 lo(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 co(e){let t=e.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,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 fo="\\u241F",Jt=(e,t)=>e+fo+String(t);function ao(){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=ao(),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(!po(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=mo(e.zoom,k.extent);try{if(A.splitBy){let U=xo(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:yo(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 go(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 ho(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 po(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function mo(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:ho(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 xo(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 go(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 yo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var bo=e=>e.kind==="symbol",wo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(wo(n)){t.push(n.anchors);continue}if(bo(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 gm=2,Vr=class{constructor(e=Pi()){this.workers=[];this.blobUrl=null;this.pending=new k;this.queue=new k;this.busy=[];this.nextId=1;this.mainThreadAborts=new k;this.destroyed=false;try{let t=new Blob([ki],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=i=>this.onMessage(i.data),r.onerror=i=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",i.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++,i={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),bc(i,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:i,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]>=gm||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,i]of this.queue.entries())o&&i.priority>=o.priority||(t=r,o=i);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 Pi(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function gc(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Ri(n,e){let t=gc(n.zoom),o=[Math.round(n.zoom*100)/100,n.center.lat.toFixed(t),n.center.lng.toFixed(t)],r=Math.round(n.bearing*10)/10,i=Math.round(n.pitch*10)/10;(r!==0||i!==0)&&(o.push(r),i!==0&&o.push(i));let a=o.join("/");return e?`${e}=${a}`:a}function Gi(n,e){let t=n.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]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let s={center:{lng:a,lat:i},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 yc(n){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=n,window.history.replaceState(window.history.state,"",e.toString());}var Ac={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}},zo=n=>Ac[n]??Ac.high;function Bc(n){let e=n.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 Nr(n){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:i}=n;if(i==="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 i==="weak"?Wi(a)??a:i==="strong"&&!o?Cc(a)??a:a}function Kr(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let n=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=n.userAgentData?.mobile===true||e;return {cores:n.hardwareConcurrency||4,memory:n.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1,gpu:ym()}}function ym(){if(typeof document>"u")return "unknown";let n=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,n=e.getContext("webgl2")??e.getContext("webgl"),!n)return "software";let t=n.getExtension("WEBGL_debug_renderer_info"),o=t?n.getParameter(t.UNMASKED_RENDERER_WEBGL):n.getParameter(n.RENDERER);return typeof o=="string"?Bc(o):"unknown"}catch{return "unknown"}finally{n?.getExtension("WEBGL_lose_context")?.loseContext();}}function Vi(n,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),i=Math.max(n*e,1),a=Math.sqrt(o.maxCanvasPixels/i);return Math.max(Math.min(r,a),1)}function Wr(n){return n==="high"?3:n==="balanced"?2:n==="low"?1:0}function Cc(n){return n==="minimal"?"low":n==="low"?"balanced":n==="balanced"?"high":null}function Wi(n){return n==="high"?"balanced":n==="balanced"?"low":n==="low"?"minimal":null}var Oi=120,Am=40,Bm=.35,Cm=.02,vm=150,wm=30,xm=1,_m=1800,zi=30,Em=1.25,Oo=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Oi);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(zi);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)%Oi,this.filled<Oi&&this.filled++,this.steady++,this.steady===_m&&(this.attempts[this.current]=0),this.filled<Am)return null;let i=this.sum/this.filled;return i>=Bm?this.down(i):i>Cm?null:this.up(i)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%zi,this.recentFilled<zi&&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*Em)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=Wi(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=xm&&Wr(t)<Wr(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=Cc(this.current);if(!t||Wr(t)>Wr(this.ceiling))return null;let o=vm*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=wm;}};var Mm=1,Vo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Mm++}`,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,i=-1/0;for(let a of e)for(let s of a){let l=re(s),c=ce(l.lng),h=fe(l.lat);c<t&&(t=c),c>r&&(r=c),h<o&&(o=h),h>i&&(i=h);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+i)/2;}toLocal(e){let t=[];for(let o of e){let r=re(o);t.push(ce(r.lng)-this.originX,fe(r.lat)-this.originY);}return t}color(e,t){let o=pe(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}},Ki=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=Bo([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 i=this.colorRuns();if(!i.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 i){let l=Bo([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=pe(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,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=Ji(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(vc(e,i[a],i[a+1])<=r)return true;return false}},Ur=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=si(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(Ni(a))),i=Bo(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Ji(Ni(this.coordinates[0]??[]),this.altitude,t);if(!Xi(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Xi(e,Ji(Ni(this.coordinates[r]),this.altitude,t)))return false;return true}},Ui=class extends Ur{constructor(e){super({...e,coordinates:[Fm(e.center,e.radius,e.segments)]});}};function Fm(n,e,t){let o=re(n),r=e/ze(o.lat),i=ce(o.lng),a=fe(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let h=c/s*Math.PI*2;l.push([Le(i+Math.cos(h)*r),De(a+Math.sin(h)*r)]);}return l}function Ji(n,e,t){let o=[];for(let r of n){let i=re(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Ni(n){if(n.length<2)return n;let e=re(n[0]),t=re(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function vc(n,e,t){let o=t.x-e.x,r=t.y-e.y,i=o*o+r*r;if(i<1e-12)return Math.hypot(n.x-e.x,n.y-e.y);let a=((n.x-e.x)*o+(n.y-e.y)*r)/i;return a=a<0?0:a>1?1:a,Math.hypot(n.x-(e.x+a*o),n.y-(e.y+a*r))}function Xi(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,s=e[r].x,l=e[r].y;a>n.y!=l>n.y&&n.x<(s-i)*(n.y-a)/(l-a)+i&&(t=!t);}return t}var wc="objects3d",Yt="level",Dm=32,Sm=100,Im=250;function xc(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:{top:n?.top??0,right:n?.right??0,bottom:n?.bottom??0,left:n?.left??0}}function Lm(n){let e={...n};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 ji=class extends tt{constructor(t){super();this.options=t;this.transform=new qt;this.ctx=null;this.sources=new k;this.rasterSources=new k;this.renderer=new Mo;this.objects=new vo;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 k;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?Nr(Kr()):t.quality;this.governor=new Oo(r,r,Dm,Sm),this.quality=zo(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Pt(t.theme?Cr(t.theme,t.style):t.style),this.background=t.background?pe(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 i=document.createElement("div");i.className="osmgl-markers",i.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(i),this.markerHost=i,this.objects.setMarkerHost(i);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=re(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 Vr(t.workerCount??Math.min(Pi(),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 i=1/0;for(let a=1;a<t.length;a++)i=Math.min(i,t[a]-t[a-1]);this.governor.setRefresh(i);};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 Uo(t);let o=new Ut(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...Ct,...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(Z,{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 zr({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:wc,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??Z)===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),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(Lm):i}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 i=this.venuesForMask();t.update({id:wc,"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(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.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($e(a,c.x,c.y,s));}}else for(let s of t.models)s.setHidden(false);}buildingsForMask(){let t=this.sources.get(Z);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??Z)!==Z)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===Yt&&t.add(o.source??Z);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??Z;if(!t.has(r))continue;let i=this.sources.get(r),a=this._style.bucketKeyFor(o);if(i&&a!==null)return {source:i,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 i=new Ho({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,i),this.triggerRepaint(),this}let r=new kr(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===Z?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>this.emit("error",{message:i})),t===Z&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new er(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 i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.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),h=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(h),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:h,symbol:this.querySymbol(s,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;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=Vi(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=re(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=re(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,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},s={center:t.center!==void 0?re(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+xt((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,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?re(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+xt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=ot(r.zoom),l=(ce(a.center.lng)-ce(r.center.lng))*s,c=(fe(a.center.lat)-fe(r.center.lat))*s,h=Math.hypot(l,c),f=Math.max(o.width,o.height),u=f*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,p,b=null;if(h<1e-6){let y=Math.log(u/f);p=Math.abs(y)/d,b=A=>({u:0,w:f*Math.exp(d*Math.sign(y)*A)});}else {let y=w=>{let x=w===0?f:u,E=w===0?u:f;return (E*E-x*x+(w===0?1:-1)*m*m*h*h)/(2*x*m*h)},A=w=>Math.log(-y(w)+Math.sqrt(y(w)*y(w)+1)),B=A(0);p=(A(1)-B)/d;let v=w=>(Math.exp(w)+Math.exp(-w))/2,_=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);b=w=>{let x=d*w+B;return {u:f*v(B)*_(x)/m-f*Math.sinh(B)/m,w:f*v(B)/v(x)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:p,u1:h,curve:b,w0:f}},this.triggerRepaint(),this}setPadding(t){return this.padding=xc(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Zt;for(let[r,i]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:i}));return o}cameraForBounds(t,o={}){let r=this.transform,i=Xr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?xc(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return i?{...i,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let i={...r,duration:o.duration??600};return o.fly?this.flyTo(i):this.easeTo(i)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=Ee((t-o.start)/o.duration,0,1),i=o.fly?r:Ko(r),a=this.transform,s=re(o.from.center),l=re(o.to.center);if(o.fly){let{u:c,w:h}=o.fly.curve(o.fly.S*r),f=o.fly.u1>1e-6?Ee(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/h),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Ko(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Ko(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)*i,lat:s.lat+(l.lat-s.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,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(re(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Pt(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(i)),l=JSON.stringify(r.workerPlan(i));s!==l&&a.setPlan(this.planFor(i,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(Cr(t,this.options.style))}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 i=this._style.layers.find(s=>s.id===t);if(!i)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=i.layout??(i.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 i=this._style.layers.find(a=>a.id===t);return i?(i.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:Le(r.mercX),lat:De(r.mercY)},key:Ut.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 i=this.sources.get(r.source??Z);if(!i)continue;let a=ri(this.transform,i,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 k,i;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),i??(i=this.sources.get(s.source??Z)));}if(!i||!o.length)return null;let a=ni(this.transform,i,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=Ri({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,yc("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=Gi(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"?Nr(Kr()):t;return this.governor.reset(o,o),this.applyQuality(zo(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,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)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(i=>i.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(zo(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(i=>i.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=pe(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??Z)===o&&"splitBy"in i&&i.splitBy===Yt))for(let i of r.splitValues(Yt)){let a=Number(i);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Yt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Yt]:this._style.splitValues[Yt]=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(i=>i>=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 Go)}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(),i=t==="globe"?Math.min(o.maxPitch,Qt):o.maxPitch,a=o.zoom<r,s=o.pitch>i;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?i: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,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,h=!!s.getExtension("EXT_float_blend"),f=h?s.RGBA32F:s.RGBA16F,u=h?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(),p=s.createRenderbuffer();if(!d||!m||!p)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,f,l,c,0,s.RGBA,u,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,p),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,p);let b=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),b!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:d,rb:p,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return s.readPixels(t,o,r,i,s.RGBA,s.FLOAT,d),{data:d,format:h?"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),i=this.ctx;i.bindFramebuffer(null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.setDepthMask(true),i.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);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,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,h=c>0&&c<Im,f=h?c:0;this.continuousFrames=h?this.continuousFrames+1:0;let u=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(u),this.emit("render",{frameMs:s,intervalMs:f}),l&&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();}}},rB=ji;
|
|
2338
|
+
exports.AssetLoader=ko;exports.BASE_SOURCE=Z;exports.BUILDING_HEIGHT_SCALE=Dt;exports.BUILDING_POS_SCALE=Ft;exports.BUILDING_VERTEX_STRIDE=Te;exports.CITY_STYLE=Ch;exports.Circle=Ui;exports.DEFAULT_ICONS=Ct;exports.DEFAULT_LIGHT=Kn;exports.DEFAULT_SHADOWS=jl;exports.DEFAULT_SKY=Nn;exports.DEFAULT_STYLE=Un;exports.DepthTarget=bo;exports.EARTH_CIRCUMFERENCE=Jo;exports.FILL_VERTEX_STRIDE=rt;exports.GLOBE_MAX_PITCH=Qt;exports.GLOBE_ZOOM_MAX=dt;exports.GLOBE_ZOOM_MIN=Zo;exports.GLYPH_BORDER=xe;exports.GLYPH_SIZE=et;exports.GROUND_SCALE=Ru;exports.GeomType=lo;exports.GlyphSource=Do;exports.GroundArrows=yo;exports.IconSource=Io;exports.IndoorMask=Ao;exports.LEVEL_LIMIT=Ou;exports.LINE_VERTEX_STRIDE=at;exports.LayerRenderer=Mo;exports.LngLatBounds=Zt;exports.MAX_LATITUDE=Qi;exports.MODEL_VERTEX_STRIDE=Fr;exports.Map=ji;exports.MapObject=Vo;exports.Marker=Ro;exports.Model=Po;exports.ModelLayer=lt;exports.ObjectManager=vo;exports.Polygon=Ur;exports.Polyline=Ki;exports.Popup=Go;exports.QualityGovernor=Oo;exports.RELIEF_STYLE=Bh;exports.RUNTIME_FILL_STRIDE=ai;exports.RUNTIME_LINE_STRIDE=Gt;exports.RasterSource=Ho;exports.RasterTile=Pr;exports.SDF_EDGE=gi;exports.SDF_PX=So;exports.SOFT_STYLE=Ah;exports.SPLIT_SEP=Ys;exports.SURFACE_CUT_BLEED=mo;exports.SURFACE_LEVEL_SCALE=hs;exports.SURFACE_VERTEX_STRIDE=Tt;exports.SdfAtlas=Fo;exports.Style=Pt;exports.SymbolRenderer=Ut;exports.THEMES=Ye;exports.TILE_SIZE=ht;exports.TileID=Xt;exports.Transform=qt;exports.VectorTile=so;exports.VectorTileFeature=sr;exports.VectorTileLayer=lr;exports.abbreviateStreet=Ii;exports.addGround=On;exports.altitudeFromMercatorZ=zm;exports.applyTheme=Br;exports.arrowLabelOffset=sc;exports.arrowVertices=Th;exports.buildRuntimeFill=si;exports.buildRuntimeLine=Bo;exports.cameraForBounds=Xr;exports.circumferenceAtLatitude=ze;exports.clampLat=Xo;exports.clampPixelRatio=Vi;exports.classifyRenderer=Bc;exports.clipLineToRect=Bi;exports.coordinateDigits=gc;exports.coveringTiles=To;exports.createGround=Gn;exports.default=rB;exports.deviceHints=Kr;exports.distToSegment=vc;exports.evaluateColor=ke;exports.evaluateNumber=W;exports.extractFeature=_r;exports.featureLevel=Bt;exports.fillFootprint=qn;exports.fogPlanes=Rt;exports.footprintOf=$n;exports.formatHash=Ri;exports.generateBuildings=dn;exports.generateFill=bn;exports.generateLine=Vn;exports.generateSurface=Rn;exports.generateSymbols=Ti;exports.globeBasis=qr;exports.globeFlatMix=qo;exports.globeRadius=Qo;exports.globeToLocal=ia;exports.groundAt=gr;exports.iconRotation=lc;exports.insideFootprint=$e;exports.latFromMercatorY=De;exports.lngFromMercatorX=Le;exports.lngLatToUnit=$o;exports.matchesFilter=ve;exports.mercatorMetersPerTile=jo;exports.mercatorX=ce;exports.mercatorY=fe;exports.mercatorZFromAltitude=Jr;exports.metersPerPixel=Wm;exports.metersPerTile=qi;exports.nextQualityDown=Wi;exports.parseGlb=td;exports.parseGlbAsync=fi;exports.parseGlyphs=Zl;exports.parseHash=Gi;exports.patchUV=Sl;exports.pickBuilding=ri;exports.pickFill=ni;exports.pitchIntent=ha;exports.pixelsPerMeter=Vm;exports.placeAlongLine=vi;exports.pointInRing=Xi;exports.qualityFor=Nr;exports.qualityProfile=zo;exports.raySphere=$r;exports.resolveTemplate=Li;exports.roundRing=Je;exports.sdfFromAlpha=yi;exports.shapeText=Ai;exports.splitBucketKey=je;exports.splitByGround=zn;exports.splitPolygons=gt;exports.stitchPieces=Wn;exports.styleWithTheme=Cr;exports.tileOriginMeters=$i;exports.tileUrl=cc;exports.toLngLat=re;exports.unitToLngLat=Qr;exports.worldSize=ot;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});//# sourceMappingURL=osmgl.global.js.map
|
|
2339
2339
|
//# sourceMappingURL=osmgl.global.js.map
|