!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mapgl=t():e.mapgl=t()}(self,(function(){return(()=>{"use strict";var e={4335:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl-hover {\n    cursor: pointer;\n}\n\n.mapgl-dragging {\n    cursor: grabbing;\n}\n\n.mapgl-rotating {\n    cursor: move;\n}\n",""]);const a=r},3103:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_lxLX8k02JhUZQLnJt5Mm {\n    font-family: Helvetica, Arial, sans-serif !important;\n    font-size: 8px !important;\n    line-height: 8px !important;\n    text-align: right !important;\n    display: flex;\n    align-items: flex-start;\n    color: #6d7173 !important;\n}\n\n.mapgl_AsSWrna6OS9VEoYItIZV {\n    display: block;\n}\n\na.mapgl_N4E6A6Wp5fYeXBf2QGWt {\n    color: #6d7173 !important;\n    text-decoration: none !important;\n}\n\na.mapgl_N4E6A6Wp5fYeXBf2QGWt:hover {\n    color: #929292 !important;\n}\n",""]),r.locals={container:"mapgl_lxLX8k02JhUZQLnJt5Mm",text:"mapgl_AsSWrna6OS9VEoYItIZV",link:"mapgl_N4E6A6Wp5fYeXBf2QGWt"};const a=r},3274:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_SqprqBDt0m3ck8ImwnZ0 {\n    position: absolute;\n    pointer-events: none;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n}\n\n.mapgl_zXpm2Oitx3qOyLXwyVKj {\n    position: absolute;\n    display: flex;\n    z-index: 50;\n    pointer-events: none;\n    width: 100%;\n    height: 100%;\n}\n\n.mapgl_zXpm2Oitx3qOyLXwyVKj > div > * {\n    pointer-events: auto;\n}\n\n.mapgl_r_oD6okoyw2O0sKMERju {\n    flex-direction: column;\n    align-items: flex-start;\n}\n\n.mapgl_FmkgHxvqVart7hWj1dIm {\n    flex-direction: row;\n    justify-content: center;\n    align-items: flex-start;\n}\n\n.mapgl_OS0i93oEEcYSyKRHurat {\n    flex-direction: column;\n    align-items: flex-end;\n}\n\n.mapgl_BIfihGR7X9awnUFk62BQ {\n    flex-direction: column;\n    justify-content: center;\n    align-items: flex-start;\n}\n\n.mapgl_vpFke4npOo1b8whqwKPv {\n    flex-direction: column;\n    justify-content: center;\n    align-items: flex-end;\n}\n\n.mapgl_gLybMsoqNs2Phzvi6hS5 {\n    flex-direction: column-reverse;\n    align-items: flex-start;\n}\n\n.mapgl_GbiZTwfDOnlyI6flVbL_ {\n    flex-direction: row;\n    justify-content: center;\n    align-items: flex-end;\n}\n\n.mapgl_YoIqRTD9ccmcm_A81adk {\n    flex-direction: column-reverse;\n    align-items: flex-end;\n}\n\n.mapgl_r_oD6okoyw2O0sKMERju > div + div,\n.mapgl_OS0i93oEEcYSyKRHurat > div + div,\n.mapgl_BIfihGR7X9awnUFk62BQ > div + div,\n.mapgl_vpFke4npOo1b8whqwKPv > div + div {\n    margin-top: 10px;\n}\n\n.mapgl_gLybMsoqNs2Phzvi6hS5 > div + div,\n.mapgl_YoIqRTD9ccmcm_A81adk > div + div {\n    margin-bottom: 10px;\n}\n\n.mapgl_FmkgHxvqVart7hWj1dIm > div + div,\n.mapgl_GbiZTwfDOnlyI6flVbL_ > div + div {\n    margin-left: 10px;\n}\n",""]),r.locals={controlPane:"mapgl_SqprqBDt0m3ck8ImwnZ0",container:"mapgl_zXpm2Oitx3qOyLXwyVKj",topLeft:"mapgl_r_oD6okoyw2O0sKMERju",topCenter:"mapgl_FmkgHxvqVart7hWj1dIm",topRight:"mapgl_OS0i93oEEcYSyKRHurat",centerLeft:"mapgl_BIfihGR7X9awnUFk62BQ",centerRight:"mapgl_vpFke4npOo1b8whqwKPv",bottomLeft:"mapgl_gLybMsoqNs2Phzvi6hS5",bottomCenter:"mapgl_GbiZTwfDOnlyI6flVbL_",bottomRight:"mapgl_YoIqRTD9ccmcm_A81adk"};const a=r},4306:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_T5RQQ2NOfnY3_e00os8n {\n    font-family: Helvetica, Arial, sans-serif !important;\n    font-size: 8px !important;\n    line-height: 8px !important;\n    text-align: right !important;\n    display: flex;\n    flex-direction: column;\n    align-items: flex-end;\n    color: #6d7173 !important;\n}\n\n.mapgl_h7bp68SOWSVBX9Orf9BN {\n    display: flex;\n    flex-direction: column;\n    padding-right: 4px;\n}\n\n.mapgl_fMmrF9RliMxNiObbmFUm {\n    display: flex;\n    flex-direction: row;\n}\n\n.mapgl_mIYahvUhOA0HDmHGtdtA {\n    animation: mapgl_mIUQLFgaHsaFSSZFHkpH 5s forwards;\n}\n\na.mapgl_rs_xxgfm2WZu987bybgD {\n    color: #6d7173 !important;\n    text-decoration: none !important;\n}\n\na.mapgl_rs_xxgfm2WZu987bybgD:hover {\n    color: #929292 !important;\n}\n@keyframes mapgl_mIUQLFgaHsaFSSZFHkpH {\n    85% {\n        opacity: 1;\n    }\n    100% {\n        opacity: 0;\n    }\n}\n",""]),r.locals={container:"mapgl_T5RQQ2NOfnY3_e00os8n",text:"mapgl_h7bp68SOWSVBX9Orf9BN",copyrights:"mapgl_fMmrF9RliMxNiObbmFUm",autoHide:"mapgl_mIYahvUhOA0HDmHGtdtA",hideAnimation:"mapgl_mIUQLFgaHsaFSSZFHkpH",link:"mapgl_rs_xxgfm2WZu987bybgD"};const a=r},1704:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_ByGR_EaTxrFwgYplL9Rn {\n    position: relative;\n}\n\n.mapgl_rV7SBEVklXHee7q0ro4A {\n    display: flex;\n    max-height: 40vh;\n    background: #ffffff;\n    width: 32px;\n    overflow: hidden;\n    border-radius: 4px;\n    box-shadow: 0 1px 3px 0 rgba(38, 38, 38, 0.5);\n}\n\n.mapgl_eTkkBoRhhRCs7jEwQ2Wb {\n    width: 100%;\n    overflow-x: hidden;\n    overflow-y: auto;\n    -moz-padding-end: 17px;\n    -webkit-padding-end: 17px;\n    -webkit-margin-end: -17px;\n}\n\n.mapgl_gnVYSnZbzDyDuJqZz3mJ {\n    display: flex;\n    flex-direction: column-reverse;\n}\n\n.mapgl_zsd_0yR5qXs0D4rXioaV {\n    padding: 0;\n\n    border: none;\n    background: #ffffff;\n    height: 32px;\n    width: 32px;\n    color: #262626;\n    cursor: pointer;\n    border-bottom: 1px solid #e6e6e6;\n    box-sizing: border-box;\n    flex-shrink: 0;\n}\n.mapgl_zsd_0yR5qXs0D4rXioaV:focus {\n    outline: 0;\n}\n.mapgl_zsd_0yR5qXs0D4rXioaV:first-child {\n    border-bottom: none;\n}\n.mapgl_zsd_0yR5qXs0D4rXioaV:hover {\n    color: rgba(38, 38, 38, 0.7);\n}\n.mapgl_zsd_0yR5qXs0D4rXioaV:active {\n    color: #028eff;\n}\n.mapgl_zsd_0yR5qXs0D4rXioaV:disabled {\n    background: #f2f2f2;\n    color: #929292;\n    cursor: default;\n}\n\n.mapgl_IpWyhNkbWQBqP479eDE2 {\n    font-size: 18px;\n    line-height: 32px;\n    font-weight: 400;\n    overflow-wrap: break-word;\n\n    position: relative;\n    text-align: center;\n    height: 100%;\n}\n\n.mapgl_yUGrJifDT7VmwlUOKi8_:after {\n    content: '';\n    position: absolute;\n    top: 4px;\n    bottom: 4px;\n    width: 4px;\n    height: 4px;\n    border-radius: 50%;\n    background: #028eff;\n}\n",""]),r.locals={root:"mapgl_ByGR_EaTxrFwgYplL9Rn",container:"mapgl_rV7SBEVklXHee7q0ro4A",scroller:"mapgl_eTkkBoRhhRCs7jEwQ2Wb",content:"mapgl_gnVYSnZbzDyDuJqZz3mJ",control:"mapgl_zsd_0yR5qXs0D4rXioaV",label:"mapgl_IpWyhNkbWQBqP479eDE2",_hasResult:"mapgl_yUGrJifDT7VmwlUOKi8_"};const a=r},6032:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_y5CSWkmzFZelEK3XsNPI {\n    background: rgba(255, 255, 255, 0.68);\n    border-width: 0 1px 1px 1px;\n    border-color: #7a7a7a;\n    border-style: solid;\n    border-radius: 0;\n    min-width: 64px;\n    height: 16px;\n    overflow: hidden;\n    pointer-events: none !important;\n}\n\n.mapgl_jEDrEoj7PBYIc0hBFCRq {\n    min-width: 50px;\n    height: 12px;\n    margin-top: 2px;\n    margin-left: 6px;\n    font-family: Helvetica, Arial, sans-serif !important;\n    font-style: normal;\n    font-weight: 400;\n    font-size: 9px;\n    line-height: 12px;\n\n    color: #262626;\n}\n",""]),r.locals={root:"mapgl_y5CSWkmzFZelEK3XsNPI",label:"mapgl_jEDrEoj7PBYIc0hBFCRq"};const a=r},4928:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_XiKtyzV1PZ9N9z7NbBH0 {\n    background: #fff;\n    box-shadow: 0 1px 3px 0 rgba(38, 38, 38, 0.5);\n    border-radius: 4px;\n    width: 32px;\n    overflow: hidden;\n}\n\n.mapgl_TCECw1gCo4pPgxN8WlHv {\n    padding: 0;\n    outline: 0;\n    border: none;\n    cursor: pointer;\n    box-sizing: border-box;\n    font-size: 18px;\n    font-weight: 400;\n    width: 32px;\n    height: 32px;\n    color: #262626;\n    background: #fff;\n}\n\n.mapgl_aifLu_eH4oBoq5TCFEl1:hover {\n    opacity: 0.7;\n}\n\n.mapgl_AZeLf0JO9BdLfzixjszM {\n    background: #299400;\n    color: #fff;\n}\n.mapgl_g9fon0BTtGdnOX4Ce0gE {\n    background: #ffb81c;\n    color: #fff;\n}\n.mapgl_GDc542cVDcz8I8tKJtvz {\n    background: #fe5000;\n    color: #fff;\n}\n\n.mapgl_AZeLf0JO9BdLfzixjszM:hover,\n.mapgl_g9fon0BTtGdnOX4Ce0gE:hover,\n.mapgl_GDc542cVDcz8I8tKJtvz:hover {\n    color: rgba(38, 38, 38, 0.7);\n}\n",""]),r.locals={root:"mapgl_XiKtyzV1PZ9N9z7NbBH0",button:"mapgl_TCECw1gCo4pPgxN8WlHv",none:"mapgl_aifLu_eH4oBoq5TCFEl1",easy:"mapgl_AZeLf0JO9BdLfzixjszM",medium:"mapgl_g9fon0BTtGdnOX4Ce0gE",hard:"mapgl_GDc542cVDcz8I8tKJtvz"};const a=r},8585:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_RyvsmCnoVe7ui2MClLMS {\n    width: 32px;\n    box-shadow: 0 1px 3px 0 rgba(38, 38, 38, 0.5);\n    border-radius: 4px;\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n    background: #fff;\n}\n\n.mapgl_Tdw0Vs7iQuaknNHHD21k {\n    padding: 0;\n    outline: 0;\n    border: none;\n    cursor: pointer;\n\n    background: #fff;\n    width: 32px;\n    height: 32px;\n    color: #262626;\n    box-sizing: border-box;\n}\n\n.mapgl_Tdw0Vs7iQuaknNHHD21k:hover {\n    opacity: 0.7;\n}\n\n.mapgl_Tdw0Vs7iQuaknNHHD21k:active {\n    color: #028eff;\n}\n\n.mapgl_Tdw0Vs7iQuaknNHHD21k:disabled {\n    background: #f2f2f2;\n    color: #929292;\n    cursor: default;\n}\n\n.mapgl_JwF7YmgOItTjpjwxORCk {\n    border-bottom: 1px solid #e6e6e6;\n}\n\n.mapgl_Tvr6BDuVyr8143cFJ4nJ {\n    border-bottom: none;\n}\n",""]),r.locals={root:"mapgl_RyvsmCnoVe7ui2MClLMS",button:"mapgl_Tdw0Vs7iQuaknNHHD21k",zoomIn:"mapgl_JwF7YmgOItTjpjwxORCk",zoomOut:"mapgl_Tvr6BDuVyr8143cFJ4nJ"};const a=r},438:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),s=i(5368),r=i.n(s)()(o());r.push([e.id,".mapgl_Zqe1f2Ik8_MdehkwZiwo {\n    pointer-events: none;\n    position: absolute;\n    top: 0px;\n    left: 0px;\n    width: 100%;\n    height: 100%;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: default;\n}\n\n.mapgl_RBLYLi7mJFgKIKMPLvv_ {\n    text-align: center;\n    font-size: 24px;\n    font-family: Helvetica, Arial, sans-serif;\n    font-weight: bold;\n    color: white;\n}\n",""]),r.locals={wrap:"mapgl_Zqe1f2Ik8_MdehkwZiwo",container:"mapgl_RBLYLi7mJFgKIKMPLvv_"};const a=r},3379:e=>{var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var s={},r=[],a=0;a<e.length;a++){var l=e[a],c=n.base?l[0]+n.base:l[0],d=s[c]||0,h="".concat(c," ").concat(d);s[c]=d+1;var u=i(h),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var f=o(m,n);n.byIndex=a,t.splice(a,0,{identifier:h,updater:f,references:1})}r.push(h)}return r}function o(e,t){var i=t.domAPI(t);i.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;i.update(e=t)}else i.remove()}}e.exports=function(e,o){var s=n(e=e||[],o=o||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=i(s[r]);t[a].references--}for(var l=n(e,o),c=0;c<s.length;c++){var d=i(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}},569:e=>{var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},9216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:(e,t,i)=>{e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},7795:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(i){!function(e,t,i){var n="";i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,o&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}");var s=i.sourceMap;s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,i)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},9958:(e,t,i)=>{i.d(t,{Z:()=>o});class n{constructor(e,t){this._initData=e,this.byteLength=void 0!==e.byteLength?e.byteLength:e,this.type=n.ArrayBuffer,this.drawType=n.StaticDraw,this.options=Object.assign({},n.defaultOptions,t),this._glBuffer=null,this._glContext=null}bind(e,t,i){return this._glBuffer||this.prepare(e),this.type===n.ArrayBuffer?(e.bindBuffer(e.ARRAY_BUFFER,this._glBuffer),i=i||this.options,e.vertexAttribPointer(t,i.itemSize,this._toGlParam(e,i.dataType),i.normalized,i.stride,i.offset)):this.type===n.ElementArrayBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._glBuffer),this}remove(){return this._unprepare(),this}subData(e,t,i){return e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferSubData(this._toGlParam(e,this.type),t,i),this}prepare(e){return this._glContext=e,this._glBuffer=e.createBuffer(),e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferData(this._toGlParam(e,this.type),this._initData,this._toGlParam(e,this.drawType)),this._initData=null,this}_unprepare(){this._glBuffer&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(e,t){return t===n.ArrayBuffer?e.ARRAY_BUFFER:t===n.ElementArrayBuffer?e.ELEMENT_ARRAY_BUFFER:t===n.StaticDraw?e.STATIC_DRAW:t===n.DynamicDraw?e.DYNAMIC_DRAW:t===n.Byte?e.BYTE:t===n.Short?e.SHORT:t===n.Int?e.INT:t===n.Float?e.FLOAT:t===n.UnsignedByte?e.UNSIGNED_BYTE:t===n.UnsignedShort?e.UNSIGNED_SHORT:t===n.UnsignedInt?e.UNSIGNED_INT:null}}n.ArrayBuffer=1,n.ElementArrayBuffer=2,n.StaticDraw=10,n.DynamicDraw=11,n.Float=20,n.UnsignedByte=21,n.UnsignedShort=22,n.UnsignedInt=23,n.Byte=24,n.Short=25,n.Int=26,n.defaultOptions={itemSize:3,dataType:n.Float,stride:0,offset:0,normalized:!1};const o=n},3287:(e,t,i)=>{i.d(t,{Ib:()=>n,WT:()=>o});const n=1e-6;let o="undefined"!=typeof Float64Array?Float64Array:Array;Math.random;Math.PI},127:(e,t,i)=>{i.d(t,{Ue:()=>o,JG:()=>s,U_:()=>r,Jp:()=>a,Iu:()=>l,bA:()=>c,zB:()=>d,dC:()=>h,wA:()=>u});var n=i(3287);function o(){let e=new n.WT(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function s(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function r(e,t){let i=t[0],n=t[1],o=t[2],s=t[3],r=t[4],a=t[5],l=t[6],c=t[7],d=t[8],h=t[9],u=t[10],m=t[11],f=t[12],p=t[13],_=t[14],v=t[15],g=i*a-n*r,y=i*l-o*r,b=i*c-s*r,w=n*l-o*a,x=n*c-s*a,I=o*c-s*l,S=d*p-h*f,M=d*_-u*f,T=d*v-m*f,P=h*_-u*p,L=h*v-m*p,E=u*v-m*_,k=g*E-y*L+b*P+w*T-x*M+I*S;return k?(k=1/k,e[0]=(a*E-l*L+c*P)*k,e[1]=(o*L-n*E-s*P)*k,e[2]=(p*I-_*x+v*w)*k,e[3]=(u*x-h*I-m*w)*k,e[4]=(l*T-r*E-c*M)*k,e[5]=(i*E-o*T+s*M)*k,e[6]=(_*b-f*I-v*y)*k,e[7]=(d*I-u*b+m*y)*k,e[8]=(r*L-a*T+c*S)*k,e[9]=(n*T-i*L-s*S)*k,e[10]=(f*x-p*b+v*g)*k,e[11]=(h*b-d*x-m*g)*k,e[12]=(a*M-r*P-l*S)*k,e[13]=(i*P-n*M+o*S)*k,e[14]=(p*y-f*w-_*g)*k,e[15]=(d*w-h*y+u*g)*k,e):null}function a(e,t,i){let n=t[0],o=t[1],s=t[2],r=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=t[9],m=t[10],f=t[11],p=t[12],_=t[13],v=t[14],g=t[15],y=i[0],b=i[1],w=i[2],x=i[3];return e[0]=y*n+b*a+w*h+x*p,e[1]=y*o+b*l+w*u+x*_,e[2]=y*s+b*c+w*m+x*v,e[3]=y*r+b*d+w*f+x*g,y=i[4],b=i[5],w=i[6],x=i[7],e[4]=y*n+b*a+w*h+x*p,e[5]=y*o+b*l+w*u+x*_,e[6]=y*s+b*c+w*m+x*v,e[7]=y*r+b*d+w*f+x*g,y=i[8],b=i[9],w=i[10],x=i[11],e[8]=y*n+b*a+w*h+x*p,e[9]=y*o+b*l+w*u+x*_,e[10]=y*s+b*c+w*m+x*v,e[11]=y*r+b*d+w*f+x*g,y=i[12],b=i[13],w=i[14],x=i[15],e[12]=y*n+b*a+w*h+x*p,e[13]=y*o+b*l+w*u+x*_,e[14]=y*s+b*c+w*m+x*v,e[15]=y*r+b*d+w*f+x*g,e}function l(e,t,i){let n,o,s,r,a,l,c,d,h,u,m,f,p=i[0],_=i[1],v=i[2];return t===e?(e[12]=t[0]*p+t[4]*_+t[8]*v+t[12],e[13]=t[1]*p+t[5]*_+t[9]*v+t[13],e[14]=t[2]*p+t[6]*_+t[10]*v+t[14],e[15]=t[3]*p+t[7]*_+t[11]*v+t[15]):(n=t[0],o=t[1],s=t[2],r=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=t[9],m=t[10],f=t[11],e[0]=n,e[1]=o,e[2]=s,e[3]=r,e[4]=a,e[5]=l,e[6]=c,e[7]=d,e[8]=h,e[9]=u,e[10]=m,e[11]=f,e[12]=n*p+a*_+h*v+t[12],e[13]=o*p+l*_+u*v+t[13],e[14]=s*p+c*_+m*v+t[14],e[15]=r*p+d*_+f*v+t[15]),e}function c(e,t,i){let n=i[0],o=i[1],s=i[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7]*o,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function d(e,t,i,o){let s,r,a,l,c,d,h,u,m,f,p=t[0],_=t[1],v=t[2],g=o[0],y=o[1],b=o[2],w=i[0],x=i[1],I=i[2];return Math.abs(p-w)<n.Ib&&Math.abs(_-x)<n.Ib&&Math.abs(v-I)<n.Ib?mat4.identity(e):(h=p-w,u=_-x,m=v-I,f=1/Math.sqrt(h*h+u*u+m*m),h*=f,u*=f,m*=f,s=y*m-b*u,r=b*h-g*m,a=g*u-y*h,f=Math.sqrt(s*s+r*r+a*a),f?(f=1/f,s*=f,r*=f,a*=f):(s=0,r=0,a=0),l=u*a-m*r,c=m*s-h*a,d=h*r-u*s,f=Math.sqrt(l*l+c*c+d*d),f?(f=1/f,l*=f,c*=f,d*=f):(l=0,c=0,d=0),e[0]=s,e[1]=l,e[2]=h,e[3]=0,e[4]=r,e[5]=c,e[6]=u,e[7]=0,e[8]=a,e[9]=d,e[10]=m,e[11]=0,e[12]=-(s*p+r*_+a*v),e[13]=-(l*p+c*_+d*v),e[14]=-(h*p+u*_+m*v),e[15]=1,e)}const h=a;function u(e,t,i){return e[0]=i[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=i[2],e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},378:(e,t,i)=>{i.d(t,{Ue:()=>o,d9:()=>s,al:()=>r,JG:()=>a,t8:()=>l,IH:()=>c,$X:()=>d,VV:()=>h,Fp:()=>u,bA:()=>m,TE:()=>f,kE:()=>p,Fv:()=>_,AK:()=>v,t7:()=>g,I6:()=>y,fS:()=>b,Zh:()=>w,lu:()=>x,TK:()=>I});var n=i(3287);function o(){let e=new n.WT(2);return e[0]=0,e[1]=0,e}function s(e){let t=new n.WT(2);return t[0]=e[0],t[1]=e[1],t}function r(e,t){let i=new n.WT(2);return i[0]=e,i[1]=t,i}function a(e,t){return e[0]=t[0],e[1]=t[1],e}function l(e,t,i){return e[0]=t,e[1]=i,e}function c(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function d(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function h(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function u(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function m(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function f(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(i*i+n*n)}function p(e){var t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function _(e,t){var i=t[0],n=t[1],o=i*i+n*n;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o),e}function v(e,t){return e[0]*t[0]+e[1]*t[1]}function g(e,t,i,n){var o=t[0],s=t[1];return e[0]=o+n*(i[0]-o),e[1]=s+n*(i[1]-s),e}function y(e,t){return e[0]===t[0]&&e[1]===t[1]}function b(e,t){let i=e[0],o=e[1],s=t[0],r=t[1];return Math.abs(i-s)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-r)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(r))}const w=p,x=d,I=f;!function(){let e=o()}()},9450:(e,t,i)=>{i.d(t,{Ue:()=>o,d9:()=>s,kE:()=>r,al:()=>a,JG:()=>l,t8:()=>c,IH:()=>d,bA:()=>h,TE:()=>u,Fv:()=>m,AK:()=>f,kC:()=>p,t7:()=>_,fF:()=>v,jI:()=>g,I6:()=>y,fS:()=>b,lu:()=>w,Zh:()=>x});var n=i(3287);function o(){let e=new n.WT(3);return e[0]=0,e[1]=0,e[2]=0,e}function s(e){var t=new n.WT(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function r(e){let t=e[0],i=e[1],n=e[2];return Math.sqrt(t*t+i*i+n*n)}function a(e,t,i){let o=new n.WT(3);return o[0]=e,o[1]=t,o[2]=i,o}function l(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function c(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function d(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function h(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function u(e,t){let i=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return Math.sqrt(i*i+n*n+o*o)}function m(e,t){let i=t[0],n=t[1],o=t[2],s=i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e}function f(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function p(e,t,i){let n=t[0],o=t[1],s=t[2],r=i[0],a=i[1],l=i[2];return e[0]=o*l-s*a,e[1]=s*r-n*l,e[2]=n*a-o*r,e}function _(e,t,i,n){let o=t[0],s=t[1],r=t[2];return e[0]=o+n*(i[0]-o),e[1]=s+n*(i[1]-s),e[2]=r+n*(i[2]-r),e}function v(e,t,i){let n=t[0],o=t[1],s=t[2],r=i[3]*n+i[7]*o+i[11]*s+i[15];return r=r||1,e[0]=(i[0]*n+i[4]*o+i[8]*s+i[12])/r,e[1]=(i[1]*n+i[5]*o+i[9]*s+i[13])/r,e[2]=(i[2]*n+i[6]*o+i[10]*s+i[14])/r,e}function g(e,t,i,n){let o=[],s=[];return o[0]=t[0]-i[0],o[1]=t[1]-i[1],o[2]=t[2]-i[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],e[0]=s[0]+i[0],e[1]=s[1]+i[1],e[2]=s[2]+i[2],e}function y(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b(e,t){let i=e[0],o=e[1],s=e[2],r=t[0],a=t[1],l=t[2];return Math.abs(i-r)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(o-a)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(s-l)<=n.Ib*Math.max(1,Math.abs(s),Math.abs(l))}const w=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e},x=r;!function(){let e=o()}()},1245:(e,t,i)=>{i.d(t,{d9:()=>o,al:()=>s,JG:()=>r,t8:()=>a,IH:()=>l,bA:()=>c,kE:()=>d,we:()=>h,Fv:()=>u,AK:()=>m,t7:()=>f,I6:()=>p,fS:()=>_});var n=i(3287);function o(e){let t=new n.WT(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function s(e,t,i,o){let s=new n.WT(4);return s[0]=e,s[1]=t,s[2]=i,s[3]=o,s}function r(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function a(e,t,i,n,o){return e[0]=t,e[1]=i,e[2]=n,e[3]=o,e}function l(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e}function c(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function d(e){let t=e[0],i=e[1],n=e[2],o=e[3];return Math.sqrt(t*t+i*i+n*n+o*o)}function h(e){let t=e[0],i=e[1],n=e[2],o=e[3];return t*t+i*i+n*n+o*o}function u(e,t){let i=t[0],n=t[1],o=t[2],s=t[3],r=i*i+n*n+o*o+s*s;return r>0&&(r=1/Math.sqrt(r),e[0]=i*r,e[1]=n*r,e[2]=o*r,e[3]=s*r),e}function m(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function f(e,t,i,n){let o=t[0],s=t[1],r=t[2],a=t[3];return e[0]=o+n*(i[0]-o),e[1]=s+n*(i[1]-s),e[2]=r+n*(i[2]-r),e[3]=a+n*(i[3]-a),e}function p(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function _(e,t){let i=e[0],o=e[1],s=e[2],r=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return Math.abs(i-a)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(o-l)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(s-c)<=n.Ib*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(r-d)<=n.Ib*Math.max(1,Math.abs(r),Math.abs(d))}!function(){let e=function(){let e=new n.WT(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}()}()},4716:(e,t)=>{!function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),n=0;n<e.length;n++)i[e.charCodeAt(n)]=n;t.c=function(t){var i,n=new Uint8Array(t),o=n.length,s="";for(i=0;i<o;i+=3)s+=e[n[i]>>2],s+=e[(3&n[i])<<4|n[i+1]>>4],s+=e[(15&n[i+1])<<2|n[i+2]>>6],s+=e[63&n[i+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s},function(e){var t,n,o,s,r,a=.75*e.length,l=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var d=new ArrayBuffer(a),h=new Uint8Array(d);for(t=0;t<l;t+=4)n=i[e.charCodeAt(t)],o=i[e.charCodeAt(t+1)],s=i[e.charCodeAt(t+2)],r=i[e.charCodeAt(t+3)],h[c++]=n<<2|o>>4,h[c++]=(15&o)<<4|s>>2,h[c++]=(3&s)<<6|63&r;return d}}()},6636:e=>{var t=.1,i="function"==typeof Float32Array;function n(e,t){return 1-3*t+3*e}function o(e,t){return 3*t-6*e}function s(e){return 3*e}function r(e,t,i){return((n(t,i)*e+o(t,i))*e+s(t))*e}function a(e,t,i){return 3*n(t,i)*e*e+2*o(t,i)*e+s(t)}function l(e){return e}e.exports=function(e,n,o,s){if(!(0<=e&&e<=1&&0<=o&&o<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===n&&o===s)return l;for(var c=i?new Float32Array(11):new Array(11),d=0;d<11;++d)c[d]=r(d*t,e,o);function h(i){for(var n=0,s=1;10!==s&&c[s]<=i;++s)n+=t;--s;var l=n+(i-c[s])/(c[s+1]-c[s])*t,d=a(l,e,o);return d>=.001?function(e,t,i,n){for(var o=0;o<4;++o){var s=a(t,i,n);if(0===s)return t;t-=(r(t,i,n)-e)/s}return t}(i,l,e,o):0===d?l:function(e,t,i,n,o){var s,a,l=0;do{(s=r(a=t+(i-t)/2,n,o)-e)>0?i=a:t=a}while(Math.abs(s)>1e-7&&++l<10);return a}(i,n,n+t,e,o)}return function(e){return 0===e?0:1===e?1:r(h(e),n,s)}}},5368:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i})).join("")},t.i=function(e,i,n,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);n&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},8276:e=>{e.exports=function(e){return e[1]}},7084:e=>{function t(e,t,n){n=n||2;var s,r,a,l,h,u,f,p=t&&t.length,_=p?t[0]*n:e.length,v=i(e,0,_,n,!0),g=[];if(!v||v.next===v.prev)return g;if(p&&(v=function(e,t,n,o){var s,r,a,l=[];for(s=0,r=t.length;s<r;s++)(a=i(e,t[s]*o,s<r-1?t[s+1]*o:e.length,o,!1))===a.next&&(a.steiner=!0),l.push(m(a));for(l.sort(c),s=0;s<l.length;s++)n=d(l[s],n);return n}(e,t,v,n)),e.length>80*n){s=a=e[0],r=l=e[1];for(var y=n;y<_;y+=n)(h=e[y])<s&&(s=h),(u=e[y+1])<r&&(r=u),h>a&&(a=h),u>l&&(l=u);f=0!==(f=Math.max(a-s,l-r))?32767/f:0}return o(v,g,n,s,r,f,0),g}function i(e,t,i,n,o){var s,r;if(o===T(e,t,i,n)>0)for(s=t;s<i;s+=n)r=I(s,e[s],e[s+1],r);else for(s=i-n;s>=t;s-=n)r=I(s,e[s],e[s+1],r);return r&&v(r,r.next)&&(S(r),r=r.next),r}function n(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!v(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(S(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function o(e,t,i,c,d,h,m){if(e){!m&&h&&function(e,t,i,n){var o=e;do{0===o.z&&(o.z=u(o.x,o.y,t,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,i,n,o,s,r,a,l,c=1;do{for(i=e,e=null,s=null,r=0;i;){for(r++,n=i,a=0,t=0;t<c&&(a++,n=n.nextZ);t++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,a--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:e=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(r>1)}(o)}(e,c,d,h);for(var f,p,_=e;e.prev!==e.next;)if(f=e.prev,p=e.next,h?r(e,c,d,h):s(e))t.push(f.i/i|0),t.push(e.i/i|0),t.push(p.i/i|0),S(e),e=p.next,_=p.next;else if((e=p)===_){m?1===m?o(e=a(n(e),t,i),t,i,c,d,h,2):2===m&&l(e,t,i,c,d,h):o(n(e),t,i,c,d,h,1);break}}}function s(e){var t=e.prev,i=e,n=e.next;if(_(t,i,n)>=0)return!1;for(var o=t.x,s=i.x,r=n.x,a=t.y,l=i.y,c=n.y,d=o<s?o<r?o:r:s<r?s:r,h=a<l?a<c?a:c:l<c?l:c,u=o>s?o>r?o:r:s>r?s:r,m=a>l?a>c?a:c:l>c?l:c,p=n.next;p!==t;){if(p.x>=d&&p.x<=u&&p.y>=h&&p.y<=m&&f(o,a,s,l,r,c,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function r(e,t,i,n){var o=e.prev,s=e,r=e.next;if(_(o,s,r)>=0)return!1;for(var a=o.x,l=s.x,c=r.x,d=o.y,h=s.y,m=r.y,p=a<l?a<c?a:c:l<c?l:c,v=d<h?d<m?d:m:h<m?h:m,g=a>l?a>c?a:c:l>c?l:c,y=d>h?d>m?d:m:h>m?h:m,b=u(p,v,t,i,n),w=u(g,y,t,i,n),x=e.prevZ,I=e.nextZ;x&&x.z>=b&&I&&I.z<=w;){if(x.x>=p&&x.x<=g&&x.y>=v&&x.y<=y&&x!==o&&x!==r&&f(a,d,l,h,c,m,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,I.x>=p&&I.x<=g&&I.y>=v&&I.y<=y&&I!==o&&I!==r&&f(a,d,l,h,c,m,I.x,I.y)&&_(I.prev,I,I.next)>=0)return!1;I=I.nextZ}for(;x&&x.z>=b;){if(x.x>=p&&x.x<=g&&x.y>=v&&x.y<=y&&x!==o&&x!==r&&f(a,d,l,h,c,m,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;I&&I.z<=w;){if(I.x>=p&&I.x<=g&&I.y>=v&&I.y<=y&&I!==o&&I!==r&&f(a,d,l,h,c,m,I.x,I.y)&&_(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function a(e,t,i){var o=e;do{var s=o.prev,r=o.next.next;!v(s,r)&&g(s,o,o.next,r)&&w(s,r)&&w(r,s)&&(t.push(s.i/i|0),t.push(o.i/i|0),t.push(r.i/i|0),S(o),S(o.next),o=e=r),o=o.next}while(o!==e);return n(o)}function l(e,t,i,s,r,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&p(l,c)){var d=x(l,c);return l=n(l,l.next),d=n(d,d.next),o(l,t,i,s,r,a,0),void o(d,t,i,s,r,a,0)}c=c.next}l=l.next}while(l!==e)}function c(e,t){return e.x-t.x}function d(e,t){var i=function(e,t){var i,n=t,o=e.x,s=e.y,r=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=o&&a>r&&(r=a,i=n.x<n.next.x?n:n.next,a===o))return i}n=n.next}while(n!==t);if(!i)return null;var l,c=i,d=i.x,u=i.y,m=1/0;n=i;do{o>=n.x&&n.x>=d&&o!==n.x&&f(s<u?o:r,s,d,u,s<u?r:o,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(o-n.x),w(n,e)&&(l<m||l===m&&(n.x>i.x||n.x===i.x&&h(i,n)))&&(i=n,m=l)),n=n.next}while(n!==c);return i}(e,t);if(!i)return t;var o=x(i,e);return n(o,o.next),n(i,i.next)}function h(e,t){return _(e.prev,e,t.prev)<0&&_(t.next,e,e.next)<0}function u(e,t,i,n,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function m(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function f(e,t,i,n,o,s,r,a){return(o-r)*(t-a)>=(e-r)*(s-a)&&(e-r)*(n-a)>=(i-r)*(t-a)&&(i-r)*(s-a)>=(o-r)*(n-a)}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&g(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var i=e,n=!1,o=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(_(e.prev,e,t.prev)||_(e,t.prev,t))||v(e,t)&&_(e.prev,e,e.next)>0&&_(t.prev,t,t.next)>0)}function _(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function g(e,t,i,n){var o=b(_(e,t,i)),s=b(_(e,t,n)),r=b(_(i,n,e)),a=b(_(i,n,t));return o!==s&&r!==a||(!(0!==o||!y(e,i,t))||(!(0!==s||!y(e,n,t))||(!(0!==r||!y(i,e,n))||!(0!==a||!y(i,t,n)))))}function y(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function b(e){return e>0?1:e<0?-1:0}function w(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function x(e,t){var i=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),o=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function I(e,t,i,n){var o=new M(e,t,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function S(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)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,i,n){for(var o=0,s=t,r=i-n;s<i;s+=n)o+=(e[r]-e[s])*(e[s+1]+e[r+1]),r=s;return o}e.exports=t,e.exports.default=t,t.deviation=function(e,t,i,n){var o=t&&t.length,s=o?t[0]*i:e.length,r=Math.abs(T(e,0,s,i));if(o)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,d=a<l-1?t[a+1]*i:e.length;r-=Math.abs(T(e,c,d,i))}var h=0;for(a=0;a<n.length;a+=3){var u=n[a]*i,m=n[a+1]*i,f=n[a+2]*i;h+=Math.abs((e[u]-e[f])*(e[m+1]-e[u+1])-(e[u]-e[m])*(e[f+1]-e[u+1]))}return 0===r&&0===h?0:Math.abs((h-r)/r)},t.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},n=0,o=0;o<e.length;o++){for(var s=0;s<e[o].length;s++)for(var r=0;r<t;r++)i.vertices.push(e[o][s][r]);o>0&&(n+=e[o-1].length,i.holes.push(n))}return i}},6001:(e,t)=>{t.read=function(e,t,i,n,o){var s,r,a=8*o-n-1,l=(1<<a)-1,c=l>>1,d=-7,h=i?o-1:0,u=i?-1:1,m=e[t+h];for(h+=u,s=m&(1<<-d)-1,m>>=-d,d+=a;d>0;s=256*s+e[t+h],h+=u,d-=8);for(r=s&(1<<-d)-1,s>>=-d,d+=n;d>0;r=256*r+e[t+h],h+=u,d-=8);if(0===s)s=1-c;else{if(s===l)return r?NaN:1/0*(m?-1:1);r+=Math.pow(2,n),s-=c}return(m?-1:1)*r*Math.pow(2,s-n)},t.write=function(e,t,i,n,o,s){var r,a,l,c=8*s-o-1,d=(1<<c)-1,h=d>>1,u=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,f=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,r=d):(r=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-r))<1&&(r--,l*=2),(t+=r+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(r++,l/=2),r+h>=d?(a=0,r=d):r+h>=1?(a=(t*l-1)*Math.pow(2,o),r+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),r=0));o>=8;e[i+m]=255&a,m+=f,a/=256,o-=8);for(r=r<<o|a,c+=o;c>0;e[i+m]=255&r,m+=f,r/=256,c-=8);e[i+m-f]|=128*p}},6208:(e,t,i)=>{e.exports=o;var n=i(6001);function o(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var s=4294967296,r=1/s,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(e){return e.type===o.Bytes?e.readVarint()+e.pos:e.pos+1}function c(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function d(e,t,i){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n);for(var o=i.pos-1;o>=e;o--)i.buf[o+n]=i.buf[o]}function h(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function _(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function v(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function g(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function y(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function b(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function w(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function x(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),o=n>>3,s=this.pos;this.type=7&n,e(o,t,this),this.pos===s&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=b(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=x(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=b(this.buf,this.pos)+b(this.buf,this.pos+4)*s;return this.pos+=8,e},readSFixed64:function(){var e=b(this.buf,this.pos)+x(this.buf,this.pos+4)*s;return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,n=this.buf;return t=127&(i=n[this.pos++]),i<128?t:(t|=(127&(i=n[this.pos++]))<<7,i<128?t:(t|=(127&(i=n[this.pos++]))<<14,i<128?t:(t|=(127&(i=n[this.pos++]))<<21,i<128?t:function(e,t,i){var n,o,s=i.buf;if(o=s[i.pos++],n=(112&o)>>4,o<128)return c(e,n,t);if(o=s[i.pos++],n|=(127&o)<<3,o<128)return c(e,n,t);if(o=s[i.pos++],n|=(127&o)<<10,o<128)return c(e,n,t);if(o=s[i.pos++],n|=(127&o)<<17,o<128)return c(e,n,t);if(o=s[i.pos++],n|=(127&o)<<24,o<128)return c(e,n,t);if(o=s[i.pos++],n|=(1&o)<<31,o<128)return c(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,i){return a.decode(e.subarray(t,i))}(this.buf,t,e):function(e,t,i){var n="",o=t;for(;o<i;){var s,r,a,l=e[o],c=null,d=l>239?4:l>223?3:l>191?2:1;if(o+d>i)break;1===d?l<128&&(c=l):2===d?128==(192&(s=e[o+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===d?(s=e[o+1],r=e[o+2],128==(192&s)&&128==(192&r)&&((c=(15&l)<<12|(63&s)<<6|63&r)<=2047||c>=55296&&c<=57343)&&(c=null)):4===d&&(s=e[o+1],r=e[o+2],a=e[o+3],128==(192&s)&&128==(192&r)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&r)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,d=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),o+=d}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==o.Bytes)return e.push(this.readVarint(t));var i=l(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==o.Bytes)return e.push(this.readSVarint());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==o.Bytes)return e.push(this.readBoolean());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==o.Bytes)return e.push(this.readFloat());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==o.Bytes)return e.push(this.readDouble());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==o.Bytes)return e.push(this.readFixed32());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==o.Bytes)return e.push(this.readSFixed32());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==o.Bytes)return e.push(this.readFixed64());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==o.Bytes)return e.push(this.readSFixed64());var t=l(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===o.Varint)for(;this.buf[this.pos++]>127;);else if(t===o.Bytes)this.pos=this.readVarint()+this.pos;else if(t===o.Fixed32)this.pos+=4;else{if(t!==o.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),w(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),w(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),w(this.buf,-1&e,this.pos),w(this.buf,Math.floor(e*r),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),w(this.buf,-1&e,this.pos),w(this.buf,Math.floor(e*r),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var i,n;e>=0?(i=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var n,o,s=0;s<t.length;s++){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){n>56319||s+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):o=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&(e[i++]=239,e[i++]=191,e[i++]=189,o=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&d(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var n=this.pos-i;n>=128&&d(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,i){this.writeTag(e,o.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,_,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,v,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writeBytesField:function(e,t){this.writeTag(e,o.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,o.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,o.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,o.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,o.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,o.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,o.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,o.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,o.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,o.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},5398:function(e){e.exports=function(){function e(e,i,o,s,r){t(e,i,o||0,s||e.length-1,r||n)}function t(e,n,o,s,r){for(;s>o;){if(s-o>600){var a=s-o+1,l=n-o+1,c=Math.log(a),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(a-d)/a)*(l-a/2<0?-1:1);t(e,n,Math.max(o,Math.floor(n-l*d/a+h)),Math.min(s,Math.floor(n+(a-l)*d/a+h)),r)}var u=e[n],m=o,f=s;for(i(e,o,n),r(e[s],u)>0&&i(e,o,s);m<f;){for(i(e,m,f),m++,f--;r(e[m],u)<0;)m++;for(;r(e[f],u)>0;)f--}0===r(e[o],u)?i(e,o,f):i(e,++f,s),f<=n&&(o=f+1),n<=f&&(s=f-1)}}function i(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function n(e,t){return e<t?-1:e>t?1:0}return e}()},7123:(e,t,i)=>{e.exports=o,e.exports.default=o;var n=i(5398);function o(e,t){if(!(this instanceof o))return new o(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function s(e,t,i){if(!i)return t.indexOf(e);for(var n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function r(e,t){a(e,0,e.children.length,t,e)}function a(e,t,i,n,o){o||(o=p(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var s,r=t;r<i;r++)s=e.children[r],l(o,e.leaf?n(s):s);return o}function l(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function c(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function h(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(e,t,i,o,s){for(var r,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=o||(r=t+Math.ceil((i-t)/o/2)*o,n(e,r,t,i,s),a.push(t,r,r,i))}o.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],n=this.toBBox;if(!f(e,t))return i;for(var o,s,r,a,l=[];t;){for(o=0,s=t.children.length;o<s;o++)r=t.children[o],f(e,a=t.leaf?n(r):r)&&(t.leaf?i.push(r):m(e,a)?this._all(r,i):l.push(r));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!f(e,t))return!1;for(var n,o,s,r,a=[];t;){for(n=0,o=t.children.length;n<o;n++)if(s=t.children[n],f(e,r=t.leaf?i(s):s)){if(t.leaf||m(e,r))return!0;a.push(s)}t=a.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var o=this.data;this.data=n,n=o}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=p([]),this},remove:function(e,t){if(!e)return this;for(var i,n,o,r,a=this.data,l=this.toBBox(e),c=[],d=[];a||c.length;){if(a||(a=c.pop(),n=c[c.length-1],i=d.pop(),r=!0),a.leaf&&-1!==(o=s(e,a.children,t)))return a.children.splice(o,1),c.push(a),this._condense(c),this;r||a.leaf||!m(a,l)?n?(i++,a=n.children[i],r=!1):a=null:(c.push(a),d.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:d,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,n){var o,s=i-t+1,a=this._maxEntries;if(s<=a)return r(o=p(e.slice(t,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(o=p([])).leaf=!1,o.height=n;var l,c,d,h,u=Math.ceil(s/a),m=u*Math.ceil(Math.sqrt(a));for(_(e,t,i,m,this.compareMinX),l=t;l<=i;l+=m)for(_(e,l,d=Math.min(l+m-1,i),u,this.compareMinY),c=l;c<=d;c+=u)h=Math.min(c+u-1,d),o.children.push(this._build(e,c,h,n-1));return r(o,this.toBBox),o},_chooseSubtree:function(e,t,i,n){for(var o,s,r,a,l,c,d,u,m,f;n.push(t),!t.leaf&&n.length-1!==i;){for(d=u=1/0,o=0,s=t.children.length;o<s;o++)l=h(r=t.children[o]),m=e,f=r,(c=(Math.max(f.maxX,m.maxX)-Math.min(f.minX,m.minX))*(Math.max(f.maxY,m.maxY)-Math.min(f.minY,m.minY))-l)<u?(u=c,d=l<d?l:d,a=r):c===u&&l<d&&(d=l,a=r);t=a||t.children[0]}return t},_insert:function(e,t,i){var n=this.toBBox,o=i?e:n(e),s=[],r=this._chooseSubtree(o,this.data,t,s);for(r.children.push(e),l(r,o);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(o,s,t)},_split:function(e,t){var i=e[t],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=p(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var n,o,s,r,l,c,d,u,m,f,p,_,v,g;for(c=d=1/0,n=t;n<=i-t;n++)o=a(e,0,n,this.toBBox),s=a(e,n,i,this.toBBox),m=o,f=s,p=void 0,_=void 0,v=void 0,g=void 0,p=Math.max(m.minX,f.minX),_=Math.max(m.minY,f.minY),v=Math.min(m.maxX,f.maxX),g=Math.min(m.maxY,f.maxY),r=Math.max(0,v-p)*Math.max(0,g-_),l=h(o)+h(s),r<c?(c=r,u=n,d=l<d?l:d):r===c&&l<d&&(d=l,u=n);return u},_chooseSplitAxis:function(e,t,i){var n=e.leaf?this.compareMinX:c,o=e.leaf?this.compareMinY:d;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,o)&&e.children.sort(n)},_allDistMargin:function(e,t,i,n){e.children.sort(n);var o,s,r=this.toBBox,c=a(e,0,t,r),d=a(e,i-t,i,r),h=u(c)+u(d);for(o=t;o<i-t;o++)s=e.children[o],l(c,e.leaf?r(s):s),h+=u(c);for(o=i-t-1;o>=t;o--)s=e.children[o],l(d,e.leaf?r(s):s),h+=u(d);return h},_adjustParentBBoxes:function(e,t,i){for(var n=i;n>=0;n--)l(t[n],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():r(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},7731:(e,t,i)=>{i.d(t,{mG:()=>n});function n(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))}Object.create;Object.create},8525:(e,t,i)=>{i.r(t),i.d(t,{AnimationOptions:()=>I.AnimationOptions,Circle:()=>ud,CircleMarker:()=>fd,CircleMarkerOptions:()=>S.CircleMarkerOptions,CircleOptions:()=>S.CircleOptions,Control:()=>mc,ControlOptions:()=>S.ControlOptions,ControlPosition:()=>S.ControlPosition,DefaultEventTargetData:()=>b.DefaultEventTargetData,DefaultSource:()=>ed,DynamicObjectEventTable:()=>b.DynamicObjectEventTable,DynamicObjectPointerEvent:()=>b.DynamicObjectPointerEvent,Easing:()=>I.Easing,EventTarget:()=>b.EventTarget,EventTargetData:()=>b.EventTargetData,FeatureState:()=>S.FeatureState,FeatureStateMap:()=>S.FeatureStateMap,FitBoundsOptions:()=>S.FitBoundsOptions,FloorControl:()=>Nc,FloorLevelChangeEvent:()=>b.FloorLevelChangeEvent,FloorPlanHideEvent:()=>b.FloorPlanHideEvent,FloorPlanShowEvent:()=>b.FloorPlanShowEvent,GeoJsonEventTargetData:()=>b.GeoJsonEventTargetData,GeoJsonSource:()=>xd,GeoJsonSourceOptions:()=>S.GeoJsonSourceOptions,HtmlMarker:()=>dd,HtmlMarkerOptions:()=>S.HtmlMarkerOptions,Label:()=>ld,LabelImage:()=>S.LabelImage,LabelOptions:()=>S.LabelOptions,LngLatBounds:()=>w.LngLatBounds,LngLatBoundsClass:()=>Rc,Map:()=>td,MapEvent:()=>b.MapEvent,MapEventTable:()=>b.MapEventTable,MapOptions:()=>S.MapOptions,MapPointerEvent:()=>b.MapPointerEvent,MapSupportOptions:()=>S.MapSupportOptions,Marker:()=>sd,MarkerIconOptions:()=>S.MarkerIconOptions,MarkerLabelOptions:()=>S.MarkerLabelOptions,MarkerOptions:()=>S.MarkerOptions,Padding:()=>S.Padding,PointerEvent:()=>b.PointerEvent,Polygon:()=>gd,PolygonOptions:()=>S.PolygonOptions,Polyline:()=>_d,PolylineOptions:()=>S.PolylineOptions,Raster:()=>bd,RasterOptions:()=>S.RasterOptions,RasterSource:()=>S.RasterSource,RasterTileSource:()=>Ld,RasterTileSourceOptions:()=>S.RasterTileSourceOptions,RotationAnimationOptions:()=>I.RotationAnimationOptions,ScaleControl:()=>Qc,SourceAttributes:()=>S.SourceAttributes,StretchableImageSource:()=>S.StretchableImageSource,StyleIconConfig:()=>x.StyleIconConfig,StyleLoadEvent:()=>b.StyleLoadEvent,TrafficControl:()=>Ic,TrafficScoreEvent:()=>b.TrafficScoreEvent,TrafficVisibilityEvent:()=>b.TrafficVisibilityEvent,ZoomControl:()=>gc,_J:()=>y,isSupported:()=>Ed,notSupportedReason:()=>kd});var n={};i.r(n),i.d(n,{geoLineDistance:()=>L.XV,geoToMapDistance:()=>L.a4,getCenterZoomByPoints:()=>R,getMetersFromPixels:()=>U,getMousePositionInContainer:()=>D,projectGeoToMap:()=>L.yq,projectGeoToScreen:()=>j,projectMapToGeo:()=>L.PA,projectMapToScreen:()=>Z,projectScreenToGeo:()=>N});var o={};i.r(o),i.d(o,{getMetersFromPixelsXY:()=>L.$X,getUrl:()=>H.Gr,hashToString:()=>G.GG});var s={};i.r(s),i.d(s,{Q:()=>el});var r={};i.r(r),i.d(r,{X:()=>Gl});var a={};i.r(a),i.d(a,{q:()=>Vl});var l={};i.r(l),i.d(l,{S:()=>Yl});var c={};i.r(c),i.d(c,{J:()=>Ql});var d={};i.r(d),i.d(d,{U:()=>oc});var h={};i.r(h),i.d(h,{n:()=>sc});var u={};i.r(u),i.d(u,{P:()=>ac});var m={};i.r(m),i.d(m,{c:()=>lc});var f={};i.r(f);var p={};i.r(p);var _={};i.r(_);var v={};i.r(v);var g={};i.r(g),i.d(g,{l:()=>hc});var y={};i.r(y),i.d(y,{Circle:()=>zl,CircleMarker:()=>le,CircleMarkerOptions:()=>p.CircleMarkerOptions,CircleOptions:()=>p.CircleOptions,CommPoiEvent:()=>f.CommPoiEvent,DashedPolyline:()=>Pl,DashedPolylineOptions:()=>p.DashedPolylineOptions,DataTileLayer:()=>hc,DataTileLayerOptions:()=>g.DataTileLayerOptions,DefaultSource:()=>Ja,DraggablePointerEvent:()=>f.DraggablePointerEvent,DynamicObject:()=>q,DynamicObjectPointerEvent:()=>f.DynamicObjectPointerEvent,Entrance:()=>Dr,EntranceOptions:()=>p.EntranceOptions,FirmsToFloorIndexMap:()=>v.FirmsToFloorIndexMap,FloorComplexHideEvent:()=>f.FloorComplexHideEvent,FloorComplexShowEvent:()=>f.FloorComplexShowEvent,FontName:()=>Zs.FontName,GeoJsonSource:()=>Pn.gs,GeoJsonSourceOptions:()=>Pn.GeoJsonSourceOptions,GeoJsonTileSource:()=>Pn.Xm,GeoJsonTileSourceOptions:()=>Pn.GeoJsonTileSourceOptions,HTMLMarkerShownEvent:()=>f.HTMLMarkerShownEvent,Heatmap:()=>Gl,HeatmapOptions:()=>r.HeatmapOptions,HeatmapPalette:()=>r.HeatmapPalette,HeatmapPoint:()=>r.HeatmapPoint,HillshadeOptions:()=>_.HillshadeOptions,HtmlMarker:()=>zr,HtmlMarkerOptions:()=>p.HtmlMarkerOptions,IconTransformerParams:()=>m.IconTransformerParams,InteractionEvent:()=>f.InteractionEvent,InteractionTarget:()=>f.InteractionTarget,LabelsDebugOptions:()=>s.LabelsDebugOptions,Map:()=>wl,MapClass:()=>wl,MapEvent:()=>f.MapEvent,MapOptions:()=>_.MapOptions,MapPointerEvent:()=>f.MapPointerEvent,Marker:()=>Ql,MarkerIconOptions:()=>c.MarkerIconOptions,MarkerLabelOptions:()=>c.MarkerLabelOptions,MarkerOptions:()=>c.MarkerOptions,OnlineMarker:()=>lc,OnlineMarkerIcon:()=>m.OnlineMarkerIcon,OnlineMarkerOptions:()=>m.OnlineMarkerOptions,Padding:()=>_.Padding,PersonalPoi:()=>_.PersonalPoi,PointLabel:()=>Yl,PointLabelOptions:()=>l.PointLabelOptions,Polygon:()=>kl,PolygonOptions:()=>p.PolygonOptions,Polyline:()=>Ml,PolylineOptions:()=>p.PolylineOptions,Raster:()=>sc,RasterOptions:()=>h.RasterOptions,RasterTileSource:()=>ac,RasterTileSourceOptions:()=>u.RasterTileSourceOptions,Rect:()=>oc,RectOptions:()=>d.RectOptions,RulerChangeEvent:()=>f.RulerChangeEvent,SourceMetatile:()=>Zs.SourceMetatile,Stats:()=>_.Stats,StretchableImage:()=>Vl,StretchableImageOptions:()=>a.StretchableImageOptions,StretchableImageSource:()=>a.StretchableImageSource,TileCoords:()=>_.TileCoords,TileLoadEvent:()=>f.TileLoadEvent,TrafficScoreEvent:()=>f.TrafficScoreEvent,Viewport:()=>_.Viewport,config:()=>T,mapglUtils:()=>o,utils:()=>n});var b={};i.r(b),i.d(b,{C:()=>Pc});var w={};i.r(w),i.d(w,{S:()=>Rc});var x={};i.r(x);var I={};i.r(I);var S={};i.r(S);var M=i(7731),T=i(1525),P=i(5849),L=i(5951),E=i(3220),k=i(9450),z=i(7090),A=i(4004);function C(e,t,i){if(0===e.length)return;const n=(0,P.Id)(t),o=z.Ue();for(const t of e){const e=(0,L.yq)(t);(0,A.hk)(e,-n),z.aM(o,e)}const s=k.Ue();return z.be(s,o),(0,A.hk)(s,n),{center:s,zoom:F(o,i)}}function F(e,t){return Math.min((0,L.to)(t[0],Math.abs(e.max[0]-e.min[0])),(0,L.to)(t[1],Math.abs(e.max[1]-e.min[1])))}function R(e,t,i){const n=C(e,t,i);if(n)return{zoom:n.zoom,center:(0,L.PA)(n.center)}}function D(e,t,i){const n=e.getBoundingClientRect();return[t-n.left-e.clientLeft,i-n.top-e.clientTop]}function O(e,t){const i=[];for(let n=0;n<e.length;n++)i[n]=D(t,e[n].clientX,e[n].clientY);return i}function B(e){return e.touches.length>1}function j(e,t,i,n,o,s,r={top:0,right:0,bottom:0,left:0},a={top:0,right:0,bottom:0,left:0}){return new E.V({center:(0,L.yq)(e),zoom:t,rotation:(0,P.Id)(i),size:n,pitch:(0,P.Id)(o),viewport:r,padding:a}).project((0,L.yq)(s))}function N(e,t,i,n,o,s,r={top:0,right:0,bottom:0,left:0},a={top:0,right:0,bottom:0,left:0}){const l=new E.V({center:(0,L.yq)(e),zoom:t,rotation:(0,P.Id)(i),size:n,pitch:(0,P.Id)(o),viewport:r,padding:a});return(0,L.PA)(l.unproject(s))}function U(e,t,i,n,o,s,r={top:0,right:0,bottom:0,left:0},a={top:0,right:0,bottom:0,left:0},l){return(0,L.$X)(e,t,i,n,o,s,r,a,l,l)}function Z(e,t){return new E.V(e).project(t)}var H=i(7018),G=i(8729),W=i(7266),V=i(308);class q extends W.c{constructor(e){super(),this.uniqId=(0,V.f)(),this.modules=e.modules,this.mapState=e.state,this.tileObjects=[],this.identifyIds=[]}update(){}destroy(){const e=this.modules;this.tileObjects.forEach((t=>{t.clean(this.mapState),e.tileManager.removeObject(t)})),this.tileObjects=[],e.layers.removeLayer(this),this.mapState.needRerender=!0}getIdentifyData(){return this.identifyIds.map((e=>({dynamicObjectId:this.uniqId,metatileHash:-1,ids:e})))}}var X=i(378),$=i(1790),Y=i(8631),K=i(3386);function J(e,t){if(void 0===t)return;if(t.sourceId){const i=e.getSourceById(t.sourceId);if("default"!==(null==i?void 0:i.type))return}const i={id:(0,Y.Ak)(t.id),symbol:t.symbol};return"point"===t.symbol&&(i.isText=1===t.instanceId),t.sublayer&&(i.isCityCommercial=(0,K.wu)(t.sublayer),i.isCommercial=(0,K.Ty)(t.sublayer),i.isPersonal=(0,K.h3)(t.sublayer),"point"!==t.symbol||i.isCommercial||(i.sysCode=t.objectClass)),t.center&&(i.center=(0,L.PA)(t.center)),i}function Q(e,t){if(void 0===t)return;if(t.sourceId){const i=e.getSourceById(t.sourceId);if(i&&"geojson"===i.type)return"internal"===i.subtype?{type:"geojson",id:(0,Y.Ak)(t.id),feature:i.getFeatureById(t.id),source:i}:{type:"geojsonTile",getFeatureProperties:()=>{var e;return i.getObjectAttributes(t.id.lo,null!==(e=t.tileKey)&&void 0!==e?e:"")},source:i}}const i={type:"default",id:(0,Y.Ak)(t.id)};return t.floorId&&(i.floorId=(0,Y.Ak)(t.floorId)),i}function ee(e,t,i,n,o){const s=(0,L.PA)(o.camera.unproject(n));if(t&&void 0!==t.dynamicObjectId){const r=e,a=o.layers.getDynamicObjectLayers().find((e=>e.uniqId===t.dynamicObjectId));if(!a)return;const l={lngLat:s,originalEvent:i,point:n,targetData:a};return void a.emit(r,l)}const r={lngLat:s,originalEvent:i,point:n,target:J(o.sourceStorage,t),targetData:Q(o.sourceStorage,t)},a=e;o.map.emit(a,r)}class te extends q{constructor(e,t){super(e),this.start=e=>{const{modules:t,container:i}=this;if(0!==e.button)return;const n=D(i,e.clientX,e.clientY);this.contains(n)&&(t.handler.block(),t.mouseMoveHandler.block(),this.dragStartCursorPoint=n,this.dragStartAnchorPoint=t.camera.project(this.getPosition()),document.addEventListener("mouseup",this.stop),document.addEventListener("mousemove",this.move),this.emitEvent("dragstart",e))},this.move=e=>{const{dragStartAnchorPoint:t,dragStartCursorPoint:i,container:n}=this;if(void 0===t||void 0===i)return;const o=D(n,e.clientX,e.clientY),s=X.d9(t);X.IH(s,s,o),X.lu(s,s,i),this.setPosition(this.modules.camera.unproject(s)),this.emitEvent("drag",e)},this.stop=e=>{if(0!==e.button)return;this.dragStartCursorPoint=void 0,this.dragStartAnchorPoint=void 0,document.removeEventListener("mouseup",this.stop),document.removeEventListener("mousemove",this.move);const{modules:t}=this;t.handler.unblock(),t.mouseMoveHandler.unblock(),this.emitEvent("dragend",e),this.isInteractive()&&t.identifier.resetCache()},this.container=e.modules.layout.mapContainer,t&&this.container.addEventListener("mousedown",this.start,!0)}destroy(){super.destroy(),this.container.removeEventListener("mousedown",this.start,!0),document.removeEventListener("mouseup",this.stop),document.removeEventListener("mousemove",this.move)}emitEvent(e,t){const i=this.getPosition(),n=(0,L.PA)(i),o=this.modules.camera.project(i),s=this.modules.identifier.searchSync(o),r=void 0!==s&&void 0===s.dynamicObjectId?J(this.modules.sourceStorage,s):void 0;this.emit(e,{originalEvent:t,target:r,targetData:this,lngLat:n,point:o})}}var ie=i(3251),ne=i(7618),oe=i(9231),se=i(6158),re=i(7054),ae=i(7768);class le extends te{constructor(e,t){var i,n;super(e,null!==(i=t.draggable)&&void 0!==i&&i),this.options=t,this.interactive=null===(n=this.options.interactive)||void 0===n||n,this.center=(0,L.yq)(this.options.coordinates);const{dynamicStyle:o,collector:s,renderer:r,tileManager:a,identifier:l,layers:c}=this.modules;if(this.layer=(0,se.qw)({type:"circle",id:`dynamic-circleMarker-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.color,strokeColor:this.options.borderColor,strokeColor2:this.options.border2Color,width:this.options.width,strokeWidth:this.options.borderWidth,strokeWidth2:this.options.border2Width}}),!this.layer)return;o.addLayer(this.layer,this.options.zIndex);const d=(0,ne.IR)(this.center),h=(0,oe.FJ)({id:this.interactive?(0,Y.Ru)(0,0):NaN});(0,ie.XI)({collector:s,generator:re.p.generate,args:[o.getStyle().id,this.layer,G.Dz,h,G.wz,G.i4,[[0],[0]]]});const u=s.getAccumulatedData(),m=new $.W("dynamicObject",u.data,r,d);a.addObject(m),this.tileObjects.push(m),this.interactive&&this.identifyIds.push(u.identifyIds),c.addLayer(this),s.reset(),this.mapState.needRerender=!0,this.interactive&&l.resetCache()}remove(){this.layer&&this.modules.dynamicStyle.removeLayer(this.layer.innerId),this.interactive&&this.modules.identifier.resetCache(),super.destroy()}setPosition(e){const{mapState:t}=this,i=this.tileObjects[0];void 0!==i&&(this.center=e,i.setTileCoords((0,ne.IR)(e)),t.needRerender=!0)}getPosition(){return this.center}isInteractive(){return this.interactive}contains(e){if(!this.layer)return!1;const{layer:t}=this,i=this.modules.camera.project(this.center),n=(0,ae.vn)(t.style.width,(0,ae.jJ)(this.mapState.styleZoom,this.mapState.styleState,[]))/2+(0,ae.vn)(t.style.strokeWidth,(0,ae.jJ)(this.mapState.styleZoom,this.mapState.styleState,[]));return X.TK(i,e)<=n}}var ce=i(5677);function de(e,t,i){const{top:n,right:o,bottom:s,left:r}=e.viewport,{clientWidth:a,clientHeight:l}=t;e.size=[Math.max(1,a-r-o),Math.max(1,l-n-s)],i.updateIdentifySize()}function he(e,t){return function(e,t){return{top:Math.min(e.top,t[1]),bottom:Math.min(e.bottom,t[1]),left:Math.min(e.left,t[0]),right:Math.min(e.right,t[0])}}(function(e){return{top:Math.max(e.top,0),bottom:Math.max(e.bottom,0),left:Math.max(e.left,0),right:Math.max(e.right,0)}}(e),t)}function ue(e,t){const{top:i,right:n,bottom:o,left:s}=e.padding;e.padding={top:i,right:n,bottom:o,left:s},e.needRerender=!0,t.updateIdentifySize()}const me="inertia",fe=ce.sT.bind(null,me),pe=(e,t)=>{ce.Vx(me,{step:(e,i,n)=>{const{startPoint:o,startSpeed:s,startTime:r,direction:a}=n,l=k.d9(a);k.bA(l,l,i),k.IH(l,l,o),z.r3(e.maxBounds,l)||_e(t,e),e.center=l,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,L.X$)(e.zoom,l):e.zoom=(0,L.Z3)(e.styleZoom,l);const c=((e,t,i)=>e*Math.pow(1-(i-t)/T.inertia.duration,T.inertia.nonLinearity))(s,r,e.time);(0,L.ik)(c,e.zoom)<T.inertia.minSpeed&&_e(t,e)}},e)},_e=(e,t)=>{ce.sT(me,t),e.classList.remove("mapgl-inertia")},ve="center",ge=(e,t,i={})=>{ce.sT(ve,e),fe(e);const n=k.Ue();if(z.Rk(n,e.maxBounds,t),!1===i.animate||0===i.duration)e.center=n,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,L.X$)(e.zoom,t):e.zoom=(0,L.Z3)(e.styleZoom,t);else{const t=void 0!==i.easing?i.easing:"linear",o=void 0!==i.duration?i.duration:250;ce.BL(ve,{easing:t},e,e.center,n,o)}},ye=ce.sT.bind(null,ve),be=ce.Vx.bind(null,ve,{step:(e,t)=>{e.center=t,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,L.X$)(e.zoom,t):e.zoom=(0,L.Z3)(e.styleZoom,t)}}),we="rotation";function xe(e,t){return(e-=t)>=Math.PI?e=(e+Math.PI)%(2*Math.PI)-Math.PI:e<-Math.PI&&(e=Math.PI-(Math.PI-e)%(2*Math.PI)),e+=t}function Ie(e,t,i={}){if(ce.sT(we,e),!1===i.animate||0===i.duration)e.rotation=xe(t,0);else{const n=void 0===i.normalize||i.normalize;ce.BL(we,{easing:i.easing||"linear"},e,e.rotation,n?xe(t,e.rotation):t,i.duration||250)}}const Se=ce.sT.bind(null,we),Me=ce.Vx.bind(null,we,{step:(e,t)=>e.rotation=xe(t,0)}),Te="pitch";function Pe(e,t,i={}){ce.sT(Te,e);const n=(0,P.uZ)(t,e.minPitch,e.maxPitch);!1===i.animate||0===i.duration?e.pitch=n:ce.BL(Te,{easing:i.easing||"linear"},e,e.pitch,n,i.duration||300)}const Le=ce.sT.bind(null,Te),Ee=ce.Vx.bind(null,Te,{step:(e,t)=>e.pitch=t}),ke="zoom",ze=(e,t,i={})=>{ce.sT(ke,e);const n=(0,P.uZ)(t,e.minZoom,e.maxZoom);if(n!==e.zoom)if(!1===i.animate||0===i.duration)i.zoomPoint&&(k.IH(e.center,e.center,(0,P.Kv)(e,i.zoomPoint,{zoom:n})),z.Rk(e.center,e.maxBounds,e.center)),e.zoom=n,e.styleZoom=(0,L.X$)(n,e.center);else{const t=i.animateHeight?(0,L.r9)(e.zoom,e.size):e.zoom,o=i.animateHeight?(0,L.r9)(n,e.size):n,s=void 0!==i.easing?i.easing:"easeOutCubic",r=void 0!==i.duration?i.duration:250;ce.BL(ke,{easing:s},e,t,o,r,{zoomPoint:i.zoomPoint,animateHeight:!!i.animateHeight,blockBuildingAnimation:!!i.blockBuildingAnimation})}},Ae=ce.sT.bind(null,ke),Ce=ce.Vx.bind(null,ke,{step:(e,t,i={})=>{const n=i&&i.animateHeight?(0,L.nn)(t,e.size):t;i&&i.zoomPoint&&(k.IH(e.center,e.center,(0,P.Kv)(e,i.zoomPoint,{zoom:n})),z.Rk(e.center,e.maxBounds,e.center)),e.zoom=n,e.styleZoom=(0,L.X$)(n,e.center)}}),Fe=navigator.msPointerEnabled&&navigator.msMaxTouchPoints&&!window.PointerEvent,Re=window.PointerEvent&&navigator.pointerEnabled&&navigator.maxTouchPoints||Fe||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,De=Ze("webkit"),Oe=Ze("chrome")||Ze("crios"),Be="ActiveXObject"in window,je=!Oe&&Ze("safari"),Ne=(Ze("gecko")&&!De&&window.opera,navigator.platform.toUpperCase().indexOf("MAC")>=0),Ue=Ze("firefox");function Ze(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}function He(e,t){const i=Object.assign({hitType:"event",eventCategory:"Metrics"},e);window.ga&&window.ga(`${T.analytics.gaName}.send`,i)}function Ge(e,t){let i,n=!1;function o(){n=!1,i&&(s(...i),i=!1)}function s(...s){n?i=s:(e(...s),setTimeout(o,t),n=!0)}return s}function We(e){Ae(e),ye(e),Se(e),Le(e),fe(e)}class Ve{constructor(e,t){this.onWheelScroll=e=>{e.preventDefault(),void 0===e.deltaMode&&void 0===e.deltaY||(this.state.userHasInteracted=!0,this.screenPoint=D(this.container,e.clientX,e.clientY),e.ctrlKey?this.deltaAccumulator-=10*e.deltaY:1===e.deltaMode?this.deltaAccumulator-=20*e.deltaY:this.deltaAccumulator-=e.deltaY,this.eventCount+=1)},this.startZooming=()=>{const e=this.state;let t;t=Ne?this.getDelta()*T.zoom.macTouchDelta:(0,P.Xx)(this.getDelta())*T.zoom.mouseDelta;const i=e.zoom+t,n=(0,P.uZ)(i,e.minZoom,e.maxZoom);n!==e.zoom&&(We(e),ze(e,n,{duration:T.zoom.animDuration,animate:!Ne,zoomPoint:e.keepCenterWhileUserZoomRotate?void 0:this.screenPoint,blockBuildingAnimation:!0}))},this.stop=()=>{this.state.userHasInteracted=!0,Ae(this.state)},this.state=e,this.container=t,Ne||(this.startZooming=Ge(this.startZooming,T.zoom.throttleDelay)),this.deltaAccumulator=0,this.eventCount=0,this.screenPoint=[0,0],this.container.addEventListener("wheel",this.onWheelScroll),this.container.addEventListener("mousedown",this.stop)}destroy(){this.container.removeEventListener("wheel",this.onWheelScroll),this.container.removeEventListener("mousedown",this.stop)}update(){0!==this.eventCount&&(this.startZooming(),this.state.needRerender=!0)}getDelta(){const e=this.deltaAccumulator/this.eventCount;return this.deltaAccumulator=0,this.eventCount=0,e}}class qe{constructor(e){this.defs=e.map((e=>new Xe(e)))}check(e){const t=this.defs;let i=!1;for(let n=0;n<t.length;n++)i?t[n].update(e):i=!t[n].equal(e);return i}}class Xe{constructor(e){this.path=Array.isArray(e.path)?e.path:[e.path],this.type=e.type,"number"===this.type?(this.last=NaN,this.compare=this.primitive,this.updateFn=this.primitiveUpdate):"boolean"===this.type?(this.last=void 0,this.compare=this.primitive,this.updateFn=this.primitiveUpdate):"vec2"===this.type?(this.last=[NaN,NaN],this.compare=this.vec2,this.updateFn=this.vec2Update):"string"===this.type?(this.last="",this.compare=this.primitive,this.updateFn=this.primitiveUpdate):"padding"===this.type&&(this.last={left:0,right:0,bottom:0,top:0},this.compare=this.padding,this.updateFn=this.paddingUpdate)}equal(e){const t=this.take(e),i=this.compare(this.last,t);return this.updateFn(t),i}update(e){this.updateFn(this.take(e))}take(e){const t=this.path;let i=0;do{e=e[t[i++]]}while(i<t.length);return e}primitive(e,t){return e===t}padding(e,t){return e.top===t.top&&e.bottom===t.bottom&&e.left===t.left&&e.right===t.right}paddingUpdate(e){this.last.top=e.top,this.last.bottom=e.bottom,this.last.right=e.right,this.last.left=e.left}vec2(e,t){return e[0]===t[0]&&e[1]===t[1]}primitiveUpdate(e){this.last=e}vec2Update(e){this.last[0]=e[0],this.last[1]=e[1]}}class $e{constructor(e,t){this.onMouseUp=e=>{1===e.which&&this.start()},this.onTouchEnd=e=>{0===e.touches.length&&this.start()},this.start=()=>{const e=this.state;e.userHasInteracted=!0;const t=this.getCurrentSpeed(e.time),i=k.kE(t);if((0,L.ik)(i,e.zoom)<=T.inertia.minSpeed)return;const n=(0,L.h0)(T.inertia.maxSpeed,e.zoom),o=Math.min(i,n),s=this.calcDistanceByStartSpeed(o),r=k.d9(e.center),a=k.Ue();k.Fv(a,t),((e,t,i,n,o)=>{ce.BL(me,{easing:"inertia"},e,0,o,T.inertia.duration,{startPoint:t,startSpeed:i,direction:n,startTime:e.time})})(e,r,o,a,s),this.container.classList.add("mapgl-inertia")},this.stop=()=>{fe(this.state),this.container.classList.remove("mapgl-inertia"),this.times=[],this.positions=[]},this.state=e,this.container=t,this.container.addEventListener("mouseup",this.onMouseUp),this.container.addEventListener("mousedown",this.stop),Re&&(this.container.addEventListener("touchend",this.onTouchEnd),this.container.addEventListener("touchstart",this.stop)),this.zoomDiffer=new qe([{path:"zoom",type:"number"}]),this.styleZoomDiffer=new qe([{path:"styleZoom",type:"number"}]),this.centerDiffer=new qe([{path:"center",type:"vec2"}]),this.times=[],this.positions=[]}destroy(){this.container.removeEventListener("mouseup",this.onMouseUp),this.container.removeEventListener("mousedown",this.stop),this.container.removeEventListener("touchend",this.onTouchEnd),this.container.removeEventListener("touchstart",this.stop)}update(){const e=this.state;this.centerDiffer.check(e)&&this.rememberTimeAndPosition(e);("zoom"===e.zoomTypePreserving?this.zoomDiffer.check(e):this.styleZoomDiffer.check(e))&&this.stop()}removeOldRecords(e){for(;e-this.times[0]>100&&this.times.length;)this.times.shift(),this.positions.shift()}rememberTimeAndPosition(e){const t=e.time;this.removeOldRecords(t),this.times.push(t),this.positions.push(k.d9(e.center))}getCurrentSpeed(e){if(this.removeOldRecords(e),this.times.length<2)return k.Ue();const t=k.d9(this.positions[this.positions.length-1]);return k.lu(t,t,this.positions[0]),k.bA(t,t,1/(this.times[this.times.length-1]-this.times[0])),t}calcDistanceByStartSpeed(e){return e*T.inertia.duration/(T.inertia.nonLinearity+1)}}class Ye{constructor(e){this.emitMouseEvent=e=>{const t=D(this.container,e.clientX,e.clientY);this.emitEvent(e,t)},this.emitTouchEvent=e=>{const t=D(this.container,e.changedTouches[0].clientX,e.changedTouches[0].clientY);this.emitEvent(e,t)},this.container=e.layout.mapContainer,this.modules=e,this.container.addEventListener("mouseup",this.emitMouseEvent),this.container.addEventListener("touchend",this.emitTouchEvent)}destroy(){this.container.removeEventListener("mouseup",this.emitMouseEvent),this.container.removeEventListener("touchend",this.emitTouchEvent)}update(){}emitEvent(e,t){if(!this.modules.layout.isActionWithCanvas(e))return;const i=e.type;this.modules.identifier.search(i,t).then((n=>{ee(i,n,e,t,this.modules)}))}}class Ke{constructor(e,t,i){this.rotationDetected=!1,this.onGestureStart=e=>{e.preventDefault(),this.startRotation=this.state.rotation,this.rotationDetected=!1,this.gestureRotation=0,this.isGestureStart=!0,this.startZoom=this.state.zoom,this.screenPoint=D(this.container,e.clientX,e.clientY),this.state.userHasInteracted=!0,this.state.disableRotationByUserInteraction||this.container.classList.add("mapgl-rotating"),this.map.emit("interactionstart",{target:"zoom/rotation"})},this.onGestureEnd=e=>{e.preventDefault(),this.isGestureStart&&(this.isGestureStart=!1,this.state.userHasInteracted=!0,this.container.classList.remove("mapgl-rotating"),this.map.emit("interactionend",{target:"zoom/rotation"}))},this.onGestureChange=e=>{e.preventDefault(),this.state.userHasInteracted=!0;const t=e.rotation/40;!this.rotationDetected&&Math.abs(t)>this.state.touchRotationThreshold&&(this.rotationDetected=!0,this.startRotation=this.state.rotation-t),this.rotationDetected&&(this.gestureRotation=t),e.scale>1?this.gestureZoom=e.scale-1:this.gestureZoom=-1/e.scale+1},this.state=e,this.container=t,this.map=i,this.isGestureStart=!1,this.gestureRotation=0,this.gestureZoom=0,this.screenPoint=[0,0],this.startRotation=0,this.startZoom=0,this.container.addEventListener("gesturestart",this.onGestureStart),this.container.addEventListener("gestureend",this.onGestureEnd),this.container.addEventListener("gesturechange",this.onGestureChange)}destroy(){this.container.removeEventListener("gesturestart",this.onGestureStart),this.container.removeEventListener("gestureend",this.onGestureEnd),this.container.removeEventListener("gesturechange",this.onGestureChange)}update(){if(0===this.gestureRotation&&0===this.gestureZoom)return;const e=this.state,t=this.startZoom+this.gestureZoom,i=this.startRotation+this.gestureRotation,n=k.Ue(),o=e.keepCenterWhileUserZoomRotate?k.Ue():(0,P.Kv)(e,this.screenPoint,{zoom:t,rotation:i});k.IH(n,e.center,o),We(e),ge(e,n,{animate:!1}),ze(e,t,{animate:!1}),e.disableRotationByUserInteraction||Ie(e,i,{animate:!1}),this.gestureRotation=0,this.gestureZoom=0}}class Je extends W.c{constructor(e){super(),this.durations=[],this.earlyTimes=[],this.countToCheck=75,this.mayCountMetrics=!1,this.startRenderTime=0,this.catchNextUpdate=!1,this.mapState=e,setTimeout((()=>{this.mayCountMetrics=!0}),1e4)}update(){const{time:e,needRerender:t}=this.mapState;this.mayCountMetrics?(this.catchNextUpdate&&(this.durations.push(e-this.startRenderTime),this.catchNextUpdate=!1),t&&(this.startRenderTime=e,this.catchNextUpdate=!0),this.durations.length>this.countToCheck&&this.check()):this.earlyTimes.push(e)}getEarlyFps(){if(this.mayCountMetrics)return;const e=[];for(let t=1;t<this.earlyTimes.length;t++)e.push(this.earlyTimes[t]-this.earlyTimes[t-1]);return Qe(e)}check(){const e=Qe(this.durations);this.emit("fps",e),e<T.performanceCheck.fpsCaveat&&(this.mapState.performanceCaveatEmitted=!0,this.emit("performancecaveat")),this.durations=[],this.countToCheck=Math.min(1e3,2*this.countToCheck)}}function Qe(e){e.sort(((e,t)=>e-t));const t=e[Math.floor(3*e.length/4)];return Math.round(1e3/t)}var et=i(5569);class tt{constructor(){this.differ=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"rotation",type:"number"},{path:"pitch",type:"number"}]),this.debouncedSet=(0,et.D)((e=>{ce.BL("stillness",{},e,e.stillness,1,400)}),100,!1),this.stillnessTickerUpdate=ce.Vx.bind(null,"stillness",{step:(e,t)=>{e.stillness=t}})}update(e){this.differ.check(e)&&(e.stillness=0,ce.sT("stillness",e),this.debouncedSet(e)),this.stillnessTickerUpdate(e)}}class it{constructor(e){this.onTouchStart=()=>{this.isTouchStartEmitted=!0},this.onMouseOut=e=>{if(!this.prevGeo)return;const t=D(this.container,e.clientX,e.clientY);ee("mouseout",this.prevGeo,e,t,this.modules),this.prevGeo=void 0,this.skipIdentifyEvents=!0,this.modules.defaultSource.resetHoverId(),this.container.classList.remove("mapgl-hover")},this.onMouseMove=e=>{if(this.isTouchStartEmitted)return void(this.isTouchStartEmitted=!1);if(this.skipIdentifyEvents=!1,this.isBlocked)return;const t=D(this.container,e.clientX,e.clientY);Promise.resolve().then((()=>this.modules.layout.isActionWithCanvas(e)?this.modules.identifier.search("mouseMove",t):void 0)).then((i=>{if(this.skipIdentifyEvents)return;const n=i&&this.prevGeo&&(!(0,Y.v7)(i.id,this.prevGeo.id)||i.instanceId!==this.prevGeo.instanceId||i.dynamicObjectId!==this.prevGeo.dynamicObjectId||i.symbol!==this.prevGeo.symbol);!this.prevGeo||i&&!n||(ee("mouseout",this.prevGeo,e,t,this.modules),this.prevGeo=void 0,this.container.classList.remove("mapgl-hover"),this.modules.defaultSource.resetHoverId()),!i||this.prevGeo&&!n||(this.prevGeo=i,this.container.classList.add("mapgl-hover"),ee("mouseover",i,e,t,this.modules),this.modules.defaultSource.setHoverId(i.id)),ee("mousemove",i,e,t,this.modules)}))},this.modules=e,this.isTouchStartEmitted=!1,this.skipIdentifyEvents=!1,this.isBlocked=!1,this.prevGeo=void 0,this.container=this.modules.layout.mapContainer,this.container.addEventListener("touchstart",this.onTouchStart),this.container.addEventListener("mousemove",this.onMouseMove),this.container.addEventListener("mouseout",this.onMouseOut)}destroy(){this.container.removeEventListener("touchstart",this.onTouchStart),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseout",this.onMouseOut)}update(){}block(){this.isBlocked=!0}unblock(){this.isBlocked=!1}}const nt=(e,t,i,n)=>{ce.sT("buildingHeight"+n,e),!1===i.animate||0===i.duration?(t.set(n,i.to),e.needLabeling=!0):ce.BL("buildingHeight"+n,{easing:i.easing},e,i.from,i.to,i.duration)};class ot{constructor(e,t){this.state=e,this.modules=t,this.differ=new qe([{path:"styleZoom",type:"number"}]),this.buildingHeights=new Map,this.minZoomBuildingHeight=1/0}getBuildingHeight(e){return void 0!==e?(this.buildingHeights.has(e)||this.addBuildingHeightZoom(e),this.buildingHeights.get(e)||0):this.getDefaultBuildingHeight()}update(){this.buildingHeights.forEach(((e,t)=>{this.updateByZoom(t,e),this.isAnimating()&&((e,t,i)=>{ce.Vx.call(null,"buildingHeight"+i,{step:(e,n)=>t.set(i,n),complete:e=>e.needLabeling=!0},e)})(this.state,this.buildingHeights,t)}))}isAnimating(){return Array.from(this.buildingHeights.keys()).some((e=>void 0!==ce.U2("buildingHeight"+e,this.state)))}clearBuildingHeights(){this.buildingHeights.clear(),this.minZoomBuildingHeight=1/0}getDefaultBuildingHeight(){const e=this.minZoomBuildingHeight!==1/0?this.minZoomBuildingHeight:16;return this.state.styleZoom<e?0:1}updateByZoom(e,t){const i=this.state,n=ce.U2("zoom",i),o=ce.U2("buildingHeight"+e,i),s=void 0!==o?o.to:t,r=void 0!==n?n.attributes.blockBuildingAnimation:this.differ.check(i);i.styleZoom>=e&&this.modules.tileManager.viewportTilesReady()&&1!==s&&!r?nt(i,this.buildingHeights,{animate:!0,easing:T.buildingAnimation.easing,from:t,to:1,duration:T.buildingAnimation.duration*(1-t)},e):i.styleZoom<e&&0!==s&&nt(i,this.buildingHeights,{animate:!1,to:0},e)}addBuildingHeightZoom(e){const t=e<this.state.styleZoom?0:1;this.buildingHeights.set(e,t),this.minZoomBuildingHeight>e&&(this.minZoomBuildingHeight=e)}}var st=i(341),rt=i(127);const at=class{constructor(){this._objects=[],this.type=0}render(){return this._objects=[],this}addObject(e){return this._objects.push(e),this}hasObjects(){return this._objects.length>0}};const lt=class extends at{constructor(){super(),this.type=17}render(e){return this._objects.forEach((t=>t.render(e))),this._objects=[],this}};const ct=class{constructor(e){if((e=e||{}).canvas){this._canvasElement="string"==typeof e.canvas?document.getElementById(e.canvas):e.canvas;const t={antialias:void 0===e.antialias||e.antialias,stencil:void 0!==e.stencil&&e.stencil,failIfMajorPerformanceCaveat:void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,preserveDrawingBuffer:void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer};this._gl=2===e.version?this._canvasElement.getContext("webgl2",t):this._canvasElement.getContext("webgl",t)||this._canvasElement.getContext("experimental-webgl",t)}else this._gl=e.gl;this._pixelRatio=e.pixelRatio||1,this.autoClear=void 0===e.autoClear||e.autoClear,this.clearColor=e.clearColor||[1,1,1,1],this.sortObjects=!0,this._plugins=[],this._pluginsByType={},this._maxPluginOrder=0,this.addPlugin(new lt,0),this.webGlExtensions={}}addPlugin(e,t){return void 0===t&&(t=this._maxPluginOrder+1),this._plugins.push({plugin:e,order:t}),this._plugins.sort(((e,t)=>e.order-t.order)),this._pluginsByType[e.type]=e,this._maxPluginOrder=Math.max.apply(Math,this._plugins.map((e=>e.order))),this}removePlugin(e){return this._plugins.some(((t,i)=>t.plugin instanceof e&&(delete this._pluginsByType[this._plugins[i].plugin.type],this._plugins.splice(i,1),!0))),this}setPixelRatio(e){return this._pixelRatio=e,this}getPixelRatio(){return this._pixelRatio}setSize(e,t){return this._size=[e*this._pixelRatio,t*this._pixelRatio],this._canvasElement&&(this._canvasElement.width=this._size[0],this._canvasElement.height=this._size[1],this._canvasElement.style.width=e+"px",this._canvasElement.style.height=t+"px"),this.setViewport(),this}setViewport(e,t){return void 0!==e&&void 0!==t?this._gl.viewport(0,0,e,t):this._gl.viewport(0,0,this._size[0],this._size[1]),this}getSize(){return this._size}setRenderTarget(e){return this._renderTarget=e,this}readPixels(e,t,i,n,o){const s=this._gl;return this._renderTarget?(this._renderTarget.bind(s),s.readPixels(e,t,i,n,s.RGBA,s.UNSIGNED_BYTE,o),this._renderTarget.unbind(s)):s.readPixels(e,t,i,n,s.RGBA,s.UNSIGNED_BYTE,o),this}clear(){const e=this._gl;return e.clearColor.apply(e,this.clearColor),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),this}render(e,t,i){const n=this._gl;e.typifyForRender(this._pluginsByType),this._renderTarget&&this._renderTarget.bind(n),n.clearDepth(1),n.clearStencil(0),this.autoClear&&this.clear(),t.updateLocalMatrix(),t.updateWorldMatrix();const o={renderer:this,extensions:this.webGlExtensions,scene:e,camera:t,gl:n,userData:i},s=this._plugins.map((e=>e.plugin)).filter((e=>e.hasObjects()));for(let e=0;e<s.length;e++)s[e].render(o,s[e-1],s[e+1]);return this._renderTarget&&this._renderTarget.unbind(n),this}addExtension(e){return this.webGlExtensions[e]=this._gl.getExtension(e),this}};class dt{constructor(e,t={}){this._src=e||null,this.options=Object.assign({},dt.defaultOptions,t),this._glContext=null}enable(e,t){const i=void 0!==t?t:this.options.unit;return void 0!==i&&e.activeTexture(e.TEXTURE0+i),this._texture||this.prepare(e),e.bindTexture(e.TEXTURE_2D,this._texture),this}remove(){return this._texture&&(this._glContext.deleteTexture(this._texture),this._glContext=null,this._texture=null),this}getTexture(){return this._texture}subImage(e,t,i,n){return e.bindTexture(e.TEXTURE_2D,this._texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.options.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),e.texSubImage2D(e.TEXTURE_2D,0,i,n,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),t),this}prepare(e){return this._glContext=e,this._texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this._texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.options.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),this.options.size?e.texImage2D(e.TEXTURE_2D,0,this._toGlParam(e,this.options.format),this.options.size[0],this.options.size[1],0,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),this._src):e.texImage2D(e.TEXTURE_2D,0,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),this._src),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this._toGlParam(e,this.options.wrapS)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this._toGlParam(e,this.options.wrapT)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this._toGlParam(e,this.options.magFilter)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this._toGlParam(e,this.options.minFilter)),this.options.generateMipmaps&&this.options.minFilter!==dt.NearestFilter&&this.options.minFilter!==dt.LinearFilter&&e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null),this}_toGlParam(e,t){return t===dt.ClampToEdgeWrapping?e.CLAMP_TO_EDGE:t===dt.Repeat?e.REPEAT:t===dt.MirroredRepeat?e.MIRRORED_REPEAT:t===dt.NearestFilter?e.NEAREST:t===dt.NearestMipMapNearestFilter?e.NEAREST_MIPMAP_NEAREST:t===dt.NearestMipMapLinearFilter?e.NEAREST_MIPMAP_LINEAR:t===dt.LinearFilter?e.LINEAR:t===dt.LinearMipMapNearestFilter?e.LINEAR_MIPMAP_NEAREST:t===dt.LinearMipMapLinearFilter?e.LINEAR_MIPMAP_LINEAR:t===dt.RgbaFormat?e.RGBA:t===dt.AlphaFormat?e.ALPHA:t===dt.RgbFormat?e.RGB:t===dt.UnsignedByte?e.UNSIGNED_BYTE:t===dt.Float?e.FLOAT:null}}dt.ClampToEdgeWrapping=8,dt.Repeat=9,dt.MirroredRepeat=10,dt.NearestFilter=1,dt.NearestMipMapNearestFilter=2,dt.NearestMipMapLinearFilter=3,dt.LinearFilter=4,dt.LinearMipMapNearestFilter=5,dt.LinearMipMapLinearFilter=6,dt.RgbaFormat=11,dt.AlphaFormat=12,dt.RgbFormat=13,dt.UnsignedByte=14,dt.Float=15,dt.defaultOptions={magFilter:dt.LinearFilter,minFilter:dt.LinearMipMapLinearFilter,wrapS:dt.ClampToEdgeWrapping,wrapT:dt.ClampToEdgeWrapping,format:dt.RgbaFormat,generateMipmaps:!0,flipY:!0,premultiplyAlpha:!0,type:dt.UnsignedByte};const ht=dt;class ut{constructor(e={}){this.options=Object.assign({},ut.defaultOptions,e),this._texture=new ht(null,this.options),this._glContext=null}bind(e){return this._frameBuffer||this._prepare(e),e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this}unbind(e){return e.bindFramebuffer(e.FRAMEBUFFER,null),this}remove(){return this._unprepare(),this}setSize(e){return this.options.size=e,this._unprepare(),this}getTexture(){return this._texture}_prepare(e){this._glContext=e,this._texture||(this._texture=new ht(null,this.options)),this._texture.prepare(e),this._frameBuffer=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._renderBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this._renderBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,this.options.size[0],this.options.size[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._texture.getTexture(),0),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this._renderBuffer),this._checkComplete(e),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null)}_unprepare(){this._texture&&(this._texture.remove(this._glContext),this._texture=null),this._frameBuffer&&(this._glContext.deleteFramebuffer(this._frameBuffer),this._glContext.deleteRenderbuffer(this._renderBuffer),this._frameBuffer=null,this._renderBuffer=null)}_checkComplete(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);t!==e.FRAMEBUFFER_COMPLETE&&(t===e.FRAMEBUFFER_UNSUPPORTED?console.log("Framebuffer is unsupported"):t===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT?console.log("Framebuffer incomplete attachment"):t===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS?console.log("Framebuffer incomplete dimensions"):t===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT?console.log("Framebuffer incomplete missing attachment"):console.log("Unexpected framebuffer status: "+t))}}ut.defaultOptions=Object.assign({},ht.defaultOptions,{size:[0,0],generateMipmaps:!1});const mt=ut;var ft=i(9769),pt=i(9899);const{wallMinBrightness:_t,wallMaxBrightness:vt}=T.floors,{lightIntensity:gt}=T.fences,yt=[gt,gt,gt],bt=[.05,.05,.05],wt=[1,0,0],xt=[1,1,1],It=(e,t,i)=>{const{size:n}=i,o=window.devicePixelRatio;t.bind(e,{u_vec2_vpt_size:[n[0]*o,n[1]*o]})},St=(e,t,i,n)=>{const{size:o}=i,s=window.devicePixelRatio;if(i.demMode){const i=n.renderer.getFramebuffer(n.demManager.getFlatFramebufferId());if(!i)return;t.bind(e,{u_vec2_vpt_size:[Math.trunc(i.renderTarget.options.size[0]),Math.trunc(i.renderTarget.options.size[1])]})}else t.bind(e,{u_vec2_vpt_size:[o[0]*s,o[1]*s]})},Mt=(e,t,i)=>{const n=(0,L.EO)(i.zoom);t.bind(e,{u_vec3_projection_scale_style_scale_dpi:[n,n,pt.$U*window.devicePixelRatio]})},Tt=(e,t,i)=>{const n=(0,L.EO)(i.styleZoom);t.bind(e,{u_vec3_projection_scale_style_scale_dpi:[n,n,pt.$U*window.devicePixelRatio]})},Pt=(e,t,i,n)=>{t.bind(e,{u_float_height_factor:n.buildingHeightAnimator.getDefaultBuildingHeight()})},Lt=(e,t,i)=>{t.bind(e,{u_float_height_limitation:(0,L.r9)(i.zoom,i.size)*Math.cos(i.pitch)*.75,u_float_tile_height:pt._9})},Et=(e,t)=>{t.bind(e,{u_float_height_limitation:pt._9,u_float_tile_height:pt._9})},kt=(e,t)=>{t.bind(e,{u_vec3_light_direction:wt,u_vec3_ambient_color:xt})},zt=(e,t)=>{t.bind(e,{u_vec3_light_color:bt})},At=(e,t)=>{t.bind(e,{u_vec3_light_color:yt})},Ct=(e,t,i)=>{t.bind(e,{u_float_rounding_factor:i.stillness})},Ft=(e,t)=>{t.bind(e,{u_float_border_width_offset:1/window.devicePixelRatio})},Rt=(e,t)=>{t.bind(e,{u_float_z_offset:0})},Dt=(e,t)=>{t.bind(e,{u_float_z_offset:-1e-5})},Ot=(e,t)=>{t.bind(e,{u_sr2d_texture:0})},Bt=(e,t)=>{t.bind(e,{u_vec2_scale_limits:[0,pt.ax]})},jt=(e,t,i,{assetManager:n})=>{n.textures.forEach((t=>t.enable(e)))};function Nt(...e){return(t,i,n,o)=>{e.forEach((e=>e(t,i,n,o)))}}var Ut=i(5507),Zt=i(9573),Ht=i(9958);const Gt=class{constructor(e,t={}){this._buffer=e,this.options=Object.assign({},Ht.Z.defaultOptions,t)}bind(e,t){this._buffer.bind(e,t,this.options)}};const Wt=class{constructor(e,t={}){this._vao=null,this._attributes=t,this._shaderProgram=e,this._ext=null}bind(e){const t=e.extensions.OES_vertex_array_object;return t?this._bind(e.gl,t):this._shaderProgram.bind(e.gl,null,this._attributes),this}unbind(){return this._ext&&this._ext.bindVertexArrayOES(null),this}remove(){return this._vao&&this._ext.deleteVertexArrayOES(this._vao),this}_bind(e,t){this._vao?t.bindVertexArrayOES(this._vao):this._prepare(e,t)}_prepare(e,t){this._ext=t,this._vao=t.createVertexArrayOES(),t.bindVertexArrayOES(this._vao);const i=this._shaderProgram.attributes,n=this._attributes;for(const t in n){const o=i[t];!0!==o.index&&e.enableVertexAttribArray(o.location),n[t].bind(e,o.location)}}};var Vt=i(8951),qt=i(184),Xt=i(2528),$t=i(1030);const Yt=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:8,offset:0,normalized:!0});return new Wt(t,{a_vec2_vertex:i})},Kt=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:8,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:8,offset:4,normalized:!0});return new Wt(t,{a_vec2_vertex:i,a_vec4_identifier:n})},Jt=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:12,offset:4,normalized:!1});return new Wt(t,{a_vec2_vertex:i,a_vec4_normals:n})},Qt=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:16,offset:4,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Float,stride:16,offset:8,normalized:!1});return new Wt(t,{a_vec2_vertex:i,a_vec4_normals:n,a_vec2_shift:o})},ei=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:12,offset:4,normalized:!1}),o=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:12,offset:8,normalized:!0});return new Wt(t,{a_vec2_vertex:i,a_vec4_normals:n,a_vec4_identifier:o})},ti=(e,t)=>{const i=28,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:4,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Byte,stride:i,offset:8,normalized:!1}),r=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:12,normalized:!1}),a=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:16,normalized:!1}),l=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:20,normalized:!1}),c=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:i,offset:24,normalized:!0});return new Wt(t,{a_vec2_vertex:n,a_vec2_texture_widen:s,a_vec2_widen:o,a_float_vertex_distance:r,a_float_component_distance:a,a_float_object_length:l,a_vec4_identifier:c})},ii=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:20,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:20,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:20,offset:12,normalized:!1});return new Wt(t,{a_vec4_position:i,a_vec2_offset:n,a_vec2_texcoord:o})},ni=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:20,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:20,offset:8,normalized:!1}),o=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:20,offset:16,normalized:!0});return new Wt(t,{a_vec4_position:i,a_vec2_offset:n,a_vec4_identifier:o})},oi=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:28,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:28,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Float,stride:28,offset:12,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Float,stride:28,offset:20,normalized:!1});return new Wt(t,{a_vec4_position:i,a_vec2_offset:o,a_vec2_texcoord:n,a_vec2_style_zoom_limits:s})},si=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:20,offset:0,normalized:!0}),n=new Gt(e,{itemSize:3,dataType:Ht.Z.Byte,stride:20,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:20,offset:16,normalized:!1});return new Wt(t,{a_vec3_vertex:i,a_vec3_normal:n,a_vec2_dem_position:o})},ri=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:20,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:20,offset:12,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:20,offset:16,normalized:!1});return new Wt(t,{a_vec3_vertex:i,a_vec4_identifier:n,a_vec2_dem_position:o})},ai=(e,t)=>{const i=20,n=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:1,dataType:Ht.Z.Short,stride:i,offset:6,normalized:!0}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Byte,stride:i,offset:8,normalized:!1}),r=new Gt(e,{itemSize:2,dataType:Ht.Z.Byte,stride:i,offset:10,normalized:!1}),a=new Gt(e,{itemSize:3,dataType:Ht.Z.Byte,stride:i,offset:12,normalized:!1}),l=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:16,normalized:!1});return new Wt(t,{a_vec4_vertex:n,a_vec2_normal:s,a_vec2_normal_delta:r,a_vec3_direction:a,a_float_distance:o,a_vec2_dem_position:l})},li=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:24,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:24,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:24,offset:12,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:24,offset:16,normalized:!1});return new Wt(t,{a_vec3_position:i,a_vec2_offset:n,a_vec2_texcoord:o,a_vec2_range:s})},ci=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:24,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:24,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:24,offset:12,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:24,offset:16,normalized:!1}),r=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:24,offset:20,normalized:!0});return new Wt(t,{a_vec3_position:i,a_vec2_offset:n,a_vec2_texcoord:o,a_vec2_range:s,a_vec4_identifier:r})},di=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:16,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:16,offset:12,normalized:!1});return new Wt(t,{a_vec2_position:i,a_vec2_direction:n,a_vec2_widen_direction:o})},hi=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:20,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:20,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:20,offset:16,normalized:!1});return new Wt(t,{a_vec3_vertex:i,a_vec2_texcoord:n,a_vec2_dem_position:o})},ui=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:8,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:8,offset:4,normalized:!1});return new Wt(t,{a_vec3_vertex:i,a_vec4_direction_distance:n})},mi=(e,t)=>{const i=new Gt(e,{itemSize:3,dataType:Ht.Z.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:16,offset:8,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:16,offset:12,normalized:!1});return new Wt(t,{a_vec3_vertex:i,a_vec4_direction_distance:n,a_vec2_dem_position:o})},fi=(e,t)=>{const i=36,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:4,normalized:!0}),s=new Gt(e,{itemSize:4,dataType:Ht.Z.Byte,stride:i,offset:8,normalized:!1}),r=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:12,normalized:!1}),a=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:16,normalized:!1}),l=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:20,normalized:!1}),c=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:24,normalized:!1}),d=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:28,normalized:!1}),h=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:i,offset:32,normalized:!0});return new Wt(t,{a_vec2_vertex:n,a_vec2_segment_end:o,a_vec4_texture_widen_arrow_widen:s,a_vec2_widen:r,a_vec2_direction:a,a_float_distance_from_start:l,a_float_object_length:c,a_float_type:d,a_vec4_identifier:h})},pi=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:12,offset:4,normalized:!1});return new Wt(t,{a_vec4_vertex:i,a_vec2_widen:n})},_i=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:12,offset:4,normalized:!1}),o=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:12,offset:8,normalized:!0});return new Wt(t,{a_vec4_vertex:i,a_vec2_widen:n,a_vec4_identifier:o})},vi=(e,t)=>{const i=Vt.z.sinks.fill.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:4,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:8,normalized:!1});return new Wt(t,{a_vec2_position:n,a_vec2_offset:o,a_vec2_texcoord:s})},gi=(e,t)=>{const i=Vt.z.sinks.fill.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!1}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.Short,stride:i,offset:4,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:8,normalized:!1}),r=new Gt(e,{itemSize:4,dataType:Ht.Z.UnsignedByte,stride:i,offset:12,normalized:!0});return new Wt(t,{a_vec2_position:n,a_vec2_offset:o,a_vec2_texcoord:s,a_vec4_identifier:r})},yi=(e,t)=>{const i=qt.h.sinks.fill.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:4,normalized:!1});return new Wt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})},bi=(e,t)=>{const i=Xt.B.sinks.framebuffer.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:1,dataType:Ht.Z.Float,stride:i,offset:4,normalized:!1}),s=new Gt(e,{itemSize:2,dataType:Ht.Z.Byte,stride:i,offset:8,normalized:!1});return new Wt(t,{a_vec2_position:n,a_vec2_widen:s,a_float_weight:o})},wi=(e,t)=>{const i=new Gt(e,{itemSize:2,dataType:Ht.Z.Float,stride:0,offset:0,normalized:!1});return new Wt(t,{a_vec2_position:i})},xi=(e,t)=>new Wt(t,{a_vec2_position:e}),Ii=(e,t)=>{const i=$t._.sinks.elevation.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:4,normalized:!1});return new Wt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})},Si=(e,t)=>{const i=$t._.sinks.hillshade.stride,n=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Gt(e,{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:i,offset:4,normalized:!1});return new Wt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})};var Mi=i(6826);const Ti=32,Pi=1/0;class Li extends $.Y{constructor(e,t,i){var n;super("raster"),this.children=[];const o=this;this.setTileCoords(e),null===(n=t.renderer.symbolSettingsList.dem.mesh)||void 0===n||n.forEach((e=>{const n={type:ft.H.Tile,symbol:"dem",sink:"mesh",tile:o,attributes:{layerId:Mi.h,styleId:t.map.state.handyStyleId,tileData:[]},stride:4,rangeStart:0,rangeEnd:24576,attributesHash:"",layerSettings:e,vao:i};!0===e.identify?o.identifyChildren.push(n):o.children.push(n)}))}setTileCoords(e){const t=e[2],i=e[3],n=(0,ne.aq)(t),o=n/Ti;this.size=n,this.zoomLevel=t,this.detailLevel=i;const s=(0,ne.Oy)(e);s[0]-=o,s[1]-=o,this.bounds.min=[s[0],s[1]],this.bounds.max=[s[0]+n,s[1]+n],rt.wA(this.modelMatrix,s,k.al(n+o,n+o,pt._9))}}class Ei{constructor(e,t){var i;this.tiles=new Map,this.destroyed=!1,this.modules=e.modules,this.maxZoom=null!==(i=null==t?void 0:t.maxZoom)&&void 0!==i?i:Pi,this.program=this.modules.renderer.getShaderProgram("demMesh");const n=[];for(let e=0;e<Ti;e++)for(let t=0;t<Ti;t++)n.push(t,e,t+1,e,t,e+1),n.push(t,e+1,t+1,e,t+1,e+1);const o=pt.Bq/Ti;for(let e=0;e<n.length;e++)n[e]*=o;this.buffer=new Ht.Z(new Uint16Array(n),{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:0,offset:0,normalized:!0}),this.buffer.drawType=Ht.Z.StaticDraw,this.vao=xi(this.buffer,this.program),this.update()}updateStyleId(){this.tiles.forEach((e=>{e.children.forEach((e=>{e.attributes.styleId=this.modules.map.state.handyStyleId})),e.identifyChildren.forEach((e=>{e.attributes.styleId=this.modules.map.state.handyStyleId}))}))}destroy(){this.destroyed||(this.tiles=new Map,this.vao.unbind(),this.vao.remove(),this.buffer.remove(),this.destroyed=!0)}setMaxZoom(e=Infinity){e!==this.maxZoom&&(this.maxZoom=e,this.update())}update(){if(this.destroyed)return;const e=this.modules.map.state,t=Math.trunc(e.styleZoom),i=Math.min(t,Math.min(this.maxZoom,t-1)),n=(0,ne.b5)(this.modules.map.state,i,0,i).reduce(((e,t)=>(e.set((0,ne.gx)(t),t),e)),new Map);this.tiles.forEach(((e,t)=>{n.has(t)||this.tiles.delete(t)})),n.forEach(((e,t)=>{this.tiles.has(t)||this.tiles.set(t,new Li(e,this.modules,this.vao))}))}}var ki=i(3287);var zi=i(1245);function Ai(){let e=new ki.WT(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Ci(e,t,i,n){let o,s,r,a,l,c=t[0],d=t[1],h=t[2],u=t[3],m=i[0],f=i[1],p=i[2],_=i[3];return c*m+d*f+h*p+u*_,s<0&&(-s,-m,-f,-p,-_),1-s>1e-6?(Math.acos(s),Math.sin(o),Math.sin((1-n)*o)/r,Math.sin(n*o)/r):(1-n,n),e[0]=a*c+l*m,e[1]=a*d+l*f,e[2]=a*h+l*p,e[3]=a*u+l*_,e}zi.d9,zi.al,zi.JG,zi.t8,zi.IH,zi.bA,zi.AK,zi.t7,zi.kE,zi.we;const Fi=zi.Fv;zi.I6,zi.fS,function(){let e=k.Ue(),t=k.al(1,0,0),i=k.al(0,1,0)}(),function(){let e=Ai(),t=Ai()}(),function(){let e=function(){let e=new ki.WT(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}()}();class Ri{constructor(e,t,i=[]){this.type="vertex"===e?Ri.Vertex:Ri.Fragment,this._code=Array.isArray(t)?t.join("\n"):t||"",this._code=i.map((e=>void 0!==e.value?"#define "+e.type+" "+e.value:"#define "+e.type)).join("\n")+"\n"+this._code}get(e){return this._shader||this._compile(e),this._shader}remove(e){this._shader&&e.deleteShader(this._shader)}_compile(e){const t=this.type===Ri.Vertex?e.VERTEX_SHADER:e.FRAGMENT_SHADER,i=this._shader=e.createShader(t);if(!i||e.isContextLost())throw new Error(`[2gl] Failed to create shader. Shader is null: ${!i}. Context is lost: ${e.isContextLost()}`);if(e.shaderSource(i,this._code),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(i))}}Ri.Vertex=1,Ri.Fragment=2;class Di{constructor(e,t){this._initData=e,this.byteLength=void 0!==e.byteLength?e.byteLength:e,this.type=Di.ArrayBuffer,this.drawType=Di.StaticDraw,this.options=Object.assign({},Di.defaultOptions,t),this._glBuffer=null,this._glContext=null}bind(e,t,i){return this._glBuffer||this.prepare(e),this.type===Di.ArrayBuffer?(e.bindBuffer(e.ARRAY_BUFFER,this._glBuffer),i=i||this.options,e.vertexAttribPointer(t,i.itemSize,this._toGlParam(e,i.dataType),i.normalized,i.stride,i.offset)):this.type===Di.ElementArrayBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._glBuffer),this}remove(){return this._unprepare(),this}subData(e,t,i){return e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferSubData(this._toGlParam(e,this.type),t,i),this}prepare(e){return this._glContext=e,this._glBuffer=e.createBuffer(),e.bindBuffer(this._toGlParam(e,this.type),this._glBuffer),e.bufferData(this._toGlParam(e,this.type),this._initData,this._toGlParam(e,this.drawType)),this._initData=null,this}_unprepare(){this._glBuffer&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(e,t){return t===Di.ArrayBuffer?e.ARRAY_BUFFER:t===Di.ElementArrayBuffer?e.ELEMENT_ARRAY_BUFFER:t===Di.StaticDraw?e.STATIC_DRAW:t===Di.DynamicDraw?e.DYNAMIC_DRAW:t===Di.Byte?e.BYTE:t===Di.Short?e.SHORT:t===Di.Int?e.INT:t===Di.Float?e.FLOAT:t===Di.UnsignedByte?e.UNSIGNED_BYTE:t===Di.UnsignedShort?e.UNSIGNED_SHORT:t===Di.UnsignedInt?e.UNSIGNED_INT:null}}Di.ArrayBuffer=1,Di.ElementArrayBuffer=2,Di.StaticDraw=10,Di.DynamicDraw=11,Di.Float=20,Di.UnsignedByte=21,Di.UnsignedShort=22,Di.UnsignedInt=23,Di.Byte=24,Di.Short=25,Di.Int=26,Di.defaultOptions={itemSize:3,dataType:Di.Float,stride:0,offset:0,normalized:!1};class Oi{constructor(e,t={}){this._src=e||null,this.options=Object.assign({},Oi.defaultOptions,t),this._glContext=null}enable(e,t){const i=void 0!==t?t:this.options.unit;return void 0!==i&&e.activeTexture(e.TEXTURE0+i),this._texture||this.prepare(e),e.bindTexture(e.TEXTURE_2D,this._texture),this}remove(){return this._texture&&(this._glContext.deleteTexture(this._texture),this._glContext=null,this._texture=null),this}getTexture(){return this._texture}subImage(e,t,i,n){return e.bindTexture(e.TEXTURE_2D,this._texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.options.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),e.texSubImage2D(e.TEXTURE_2D,0,i,n,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),t),this}prepare(e){return this._glContext=e,this._texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this._texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.options.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.options.premultiplyAlpha),this.options.size?e.texImage2D(e.TEXTURE_2D,0,this._toGlParam(e,this.options.format),this.options.size[0],this.options.size[1],0,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),this._src):e.texImage2D(e.TEXTURE_2D,0,this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.format),this._toGlParam(e,this.options.type),this._src),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this._toGlParam(e,this.options.wrapS)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this._toGlParam(e,this.options.wrapT)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this._toGlParam(e,this.options.magFilter)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this._toGlParam(e,this.options.minFilter)),this.options.generateMipmaps&&this.options.minFilter!==Oi.NearestFilter&&this.options.minFilter!==Oi.LinearFilter&&e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null),this}_toGlParam(e,t){return t===Oi.ClampToEdgeWrapping?e.CLAMP_TO_EDGE:t===Oi.Repeat?e.REPEAT:t===Oi.MirroredRepeat?e.MIRRORED_REPEAT:t===Oi.NearestFilter?e.NEAREST:t===Oi.NearestMipMapNearestFilter?e.NEAREST_MIPMAP_NEAREST:t===Oi.NearestMipMapLinearFilter?e.NEAREST_MIPMAP_LINEAR:t===Oi.LinearFilter?e.LINEAR:t===Oi.LinearMipMapNearestFilter?e.LINEAR_MIPMAP_NEAREST:t===Oi.LinearMipMapLinearFilter?e.LINEAR_MIPMAP_LINEAR:t===Oi.RgbaFormat?e.RGBA:t===Oi.AlphaFormat?e.ALPHA:t===Oi.RgbFormat?e.RGB:t===Oi.UnsignedByte?e.UNSIGNED_BYTE:t===Oi.Float?e.FLOAT:null}}Oi.ClampToEdgeWrapping=8,Oi.Repeat=9,Oi.MirroredRepeat=10,Oi.NearestFilter=1,Oi.NearestMipMapNearestFilter=2,Oi.NearestMipMapLinearFilter=3,Oi.LinearFilter=4,Oi.LinearMipMapNearestFilter=5,Oi.LinearMipMapLinearFilter=6,Oi.RgbaFormat=11,Oi.AlphaFormat=12,Oi.RgbFormat=13,Oi.UnsignedByte=14,Oi.Float=15,Oi.defaultOptions={magFilter:Oi.LinearFilter,minFilter:Oi.LinearMipMapLinearFilter,wrapS:Oi.ClampToEdgeWrapping,wrapT:Oi.ClampToEdgeWrapping,format:Oi.RgbaFormat,generateMipmaps:!0,flipY:!0,premultiplyAlpha:!0,type:Oi.UnsignedByte};const Bi=Oi;class ji{constructor(e={}){this.options=Object.assign({},ji.defaultOptions,e),this._texture=new Bi(null,this.options),this._glContext=null}bind(e){return this._frameBuffer||this._prepare(e),e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this}unbind(e){return e.bindFramebuffer(e.FRAMEBUFFER,null),this}remove(){return this._unprepare(),this}setSize(e){return this.options.size=e,this._unprepare(),this}getTexture(){return this._texture}_prepare(e){this._glContext=e,this._texture||(this._texture=new Bi(null,this.options)),this._texture.prepare(e),this._frameBuffer=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._renderBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this._renderBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,this.options.size[0],this.options.size[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._texture.getTexture(),0),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this._renderBuffer),this._checkComplete(e),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null)}_unprepare(){this._texture&&(this._texture.remove(this._glContext),this._texture=null),this._frameBuffer&&(this._glContext.deleteFramebuffer(this._frameBuffer),this._glContext.deleteRenderbuffer(this._renderBuffer),this._frameBuffer=null,this._renderBuffer=null)}_checkComplete(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);t!==e.FRAMEBUFFER_COMPLETE&&(t===e.FRAMEBUFFER_UNSUPPORTED?console.log("Framebuffer is unsupported"):t===e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT?console.log("Framebuffer incomplete attachment"):t===e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS?console.log("Framebuffer incomplete dimensions"):t===e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT?console.log("Framebuffer incomplete missing attachment"):console.log("Unexpected framebuffer status: "+t))}}ji.defaultOptions=Object.assign({},Bi.defaultOptions,{size:[0,0],generateMipmaps:!1});const Ni=ji;var Ui=i(7123),Zi=i(4712),Hi=i(8072),Gi=i(6451);const Wi=new Hi.TD("main").getPacked(),Vi=64;class qi{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="dem",this.tree=Ui(),this.minElevation=0,this.tileLoader=new Zi.U("arrayBuffer"),this.attributes={},this.tiles=new Map,this.textureIndices=new Map,this.url=e=>{const[t,i,n]=(0,ne._W)(e);return this.options.url(t,i,n)}}abortTileFetch(e){this.tileLoader.abortRequest((0,ne.gx)(e))}deleteTile(e){const t=(0,ne.gx)(e);if(this.tiles.get(t)){const i=(0,ne.Sl)(e);this.tree.remove({minX:i.min[0],minY:i.min[1],maxX:i.max[0],maxY:i.max[1]},((e,i)=>t===i.key))}this.tiles.delete(t),this.updateMinElevation()}fetchTile(e){const t=(0,ne.gx)(e),i=[{regionId:0,metatileHash:-1}];if(this.tiles.has(t))return Promise.resolve(i);const n=this.url(e);return this.tileLoader.fetch(e,(()=>n)).then((n=>(n.rejected||this.tiles.set(t,n.data?this.tileDataToFloat32Array(n.data,e):void 0),i)),(()=>Promise.resolve(void 0)))}generateTile(e,t,i,n,o,s){return(0,M.mG)(this,void 0,void 0,(function*(){const e=[],i=[],n=(0,ne.gx)(t),o=this.tiles.get(n);if(!o)return Promise.resolve({results:e,transferable:i});const s=(0,ne.aq)(t[2]),r=(0,ne.Sl)(t);this.tree.insert(Object.assign({key:n,minX:r.min[0],minY:r.min[1],maxX:r.max[0],maxY:r.max[1],cellSize:s/Vi},o)),this.updateMinElevation();const a=this.modules.renderer.getRenderingContext(),l=new Bi(o.data,{size:[Vi,Vi],format:Bi.AlphaFormat,type:Bi.Float,flipY:!0,magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter}).prepare(a),c=this.modules.imageManager.addPreparedTexture(l);this.textureIndices.set(n,c);const d=this.modules.map.state.handyStyleId,h=.0078125,u=[[0,0,0+h,0+h],[1,0,1-h,0+h],[0,1,0+h,1-h],[0,1,0+h,1-h],[1,0,1-h,0+h],[1,1,1-h,1-h]],m=$t._.generateElevation(this.modules.collector,u,d,Mi.h,c);return e.push({regionId:0,metatileHash:-1,styleId:d,collectorOutput:{data:[m],labels:[],geoIds:new Uint32Array,floorHidingMap:[],rastersToLoad:new Float64Array,transferable:[],identifyIds:Wi}}),Promise.resolve({results:e,transferable:i})}))}tileDataToFloat32Array(e,t){const[i,n,o,s]=t,r=new Uint8Array(e),a=new Float32Array(Math.pow(Vi,2));let l=1/0,c=-1/0;for(let e=0;e<Vi;e++){const t=(0,L.PA)((0,ne.Oy)([i,n+.015625*e,o,s])),d=(0,L.Xg)(t[1]);for(let t=0;t<Vi;t++){const i=t+e*Vi,n=(r[i]+256*r[Math.pow(Vi,2)+i]-1e4)*d;l=Math.min(n,l),c=Math.max(n,c),a[i]=n}}return{data:a,minZ:l,maxZ:c,bounds:{min:(0,ne.Oy)(t),max:(0,ne.Oy)([i+1,n+1,o,s])}}}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e}getId(){return this.id}destroy(){const{imageManager:e}=this.modules;this.tileLoader.destroy(),this.tiles.clear(),this.tree.clear(),this.textureIndices.forEach((t=>e.deleteTexture(t))),this.textureIndices.clear()}getElevation(e){const t=this.getElevationTile(e);if(t)return function(e,t){const i=(0,P.uZ)((t[0]-e.minX)/e.cellSize,0,63),n=(0,P.uZ)((t[1]-e.minY)/e.cellSize,0,63),o=Math.trunc(i),s=Math.trunc(n),r=Math.min(o+1,63),a=Math.min(s+1,63),l=X.t7([],[e.data[Xi(s)*Vi+o],e.data[Xi(a)*Vi+o]],[e.data[Xi(s)*Vi+r],e.data[Xi(a)*Vi+r]],i%1);return(0,P.t7)(l[0],l[1],n%1)}(t,e)}getElevationTile(e){return this.tree.search({minX:e[0],minY:e[1],maxX:e[0],maxY:e[1]}).reduce(((e,t)=>!e||e.cellSize>t.cellSize?t:e),void 0)}getMinElevation(){return this.minElevation}updateMinElevation(){const e=this.modules.map.state;if(!e.demMode)return;const t=this.modules.camera.position[2],i=(0,Gi.BS)(e.tilesBounds);if(void 0!==e.elevation){const n=e.elevation/2*L.k3/t+1,o=Math.max(e.pitch/e.maxPitch*30,4);(0,z.bA)(i,Math.min(n,o))}const n=this.tree.search({minX:i.min[0],minY:i.min[1],maxX:i.max[0],maxY:i.max[1]});e.styleZoom-on>1?this.minElevation=n.reduce(((e,t)=>{const n=(0,z.jV)(i,t.bounds);X.lu(n.min,n.min,t.bounds.min),X.lu(n.max,n.max,t.bounds.min),X.bA(n.min,n.min,1/t.cellSize),X.bA(n.max,n.max,1/t.cellSize);for(let i=Math.trunc(n.min[0]);i<n.max[0];i++)for(let o=Math.trunc(n.min[1]);o<n.max[1];o++){const n=i+o*Vi,s=t.data[n];e=void 0===e?s:Math.min(e,s)}return e}),void 0):this.minElevation=n.reduce(((e,t)=>void 0===e?t.minZ:Math.min(e,t.minZ)),void 0)}}function Xi(e){return 63-e}var $i=i(7354),Yi=i(2034),Ki=i(2771);const Ji=new Float64Array(16);class Qi{constructor(e,t,i){this.detailLevel=0,this.mvpMatrix=new Float64Array(16),this.texMatrix=new Float64Array(16),rt.JG(this.mvpMatrix,e),rt.Jp(this.texMatrix,L.LX,e),this.detailLevel=i,this.viewport=[[0,0,0,1],[1,0,0,1],[1,1,0,1],[0,1,0,1]],rt.U_(Ji,this.texMatrix),this.viewport.forEach((e=>{k.fF(e,e,Ji),e[0]-=t[0],e[1]-=t[1],e[2]-=t[2],e[2]>=0&&(e[2]=-1),k.Fv(e,e);const i=-t[2]/e[2];e[0]=t[0]+e[0]*i,e[1]=t[1]+e[1]*i,e[2]=t[2]+e[2]*i}))}}class en{constructor(e){this.destroyed=!1,this.modules=e.modules,this.textures=[]}update(){if(this.destroyed)return;const{center:e,padding:t,rotation:i,size:n,viewport:o,demTilesBounds:s,zoom:r}=this.modules.map.state,a=(0,Ki.hS)(s[0],s[1]),l=(0,Ki.Oy)(s[2],a);this.textures=[];const c=(0,P.Id)(45),d=Math.min(this.modules.map.state.pitch,c),h=new E.V({pitch:d,center:e,padding:t,rotation:i,size:n,viewport:o,zoom:r}),u=(0,P.uZ)(Math.pow(this.modules.map.state.pitch/c,3),0,1);let m=-(.5+.5*u);if(rt.wA(Ji,[0,-m,0],[1/sn[0],1/sn[1],1]),rt.Jp(Ji,Ji,h.viewProjectionMatrix),this.textures.push(new Qi(Ji,h.position,0)),(0,Ki.Oy)(this.textures[0].viewport[2],a)>=l)return!0;m+=1;const f=Math.pow(n[1]/749,2);[1.4,3.2,12,31].some(((e,t)=>{e=(e-1)*u*f+1,rt.wA(Ji,[0,-(m*e+1),0],[1/sn[0],e/sn[1],1]),rt.Jp(Ji,Ji,h.viewProjectionMatrix),m+=2/e;const i=this.textures.push(new Qi(Ji,h.position,t));if((0,Ki.Oy)(this.textures[i-1].viewport[2],a)>=l)return!0}))}destroy(){this.textures=[]}}var tn=i(6743);const nn=64,on=12,sn=[1.5,1];const rn=(e,t,i)=>`https://tileserver.web-staging.2gis.ru/v2/ald?ts=relief_sd&x=${e}&y=${t}&z=${i}`,an=k.Ue();class ln{constructor(e){this.demTextureMatrix=new Float64Array(rt.Ue()),this.flatFbVpTransformMatrix=new Float64Array(rt.Ue()),this.centerCorrectionFactor=.1,this.demFbVpMatrix=new Float64Array(rt.Ue()),this.demFramebufferId=$i.z,this.flatFramebufferId=$i.z,this.identifyFlatFramebufferId=$i.z,this.hillshadeRampTextureId=NaN,this.hillshadeFramebufferId=$i.z,this.lastStyleId=NaN,this.demModelMatrix=new Float64Array(rt.Ue()),this.modules=e,this.enabled=!1,this.sources=[],this.tileLayers=[],this.differ=new qe([])}enable(){this.differ=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"demMode",type:"boolean"},{path:"elevation",type:"number"},{path:"minElevation",type:"number"}]),this.demFramebufferId=this.createDemFramebuffer(),this.hillshadeFramebufferId=this.createHillshadeFramebuffer(),this.flatFramebufferId=this.createFlatFramebuffer(),this.identifyFlatFramebufferId=this.createFlatIdentifyFramebuffer();const e=new Ht.Z(new Uint16Array([[0,0,0,0],[1,0,1,0],[0,1,0,1],[0,1,0,1],[1,0,1,0],[1,1,1,1]].reduce(((e,t)=>{const[i,n,o,s]=t;return e.push(i*pt.Bq,n*pt.Bq,(0,Yi.Bb)(o),(0,Yi.Bb)(s)),e}),[])));this.hillshadeVao=Si(e,this.modules.renderer.getShaderProgram("demHillshade")),this.addDefaultSources(),this.modules.styleManager.setFramebufferId(this.modules.map.state.handyStyleId,Mi.h,{elevation:this.demFramebufferId,hillshade:this.hillshadeFramebufferId});const t=this.modules.styleManager.getStyle(this.modules.map.state.handyStyleId);(null==t?void 0:t.dem)&&(this.hillshadeRampTextureId=this.modules.imageManager.addPreparedTexture(function(e,t,i){const n=(0,ae.jJ)(e.styleZoom,e.styleState,[]),o=[],s=i-1;for(let e=0;e<i;e++){const i=e/s,r=256*(0,ae.UP)(t,i,n);o.push(r)}return new Bi(new Uint8Array(o),{size:[i,1],format:Bi.AlphaFormat,magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter,wrapS:Bi.ClampToEdgeWrapping,wrapT:Bi.ClampToEdgeWrapping})}(this.modules.map.state,t.dem.style.shadingPalette,256))),this.modules.defaultSource.disableHillshade(),this.enabled=!0}disable(){var e,t,i,n;this.enabled&&(null===(e=this.meshSource)||void 0===e||e.destroy(),this.meshSource=void 0,null===(t=this.flatMapSource)||void 0===t||t.destroy(),this.flatMapSource=void 0,this.tileLayers.forEach((e=>{this.modules.tileManager.removeTileLayer(e)})),this.tileLayers=[],this.sources.forEach((e=>{e.destroy()})),this.sources=[],this.hillshadeTile&&(this.modules.tileManager.removeObject(this.hillshadeTile),this.hillshadeTile=void 0),null===(i=this.hillshadeVao)||void 0===i||i.unbind(),null===(n=this.hillshadeVao)||void 0===n||n.remove(),this.modules.styleManager.removeLayer("demo_raster_layer"),this.modules.styleManager.setFramebufferId(this.modules.map.state.handyStyleId,Mi.h,{elevation:$i.z,hillshade:$i.z}),this.modules.renderer.removeFramebuffer(this.hillshadeFramebufferId),this.modules.renderer.removeFramebuffer(this.demFramebufferId),this.modules.renderer.removeFramebuffer(this.flatFramebufferId),this.modules.defaultSource.enableHillshade({}),this.enabled=!1)}update(){var e,t,i;if(!this.enabled)return;const n=this.modules.map.state;this.lastStyleId!==n.handyStyleId&&(null===(e=this.meshSource)||void 0===e||e.updateStyleId(),this.lastStyleId=n.handyStyleId),this.differ.check(this.modules.map.state)&&(this.updateMinElevation(),null===(t=this.flatMapSource)||void 0===t||t.update(),null===(i=this.meshSource)||void 0===i||i.update(),this.updateDemFramebufferMatrix(),this.modules.map.state.needRerender=!0)}isEnabled(){return this.enabled}getDemFramebufferId(){return this.demFramebufferId}getFlatFramebufferId(){return this.flatFramebufferId}getIdentifyFlatFramebufferId(){return this.identifyFlatFramebufferId}getHillshadeFramebufferId(){return this.hillshadeFramebufferId}getHillshadeRampTextureId(){return this.hillshadeRampTextureId}getElevation(e){if(!this.enabled)return;let t;for(let i=this.sources.length-1;i>=0;i--){const n=this.sources[i].getElevation(e);if(void 0!==n){t=n;break}}return t}getLabelsDemKey(e){if(!this.isEnabled()||0===e.length)return;let t,i;for(const i of e)if(t=i.labels.find((e=>e.type===tn.R2.Point)),t)break;if(t){(0,ne.L7)(an,t.vertices,0,(0,ne.Bs)(t.tileCoords));for(let e=this.sources.length-1;e>=0;e--){const t=this.sources[e].getElevationTile(an);if(void 0!==t){i=t;break}}return i?i.key:void 0}}enrichWithElevation(e){var t;if(this.isEnabled())for(const i of e){let e=null;for(const n of i.labels)n.type===tn.R2.Point&&(e||(e=(0,ne.Bs)(n.tileCoords)),(0,ne.L7)(an,n.vertices,0,e),n.demElevation=null!==(t=this.getElevation(an))&&void 0!==t?t:NaN)}}getMinElevation(){return this.sources.reduce(((e,t)=>{const i=t.getMinElevation();return void 0===i?e:void 0===e?i:Math.min(e,i)}),void 0)}updateMinElevation(){this.sources.forEach((e=>e.updateMinElevation()))}getMeshTiles(){return this.meshSource?Array.from(this.meshSource.tiles.values()):[]}getFlatMapTextures(){return this.flatMapSource?this.flatMapSource.textures.slice():[]}clearTextureBindings(){const e=this.modules.renderer.getRenderingContext();e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+6),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+7),e.bindTexture(e.TEXTURE_2D,null)}setMeshMaxZoom(e){var t;this.meshMaxZoom=e,null===(t=this.meshSource)||void 0===t||t.setMaxZoom(e)}addDefaultSources(){var e;if(!this.enabled){this.addElevationSource({url:rn,minZoom:5,maxZoom:8,attributes:{}}),this.addElevationSource({url:rn,minZoom:9,maxZoom:on,attributes:{}}),this.flatMapSource=new en(this.modules.map),this.meshSource=new Ei(this.modules.map,{maxZoom:this.meshMaxZoom});const t=this.hillshadeVao,i=null===(e=this.modules.renderer.symbolSettingsList.dem.hillshade)||void 0===e?void 0:e[0];if(t&&i){this.hillshadeTile=new $.W("raster",[],this.modules.renderer);const e={type:ft.H.Tile,symbol:"dem",sink:"hillshade",tile:this.hillshadeTile,attributes:{layerId:Mi.h,styleId:this.modules.map.state.handyStyleId,tileData:[]},stride:$t._.sinks.hillshade.stride,rangeStart:0,rangeEnd:6*$t._.sinks.hillshade.stride,attributesHash:"",layerSettings:i,vao:t};this.hillshadeTile.children.push(e),this.modules.tileManager.addObject(this.hillshadeTile)}}}addElevationSource(e){const t=new qi((0,Ut.Q)(),this.modules,e);this.sources.push(t);const{minZoom:i,maxZoom:n}=e,o=new Zt.I(i,n,i,n,this.modules,this.modules.map.state,t);this.modules.tileManager.addTileLayer(o),this.tileLayers.push(o)}getDemTextureSize(){const e=this.modules.map.state.size[1]*T.camera.viewportLimitRatio;return Math.min(Math.ceil(Math.hypot(e,e)/pt.y4),nn)}createDemFramebuffer(){const e=this.modules.renderer.getRenderingContext();let t=this.getDemTextureSize()*nn;const i=new Ni({size:[t,t],magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter,wrapS:Bi.ClampToEdgeWrapping,wrapT:Bi.ClampToEdgeWrapping,flipY:!0,type:Bi.Float});return this.modules.renderer.addFramebuffer({clearColor:[0,0,0,0],onResize:()=>{const n=this.getDemTextureSize()*nn;n!==t&&(console.log(`[DEM] Texture resized: ${t}`),t=n,i.setSize([t,t]),i.bind(e),i.unbind(e))},renderTarget:i,getViewProjectionMatrix:()=>this.demFbVpMatrix,renderIndex:0,onRenderStart:()=>{this.clearTextureBindings()}})}createHillshadeFramebuffer(){const e=this.modules.renderer.getRenderingContext();let t=this.getDemTextureSize()*nn;const i=new Ni({size:[t,t],magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter,wrapS:Bi.ClampToEdgeWrapping,wrapT:Bi.ClampToEdgeWrapping,format:Bi.RgbFormat,flipY:!0});return this.modules.renderer.addFramebuffer({clearColor:[0,0,0,0],onResize:()=>{const n=this.getDemTextureSize()*nn;n!==t&&(console.log(`[DEM] Texture resized: ${t}`),t=n,i.setSize([t,t]),i.bind(e),i.unbind(e))},renderTarget:i,getViewProjectionMatrix:()=>this.demFbVpMatrix,renderIndex:1,onRenderStart:()=>{this.clearTextureBindings()},onRenderEnd:()=>{e.colorMask(!0,!0,!0,!0)}})}createFlatFramebuffer(){const e=this.modules.renderer.getRenderingContext(),t=window.devicePixelRatio,i=this.modules.map.state.size,n=new Ni({size:[Math.trunc(i[0]*sn[0]*t),Math.trunc(i[1]*sn[1]*t)],magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter,wrapS:Bi.ClampToEdgeWrapping,wrapT:Bi.ClampToEdgeWrapping});return this.modules.renderer.addFramebuffer({clearColor:[0,0,0,0],onResize:()=>{const t=window.devicePixelRatio,i=this.modules.map.state.size;n.setSize([Math.trunc(i[0]*sn[0]*t),Math.trunc(i[1]*sn[1]*t)]),n.bind(e),n.unbind(e)},renderTarget:n,renderIndex:2,onRenderStart:()=>{e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,null)}})}createFlatIdentifyFramebuffer(){const e=this.modules.renderer.getRenderingContext(),t=this.modules.map.state.size,i=new Ni({size:[Math.trunc(t[0]*sn[0]*T.identify.pixelDensity),Math.trunc(t[1]*sn[1]*T.identify.pixelDensity)],magFilter:Bi.NearestFilter,minFilter:Bi.NearestFilter,wrapS:Bi.ClampToEdgeWrapping,wrapT:Bi.ClampToEdgeWrapping});return this.modules.renderer.addFramebuffer({clearColor:[0,0,0,0],onResize:()=>{const t=this.modules.map.state.size;i.setSize([Math.trunc(t[0]*sn[0]*T.identify.pixelDensity),Math.trunc(t[1]*sn[1]*T.identify.pixelDensity)]),i.bind(e),i.unbind(e)},renderTarget:i,renderIndex:2,onRenderStart:()=>{e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,null)}})}updateDemFramebufferMatrix(){const e=this.modules.map.state,t=Math.trunc(e.styleZoom),i=(0,ne.aq)(Math.min(t,on)),n=i*this.getDemTextureSize(),o=n/2,s=i/nn,r=[e.center[0]-o,e.center[1]-o],a=[];X.lu(a,this.modules.camera.position,e.center);const l=X.Zh(a);X.Fv(a,a);const c=(o-l-s)*Math.sin(e.pitch/e.maxPitch*(Math.PI/2));X.bA(a,a,c),X.lu(r,r,a),rt.wA(this.demModelMatrix,[Math.trunc(r[0]/s)*s,Math.trunc(r[1]/s)*s,0],[n,n,pt._9]),rt.U_(this.demTextureMatrix,this.demModelMatrix),rt.Jp(this.demFbVpMatrix,L.TD,this.demTextureMatrix),rt.dC(this.demTextureMatrix,this.demTextureMatrix,this.modules.camera.viewProjectionMatrixInverse)}}function cn(...e){return(t,i,n,o,s)=>{e.forEach((e=>e(t,i,n,o,s)))}}const dn=(e,t,i,n,o)=>{var s;if(!0===o||!n.demManager.isEnabled())return un(e,t);const r=n.demManager.getDemFramebufferId(),a=n.renderer.getFramebuffer(r),l=n.styleManager.getStyle(i.handyStyleId);if(!a||!l)return un(e,t);const c=a.renderTarget.getTexture(),d=c.options.size;if(!d)return un(e,t);const h=n.imageManager.getTexture(n.demManager.getHillshadeRampTextureId());if(void 0===c||void 0===h)return un(e,t);const u={type:"binder",styleZoom:i.styleZoom,styleState:i.styleState,tileData:[]},m=(0,ae.vn)(l.dem.style.verticalScale,u),f=(0,L.v3)((0,P.Id)((0,ae.vn)(l.dem.style.lightingDirection,u))-i.rotation),p=(0,ae.vn)(l.dem.style.shadingIntensity,u),_=L.A5/(Math.pow(2,Math.min(Math.trunc(i.styleZoom),on))*nn);c.enable(e,5),h.enable(e,7),t.bind(e,{u_mat4_dem_mvp:n.demManager.demTextureMatrix,u_float_dem_scale:m,u_float_dem_resolution:d[0],u_float_dem_cell_size:_,u_float_dem_light_direction:f,u_float_dem_shade_intension:p,u_tex_dem:5,u_tex_hillshade_ramp:7,u_float_map_center_elevation:null!==(s=i.elevation)&&void 0!==s?s:0})},hn=(e,t)=>(t.bind(e,{u_float_dem_shade_intension:0}),!0),un=(e,t)=>(t.bind(e,{u_float_dem_scale:0}),!0),mn=cn(kt,Lt,dn),fn=cn(Lt,It,dn),pn=cn(kt,It,Lt,dn),_n=cn(Ot,Pt),vn=cn(It,Mt,Bt,Ft),gn=cn(It,Mt,((e,t)=>{t.bind(e,{u_vec4_border_color:[0,0,0,0]})}),((e,t)=>{t.bind(e,{u_vec4_space_color:[0,0,0,0]})})),yn=cn(It,Tt,Ct,Pt,dn),bn=cn(It,Tt,Pt,dn),wn=cn(Ot,Pt,It,dn),xn=It,In=cn(It,Mt,Bt,Ft),Sn=cn(It,Ct),Mn=dn;var Tn=i(8604),Pn=i(9329),Ln=i(9670);function En(e,t){return 0===t?1:1===t?e.labelingOpacity:1-e.labelingOpacity}const kn=(e,t,i,n,o,s,r)=>{const a=(0,ae.zn)(s.style.color,_o(i,o));return zi.JG(r.value,a.value),!0},zn=(e,t,i,n,o,s,r)=>{const a=(0,ae.zn)(s.style.topColor,_o(i,o));return zi.JG(r.value,a.value),!0},An=(e,t,i,n,o,s,r)=>{const a=(0,ae.zn)(s.style.sideColor,_o(i,o));return zi.JG(r.value,a.value),!0},Cn=(e,t,i,n,o,s,r)=>{const a=(0,ae.zn)(s.style.strokeColor,_o(i,o));return zi.JG(r.value,a.value),!0},Fn=(e,t,i,n,o,s,r)=>{const a=(0,ae.zn)(s.style.strokeColor2,_o(i,o));return zi.JG(r.value,a.value),!0},Rn=(e,t,i,n,o,s,r)=>(void 0===o.attributes.id||(r.value[3]*=n.modelLayer.getOpacity(o.attributes.id,s.minzoom)),!0),Dn=(e,t,i,{modelLayer:n},o,s,r)=>{if(void 0===o.attributes.hiddenObjectId)return!0;if(o.attributes.hiddenObjectId&&!n.hasModel(o.attributes.hiddenObjectId))return!0;const a=n.getVisibleModelData(o.attributes.hiddenObjectId);if(!a)return!0;const l=1-a.opacity;return!(l<.5)&&(r.value[3]*=l,!0)},On=(e,t)=>(t.bind(e,{u_float_opacity:1}),!0),Bn=(e,t,i,n,o,s,r)=>{const a=_o(i,o),l=(0,ae.zn)(s.style.strokeColor,a).value,c=(0,ae.vn)(s.style.strokeWidth,a);return zi.fS(r.value,l)&&1===r.value[3]&&c<=1&&(r.value[3]*=i.stillness),!0},jn=(e,t,i,n,o,s,r)=>{const a=_o(i,o),l=(0,ae.zn)(s.style.topColor,a).value,c=(0,ae.vn)(s.style.strokeWidth,a);return zi.fS(r.value,l)&&1===r.value[3]&&c<=1&&(r.value[3]*=i.stillness),!0},Nn=(e,t,i,n,o,s,r)=>(r.value[3]*=i.stillness,!0),Un=(e,t,i,n,o,s,r)=>{const a=(0,ae.m2)(r);return zi.bA(a,a,o.tile.readiness),0!==r.value[3]&&(t.bind(e,{u_vec4_color:a}),!0)},Zn=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.width,_o(i,o));return 0!==r&&(t.bind(e,{u_float_width:r*window.devicePixelRatio}),!0)},Hn=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.strokeWidth,_o(i,o));return 0!==r&&(t.bind(e,{u_float_width:r*window.devicePixelRatio}),!0)},Gn=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.strokeWidth,r);if(0===a)return!1;const l=(0,ae.vn)(s.style.width,r)+2*a;return t.bind(e,{u_float_width:l*window.devicePixelRatio}),!0},Wn=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.strokeWidth2,r);if(0===a)return!1;const l=(0,ae.vn)(s.style.width,r)+2*(0,ae.vn)(s.style.strokeWidth,r)+2*a;return t.bind(e,{u_float_width:l*window.devicePixelRatio}),!0},Vn=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.width,r)+2*(0,ae.vn)(s.style.strokeWidth,r)+2*(0,ae.vn)(s.style.strokeWidth2,r);return 0!==a&&(t.bind(e,{u_float_width:a*window.devicePixelRatio}),!0)},qn=(e,t,i,n,o,s)=>{const r=_o(i,o);return(0,ae.vn)(s.style.iconWidth,r)>0},Xn=(e,t,i,n,o,s)=>(t.bind(e,{u_float_shift:(0,ae.vn)(s.style.shift,_o(i,o))*window.devicePixelRatio}),!0),$n=(e,t,i,n,o,s)=>0!==En(i,o.attributes.animDirection),Yn=(e,t,i,n,o,s)=>{const r=En(i,o.attributes.animDirection);return 0!==r&&(t.bind(e,{u_float_opacity:r}),!0)},Kn=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.iconRotation,_o(i,o));return t.bind(e,{u_vec2_rotation:[Math.cos(r),Math.sin(r)]}),!0},Jn=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.opacity,_o(i,o));return t.bind(e,{u_float_opacity:o.tile.readiness*r}),!0},Qn=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.opacity,_o(i,o));return t.bind(e,{u_float_opacity:r}),!0},eo=(e,t,i,{floorManager:n},o)=>void 0===o.attributes.hiddenObjectId||!n.hasDisplayedFloorBuilding(o.attributes.hiddenObjectId),to=(e,t,i,{modelLayer:n},o)=>{if(void 0===o.attributes.hiddenObjectId)return!0;if(!n.hasModel(o.attributes.hiddenObjectId))return!0;const s=n.getVisibleModelData(o.attributes.hiddenObjectId);return!s||1!==s.opacity},io=(e,t,i,n,o)=>(t.bind(e,{u_sr2d_texture:o.attributes.atlasIndex}),!0),no=(e,t,i,n,o)=>{const{range:s,fontIndex:r,styleId:a}=o.attributes,l=n.styleManager.getStyle(a);if(!l)return!1;const c=l.fonts[r],d=n.assetManager.getFontTextureByName(c,s);return void 0!==d&&(d.enable(e),!0)},oo=(e,t,i,{imageManager:n},o)=>{const s=n.getTexture(o.attributes.textureIndex);return void 0!==s&&(s.enable(e,0),t.bind(e,{u_sr2d_texture:0}),!0)},so=(e,t,i,{imageManager:n},o)=>{const s=n.getTexture(o.attributes.rampTextureIndex);return void 0!==s&&(s.enable(e,1),t.bind(e,{u_sr2d_ramp_texture:1}),!0)},ro=(e,t,i,n,o,s)=>{const{tile:r}=o,a=(0,ae.zn)(s.style.gapColor,_o(i,o));if(!a)return!0;const l=(0,ae.m2)((0,ae.zn)(a,_o(i,o)));return zi.bA(l,l,r.readiness),t.bind(e,{u_vec4_space_color:l}),!0},ao=(e,t,i,n,o,s)=>{const{styleZoom:r}=i,a=_o(i,o),{tile:l}=o,c=(0,ae.m2)((0,ae.zn)(s.style.color,a));zi.bA(c,c,l.readiness),a.styleZoom=Math.floor(r);const d=Math.pow(2,(0,P.vO)(r)),h=(0,ae.vn)(s.style.dashLength,a)*d,u=(0,ae.vn)(s.style.gapLength,a)*d;return t.bind(e,{u_vec4_dash_color:c,u_vec2_scaler_params:[0,pt.ax],u_float_dash_length:(0,L.Qn)(h,l.size),u_float_dash2_length:(0,L.Qn)(h,l.size),u_float_space_length:(0,L.Qn)(u,l.size)}),!0},lo=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.tipWidth,r),l=(0,ae.vn)(s.style.tipHeight,r),c=a,d=X.al(-c,-0);X.Fv(d,d);const h=X.al(a,l);return X.Fv(h,h),t.bind(e,{u_vec2_wing_normal:d,u_vec2_tip_normal:h,u_float_tip_height_multiplier:l,u_float_wing_height_multiplier:0,u_float_wing_width_multiplier:c,u_float_size_factor:(0,L.Qn)(1,o.tile.size)/2}),!0},co=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.lineLength,r),l=(0,ae.vn)(s.style.lineWidth,r);return t.bind(e,{u_float_length:a,u_float_width:l,u_float_border_width:0}),!0},ho=(e,t,i,n,o,s)=>{const r=_o(i,o),{tile:a,attributes:l}=o,c=l.isLongArrow,d=o.tile.dynamicObject;let h=0,u=1;d&&(c?u=d.growPosition:h=d.bouncePosition);let m=0;return"appearance"===s.style.animation.type&&(m=(0,ae.vn)(s.style.animation.tipMovementAmplitude,r)),t.bind(e,{u_float_width_zpt:(0,ae.vn)(s.style.lineWidth,r),u_float_border_width_zpt:(0,ae.vn)(s.style.strokeWidth,r),u_float_tip_movement_amplitude:(0,L.Qn)(m,a.size),u_float_vertex_shift:h,u_float_relative_end_position:u}),!0},uo=(e,t,i,{modelLayer:n},o)=>{const{texture:s,id:r}=o.attributes;if(void 0===r)return!1;const a=n.getTexture(r,s);return void 0!==a&&(a.enable(e,0),t.bind(e,{u_sr2d_texture:0}),!0)},mo=(e,t,i,n,o,s)=>{if(void 0===o.attributes.id)return!0;const r=n.modelLayer.getOpacity(o.attributes.id,s.minzoom),a=1===n.modelLayer.getBuildingHeight(o.attributes.id)?1:r;return t.bind(e,{u_float_height_factor:a}),!0},fo=(e,t,i,n,o,s)=>{const r=_o(i,o),a=(0,ae.vn)(s.style.height,r);return t.bind(e,{u_float_height_factor:(0,ne.VW)(a)}),!0},po=(e,t,i,n,o,s)=>{let r=n.buildingHeightAnimator.getBuildingHeight(s.minzoom);return n.demManager.isEnabled()&&(r=.001+.999*r),o.attributes.hiddenObjectId&&n.modelLayer.setBuildingHeight(o.attributes.hiddenObjectId,r),t.bind(e,{u_float_height_factor:r}),!0};function _o(e,t){return(0,ae.jJ)(e.styleZoom,e.styleState,t.attributes.tileData)}const vo=(e,t,i,n,o,s)=>{const{tile:{purpose:r,detailLevel:a}}=o,{styleZoom:l}=i;switch(r){case"terrain":case"traffic":case"geojson":const e=a<function(e){switch(e){case"terrain":return T.tiles.maxDetailLevel;case"traffic":return T.traffic.maxDetailLevel;case"geojson":return Pn.rR}}(r)?(0,P.uZ)(l,a,a+.99999):l;return s.minzoom<=e&&e<s.maxzoom;case"dynamicObject":return s.minzoom<=l&&l<=s.maxzoom;default:return s.minzoom<=l&&l<s.maxzoom}};const go=(e,t,i,n,o)=>{const{styleZoom:s}=i,{tile:r}=o;return!("terrain"===r.purpose&&s<=T.tiles.maxUniverseZoom)},yo=(e,t,i,n,o,s)=>{const{styleZoom:r}=i;return r>=s.minzoom&&r<s.maxzoom},bo=(e,t,i,n,o,s)=>{const{tile:r}=o,a=(0,ae.vn)(s.style.width,_o(i,o));return 0!==a&&(t.bind(e,{u_float_width:(0,L.Qn)(a,r.size)/2,u_float_width_offset:(0,L.Qn)(1/window.devicePixelRatio,r.size)/2}),!0)},wo=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.radius,_o(i,o));return!(r<=0)&&(t.bind(e,{u_float_radius:r*window.devicePixelRatio}),!0)},xo=(e,t,i,n,o,s)=>{const r=(0,ae.vn)(s.style.intensity,_o(i,o));return t.bind(e,{u_float_intensity:r}),!0},Io=(e,t,i,n,o,s)=>{const r=_o(i,o);let a=(0,ae.vn)(s.style.textFontSize,r);if("point"===o.symbol){const e=o.attributes.labelIndex;e===Tn.bR.Second&&s.style.textFontSize2?a=(0,ae.vn)(s.style.textFontSize2,r):e===Tn.bR.Icon&&s.style.iconTextFontSize&&(a=(0,ae.vn)(s.style.iconTextFontSize,r))}return t.bind(e,{u_float_scale:a*window.devicePixelRatio/T.fonts.baseSize}),!0},So=(e,t,i,n,o,s)=>{var r,a;const l=s.style;if("point"===o.symbol){switch(o.attributes.labelIndex){case Tn.bR.Second:return(null!==(r=l.textHaloWidth2)&&void 0!==r?r:0)>0&&!!l.textHaloColor2;case Tn.bR.Icon:return(null!==(a=l.iconTextHaloWidth)&&void 0!==a?a:0)>0&&!!l.iconTextHaloColor;case Tn.bR.First:}}return l.textHaloWidth>0&&!!l.textHaloColor},Mo=(e,t,i,n,o,s)=>Po(e,t,i,o,s.style.textFontSize,s.style.textColor,s.style.textHaloWidth,s.style.textHaloColor,o.layerSettings.uniformSet),To=(e,t,i,n,o,s)=>{const{layerSettings:r}=o,{uniformSet:a}=r,l=o.attributes.labelIndex,c=s.style;let{textFontSize:d,textHaloWidth:h,textColor:u,textHaloColor:m}=c;switch(l){case Tn.bR.Icon:d=c.iconTextFontSize,h=c.iconTextHaloWidth,u=c.iconTextColor,m=c.iconTextHaloColor;break;case Tn.bR.Second:d=c.textFontSize2,h=c.textHaloWidth2,u=c.textColor2,m=c.textHaloColor2}return Po(e,t,i,o,d,u,h,m,a)},Po=(e,t,i,n,o,s,r,a,l)=>{const c=_o(i,n),d=(0,ae.vn)(o,c)/T.fonts.baseSize,h=d*window.devicePixelRatio,u=T.fonts.gamma/h;let m;if("fontHalo"===l){if(!a)return!1;m=(0,ae.m2)((0,ae.zn)(a,c))}else m=(0,ae.m2)((0,ae.zn)(s,c));const f="fontHalo"===l?(6-(0,ae.vn)(r,c)/d)/8:.75;return t.bind(e,{u_float_buffer:f,u_float_gamma:u,u_vec4_color:m}),!0},Lo=(e,t,i,n,o)=>{const{attributes:s}=o,{offsetX:r,offsetY:a}=s,l=window.devicePixelRatio;return t.bind(e,{u_vec2_offset:[r*l,a*l]}),!0},Eo=(e,t,i)=>(t.bind(e,{u_float_style_zoom:i.styleZoom}),!0),ko=(e,t,i,n,o)=>{const{tile:s}=o,{zoom:r}=i,a=pt.y4*Math.pow(2,r-s.zoomLevel)*window.devicePixelRatio;return t.bind(e,{u_float_tile_to_pixel_ratio:1/a}),!0},zo=(e,t,i,{demManager:n,renderer:o})=>{if(!n.isEnabled())return!1;const s=n.getFlatFramebufferId(),r=o.getFramebuffer(s);if(!r)return!1;return r.renderTarget.getTexture().enable(e,0),t.bind(e,{u_flat_tex:0}),!0},Ao=(e,t,i,{demManager:n,renderer:o})=>{if(!n.isEnabled())return!1;const s=n.getIdentifyFlatFramebufferId(),r=o.getFramebuffer(s);if(!r)return!1;return r.renderTarget.getTexture().enable(e,0),t.bind(e,{u_flat_tex:0}),!0},Co=(e,t,i,{demManager:n,renderer:o})=>{if(!n.isEnabled())return!1;const s=n.getHillshadeFramebufferId(),r=o.getFramebuffer(s);if(!r)return!1;return r.renderTarget.getTexture().enable(e,6),t.bind(e,{u_hillshade_tex:6}),!0};function Fo(...e){const t=(0,Ln.lK)([0,0,0,0]);return(i,n,o,s,r,a)=>{for(let l=0;l<e.length;l++){if(!e[l](i,n,o,s,r,a,t))return!1}return!0}}const Ro=e=>{e.depthMask(!0),e.enable(e.DEPTH_TEST),e.depthFunc(e.LESS),e.enable(e.CULL_FACE),e.cullFace(e.BACK),e.disable(e.BLEND),e.blendFunc(e.ONE,e.ZERO),e.colorMask(!0,!0,!0,!0),e.disable(e.POLYGON_OFFSET_FILL)},Do=e=>{Ro(e),e.depthMask(!1),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},Oo=e=>{Ro(e),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.disable(e.CULL_FACE)},Bo=e=>{Ro(e),e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},jo=e=>{Ro(e),e.disable(e.DEPTH_TEST),e.colorMask(!0,!1,!1,!0)},No=e=>{Ro(e),e.disable(e.DEPTH_TEST)},Uo=e=>{Ro(e),e.depthMask(!1)},Zo=e=>{Ro(e),e.colorMask(!1,!1,!1,!1)},Ho=e=>{Ro(e),e.depthFunc(e.EQUAL),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},Go=e=>{Ro(e),e.disable(e.DEPTH_TEST),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},Wo=e=>{Ro(e),e.polygonOffset(1,2),e.enable(e.POLYGON_OFFSET_FILL),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},Vo=e=>{Ro(e),e.disable(e.DEPTH_TEST),e.cullFace(e.FRONT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)},qo=e=>{e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE)};class Xo{constructor(e){this.gl=e,this.ext=e.getExtension("EXT_disjoint_timer_query"),this.queries=[]}addTimer(){if(!this.ext)return;const e=this.ext.createQueryEXT();this.queries.push(e),this.ext.beginQueryEXT(this.ext.TIME_ELAPSED_EXT,e)}stopTimer(){this.ext&&this.queries.length&&this.ext.endQueryEXT(this.ext.TIME_ELAPSED_EXT)}tryToGetFirstTimerValue(){if(!this.ext)return;const e=this.queries[0];if(!e)return;const t=this.ext,i=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT),n=this.gl.getParameter(t.GPU_DISJOINT_EXT);if(!i||n)return;const o=t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT);return t.deleteQueryEXT(e),this.queries.shift(),Number(o)}}const $o=class{constructor(e){this.name=e.name,this.index=e.index,this.location=void 0!==e.location?e.location:-1,this._enable=!1}bindLocation(e,t){return-1!==this.location&&!0!==this.index&&e.bindAttribLocation(t,this.location,this.name),this}getLocation(e,t){return-1===this.location&&!0!==this.index&&(this.location=e.getAttribLocation(t,this.name)),this}bind(e,t){return this._enable||!0===this.index||(e.enableVertexAttribArray(this.location),this._enable=!0),t.bind(e,this.location),this}disable(e){return this._enable&&!0!==this.index&&(e.disableVertexAttribArray(this.location),this._enable=!1),this}};const Yo=class{constructor(e){this.name=e.name,this.type=e.type,this.location=-1}getLocation(e,t){return this.location=e.getUniformLocation(t,this.name),this}bind(e,t){const i=this.type;return"mat2"===i?e.uniformMatrix2fv(this.location,!1,t):"mat3"===i?e.uniformMatrix3fv(this.location,!1,t):"mat4"===i?e.uniformMatrix4fv(this.location,!1,t):"2f"===i?e.uniform2f(this.location,t[0],t[1]):"3f"===i?e.uniform3f(this.location,t[0],t[1],t[2]):"4f"===i?e.uniform4f(this.location,t[0],t[1],t[2],t[3]):"2i"===i?e.uniform2i(this.location,t[0],t[1]):"3i"===i?e.uniform3i(this.location,t[0],t[1],t[2]):"4i"===i?e.uniform4i(this.location,t[0],t[1],t[2],t[3]):e["uniform"+i](this.location,t),this}};const Ko=class{constructor(e){e=e||{},this._vertexShader=e.vertex,this._fragmentShader=e.fragment,this.uniforms={},e.uniforms=e.uniforms||[],e.uniforms.forEach((e=>{this.uniforms[e.name]=new Yo(e)})),this.attributes={},e.attributes=e.attributes||[],e.attributes.forEach((e=>{this.attributes[e.name]=new $o(e)})),this._linked=!1,this._located=!1,this._error=!1}enable(e){return this._error?this:(this.link(e),this.locate(e),this._error||e.useProgram(this._webglProgram),this)}bind(e,t,i){if(this._error)return this;if(t)for(const i in t)this.uniforms[i].bind(e,t[i]);if(i)for(const t in i)this.attributes[t].bind(e,i[t]);return this}disable(e){if(this._error)return this;for(const t in this.attributes)this.attributes[t].disable(e);return this}link(e){if(this._linked||this._error)return this;try{this._webglProgram=e.createProgram(),this._vertexShader&&e.attachShader(this._webglProgram,this._vertexShader.get(e)),this._fragmentShader&&e.attachShader(this._webglProgram,this._fragmentShader.get(e));for(const t in this.attributes)this.attributes[t].bindLocation(e,this._webglProgram);if(e.linkProgram(this._webglProgram),!e.getProgramParameter(this._webglProgram,e.LINK_STATUS))throw new Error(e.getProgramInfoLog(this._webglProgram));this._linked=!0}catch(e){throw this._error=!0,e}return this}locate(e){if(this._located||this._error)return this;for(const t in this.attributes)this.attributes[t].getLocation(e,this._webglProgram);for(const t in this.uniforms)this.uniforms[t].getLocation(e,this._webglProgram);return this._located=!0,this}},Jo="vec4 apply_opacity(const vec4 color, const float opacity)\n{\nreturn color * opacity;\n}\n",Qo={affine_step:"\nfloat affine_step(const float edge0, const float edge1, const float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0., 1.);\n}\n",apply_opacity:Jo,color:"varying vec4 v_vec4_color;\nvoid main()\n{\ngl_FragColor = v_vec4_color;\n}\n",line:"varying vec4 v_vec4_color;\nvarying float v_float_distance;\nvoid main()\n{\ngl_FragColor = v_vec4_color * (1. - abs(v_float_distance * gl_FragCoord.w));\n}\n",lowp_float:"precision lowp float;\n",mediump_float:"precision mediump float;\n",highp_float:"precision highp float;\n",pointsprite:"uniform sampler2D u_sr2d_texture;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\ngl_FragColor = apply_opacity(texture2D(u_sr2d_texture, v_vec2_texcoord), u_float_opacity);\n}\n",striped_line:"varying vec4 v_vec4_dash_color;\nvarying vec4 v_vec4_space_color;\nvarying vec4 v_vec4_border_color;\nvarying vec2 v_vec2_circle;\nvarying float v_float_width;\nvarying float v_float_part_color_swap_threshold;\nvarying float v_float_distance_in_parts;\nvec4 distance_func_smooth(in vec4 main_color, in vec4 border_color, in vec2 circle)\n{\nfloat circle_length = length(circle);\nfloat distance = circle_length - v_float_width;\nmat2 derivatives = mat2(dFdx(v_vec2_circle), dFdy(v_vec2_circle));\nvec2 circle_dx = derivatives[0];\nvec2 circle_dy = derivatives[1];\nfloat distance_dx = dot(v_vec2_circle, circle_dx);\nfloat distance_dy = dot(v_vec2_circle, circle_dy);\nfloat derivative_denominator = circle_length;\nfloat width = max(abs(distance_dx), abs(distance_dy));\nvec4 from_main_to_border = mix(\nmain_color,\nborder_color,\naffine_step(-width, 0., distance * derivative_denominator));\nvec4 from_color_to_fade = mix(\nfrom_main_to_border,\nvec4(0.),\naffine_step(0., +width, distance * derivative_denominator));\nreturn from_color_to_fade;\n}\nfloat calculate_segment_color_factor(in float distance_in_parts, in float threshold)\n{\nfloat color_factor = abs(fract(distance_in_parts + 0.5 - 0.5 * threshold) - 0.5);\nfloat parts_affine_step_width = fwidth(distance_in_parts);\nfloat smoothed_color_factor = affine_step(\n0.5 * threshold - 0.5 * parts_affine_step_width,\n0.5 * threshold + 0.5 * parts_affine_step_width,\ncolor_factor);\nreturn smoothed_color_factor;\n}\nvoid main()\n{\nvec4 current_segment_color = mix(\nv_vec4_dash_color,\nv_vec4_space_color,\ncalculate_segment_color_factor(\nv_float_distance_in_parts,\nv_float_part_color_swap_threshold));\nvec4 final_border_color = (1.0 - v_vec4_border_color.a) * current_segment_color + v_vec4_border_color;\ngl_FragColor = distance_func_smooth(current_segment_color, final_border_color, v_vec2_circle);\n}\n",label:"uniform sampler2D u_sr2d_texture;\nuniform float u_float_buffer;\nuniform float u_float_gamma;\nuniform vec4 u_vec4_color;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_texcoord;\nvoid main() {\n    float dist = texture2D(u_sr2d_texture, v_vec2_texcoord).a;\n    float alpha = smoothstep(\n        u_float_buffer - u_float_gamma,\n        u_float_buffer + u_float_gamma,\n        dist\n    );\n    gl_FragColor = apply_opacity(u_vec4_color * alpha, u_float_opacity);\n}\n",one_way_line:"uniform vec2 u_vec2_wing_normal;\nuniform vec2 u_vec2_tip_normal;\nuniform float u_float_width;\nuniform float u_float_length;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_tip_height_multiplier;\nuniform float u_float_wing_height_multiplier;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_border_color;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_border_width;\nvarying float v_float_zpt_to_texcoord_factor;\nvarying float v_float_outer_width;\nvarying float v_float_opacity;\nfloat one_way_line_distance(const ArrowDistances ad)\n{\nreturn max(max(max(ad.top_tip_cut, ad.bottom_tip_cut), max(ad.top_left_wing, ad.top_right_wing)), min(ad.line, min(ad.bottom_left_wing, ad.bottom_right_wing)));\n}\nvoid main()\n{\nmat2 derivatives = mat2(dFdx(v_vec2_texcoord), dFdy(v_vec2_texcoord));\nArrowDistanceParameters arrow_parameters = calculate_arrow_distance_parameters(\nu_vec2_wing_normal,\nu_vec2_tip_normal,\nu_float_width * v_float_zpt_to_texcoord_factor,\nu_float_length * v_float_zpt_to_texcoord_factor,\nu_float_tip_height_multiplier,\nu_float_wing_height_multiplier);\nfloat border_clipping = (abs(v_vec2_texcoord.y) - v_float_outer_width) / max(abs(derivatives[0].y), abs(derivatives[1].y));\nfloat fill_factor = affine_step(-1., 0., one_way_line_distance(calculate_arrow_distances(arrow_parameters, v_vec2_texcoord, 0., derivatives)));\nfloat border_factor = max(border_clipping, affine_step(0., 1., one_way_line_distance(calculate_arrow_distances(arrow_parameters, v_vec2_texcoord, v_float_border_width, derivatives))));\ngl_FragColor = apply_opacity(mix(mix(v_vec4_color, v_vec4_border_color, fill_factor), vec4(0.), border_factor), v_float_opacity);\n}\n",color_identify:"varying vec4 v_vec4_identifier;\nvoid main()\n{\ngl_FragColor = v_vec4_identifier;\n}\n",pointsprite_identify:"uniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\nvec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\nif (color.a < 0.3) {\ndiscard;\n} else {\ngl_FragColor = v_vec4_identifier;\n}\n}\n",model:"uniform sampler2D u_sr2d_texture;\nuniform vec4 u_vec4_color;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\ngl_FragColor = texture2D(u_sr2d_texture, v_vec2_texcoord) * u_vec4_color;\n}\n",simple_line:"uniform vec4 u_vec4_color;\nvarying float v_float_distance;\nvarying float v_float_distance_offset;\nvoid main()\n{\nvec4 color = u_vec4_color;\ngl_FragColor = color * clamp(\n1. + v_float_distance_offset - abs(v_float_distance * gl_FragCoord.w),\n0.,\n1.);\n}\n",enable_standard_derivatives:"#extension GL_OES_standard_derivatives: enable\n",arrow_functions:"struct ArrowDistanceParameters\n{\nvec2 wing_normal;\nvec2 tip_normal;\nvec2 mirrored_wing_normal;\nvec2 mirrored_tip_normal;\nfloat width;\nfloat full_length;\nfloat arrow_height;\n};\nArrowDistanceParameters calculate_arrow_distance_parameters(\nconst vec2 wing_normal,\nconst vec2 tip_normal,\nconst float width_zpt,\nconst float length_zpt,\nconst float tip_height_multiplier,\nconst float wing_height_multiplier)\n{\nvec2 mirrored_wing_normal = vec2(wing_normal.x, -wing_normal.y);\nvec2 mirrored_tip_normal = vec2(tip_normal.x, -tip_normal.y);\nfloat width = 0.5 * width_zpt;\nfloat length = 0.5 * length_zpt;\nfloat arrow_height = width_zpt * (tip_height_multiplier - wing_height_multiplier);\nreturn ArrowDistanceParameters(\nwing_normal,\ntip_normal,\nmirrored_wing_normal,\nmirrored_tip_normal,\nwidth,\nlength,\narrow_height);\n}\nstruct ArrowDistances\n{\nfloat top_tip_cut;\nfloat bottom_tip_cut;\nfloat line;\nfloat bottom_left_wing;\nfloat bottom_right_wing;\nfloat top_left_wing;\nfloat top_right_wing;\n};\nArrowDistances calculate_arrow_distances(\nconst ArrowDistanceParameters arrow_parameters,\nconst vec2 texcoord,\nconst float offset,\nconst mat2 derivatives)\n{\nfloat derivatives_x_multiplier = 1. / max(abs(derivatives[0].x), abs(derivatives[1].x));\nfloat dt = ( texcoord.x - arrow_parameters.full_length - offset) * derivatives_x_multiplier;\nfloat d0 = (-texcoord.x - arrow_parameters.full_length - offset) * derivatives_x_multiplier;\nfloat d1 = (abs(texcoord.y) - arrow_parameters.width - offset) / max(abs(derivatives[0].y), abs(derivatives[1].y));\nfloat d2 = (dot(texcoord - vec2(arrow_parameters.full_length - arrow_parameters.arrow_height, 0.), arrow_parameters.wing_normal) - offset) / max(abs(dot(derivatives[0], arrow_parameters.wing_normal)), abs(dot(derivatives[1], arrow_parameters.wing_normal)));\nfloat d3 = (dot(texcoord - vec2(arrow_parameters.full_length - arrow_parameters.arrow_height, 0.), arrow_parameters.mirrored_wing_normal) - offset) / max(abs(dot(derivatives[0], arrow_parameters.mirrored_wing_normal)), abs(dot(derivatives[1], arrow_parameters.mirrored_wing_normal)));\nfloat d4 = (dot(texcoord - vec2(arrow_parameters.full_length, 0.), arrow_parameters.tip_normal) - offset) / max(abs(dot(derivatives[0], arrow_parameters.tip_normal)), abs(dot(derivatives[1], arrow_parameters.tip_normal)));\nfloat d5 = (dot(texcoord - vec2(arrow_parameters.full_length, 0.), arrow_parameters.mirrored_tip_normal) - offset) / max(abs(dot(derivatives[0], arrow_parameters.mirrored_tip_normal)), abs(dot(derivatives[1], arrow_parameters.mirrored_tip_normal)));\nreturn ArrowDistances(dt, d0, d1, d2, d3, d4, d5);\n}\n",circle_functions:"\nconst float g_distance_precision_limit = 1e-4;\nstruct CircleDistance\n{\nfloat distance;\nfloat width;\n};\nCircleDistance circle_color_distance(\nconst mat2 derivatives,\nconst vec2 circle,\nconst float circle_width)\n{\nfloat circle_length = length(circle);\nfloat distance = circle_length - circle_width;\nvec2 circle_dx = derivatives[0];\nvec2 circle_dy = derivatives[1];\nfloat distance_dx = dot(circle, circle_dx);\nfloat distance_dy = dot(circle, circle_dy);\nfloat derivative_denominator = circle_length;\nfloat width = max(abs(distance_dx), abs(distance_dy));\nreturn CircleDistance(\ndistance * derivative_denominator,\nwidth);\n}\nvec4 distance_to_color(\nconst float fill_distance,\nconst float border_distance,\nconst vec4 fill_color,\nconst vec4 border_color)\n{\nfloat fill_factor = affine_step(-1., 0., fill_distance);\nfloat border_factor = affine_step(0., 1., border_distance);\nreturn\nmix(mix(fill_color, border_color, fill_factor), vec4(.0), border_factor);\n}\nvec4 distance_to_color(\nconst CircleDistance circle_distance,\nconst vec4 fill_color)\n{\nfloat fill_factor = circle_distance.distance < g_distance_precision_limit\n? 0.\n: affine_step(0., circle_distance.width, circle_distance.distance);\nreturn mix(fill_color, vec4(0.), fill_factor);\n}\n",arrow_line:"uniform vec2 u_vec2_wing_normal;\nuniform vec2 u_vec2_tip_normal;\nuniform float u_float_tip_height_multiplier;\nuniform float u_float_wing_height_multiplier;\nvarying vec2 v_vec2_line_type_arrow_tail;\nvarying vec4 v_vec4_arrow_width_length_border_outer;\nvarying vec4 v_vec4_texcoord_arrow_line;\nvarying vec4 v_vec4_distance_vertex_hiding;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_border_color;\nconst float g_type_arrow = 1.;\nconst float g_type_start_border = 2.;\nbool lookalike(const float a, const float b)\n{\nreturn abs(a - b) < 1e-4;\n}\nfloat filter_border(const float start, const float value)\n{\nreturn step(start, value) * 2. - 1.;\n}\nfloat arrow_distance(\nconst ArrowDistanceParameters arrow_parameters,\nconst vec2 texcoord,\nconst float offset,\nconst mat2 derivatives,\nconst float line_distance,\nconst float line_distance_no_offset)\n{\nArrowDistances ad = calculate_arrow_distances(arrow_parameters, texcoord, offset, derivatives);\nfloat derivatives_x_multiplier = 1. / max(abs(derivatives[0].x), abs(derivatives[1].x));\nfloat intersection_point = arrow_parameters.full_length - arrow_parameters.arrow_height - arrow_parameters.width * u_vec2_wing_normal.y / u_vec2_wing_normal.x;\nfloat tail_arrow_intersection = filter_border(-1., (texcoord.x - intersection_point) * derivatives_x_multiplier);\nfloat tail_hide_part = v_vec2_line_type_arrow_tail.y;\nfloat tail_hide_mask = (-texcoord.x - tail_hide_part) * derivatives_x_multiplier;\nfloat clipped_tail = max(tail_hide_mask, max(line_distance, max(ad.top_left_wing, ad.top_right_wing)));\nfloat line_without_offset = filter_border(0., line_distance_no_offset);\nfloat wings_with_tail = max(min(min(ad.bottom_left_wing, ad.bottom_right_wing), line_without_offset), max(ad.top_left_wing, ad.top_right_wing));\nreturn (v_vec4_distance_vertex_hiding.x < v_vec4_distance_vertex_hiding.y)\n? max(ad.top_tip_cut, max(-max(tail_arrow_intersection, line_without_offset), wings_with_tail))\n: max(ad.top_tip_cut, min(clipped_tail, max(-max(tail_arrow_intersection, line_without_offset), wings_with_tail)));\n}\nvec4 distance_to_arrow_line_color(\nconst float fill_distance,\nconst float border_distance)\n{\nreturn distance_to_color(fill_distance, border_distance, v_vec4_color, v_vec4_border_color);\n}\nvec4 arrow_color(\nconst vec2 texcoord,\nconst ArrowDistanceParameters arrow_parameters,\nconst float line_fill_distance,\nconst float line_border_distance)\n{\nmat2 derivatives = mat2(dFdx(texcoord), dFdy(texcoord));\nfloat border_clipping = (abs(texcoord.y) - v_vec4_arrow_width_length_border_outer.w) / max(abs(derivatives[0].y), abs(derivatives[1].y));\nfloat arrow_border_distance = arrow_distance(\narrow_parameters,\ntexcoord,\nv_vec4_arrow_width_length_border_outer.z,\nderivatives,\nline_border_distance,\nline_fill_distance);\nfloat border_factor = max(border_clipping, affine_step(0., 1., arrow_border_distance));\nreturn distance_to_arrow_line_color(\narrow_distance(arrow_parameters, texcoord, 0., derivatives, line_fill_distance, line_fill_distance),\nborder_factor);\n}\nfloat line_start_distance(\nconst vec2 texcoord,\nconst float offset,\nconst mat2 derivatives,\nconst float line_distance)\n{\nfloat tail_hide_part = v_vec2_line_type_arrow_tail.y;\nfloat d0 = (-texcoord.x - offset) / max(abs(derivatives[0].x), abs(derivatives[1].x));\nfloat dh = (texcoord.x - tail_hide_part) / max(abs(derivatives[0].x), abs(derivatives[1].x));\nreturn max(d0, max(line_distance, dh));\n}\nvec4 line_color(const float line_fill_distance, const float line_border_distance)\n{\nfloat type = v_vec2_line_type_arrow_tail.x;\nfloat fill_distance = line_fill_distance;\nfloat border_distance = line_border_distance;\nif (lookalike(type, g_type_start_border))\n{\nvec2 texcoord = v_vec4_texcoord_arrow_line.xy;\nmat2 derivatives = mat2(dFdx(texcoord), dFdy(texcoord));\nfill_distance = line_start_distance(texcoord, 0., derivatives, line_fill_distance);\nborder_distance = line_start_distance(texcoord, v_vec4_arrow_width_length_border_outer.z, derivatives, line_border_distance);\n}\nreturn distance_to_arrow_line_color(fill_distance, border_distance);\n}\nvec4 arrow_line_color()\n{\nif (lookalike(min(v_vec4_distance_vertex_hiding.y, 1.), 1.)\n|| lookalike(v_vec4_distance_vertex_hiding.w, 1.)\n|| !lookalike(v_vec2_line_type_arrow_tail.x, g_type_arrow) && (v_vec4_distance_vertex_hiding.x < v_vec4_distance_vertex_hiding.y || v_vec4_distance_vertex_hiding.x > v_vec4_distance_vertex_hiding.z))\n{\ndiscard;\n}\nArrowDistanceParameters arrow_parameters = calculate_arrow_distance_parameters(\nu_vec2_wing_normal,\nu_vec2_tip_normal,\nv_vec4_arrow_width_length_border_outer.x,\nv_vec4_arrow_width_length_border_outer.y,\nu_float_tip_height_multiplier,\nu_float_wing_height_multiplier);\nfloat line_width = arrow_parameters.width;\nfloat line_border = v_vec4_arrow_width_length_border_outer.z;\nvec2 line_texcoord = v_vec4_texcoord_arrow_line.zw;\nmat2 line_derivatives = mat2(dFdx(line_texcoord), dFdy(line_texcoord));\nCircleDistance circle_fill_distance = circle_color_distance(line_derivatives, line_texcoord, line_width);\nCircleDistance circle_border_distance = circle_color_distance(line_derivatives, line_texcoord, line_width + line_border);\nfloat line_fill_distance = affine_step(-1., 0., circle_fill_distance.distance / circle_fill_distance.width) - 1.;\nfloat line_border_distance = affine_step(0., circle_border_distance.width, circle_border_distance.distance);\nreturn lookalike(v_vec2_line_type_arrow_tail.x, g_type_arrow)\n? arrow_color(v_vec4_texcoord_arrow_line.xy, arrow_parameters, line_fill_distance, line_border_distance)\n: line_color(line_fill_distance, line_border_distance);\n}\nvoid main()\n{\ngl_FragColor = arrow_line_color();\n}\n",arrow_line_identify:"\nvarying vec2 v_vec2_line_type_arrow_tail;\nvarying vec4 v_vec4_distance_vertex_hiding;\nvarying vec4 v_vec4_identifier;\nconst float g_type_arrow = 1.;\nbool lookalike(const float a, const float b)\n{\nreturn abs(a - b) < 1e-5;\n}\nvoid main()\n{\nif (lookalike(min(v_vec4_distance_vertex_hiding.y, 1.), 1.)\n|| lookalike(v_vec4_distance_vertex_hiding.w, 1.)\n|| !lookalike(v_vec2_line_type_arrow_tail.x, g_type_arrow) && (v_vec4_distance_vertex_hiding.x < v_vec4_distance_vertex_hiding.y || v_vec4_distance_vertex_hiding.x > v_vec4_distance_vertex_hiding.z))\n{\ndiscard;\n}\n    gl_FragColor = v_vec4_identifier;\n}\n",circle_marker:"uniform vec4 u_vec4_color;\nvarying vec2 v_vec2_circle;\nvarying float v_float_width;\nvoid main() {\n    float center_distance = dot(v_vec2_circle, v_vec2_circle);\n    gl_FragColor = u_vec4_color * affine_step(1.0, 1.0 - 4.0 / v_float_width, center_distance);\n}\n",road:"uniform vec4 u_vec4_color;\nvarying vec2 v_vec2_normal;\nvarying float v_float_half_width;\nvoid main()\n{\n    \n    float opacity = 1.0 - affine_step(\n        v_float_half_width - length(fwidth(v_vec2_normal)),\n        v_float_half_width,\n        length(v_vec2_normal)\n    );\n    gl_FragColor = u_vec4_color * opacity;\n}\n",road_identify:"varying vec4 v_vec4_identifier;\nvarying vec2 v_vec2_normal;\nvarying float v_float_half_width;\nvoid main()\n{\n    if (dot(v_vec2_normal, v_vec2_normal) > v_float_half_width * v_float_half_width) {\n        discard;\n    }\n    gl_FragColor = v_vec4_identifier;\n}\n",stretchable_image:"uniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  gl_FragColor = texture2D(u_sr2d_texture, v_vec2_texcoord);\n}\n",stretchable_image_identify:"uniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\n  vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\n  if (color.a < 0.1) {\n    discard;\n  } else {\n    gl_FragColor = v_vec4_identifier;\n  }\n}\n",rect:"uniform vec4 u_vec4_color;\nvoid main()\n{\ngl_FragColor = u_vec4_color;\n}\n",rect_with_texture:"uniform sampler2D u_sr2d_texture;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  gl_FragColor = apply_opacity(texture2D(u_sr2d_texture, v_vec2_texcoord), u_float_opacity);\n}\n",heatmap:"uniform highp float u_float_intensity;\nvarying float v_float_weight;\nvarying vec2 v_vec2_extrude;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n    float d = -0.5 * 3.0 * 3.0 * dot(v_vec2_extrude, v_vec2_extrude);\n    float val = v_float_weight * u_float_intensity * GAUSS_COEF * exp(d);\n    gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n}",heatmap_texture:"uniform sampler2D u_sr2d_texture;\nuniform sampler2D u_sr2d_ramp_texture;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_position;\nvoid main() {\n    float t = texture2D(u_sr2d_texture, v_vec2_position).r;\n    vec4 color = texture2D(u_sr2d_ramp_texture, vec2(t, 0.5));\n    gl_FragColor = color * u_float_opacity;\n}",dem_mesh:"\nuniform sampler2D u_flat_tex;\nuniform sampler2D u_hillshade_tex;\nuniform sampler2D u_tex_hillshade_ramp;\nuniform float u_float_dem_shade_intension;\nvarying vec3 v_vec3_texcoord;\nvarying vec2 hs_tex_pos;\nconst float M_PI = 3.1415926535897932384626433832795;\nconst float zenith = 45. * M_PI / 180.;\nconst float HILLSHADE_OFFSET = cos(zenith) - 0.5;\nvoid main()\n{\nif (v_vec3_texcoord.z == 0.) {\ndiscard;\n}\nif (v_vec3_texcoord.x < 0. || v_vec3_texcoord.x > 1. || v_vec3_texcoord.y < 0. || v_vec3_texcoord.y > 1.) {\ndiscard;\n} else {\nvec4 flatMapColor = texture2D(u_flat_tex, v_vec3_texcoord.xy);\nif (u_float_dem_shade_intension > 0.) {\nfloat shade_raw = texture2D(u_hillshade_tex, hs_tex_pos).x;\nfloat shade_value = texture2D(u_tex_hillshade_ramp, vec2(shade_raw, 0.5)).a;\nfloat base = 1. - u_float_dem_shade_intension;\ngl_FragColor.a = flatMapColor.a;\ngl_FragColor.rgb = (flatMapColor.rgb * base) + (flatMapColor.rgb * 2. * u_float_dem_shade_intension * (shade_value - HILLSHADE_OFFSET));\n} else {\ngl_FragColor = flatMapColor;\n}\n}\n}",dem_elevation:"uniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\n  gl_FragColor = vec4(color.a, 0, 0, 1);\n}",dem_hillshade:"\nuniform sampler2D u_tex_dem;\nconst float DEM_INVALID_VALUE = -9999.;\nuniform float u_float_dem_resolution;\nuniform float u_float_dem_cell_size;\nuniform float u_float_dem_light_direction;\nuniform float u_float_dem_scale;\nconst float M_PI = 3.1415926535897932384626433832795;\nconst float zenith = 45. * M_PI / 180.;\nfloat tex_step = 1. / u_float_dem_resolution;\nvarying vec2 v_vec2_texcoord;\nmat3 get_kernel(vec2 pos, float step, float defval) {\nmat3 kernel;\nfor (int x = 0; x < 3; x++) {\nvec3 col;\nfor (int y = 0; y < 3; y++) {\ncol[y] = texture2D(u_tex_dem, vec2(pos.x + float(x - 1) * step, pos.y + float(y - 1) * step)).r;\nif (col[y] == DEM_INVALID_VALUE) {\ncol[y] = defval;\n}\n}\nkernel[x] = col;\n}\nreturn kernel;\n}\nfloat calc_aspect(mat3 kernel) {\n    float dzdx = ((kernel[2].z + 2.0 * kernel[2].y + kernel[2].x) - (kernel[0].z + 2.0 * kernel[0].y + kernel[0].x)) / 8.;\n    float dzdy = ((kernel[0].x + 2.0 * kernel[1].x + kernel[2].x) - (kernel[0].z + 2.0 * kernel[1].z + kernel[2].z)) / 8.;\n    return atan(-dzdx, dzdy);\n}\nfloat calc_slope(mat3 kernel, float cell_size) {\n    float dzdx = ((kernel[2].z + 2. * kernel[2].y + kernel[2].x) - (kernel[0].z + 2. * kernel[0].y + kernel[0].x)) / (8. * cell_size);\n    float dzdy = ((kernel[0].x + 2. * kernel[1].x + kernel[2].x) - (kernel[0].z + 2. * kernel[1].z + kernel[2].z)) / (8. * cell_size);\n    float rise_run = sqrt(dzdx * dzdx + dzdy * dzdy);\n    return atan(rise_run);\n}\nfloat dem_hillshade(const vec2 tex_pos)\n{\nif (u_float_dem_scale == 0.) {\nreturn 0.;\n}\nvec4 e = texture2D(u_tex_dem, tex_pos);\nif (e.a == 0. || e.r == DEM_INVALID_VALUE) {\nreturn 0.;\n}\nmat3 kernel = get_kernel(tex_pos.xy, tex_step, e.r);\nfloat aspect = calc_aspect(kernel);\n    float slope = calc_slope(kernel, u_float_dem_cell_size);\nfloat azimuth = u_float_dem_light_direction;\nreturn (cos(zenith) * cos(slope)) + \n             (sin(zenith) * sin(slope) * cos(azimuth - aspect));\n}\nvoid main() {\n    gl_FragColor = vec4(dem_hillshade(v_vec2_texcoord), 0, 0, 1);\n}"},es={apply_height_factor:"vec4 apply_z_limitation(vec4 vertex, float tile_height, float height_limitation)\n{\nvertex.z = min(vertex.z, height_limitation / tile_height);\nreturn vertex;\n}\nvec4 apply_height_factor(const vec3 vertex, const float height_factor)\n{\nvec3 result_vertex = vertex;\nresult_vertex.z *= height_factor;\nreturn vec4(result_vertex, 1.0);\n}\n",apply_opacity:Jo,color:"uniform vec4 u_vec4_color;\nuniform float u_float_opacity;\nattribute vec2 a_vec2_vertex;\nvarying vec4 v_vec4_color;\nvoid main()\n{\nv_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\ngl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n}\n",diffuse:"uniform vec3 u_vec3_light_direction;\nuniform vec3 u_vec3_light_color;\nuniform vec3 u_vec3_ambient_color;\nuniform vec4 u_vec4_color;\nuniform float u_float_height_limitation;\nuniform float u_float_tile_height;\nuniform float u_float_height_factor;\nuniform float u_float_opacity;\nattribute vec3 a_vec3_vertex;\nattribute vec3 a_vec3_normal;\nattribute vec2 a_vec2_dem_position;\nvarying vec4 v_vec4_color;\nconst float g_wall_offset_isometric = .001;\nconst float g_wall_offset_perspective = 8.;\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\nif (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nv_vec4_color = vec4(0, 0, 0, 0);\nreturn;\n    }\nv_vec4_color = apply_opacity(\nvec4(\nu_vec4_color.rgb * (u_vec3_ambient_color + u_vec3_light_color * abs(dot(u_vec3_light_direction, normalize_s08(a_vec3_normal)))),\nu_vec4_color.a),\nu_float_opacity);\nvec4 vertex_hf = apply_height_factor(a_vec3_vertex, u_float_height_factor);\nvertex_hf.z += height;\nvertex_hf = apply_z_limitation(vertex_hf, u_float_tile_height, u_float_height_limitation);\nvertex_hf.z = max(vertex_hf.z, height);\ngl_Position = u_mat4_mvp * vertex_hf;\nif (normalize_s08(a_vec3_normal).z < .5)\n{\nif ((u_mat4_mvp[0][3] == 0.) && (u_mat4_mvp[1][3] == 0.) && (u_mat4_mvp[2][3] == 0.))\n{\ngl_Position.z += g_wall_offset_isometric;\n}\nelse\n{\nif (height == 0.) {\ngl_Position.z += g_wall_offset_perspective;\n} else {\ngl_Position.z += g_wall_offset_isometric;\n}\n}\n}\n}\n",line:"uniform vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_light_direction;\nuniform vec3 u_vec3_light_color;\nuniform vec3 u_vec3_ambient_color;\nuniform vec4 u_vec4_color;\nuniform float u_float_height_limitation;\nuniform float u_float_tile_height;\nuniform float u_float_height_factor;\nuniform float u_float_opacity;\nattribute vec4 a_vec4_vertex;\nattribute vec2 a_vec2_normal;\nattribute vec2 a_vec2_normal_delta;\nattribute vec3 a_vec3_direction;\nattribute float a_float_distance;\nattribute vec2 a_vec2_dem_position;\nvarying vec4 v_vec4_color;\nvarying float v_float_distance;\nconst float g_shift_pixels = 1.;\nconst float g_min_denominator = 1e-4;\nconst float g_w_factor = 1e-6;\nvec2 multiply_complex(vec2 lhs, vec2 rhs)\n{\nreturn vec2(lhs.x * rhs.x - lhs.y * rhs.y, lhs.x * rhs.y + lhs.y * rhs.x);\n}\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\nvec2 half_viewport = u_vec2_vpt_size / vec2(2.);\nvec4 clip_space_direction = u_mat4_mvp * vec4(normalize_s08(vec3(a_vec3_direction.xy, a_vec3_direction.z + height)), 0.);\nvec4 vertex_hf = apply_height_factor(a_vec4_vertex.xyz, u_float_height_factor);\nvertex_hf.z += height;\nvertex_hf = apply_z_limitation(vertex_hf, u_float_tile_height, u_float_height_limitation);\nvertex_hf.z = max(vertex_hf.z, height);\nvec4 clip_space_vertex = u_mat4_mvp * vertex_hf;\nvec2 screen_space_direction = (clip_space_direction.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_direction.w) * half_viewport;\nvec2 screen_space_perp = vec2(-screen_space_direction.y, screen_space_direction.x);\nfloat denominator = max(g_min_denominator, length(screen_space_perp));\nvec2 bevel_normal = normalize_s08(a_vec2_normal);\nvec2 normal_delta = normalize_s08(a_vec2_normal_delta);\nvec4 clip_space_bevel_normal = u_mat4_mvp * vec4(bevel_normal, 0., 0.);\nvec2 screen_space_bevel_normal = (clip_space_bevel_normal.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_bevel_normal.w) * half_viewport;\nfloat bevel_denominator = max(g_min_denominator, length(screen_space_bevel_normal));\nfloat normal_factor = -dot(screen_space_bevel_normal, screen_space_perp) / denominator / bevel_denominator;\nvec2 wall_normal = multiply_complex(bevel_normal, vec2(normal_delta.x, sign(normal_factor) * normal_delta.y));\nfloat bevel_diffuse = abs(dot(u_vec3_light_direction.xy, bevel_normal));\nfloat wall_diffuse = abs(dot(u_vec3_light_direction.xy, wall_normal));\nfloat diffuse = mix(bevel_diffuse, wall_diffuse, abs(normal_factor));\ngl_Position = g_w_factor * (clip_space_vertex + vec4(screen_space_perp / half_viewport, 0., 0.) * g_shift_pixels * a_float_distance / denominator * clip_space_vertex.w);\nv_vec4_color = vec4(u_vec4_color.rgb * (u_vec3_ambient_color + u_vec3_light_color * diffuse), u_vec4_color.a);\nv_float_distance = a_float_distance * gl_Position.w;\n}\n",packed_attributes:"\nvec2 normalize_s08(vec2 value)\n{\nreturn value * (1. / 127.);\n}\nvec3 normalize_s08(vec3 value)\n{\nreturn value * (1. / 127.);\n}\nfloat normalize_s16(float value)\n{\nreturn value * (1. / 32767.);\n}\nvec2 normalize_s16(vec2 value)\n{\nreturn value * (1. / 32767.);\n}\nvec3 normalize_s16(vec3 value)\n{\nreturn value * (1. / 32767.);\n}\nvec2 unpack_widen(vec2 widen_packed)\n{\nreturn normalize_s08(widen_packed) * sqrt(2.);\n}\nvec2 unpack_texcoord(vec2 texcoord)\n{\nreturn texcoord * (1. / 32768.);\n}\nvec2 unpack_model_texcoord(vec2 texcoord)\n{\nconst float min_value = -3.0;\nconst float max_value = 5.0;\nreturn texcoord * (max_value - min_value) / 65536.0 + min_value;\n}\n",pixel_offset:"\nconst float g_min_denominator = 1e-7;\nconst float g_max_factor = 10000.;\nfloat calculate_multiplication_factor(\nvec2 half_viewport,\nvec4 clip_space_widen,\nvec4 clip_space_widen_perp,\nvec4 clip_space_vertex,\nfloat shift_pixels)\n{\nfloat limited_factor = 0.;\n{\nvec2 screen_space_widen = (clip_space_widen.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_widen.w) * half_viewport;\nvec2 screen_space_widen_perp = (clip_space_widen_perp.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_widen_perp.w) * half_viewport;\nvec2 perp = vec2(screen_space_widen_perp.y, -screen_space_widen_perp.x);\nfloat perp_length = length(perp);\nvec4 v = clip_space_vertex;\nvec4 n = clip_space_widen;\nfloat denominator = dot(perp, screen_space_widen) / shift_pixels - n.w * v.w * perp_length;\nif (abs(denominator) > g_min_denominator)\n{\nfloat factor = v.w * v.w * perp_length / denominator;\nlimited_factor = sign(factor) * min(g_max_factor, abs(factor));\n}\n}\nreturn limited_factor;\n}\n",pointsprite:"uniform vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform float u_float_height_factor;\nuniform float u_float_rounding_factor;\nuniform vec2 u_vec2_rotation; \nattribute vec3 a_vec3_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_range;\nattribute vec2 a_vec2_rescale;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\nfloat height = dem_height(a_vec3_position.xy);\n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nreturn;\n    } \nmat2 rotation_matrix = mat2(\nu_vec2_rotation.x, -u_vec2_rotation.y,\nu_vec2_rotation.y, u_vec2_rotation.x\n);\nvec2 inv_half_size = 2.0 / u_vec2_vpt_size;\nvec4 anchor = apply_height_factor(a_vec3_position, u_float_height_factor);\nanchor.z += height;\nanchor = u_mat4_mvp * anchor;\nvec2 offset = rescale(rotation_matrix * a_vec2_offset, a_vec2_rescale, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y);\nvec2 pos_2d = anchor.xy + overlay_transform(offset, inv_half_size) * anchor.w;\nvec2 corner = make_position(pos_2d, anchor.w, inv_half_size, u_float_rounding_factor);\ngl_Position = vec4(corner, anchor.z, clipw(anchor.w, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y));\nv_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",precision_constants:"\nconst float g_circle_scale_precision_factor = 1e8;\n",striped_line:"uniform vec4 u_vec4_dash_color;\nuniform vec4 u_vec4_space_color;\nuniform vec4 u_vec4_border_color;\nuniform mediump vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform float u_float_width;\nuniform float u_float_width_offset;\nuniform vec2 u_vec2_scaler_params;\nuniform float u_float_dash_length;\nuniform float u_float_space_length;\nuniform float u_float_dash2_length;\nuniform float u_float_opacity;\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texture_widen;\nattribute vec2 a_vec2_widen;\nattribute float a_float_vertex_distance;\nattribute float a_float_component_distance;\nattribute float a_float_object_length;\nvarying vec4 v_vec4_dash_color;\nvarying vec4 v_vec4_space_color;\nvarying vec4 v_vec4_border_color;\nvarying vec2 v_vec2_circle;\nvarying float v_float_width;\nvarying float v_float_part_color_swap_threshold;\nvarying float v_float_distance_in_parts;\nconst float g_shift_pixels = 2.;\nconst float g_w_factor = 1e-7;\nPolylineDistance decode_line_distance()\n{\nreturn PolylineDistance(\na_float_vertex_distance,\na_float_component_distance,\na_float_object_length);\n}\nStripedLineInParams decode_line_params(const Scale scale)\n{\nfloat width = calculate_final_width(scale, u_float_width, u_float_width_offset);\nfloat dash_length  = scale.calculation * u_float_dash_length;\nfloat space_length = scale.calculation * u_float_space_length;\nfloat dash2_length = scale.calculation * u_float_dash2_length;\nreturn StripedLineInParams(\ndash_length,\nspace_length,\ndash2_length,\nwidth);\n}\nvoid main()\n{\nScale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scaler_params);\nStripedLineInParams params = decode_line_params(scale);\nvec2 widen = unpack_widen(a_vec2_widen);\nvec2 widen_perp = vec2(-widen.y, widen.x);\nvec4 clip_space_widen = u_mat4_mvp * vec4(widen, 0., 0.);\nvec4 clip_space_widen_perp = u_mat4_mvp * vec4(widen_perp, 0., 0.);\nvec4 clip_space_vertex = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0) + clip_space_widen * params.line_width;\nvec2 half_viewport = 0.5 * u_vec2_vpt_size;\nfloat limited_factor = calculate_multiplication_factor(\nhalf_viewport,\nclip_space_widen,\nclip_space_widen_perp,\nclip_space_vertex,\ng_shift_pixels);\nPolylineDistance distance_decoded = decode_line_distance();\nStripedLineOutParams output_params;\ncalculate_line_params(distance_decoded, params, output_params);\nvec2 texture_widen_with_shift_sign = unpack_widen(a_vec2_texture_widen);\nfloat shift_sign = sign(dot(widen, texture_widen_with_shift_sign));\nvec2 texture_widen = shift_sign * texture_widen_with_shift_sign;\nvec2 texture_widen_perp = vec2(-texture_widen.y, texture_widen.x);\nfloat distance_shift = shift_sign * abs(dot(widen, texture_widen_perp)) * params.line_width;\nfloat circle_factor = g_circle_scale_precision_factor / scale.calculation;\nv_vec2_circle = texture_widen * (params.line_width + limited_factor) * circle_factor;\nv_float_width = params.line_width * circle_factor;\nv_float_part_color_swap_threshold = output_params.part_color_swap_threshold;\nv_float_distance_in_parts = output_params.distance_in_parts;\nv_vec4_dash_color = apply_opacity(u_vec4_dash_color, u_float_opacity);\nv_vec4_space_color = apply_opacity(u_vec4_space_color, u_float_opacity);\nv_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\ngl_Position = (clip_space_vertex + clip_space_widen * limited_factor) * g_w_factor;\n}\n",striped_line_identify:"uniform vec4 u_vec4_dash_color;\nuniform vec4 u_vec4_space_color;\nuniform vec4 u_vec4_border_color;\nuniform mediump vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform float u_float_width;\nuniform float u_float_width_offset;\nuniform vec2 u_vec2_scaler_params;\nuniform float u_float_dash_length;\nuniform float u_float_space_length;\nuniform float u_float_dash2_length;\nuniform float u_float_opacity;\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texture_widen;\nattribute vec2 a_vec2_widen;\nattribute float a_float_vertex_distance;\nattribute float a_float_component_distance;\nattribute float a_float_object_length;\nattribute vec4 a_vec4_identifier;\nvarying vec4 v_vec4_identifier;\nvarying vec4 v_vec4_dash_color;\nvarying vec4 v_vec4_space_color;\nvarying vec4 v_vec4_border_color;\nvarying vec2 v_vec2_circle;\nvarying float v_float_width;\nvarying float v_float_part_color_swap_threshold;\nvarying float v_float_distance_in_parts;\nconst float g_shift_pixels = 2.;\nconst float g_w_factor = 1e-7;\nPolylineDistance decode_line_distance()\n{\nreturn PolylineDistance(\na_float_vertex_distance,\na_float_component_distance,\na_float_object_length);\n}\nStripedLineInParams decode_line_params(const Scale scale)\n{\nfloat width = calculate_final_width(scale, u_float_width, u_float_width_offset);\nfloat dash_length  = scale.calculation * u_float_dash_length;\nfloat space_length = scale.calculation * u_float_space_length;\nfloat dash2_length = scale.calculation * u_float_dash2_length;\nreturn StripedLineInParams(\ndash_length,\nspace_length,\ndash2_length,\nwidth);\n}\nvoid main()\n{\nScale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scaler_params);\nStripedLineInParams params = decode_line_params(scale);\nvec2 widen = unpack_widen(a_vec2_widen);\nvec2 widen_perp = vec2(-widen.y, widen.x);\nvec4 clip_space_widen = u_mat4_mvp * vec4(widen, 0., 0.);\nvec4 clip_space_widen_perp = u_mat4_mvp * vec4(widen_perp, 0., 0.);\nvec4 clip_space_vertex = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0) + clip_space_widen * params.line_width;\nvec2 half_viewport = 0.5 * u_vec2_vpt_size;\nfloat limited_factor = calculate_multiplication_factor(\nhalf_viewport,\nclip_space_widen,\nclip_space_widen_perp,\nclip_space_vertex,\ng_shift_pixels);\nPolylineDistance distance_decoded = decode_line_distance();\nStripedLineOutParams output_params;\ncalculate_line_params(distance_decoded, params, output_params);\nvec2 texture_widen_with_shift_sign = unpack_widen(a_vec2_texture_widen);\nfloat shift_sign = sign(dot(widen, texture_widen_with_shift_sign));\nvec2 texture_widen = shift_sign * texture_widen_with_shift_sign;\nvec2 texture_widen_perp = vec2(-texture_widen.y, texture_widen.x);\nfloat distance_shift = shift_sign * abs(dot(widen, texture_widen_perp)) * params.line_width;\nfloat circle_factor = g_circle_scale_precision_factor / scale.calculation;\nv_vec2_circle = texture_widen * (params.line_width + limited_factor) * circle_factor;\nv_float_width = params.line_width * circle_factor;\nv_float_part_color_swap_threshold = output_params.part_color_swap_threshold;\nv_float_distance_in_parts = output_params.distance_in_parts;\nv_vec4_dash_color = apply_opacity(u_vec4_dash_color, u_float_opacity);\nv_vec4_space_color = apply_opacity(u_vec4_space_color, u_float_opacity);\nv_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\nv_vec4_identifier = a_vec4_identifier;\nif (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n{\ngl_Position = (clip_space_vertex + clip_space_widen * limited_factor) * g_w_factor;\n}\nelse\n{\ngl_Position = vec4(1., 1., 1., 1.);\n}\n}\n",striped_line_functions:"struct PolylineDistance\n{\nfloat vertex_distance_from_start;\nfloat segment_distance_from_start;\nfloat total_length;\n};\nstruct StripedLineInParams\n{\nfloat dash_length;\nfloat space_length;\nfloat dash2_length;\nfloat line_width;\n};\nstruct StripedLineOutParams\n{\nfloat part_color_swap_threshold;\nfloat distance_in_parts;\n};\nvoid calculate_line_params(in PolylineDistance polyline_distance, in StripedLineInParams striped_line_params, out StripedLineOutParams line_params)\n{\nfloat requested_part_length =\nstriped_line_params.dash_length\n+ striped_line_params.space_length;\nfloat space2_length = requested_part_length - striped_line_params.dash2_length;\nfloat min_part_length =\nrequested_part_length\n- 0.5 * min(striped_line_params.space_length, space2_length);\nfloat part_count = max(\nfloor(polyline_distance.total_length / requested_part_length + 0.5),\n1.0);\nfloat part_length = polyline_distance.total_length / part_count;\nfloat dash_length = (part_length / requested_part_length) * striped_line_params.dash2_length;\nfloat part_color_swap_threshold;\nif (polyline_distance.total_length < min_part_length)\n{\ndash_length = part_length;\npart_color_swap_threshold = 1.0;\n}\nelse\n{\npart_color_swap_threshold = dash_length / part_length;\n}\nfloat segment_start = fract((polyline_distance.segment_distance_from_start + 0.5 * dash_length) / part_length);\nfloat vertex_normalized_distance = segment_start + polyline_distance.vertex_distance_from_start / part_length;\nline_params = StripedLineOutParams(\npart_color_swap_threshold,\nvertex_normalized_distance);\n}\n",label_fixed_anchor:"attribute vec4 a_vec4_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nuniform vec2 u_vec2_offset;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_scale;\nuniform float u_float_height_factor;\nvarying vec2 v_vec2_texcoord;\nvoid main() {\n    float height = dem_height(a_vec4_position.xy);\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    vec4 ndcPosition = apply_height_factor(a_vec4_position.xyz, u_float_height_factor);\n    ndcPosition.z += height;\n    ndcPosition = u_mat4_mvp * ndcPosition;\n    ndcPosition.xyz = ndcPosition.xyz / ndcPosition.w;\n    ndcPosition.w = 1.0;\n    ndcPosition.xy += (a_vec2_offset * u_float_scale + u_vec2_offset) / u_vec2_vpt_size * 2.0;\n    gl_Position = ndcPosition;\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",label_fixed_anchor_identify:"attribute vec4 a_vec4_position;\nattribute vec2 a_vec2_offset;\nattribute vec4 a_vec4_identifier;\nuniform vec2 u_vec2_offset;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_scale;\nvarying vec4 v_vec4_identifier;\nvoid main() {\n    float height = dem_height(a_vec4_position.xy);\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    \n    v_vec4_identifier = a_vec4_identifier;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n    {\n        vec4 ndcPosition = u_mat4_mvp * vec4(a_vec4_position.xy, a_vec4_position.z + height, a_vec4_position.w);\n        ndcPosition.xyz = ndcPosition.xyz / ndcPosition.w;\n        ndcPosition.w = 1.0;\n        ndcPosition.xy += (a_vec2_offset * u_float_scale + u_vec2_offset) / u_vec2_vpt_size * 2.0;\n        gl_Position = ndcPosition;\n    }\n    else\n    {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n}\n",label_directional:"attribute vec4 a_vec4_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_style_zoom_limits;\nuniform float u_float_style_zoom;\nuniform float u_float_scale;\nuniform float u_float_tile_to_pixel_ratio;\nvarying vec2 v_vec2_texcoord;\nfloat clipw(const float w, const vec2 range, const float zoom) {\n    return w * (step(range.x, zoom) - step(range.y, zoom));\n}\nvoid main() {\n    vec4 newPosition = a_vec4_position;\n    newPosition.xy += a_vec2_offset * u_float_scale * u_float_tile_to_pixel_ratio;\n    newPosition = u_mat4_mvp * newPosition;\n    gl_Position = vec4(newPosition.xyz, clipw(newPosition.w, a_vec2_style_zoom_limits, u_float_style_zoom));\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",one_way_line:"uniform vec4 u_vec4_color;\nuniform vec4 u_vec4_border_color;\nuniform mediump vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform vec2 u_vec2_scale_limits;\nuniform float u_float_border_width;\nuniform float u_float_border_width_offset;\nuniform float u_float_size_factor;\nuniform mediump float u_float_width;\nuniform mediump float u_float_length;\nuniform float u_float_wing_width_multiplier;\nuniform float u_float_opacity;\nattribute vec2 a_vec2_position;\nattribute vec2 a_vec2_direction;\nattribute vec2 a_vec2_widen_direction;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_border_color;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_border_width;\nvarying float v_float_zpt_to_texcoord_factor;\nvarying float v_float_outer_width;\nvarying float v_float_opacity;\nconst float g_shift_pixels = 2.;\nconst float g_w_factor = 1e-7;\nvoid main()\n{\nfloat style_scale_clamped = clamp(u_vec3_projection_scale_style_scale_dpi.y, u_vec2_scale_limits.x, u_vec2_scale_limits.y);\nfloat scale_ratio = u_vec3_projection_scale_style_scale_dpi.x / u_vec3_projection_scale_style_scale_dpi.y;\nfloat calculation_scale = style_scale_clamped * scale_ratio;\nArrowParameters arrow_parameters = calculate_arrow_parameters(\ncalculation_scale,\nu_float_width,\nu_float_border_width,\nu_float_length,\nu_float_wing_width_multiplier,\nu_float_size_factor);\nv_float_zpt_to_texcoord_factor = arrow_parameters.zpt_to_texcoord_factor;\nv_float_outer_width = arrow_parameters.outer_width;\nvec2 direction = normalize_s08(a_vec2_direction);\nvec2 untransformed_widen = a_vec2_widen_direction * arrow_parameters.widen_size;\nvec2 widen = multiply_complex(untransformed_widen * arrow_parameters.final_size, direction);\nfloat shift_pixels = g_shift_pixels * sqrt(2.) / min(abs(untransformed_widen.x), abs(untransformed_widen.y));\nVertexShiftParameters shift_parameters = calculate_vertex_shift_parameters(\nu_mat4_mvp,\nu_vec2_vpt_size,\na_vec2_position,\nwiden,\nshift_pixels);\ngl_Position = shift_parameters.clip_space_vertex / arrow_parameters.final_size * g_w_factor;\nv_vec2_texcoord = untransformed_widen * (1. + shift_parameters.limited_factor);\nfloat border_width = u_float_border_width * v_float_zpt_to_texcoord_factor;\nfloat border_width_offset = u_float_border_width_offset * v_float_zpt_to_texcoord_factor;\nv_float_border_width = max(0., border_width - u_vec3_projection_scale_style_scale_dpi.y / style_scale_clamped * border_width_offset);\nv_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\nv_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\nv_float_opacity = u_float_opacity;\n}\n",round_position:"\nvec4 round_position(const vec4 position, const vec2 half_viewport)\n{\nif (\nposition.w < 0.\n|| position.x < -position.w\n|| position.x > position.w\n|| position.y < -position.w\n|| position.y > position.w\n|| position.z < -position.w\n|| position.z > position.w)\n{\nreturn position;\n}\nelse\n{\nreturn vec4(\nsign(position.xy) * floor(abs(position.xy) * half_viewport / position.w + .5)\n* position.w / half_viewport,\nposition.zw);\n}\n}\n",color_identify:"uniform vec2 u_vec2_vpt_size;\nattribute vec2 a_vec2_vertex;\nattribute vec4 a_vec4_identifier;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\nv_vec4_identifier = a_vec4_identifier;\nif (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n{\ngl_Position = round_position(u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.), .5 * u_vec2_vpt_size);\n}\nelse\n{\ngl_Position = vec4(1., 1., 1., 1.);\n}\n}\n",model_identify:"uniform vec2 u_vec2_vpt_size;\nattribute vec3 a_vec3_vertex;\nattribute vec4 a_vec4_identifier;\nattribute vec2 a_vec2_dem_position;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\nif (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nreturn;\n    }\nv_vec4_identifier = a_vec4_identifier;\nif (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n{\ngl_Position = round_position(u_mat4_mvp * vec4(a_vec3_vertex.xy, a_vec3_vertex.z + height, 1.), .5 * u_vec2_vpt_size);\n}\nelse\n{\ngl_Position = vec4(1., 1., 1., 1.);\n}\n}\n",pointsprite_identify:"uniform vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform float u_float_height_factor;\nuniform vec2 u_vec2_rotation; \nattribute vec3 a_vec3_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_range;\nattribute vec2 a_vec2_rescale;\nattribute vec4 a_vec4_identifier;\nvarying vec2 v_vec2_texcoord;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\nif (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n{\nfloat height = dem_height(a_vec3_position.xy);\nif (height == DEM_INVALID_VALUE) {\ngl_Position = vec4(0, 0, 0, 0);\nreturn;\n} \nmat2 rotation_matrix = mat2(\nu_vec2_rotation.x, -u_vec2_rotation.y,\nu_vec2_rotation.y, u_vec2_rotation.x\n);\nvec2 inv_half_size = 2.0 / u_vec2_vpt_size;\nvec4 anchor = apply_height_factor(a_vec3_position, u_float_height_factor);\nanchor.z += height;\nanchor = u_mat4_mvp * anchor;\nvec2 offset = rescale(rotation_matrix * a_vec2_offset, a_vec2_rescale, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y);\nvec2 pos_2d = anchor.xy + overlay_transform(offset, inv_half_size) * anchor.w;\nvec2 corner = make_position(pos_2d, anchor.w, inv_half_size, 1.0);\ngl_Position = vec4(corner, anchor.z, clipw(anchor.w, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y));\n}\nelse\n{\ngl_Position = vec4(1., 1., 1., 1.);\n}\nv_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\nv_vec4_identifier = a_vec4_identifier;\n}\n",model:"uniform float u_float_height_factor;\nattribute vec3 a_vec3_vertex;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_dem_position;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\nif (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nreturn;\n    }\nv_vec2_texcoord = unpack_model_texcoord(a_vec2_texcoord);\nvec4 vh = apply_height_factor(a_vec3_vertex, u_float_height_factor);\nvh.z += height;\ngl_Position = u_mat4_mvp * vh;\n}\n",simple_line:"uniform vec2 u_vec2_vpt_size;\nuniform float u_float_width;\nuniform float u_float_height_factor;\nuniform float u_float_height_limitation;\nuniform float u_float_tile_height;\nuniform float u_float_z_offset;\nattribute vec3 a_vec3_vertex;\nattribute vec4 a_vec4_direction_distance;\nattribute vec2 a_vec2_dem_position;\nvarying float v_float_distance;\nvarying float v_float_distance_offset;\nconst float g_smooth_width = 1.;\nconst float g_min_denominator = 1e-4;\nconst float g_w_factor = 1e-6;\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nreturn;\n    } \nfloat shift_pixels = 0.5 * max(u_float_width - 1., 0.);\nfloat shift_pixels_added = shift_pixels + g_smooth_width;\nvec3 direction = a_vec4_direction_distance.xyz;\nfloat distance = a_vec4_direction_distance.w;\nvec2 half_viewport = u_vec2_vpt_size / vec2(2.);\nvec4 clip_space_direction = normalize(u_mat4_mvp * vec4(normalize_s08(direction), 0.));\nvec4 clip_space_vertex = apply_height_factor(a_vec3_vertex, u_float_height_factor);\nclip_space_vertex.z += height;\nclip_space_vertex = apply_z_limitation(\nclip_space_vertex,\nu_float_tile_height, u_float_height_limitation\n);\nclip_space_vertex.z = max(clip_space_vertex.z, height);\nclip_space_vertex = u_mat4_mvp * clip_space_vertex;\nvec2 screen_space_direction =\n(clip_space_direction.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_direction.w) * half_viewport;\nvec2 screen_space_perp = vec2(-screen_space_direction.y, screen_space_direction.x);\nfloat denominator = max(g_min_denominator, length(screen_space_perp));\ngl_Position = g_w_factor * (clip_space_vertex + vec4(screen_space_perp / half_viewport, 0., 0.)\n* distance * shift_pixels_added / denominator * clip_space_vertex.w);\ngl_Position.z += u_float_z_offset;\nv_float_distance = shift_pixels_added * distance * gl_Position.w;\nv_float_distance_offset = shift_pixels;\n}\n",arrow_line_entrance:"uniform vec4 u_vec4_color;\nuniform vec4 u_vec4_border_color;\nuniform mediump vec2 u_vec2_vpt_size;\nuniform vec3 u_vec3_projection_scale_style_scale_dpi;\nuniform vec2 u_vec2_scale_limits;\nuniform float u_float_width_zpt;\nuniform float u_float_wing_width_multiplier;\nuniform float u_float_border_width_zpt;\nuniform float u_float_size_factor;\nuniform float u_float_border_width_offset;\nuniform float u_float_tip_height_multiplier;\nuniform float u_float_relative_end_position;\nuniform float u_float_tip_movement_amplitude;\nuniform float u_float_vertex_shift; \nuniform float u_float_opacity;\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_segment_end;\nattribute vec4 a_vec4_texture_widen_arrow_widen;\nattribute vec2 a_vec2_widen;\nattribute vec2 a_vec2_direction; \nattribute float a_float_distance_from_start;\nattribute float a_float_object_length;\nattribute float a_float_type;\nattribute vec4 a_vec4_identifier; \nvarying vec2 v_vec2_line_type_arrow_tail;\nvarying vec4 v_vec4_arrow_width_length_border_outer;\nvarying vec4 v_vec4_texcoord_arrow_line;\nvarying vec4 v_vec4_distance_vertex_hiding;\nvarying vec4 v_vec4_identifier;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_border_color;\nconst float g_w_factor = 1e-7;\nconst float g_type_line = 0.;\nconst float g_type_arrow = 1.;\nconst float g_type_start_border = 2.;\nconst float g_type_line_ending = 3.;\nconst float g_type_line_cut = 4.;\nconst float g_shift_pixels = 2.;\nconst float g_line_overlapping_part = .2;\nstruct ArrowLineViewParameters\n{\nfloat vertex_type;\nfloat width_zpt;\nfloat border_width_zpt;\nfloat border_width_offset;\nfloat arrow_segment_length_zpt;\nfloat wing_width_multiplier;\nfloat size_factor;\nvec2 vertex_position;\nvec2 vertex_widen;\nvec2 line_texture_widen;\nvec2 arrow_texture_widen;\nvec2 segment_direction;\nfloat segment_length;\nfloat distance_to_end;\n};\nstruct DistanceShiftParameters\n{\nfloat shift;\nbool invisible;\n};\nvec2 perp(const vec2 vector)\n{\nreturn vec2(-vector.y, vector.x);\n}\nvec2 vertex_shift(const Scale scale)\n{\nreturn u_float_vertex_shift * u_float_tip_movement_amplitude * normalize_s08(a_vec2_direction) * scale.calculation;\n}\nvec2 arrow_shift(const ArrowLineViewParameters view)\n{\nreturn view.segment_direction * view.distance_to_end;\n}\nfloat erase_length_end()\n{\nreturn clamp(u_float_relative_end_position, 0., 1.) * a_float_object_length;\n}\nvoid set_texcoord_varyings(const vec2 arrow_texcoord, const vec2 line_texcoord)\n{\nv_vec4_texcoord_arrow_line = vec4(arrow_texcoord, line_texcoord);\n}\nvoid set_arrow_varyings(\nconst float arrow_width,\nconst float arrow_length,\nconst float arrow_border,\nconst float arrow_outer_width,\nconst float arrow_tail_hide_part)\n{\nv_vec4_arrow_width_length_border_outer = vec4(\narrow_width,\narrow_length,\narrow_border,\narrow_outer_width);\nv_vec2_line_type_arrow_tail = vec2(\na_float_type,\narrow_tail_hide_part);\n}\nDistanceShiftParameters calculate_entrance_arrow_distances(\nconst ArrowLineViewParameters view,\nconst float signed_distance_shift,\nconst float arrow_final_size,\nconst float entrance_arrow_distance_shift)\n{\nDistanceShiftParameters line_distance_parameters = DistanceShiftParameters(\nsigned_distance_shift + entrance_arrow_distance_shift,\nfalse);\nif (a_float_type == g_type_arrow)\n{\nbool outside_of_current_segment = view.distance_to_end > view.segment_length + entrance_arrow_distance_shift;\nbool inside_end_hide = a_float_distance_from_start + entrance_arrow_distance_shift > erase_length_end();\nreturn DistanceShiftParameters(\nline_distance_parameters.shift + view.distance_to_end,\noutside_of_current_segment || inside_end_hide\n);\n}\nelse\n{\nreturn line_distance_parameters;\n}\n}\nvoid set_distance_varyings(\nconst ArrowLineViewParameters view,\nconst float arrow_final_size,\nconst float signed_shift_distance)\n{\nfloat entrance_arrow_distance_shift = arrow_final_size * (2. - g_line_overlapping_part);\nDistanceShiftParameters distance_shift_parameters = calculate_entrance_arrow_distances(\nview,\nsigned_shift_distance,\narrow_final_size,\nentrance_arrow_distance_shift);\nv_vec4_distance_vertex_hiding =\nvec4(\na_float_distance_from_start + distance_shift_parameters.shift,\n0.,\nerase_length_end(),\ndistance_shift_parameters.invisible\n? a_float_object_length\n: 0.\n) / a_float_object_length;\n}\nArrowLineViewParameters decode_arrow_line_view_parameters()\n{\nfloat width_zpt = u_float_width_zpt;\nfloat border_width_zpt = u_float_border_width_zpt;\nfloat arrow_segment_length_zpt = width_zpt * u_float_tip_height_multiplier + border_width_zpt;\nfloat vertex_type = a_float_type;\nvec2 segment_direction = (vertex_type == g_type_line_ending || vertex_type == g_type_line_cut)\n? normalize(a_vec2_vertex - a_vec2_segment_end)\n: normalize(a_vec2_segment_end - a_vec2_vertex);\nfloat segment_length = length(a_vec2_segment_end - a_vec2_vertex);\nfloat distance_to_end = erase_length_end() - a_float_distance_from_start;\nreturn ArrowLineViewParameters(\nvertex_type,\nwidth_zpt,\nborder_width_zpt,\nu_float_border_width_offset,\narrow_segment_length_zpt,\nu_float_wing_width_multiplier,\nu_float_size_factor,\na_vec2_vertex,\nunpack_widen(a_vec2_widen),\nunpack_widen(a_vec4_texture_widen_arrow_widen.xy),\nunpack_widen(a_vec4_texture_widen_arrow_widen.zw),\nsegment_direction,\nsegment_length,\ndistance_to_end);\n}\nvec4 process_arrow_line_vertex(const Scale scale, const mat4 mvp, const vec2 vpt_size)\n{\nArrowLineViewParameters view = decode_arrow_line_view_parameters();\nArrowParameters arrow_parameters = calculate_arrow_parameters(\nscale.calculation,\nview.width_zpt,\nview.border_width_zpt,\nview.arrow_segment_length_zpt,\nview.wing_width_multiplier,\nview.size_factor);\nvec2 vertex_widen = view.vertex_widen;\nvec2 texture_widen_with_sign = view.line_texture_widen;\nfloat shift_sign = sign(dot(vertex_widen, texture_widen_with_sign));\nvec2 line_texture_widen = shift_sign * texture_widen_with_sign;\nfloat line_final_size = (view.width_zpt + 2. * view.border_width_zpt) * view.size_factor * scale.calculation;\nfloat final_size = (view.vertex_type == g_type_arrow)\n? arrow_parameters.final_size\n: line_final_size;\nvec2 line_texture_widen_perp = perp(line_texture_widen);\nfloat shift_distance = abs(dot(vertex_widen, line_texture_widen_perp)) * final_size;\nvec2 shift_direction = line_texture_widen_perp * sign(dot(vertex_widen, line_texture_widen_perp));\nvec2 line_vertex_shift = vertex_widen * final_size - shift_direction * max(0., shift_distance - .5 * view.segment_length);\nvec2 arrow_vertex_widen = vertex_widen * arrow_parameters.final_size;\nvec2 scene_vertex_shift = (view.vertex_type == g_type_arrow)\n? arrow_vertex_widen\n: line_vertex_shift;\nvec2 arrow_position_shift = (view.vertex_type == g_type_arrow)\n? arrow_shift(view)\n: vec2(0.);\nfloat shift_pixels = g_shift_pixels * sqrt(2.);\nVertexShiftParameters line_shift_parameters = calculate_vertex_shift_parameters(\nmvp,\nvpt_size,\nview.vertex_position + (vertex_shift(scale) + arrow_position_shift),\nscene_vertex_shift,\nshift_pixels);\nfloat arrow_line_texcoord_scale = line_final_size / arrow_parameters.final_size;\nfloat line_texcoord_scale = (view.vertex_type != g_type_arrow)\n? arrow_line_texcoord_scale\n: 1.;\nvec2 line_texcoord = line_texture_widen * (1. + line_shift_parameters.limited_factor) * line_texcoord_scale;\nfloat arrow_texcoord_scale = (view.vertex_type == g_type_start_border)\n? arrow_line_texcoord_scale\n: 1.;\nvec2 arrow_texcoord = view.arrow_texture_widen * (1. + line_shift_parameters.limited_factor) * arrow_texcoord_scale;\nset_texcoord_varyings(arrow_texcoord, line_texcoord);\nfloat arrow_width = view.width_zpt * arrow_parameters.zpt_to_texcoord_factor;\nfloat arrow_length = view.arrow_segment_length_zpt * arrow_parameters.zpt_to_texcoord_factor;\nfloat texcoord_border_width = view.border_width_zpt * arrow_parameters.zpt_to_texcoord_factor;\nfloat border_width_texcoord_offset = view.border_width_offset * arrow_parameters.zpt_to_texcoord_factor;\nfloat arrow_border = max(0., texcoord_border_width - scale.style / scale.style_clamped * border_width_texcoord_offset);\nfloat tail_shift_direction = (view.vertex_type == g_type_line_ending || view.vertex_type == g_type_start_border) ? 1. : -1.;\nfloat tail_hide_shift = dot(arrow_vertex_widen, tail_shift_direction * view.segment_direction);\nfloat arrow_tail_hide_part = (view.distance_to_end - tail_hide_shift) * arrow_parameters.zpt_to_texcoord_factor / view.size_factor;\nset_arrow_varyings(\narrow_width,\narrow_length,\narrow_border,\narrow_parameters.outer_width,\narrow_tail_hide_part);\nset_distance_varyings(\nview,\narrow_parameters.final_size,\nshift_sign * shift_distance);\nreturn line_shift_parameters.clip_space_vertex / final_size;\n}\nvoid main()\n{\nv_vec4_identifier = a_vec4_identifier; \nScale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scale_limits);\nvec4 processed_vertex = process_arrow_line_vertex(scale, u_mat4_mvp, u_vec2_vpt_size);\ngl_Position = processed_vertex * g_w_factor;\nv_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\nv_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\n}\n",diffuse_identify:"uniform vec2 u_vec2_vpt_size;\nuniform float u_float_height_limitation;\nuniform float u_float_tile_height;\nuniform float u_float_height_factor;\nattribute vec3 a_vec3_vertex;\nattribute vec4 a_vec4_identifier;\nattribute vec2 a_vec2_dem_position;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\nfloat height = dem_height(unpack_dem_position(a_vec2_dem_position));\nif (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\nreturn;\n    }\nv_vec4_identifier = a_vec4_identifier;\nif (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n{\nvec4 vertex_hf = apply_height_factor(a_vec3_vertex, u_float_height_factor);\nvertex_hf.z += height;\nvertex_hf = apply_z_limitation(vertex_hf, u_float_tile_height, u_float_height_limitation);\nvertex_hf.z = max(vertex_hf.z, height);\ngl_Position = round_position(\nu_mat4_mvp * vertex_hf,\n.5 * u_vec2_vpt_size);\n}\nelse\n{\ngl_Position = vec4(1., 1., 1., 1.);\n}\n}\n",calculate_scale:"struct Scale\n{\nfloat projection;\nfloat style;\nfloat style_clamped;\nfloat calculation;\n};\nScale calculate_scale(const vec3 projection_scale_style_scale_dpi, const vec2 scale_limits)\n{\nfloat style_scale_clamped = clamp(projection_scale_style_scale_dpi.y, scale_limits.x, scale_limits.y);\nfloat scale_ratio = projection_scale_style_scale_dpi.x / projection_scale_style_scale_dpi.y;\nfloat calculation_scale = style_scale_clamped * scale_ratio;\nreturn Scale(\nprojection_scale_style_scale_dpi.x,\nprojection_scale_style_scale_dpi.y,\nstyle_scale_clamped,\ncalculation_scale);\n}\nconst float g_min_scale_factor = 1e-2;\nconst float g_max_scale_factor = 1e2;\nconst float g_base_scale_numerator = 1e2;\nfloat normalize_scale_to_tile(const float scale, const float tile_size)\n{\nreturn clamp(\n    (scale - g_min_scale_factor) / (tile_size - g_min_scale_factor),\n    g_min_scale_factor,\n    g_max_scale_factor);\n}",line_width:"float calculate_final_width(\nconst Scale scale,\nconst float width,\nconst float width_offset)\n{\nfloat final_width = max(0., scale.calculation * width - scale.projection * width_offset);\nreturn final_width;\n}\n",arrow_functions:"\nvec2 multiply_complex(const vec2 lhs, const vec2 rhs)\n{\nreturn vec2(lhs.x * rhs.x - lhs.y * rhs.y, lhs.x * rhs.y + lhs.y * rhs.x);\n}\nstruct ArrowParameters\n{\nfloat zpt_to_texcoord_factor;\nfloat final_size;\nfloat outer_width;\nvec2 widen_size;\n};\nArrowParameters calculate_arrow_parameters(\nconst float calculation_scale,\nconst float width_zpt,\nconst float border_width_zpt,\nconst float segment_length_zpt,\nconst float wing_width_multiplier,\nconst float size_factor)\n{\nfloat quad_width = 2.0 * border_width_zpt + 2.0 * wing_width_multiplier * width_zpt;\nfloat quad_height = 2.0 * border_width_zpt + segment_length_zpt;\nfloat max_quad_dimension = max(quad_width, quad_height);\nfloat zpt_to_texcoord_factor = 2.0 / max_quad_dimension;\nfloat final_size = calculation_scale * size_factor * max_quad_dimension;\nvec2 widen_size = 0.5 * vec2(quad_height, quad_width) * zpt_to_texcoord_factor;\nfloat outer_width = (width_zpt * wing_width_multiplier + border_width_zpt) * zpt_to_texcoord_factor;\nreturn ArrowParameters(\nzpt_to_texcoord_factor,\nfinal_size,\nouter_width,\nwiden_size);\n}\nstruct VertexShiftParameters\n{\nvec4 clip_space_vertex;\nfloat limited_factor;\n};\nVertexShiftParameters calculate_vertex_shift_parameters(\nconst mat4 mvp,\nconst vec2 vpt_size,\nconst vec2 vertex,\nconst vec2 widen,\nconst float shift_pixels)\n{\nvec2 widen_perp = vec2(-widen.y, widen.x);\nvec4 clip_space_widen = mvp * vec4(widen, 0., 0.);\nvec4 clip_space_widen_perp = mvp * vec4(widen_perp, 0., 0.);\nvec2 half_viewport = vpt_size / 2.;\nvec4 clip_space_vertex = mvp * vec4(vertex, 0.0, 1.0) + clip_space_widen;\nfloat limited_factor = calculate_multiplication_factor(\nhalf_viewport,\nclip_space_widen,\nclip_space_widen_perp,\nclip_space_vertex,\nshift_pixels);\nreturn VertexShiftParameters(\nclip_space_vertex + clip_space_widen * limited_factor,\nlimited_factor);\n}\n",circle_marker:"attribute vec4 a_vec4_vertex;\nattribute vec2 a_vec2_widen;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_width;\nvarying vec2 v_vec2_circle;\nvarying float v_float_width;\nvoid main() {\n    vec4 clip_space_position = u_mat4_mvp * a_vec4_vertex;\n    vec4 ndc_position = clip_space_position / clip_space_position.w;\n    ndc_position.xy += a_vec2_widen * u_float_width / u_vec2_vpt_size;\n    gl_Position = ndc_position;\n    v_vec2_circle = a_vec2_widen;\n    v_float_width = u_float_width;\n}\n",circle_marker_identify:"attribute vec4 a_vec4_vertex;\nattribute vec2 a_vec2_widen;\nattribute vec4 a_vec4_identifier;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_width;\nvarying vec2 v_vec2_circle;\nvarying vec4 v_vec4_identifier;\nvoid main() {\n    v_vec2_circle = a_vec2_widen;\n    v_vec4_identifier = a_vec4_identifier;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n    {\n        vec4 clip_space_position = u_mat4_mvp * a_vec4_vertex;\n        vec4 ndc_position = clip_space_position / clip_space_position.w;\n        ndc_position.xy += a_vec2_widen * u_float_width / u_vec2_vpt_size;\n        gl_Position = ndc_position;\n    }\n    else\n    {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n}\n",raster_functions:"\nfloat unpack_scale(float value)\n{\nreturn exp(abs(value) / 256.) * sign(value);\n}\nfloat unpack_positive_value(float value)\n{\nreturn exp(value / 256.);\n}\nvec2 make_position(const vec2 position, const float w, const vec2 inv_half_size, const float rounding_factor)\n{\nvec2 non_rounded_position = (position + w) / (w * inv_half_size);\nvec2 rounded_position = floor(non_rounded_position + 0.5);\nvec2 rounding_delta = rounded_position - non_rounded_position;\nvec2 pixel_coord = non_rounded_position + rounding_factor * rounding_delta - 0.5;\nreturn (pixel_coord * inv_half_size) * w - w;\n}\nvec2 overlay_transform(const vec2 position, const vec2 inv_half_size)\n{\nreturn position * inv_half_size;\n}\nfloat clipw(const float w, const vec2 range, const float scale)\n{\nreturn w * (step(unpack_scale(range.x), scale) - step(unpack_positive_value(range.y), scale));\n}\nvec2 rescale(const vec2 corner, const vec2 rescale, const vec2 scale_range, const float style_scale)\n{\nif (scale_range.x < 0.)\n{\nfloat default_scale_denominator = unpack_positive_value(rescale.x);\nfloat rescale_coeff = unpack_positive_value(rescale.y);\nfloat min_scale = unpack_positive_value(-scale_range.x);\nfloat stretch_exponent = floor(0.5 + log2(\nmax(1., 1. + rescale_coeff * (1. / max(min_scale, style_scale) - default_scale_denominator))));\nreturn corner.xy * exp2(stretch_exponent);\n}\nreturn corner;\n}\n",road:"attribute vec2 a_vec2_vertex;\nattribute vec4 a_vec4_normals;\nattribute vec2 a_vec2_shift;\nuniform float u_float_width;\nuniform float u_float_tile_to_pixel_ratio;\nuniform float u_float_shift;\nvarying vec2 v_vec2_normal;\nvarying float v_float_half_width;\nconst float g_w_factor = 1e-6;\nconst float normal_unpack_multiplier = 0.011135539861205473;\nvoid main()\n{\n    \n    float half_width = 0.5 * (u_float_width + 1.0);\n    \n    vec4 normals = a_vec4_normals * normal_unpack_multiplier * half_width;\n    vec2 extender = normals.xy;\n    vec2 normal = normals.zw;\n    vec2 shift = a_vec2_shift * u_float_shift;\n    \n    vec4 shifted_vertex = vec4(a_vec2_vertex + (shift + extender) * u_float_tile_to_pixel_ratio, 0.0, 1.0);\n    gl_Position = g_w_factor * u_mat4_mvp * shifted_vertex;\n    v_vec2_normal = normal;\n    v_float_half_width = half_width;\n}\n",road_identify:"attribute vec2 a_vec2_vertex;\nattribute vec4 a_vec4_normals;\nattribute vec4 a_vec4_identifier;\nuniform float u_float_width;\nuniform float u_float_tile_to_pixel_ratio;\nvarying vec2 v_vec2_normal;\nvarying vec4 v_vec4_identifier;\nvarying float v_float_half_width;\nconst float g_w_factor = 1e-6;\nconst float normal_unpack_multiplier = 0.011135539861205473;\nvoid main()\n{\n    \n    float half_width = 0.5 * (u_float_width + 1.0);\n    \n    vec4 normals = a_vec4_normals * normal_unpack_multiplier * half_width;\n    vec2 extender = normals.xy;\n    vec2 normal = normals.zw;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier) {\n        \n        vec4 shifted_vertex = vec4(a_vec2_vertex + extender * u_float_tile_to_pixel_ratio, 0.0, 1.0);\n        gl_Position = g_w_factor * u_mat4_mvp * shifted_vertex;\n    } else {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n    v_vec2_normal = normal;\n    v_vec4_identifier = a_vec4_identifier;\n    v_float_half_width = half_width;\n}\n",stretchable_image:"uniform vec4 u_vec4_color;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_rounding_factor;\nattribute vec2 a_vec2_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  vec2 inv_half_size = 2.0 / u_vec2_vpt_size;\n  vec4 anchor = u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\n  vec2 pos_2d = anchor.xy + overlay_transform(a_vec2_offset, inv_half_size) * anchor.w;\nvec2 pos_2d_rounded = make_position(pos_2d, anchor.w, inv_half_size, u_float_rounding_factor);\n  gl_Position = vec4(pos_2d_rounded, anchor.z, anchor.w);\n  v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",stretchable_image_identify:"uniform vec4 u_vec4_color;\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_rounding_factor;\nattribute vec2 a_vec2_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec4 a_vec4_identifier;\nvarying vec2 v_vec2_texcoord;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\n  if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n  {\n    vec2 inv_half_size = 2.0 / u_vec2_vpt_size;\n    vec4 anchor = u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\n    vec2 pos_2d = anchor.xy + overlay_transform(a_vec2_offset, inv_half_size) * anchor.w;\n  vec2 pos_2d_rounded = make_position(pos_2d, anchor.w, inv_half_size, u_float_rounding_factor);\n    gl_Position = vec4(pos_2d_rounded, anchor.z, anchor.w);\n  }\n  else\n  {\n    gl_Position = vec4(1., 1., 1., 1.);\n  }\n  v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n  v_vec4_identifier = a_vec4_identifier;\n}\n",rect:"attribute vec2 a_vec2_vertex;\nvoid main()\n{\ngl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n}\n",rect_with_texture:"attribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\ngl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\nv_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",heatmap:"attribute vec2 a_vec2_position;\nattribute vec2 a_vec2_widen;\nattribute float a_float_weight;\nvarying vec2 v_vec2_extrude;\nvarying float v_float_weight;\nuniform float u_float_radius;\nuniform float u_float_intensity;\nuniform float u_float_tile_to_pixel_ratio;\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n    float S = sqrt(-2.0 * log(ZERO / a_float_weight / u_float_intensity / GAUSS_COEF)) / 3.0;\n    v_vec2_extrude = S * a_vec2_widen;\n    v_float_weight = a_float_weight;\n    vec2 pos = a_vec2_position + a_vec2_widen * u_float_radius * u_float_tile_to_pixel_ratio;\n    gl_Position = u_mat4_mvp * vec4(pos, 0.0, 1.0);\n}",heatmap_texture:"attribute vec2 a_vec2_position;\nvarying vec2 v_vec2_position;\nvoid main() {\n    gl_Position = vec4(a_vec2_position, 0.0, 1.0);\n    v_vec2_position = clamp(a_vec2_position, vec2(0,0), vec2(1,1));\n}",dem_mesh:"uniform mat4 u_mat4_flat_map_mvp;\nattribute vec2 a_vec2_position;\nvarying vec3 v_vec3_texcoord;\nvarying vec2 hs_tex_pos;\nvoid main()\n{\nvec4 coords = u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\nvec4 tex_pos = u_mat4_dem_mvp * u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\nfloat height = dem_height_direct(tex_pos.xy / tex_pos.w);\nif (height == DEM_INVALID_VALUE) {\ngl_Position = coords;\nv_vec3_texcoord = vec3(a_vec2_position, 0);\n} else {\ngl_Position = u_mat4_mvp * vec4(a_vec2_position, height, 1.0);\nvec4 flat_coord = u_mat4_flat_map_mvp * vec4(a_vec2_position, 0.0, 1.0);\nv_vec3_texcoord = vec3(flat_coord.xy / flat_coord.w, 1);\nhs_tex_pos = tex_pos.xy;\n}\n}",dem:"\nuniform sampler2D u_tex_dem;\nuniform mat4 u_mat4_dem_mvp;\nuniform float u_float_dem_scale;\nuniform float u_float_map_center_elevation;\nconst float DEM_INVALID_VALUE = -9999.;\nconst float METERS_TO_MAP_POINTS = 107.17323258889581;\nconst float TILE_HEIGHT = 1048576.;\nconst float METERS_TO_TILE = METERS_TO_MAP_POINTS / TILE_HEIGHT;\nfloat dem_height_direct(const vec2 tex_pos) {\nif (u_float_dem_scale == 0.) {\nreturn 0.;\n}\nvec4 elevation = texture2D(u_tex_dem, tex_pos.xy);\nif (elevation.a == 0.) {\nreturn DEM_INVALID_VALUE;\n} else {\nreturn u_float_dem_scale * METERS_TO_TILE * (elevation.r - u_float_map_center_elevation);\n}\n}\nfloat dem_height(const vec2 coords) {\nif (u_float_dem_scale == 0.) {\nreturn 0.;\n}\nvec4 tex_pos = u_mat4_dem_mvp * u_mat4_mvp * vec4(coords, 0.0, 1.0);\nreturn dem_height_direct(tex_pos.xy);\n}\nvec2 unpack_dem_position(const vec2 pos) {\nreturn (pos * 8.) / 65535.;\n}\n",dem_elevation:"attribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\ngl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\nv_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}",dem_hillshade:"attribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\ngl_Position = vec4((a_vec2_vertex * 2. - vec2(1, 1)), 0.0, 1.0);\nv_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}",mvp_mat:"uniform mat4 u_mat4_mvp;"},ts={color:["mvp_mat","apply_opacity","color"],diffuse:["mvp_mat","dem","packed_attributes","apply_height_factor","apply_opacity","diffuse"],line:["mvp_mat","dem","packed_attributes","apply_height_factor","apply_opacity","line"],pointSprite:["mvp_mat","dem","packed_attributes","apply_height_factor","raster_functions","pointsprite"],labelPoint:["mvp_mat","dem","packed_attributes","apply_height_factor","label_fixed_anchor"],labelPointIdentify:["mvp_mat","dem","label_fixed_anchor_identify"],labelLine:["mvp_mat","packed_attributes","label_directional"],stripedLine:["mvp_mat","packed_attributes","pixel_offset","calculate_scale","line_width","apply_opacity","precision_constants","striped_line_functions","striped_line"],stripedLineIdentify:["mvp_mat","packed_attributes","pixel_offset","calculate_scale","line_width","apply_opacity","precision_constants","striped_line_functions","striped_line_identify"],oneWayLine:["mvp_mat","packed_attributes","pixel_offset","arrow_functions","apply_opacity","one_way_line"],colorIdentify:["mvp_mat","round_position","color_identify"],modelIdentify:["mvp_mat","dem","round_position","model_identify"],buildingIdentify:["mvp_mat","dem","round_position","apply_height_factor","diffuse_identify"],pointSpriteIdentify:["mvp_mat","dem","packed_attributes","apply_height_factor","raster_functions","pointsprite_identify"],model:["mvp_mat","dem","packed_attributes","apply_height_factor","model"],simpleLine:["mvp_mat","dem","packed_attributes","apply_height_factor","simple_line"],entranceArrow:["mvp_mat","packed_attributes","pixel_offset","arrow_functions","calculate_scale","apply_opacity","arrow_line_entrance"],circleMarker:["mvp_mat","circle_marker"],circleMarkerIdentify:["mvp_mat","circle_marker_identify"],rect:["mvp_mat","rect"],road:["mvp_mat","road"],roadIdentify:["mvp_mat","road_identify"],rectWithTexture:["mvp_mat","packed_attributes","apply_opacity","raster_functions","rect_with_texture"],stretchableImage:["mvp_mat","packed_attributes","raster_functions","stretchable_image"],stretchableImageIdentify:["mvp_mat","packed_attributes","raster_functions","stretchable_image_identify"],heatmap:["mvp_mat","heatmap"],heatmapTexture:["heatmap_texture"],demMesh:["mvp_mat","dem","dem_mesh"],demElevation:["mvp_mat","packed_attributes","dem_elevation"],demHillshade:["mvp_mat","packed_attributes","dem_hillshade"]},is={color:["lowp_float","color"],line:["mediump_float","line"],pointSprite:["mediump_float","apply_opacity","pointsprite"],label:["mediump_float","apply_opacity","label"],stripedLine:["enable_standard_derivatives","mediump_float","affine_step","striped_line"],oneWayLine:["enable_standard_derivatives","mediump_float","affine_step","apply_opacity","arrow_functions","one_way_line"],colorIdentify:["lowp_float","color_identify"],pointSpriteIdentify:["mediump_float","pointsprite_identify"],model:["lowp_float","model"],simpleLine:["lowp_float","simple_line"],entranceArrow:["enable_standard_derivatives","highp_float","affine_step","arrow_functions","circle_functions","arrow_line"],entranceArrowIdentify:["lowp_float","arrow_line_identify"],circleMarker:["mediump_float","affine_step","circle_marker"],rect:["lowp_float","rect"],road:["enable_standard_derivatives","mediump_float","affine_step","road"],roadIdentify:["enable_standard_derivatives","lowp_float","road_identify"],stretchableImage:["mediump_float","stretchable_image"],rectWithTexture:["mediump_float","apply_opacity","rect_with_texture"],stretchableImageIdentify:["mediump_float","stretchable_image_identify"],heatmap:["mediump_float","heatmap"],heatmapTexture:["mediump_float","heatmap_texture"],demMesh:["mediump_float","dem_mesh"],demElevation:["mediump_float","dem_elevation"],demHillshade:["lowp_float","dem_hillshade"]};class ns{constructor(e,t,i=[]){this.type="vertex"===e?ns.Vertex:ns.Fragment,this._code=Array.isArray(t)?t.join("\n"):t||"",this._code=i.map((e=>void 0!==e.value?"#define "+e.type+" "+e.value:"#define "+e.type)).join("\n")+"\n"+this._code}get(e){return this._shader||this._compile(e),this._shader}remove(e){this._shader&&e.deleteShader(this._shader)}_compile(e){const t=this.type===ns.Vertex?e.VERTEX_SHADER:e.FRAGMENT_SHADER,i=this._shader=e.createShader(t);if(!i||e.isContextLost())throw new Error(`[2gl] Failed to create shader. Shader is null: ${!i}. Context is lost: ${e.isContextLost()}`);if(e.shaderSource(i,this._code),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(i))}}ns.Vertex=1,ns.Fragment=2;const os=ns,ss={},rs={};for(const e in ts){const t=ts[e].map((e=>es[e]));rs[e]=t}for(const e in is){const t=is[e].map((e=>Qo[e]));ss[e]=t}function as(e){return new os("vertex",rs[e])}function ls(e){return new os("fragment",ss[e])}const cs=[{name:"u_tex_dem",type:"1i"},{name:"u_tex_hillshade_ramp",type:"1i"},{name:"u_mat4_dem_mvp",type:"mat4"},{name:"u_float_dem_scale",type:"1f"},{name:"u_float_dem_resolution",type:"1f"},{name:"u_float_dem_cell_size",type:"1f"},{name:"u_float_dem_light_direction",type:"1f"},{name:"u_float_dem_shade_intension",type:"1f"},{name:"u_float_map_center_elevation",type:"1f"}];var ds=i(7422),hs=i(660);const us=(e,t,i,n,o)=>{i.length>0&&Number.isNaN(e.metrics.firstcontent)&&(e.metrics.firstcontent=performance.now()-e.metrics.start),Ls(i,n,o),Ss(i,e).forEach((i=>ms(e,t,i,n)))},ms=(e,t,i,n)=>{Ts(t.styleManager,i,e).forEach((i=>{bs(t.styleManager,i[0])?fs(e,t,i,n):ps(e,t,i,n)}))},fs=(e,t,i,n)=>{const o=bs(t.styleManager,i[0]);if(!o)return;const s=(i,r)=>{r>=o.orderBy.length?ps(e,t,i,n):Es(o.orderBy[r],i,e).forEach(((e,t)=>s(e,t+1)))};s(i,0)},ps=(e,t,i,n)=>{const o=i[0];if((null==o?void 0:o.type)===ft.H.Custom)t.styleManager.callCustomLayerRender(o.attributes.layerId);else{const o=i;o.sort(((e,t)=>e.tile.zoomLevel-t.tile.zoomLevel)),Ms(t.styleManager,o,e).forEach((i=>_s(e,t,i,n)))}},_s=(e,t,i,n)=>{Ps(i,e).forEach((i=>vs(e,t,i,n)))},vs=(e,t,i,n)=>{ks(i,e).forEach((i=>gs(e,t,i,n)))},gs=(e,t,i,n)=>{n.useProgram(i),zs(i,e).forEach((i=>{ys(e,t,i,n)}))},ys=(e,t,i,n)=>{n.useState(i);const o=i[0],s=function(e,t){const i=e.getStyle(t.attributes.styleId);if(!i)return;const n=i.layersById[t.attributes.layerId];n&&n.type!==t.symbol&&(0,hs.cM)(`Expecting layer with type '${t.symbol}' but got '${n.type}'`);return n}(t.styleManager,o);s&&As(i,e).forEach((i=>{n.drawSymbol(i,s,e,t)}))};function bs(e,t){const i=e.getStyle(t.attributes.styleId);if(!i)return;const n=i.layersById[t.attributes.layerId];if(!n)return;if(void 0===n.groupId)return;const o=i.groupsById[n.groupId];if(!o||"group"===o.type)return o;(0,hs.cM)(`Expecting layer with type 'group' but got '${o.type}'`)}const ws=(e,t)=>Number(e)-Number(t),xs=e=>(t,i)=>{const n={};for(let o=0;o<t.length;o++){const s=t[o],r=e(s,i),a=n[r];void 0===a?n[r]=[s]:a.push(s)}const o=Object.keys(n);o.sort(ws);const s=[];for(let e=0;e<o.length;e++)s.push(n[o[e]]);return s},Is=e=>(t,i)=>{const n=new Map;for(let o=0;o<t.length;o++){const s=t[o],r=e(s,i);n.has(r)?n.get(r).push(s):n.set(r,[s])}return n},Ss=xs((e=>{const{styleId:t}=e.attributes;return t===oe.jf?1:-t})),Ms=(e,t,i)=>xs((t=>((e,t,i)=>{const n=e.getStyle(t);if(!n)return(0,hs.cM)(`Cannot get style with id=${t} for renderIndex`),NaN;const o=n.layersById[i];return o?o.groupIndex||0:NaN})(e,t.attributes.styleId,t.attributes.layerId)))(t,i),Ts=(e,t,i)=>xs((t=>((e,t,i)=>{const n=e.getStyle(t);if(!n)return(0,hs.cM)(`Cannot get style with id=${t} for renderIndex`),NaN;const o=n.layersById[i];return o?o.renderIndex:NaN})(e,t.attributes.styleId,t.attributes.layerId)))(t,i),Ps=xs((e=>e.layerSettings.subRenderIndex||0)),Ls=(e,t,i)=>{const n=new Set;e.forEach((e=>{if(e.type===ft.H.Custom)return;const o=e.layerSettings.programName;n.has(e.layerSettings.programName)||(n.add(o),t.setProgramBinder(e,i))}))},Es=(e,t,i)=>xs(((t,i)=>{const n=(0,ae.jJ)(i.styleZoom,i.styleState,t.attributes.tileData);return(0,ae.vn)(e,n,0)}))(t,i),ks=Is((e=>e.layerSettings.programName)),zs=Is((e=>e.layerSettings.stateBinder)),As=Is((e=>e.sink+"_"+e.attributesHash+"_"+e.tile.readiness));const Cs=(e,t)=>{const i=t.renderer.getRenderingContext();return{drawSymbol:Rs,useProgram:n=>{const{layerBinder:o,programName:s}=n[0].layerSettings,r=t.renderer.getShaderProgram(s);r.enable(i),null==o||o(i,r,e,t)},setProgramBinder:(n,o)=>{if(n.layerSettings.programBinder){const s=t.renderer.getShaderProgram(n.layerSettings.programName);s.enable(i),n.layerSettings.programBinder(i,s,e,t,o)}},useState:e=>{e[0].layerSettings.stateBinder(i)}}},Fs=rt.Ue(),Rs=(e,t,i,n)=>{const o=n.renderer.getRenderingContext(),s=e[0],{objectBinder:r,programName:a,tileZoomBinder:l}=s.layerSettings,c=n.renderer.getShaderProgram(a);r(o,c,i,n,s,t)&&(l?Os(e,i).forEach((e=>{l(o,c,i,n,e[0],t),e.forEach((e=>Ds(e,n,c,i,o)))})):e.forEach((e=>Ds(e,n,c,i,o))))},Ds=(e,t,i,n,o)=>{const s=t.renderer.webGlExtensions;"buildingModel"===e.symbol?(rt.dC(Fs,t.camera.viewProjectionMatrix,e.attributes.matrix),i.bind(o,{u_mat4_mvp:Fs})):"heatmap"===e.symbol&&"fill"===e.sink||i.bind(o,{u_mat4_mvp:e.tile.mvpMatrix}),e.vao.bind({gl:o,extensions:s});const r=e.rangeStart/e.stride,a=(e.rangeEnd-e.rangeStart)/e.stride,l="buildingModel"===e.symbol&&"fill"===e.sink&&1===e.attributes.primitiveType?o.TRIANGLE_STRIP:o.TRIANGLES;o.drawArrays(l,r,a),n.collectStats&&!e.layerSettings.identify&&(n.stats.drawCount++,n.stats.vertexCount+=a)},Os=xs((e=>e.tile.zoomLevel)),Bs=new Float32Array(16);class js extends ct{constructor(e,t){super({canvas:t.layout.canvas,antialias:!1,stencil:!0,clearColor:(0,ae.m2)((0,ds.MV)(e.defaultBackgroundColor)),preserveDrawingBuffer:e.preserveDrawingBuffer}),this.framebuffers=[],this.lastRenderedFramebuffers=[],this.trackContextLost=e=>{e.preventDefault(),this.modules.map.destroy(),He({eventAction:"WebGlContext",eventLabel:"webglcontextlost"}),He({eventCategory:"WebGlContext",eventAction:"webglcontextlost",eventLabel:e.statusMessage||""})},this.state=e,this.modules=t,this.identifyBuffer=new mt,this.shaderPrograms={diffuse:new Ko({vertex:as("diffuse"),fragment:ls("color"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec3_light_direction",type:"3fv"},{name:"u_vec3_light_color",type:"3fv"},{name:"u_vec3_ambient_color",type:"3fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_limitation",type:"1f"},{name:"u_float_tile_height",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},...cs],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec3_normal",location:1},{name:"a_vec2_dem_position",location:2}]}),labelLine:new Ko({vertex:as("labelLine"),fragment:ls("label"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_float_tile_to_pixel_ratio",type:"1f"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_buffer",type:"1f"},{name:"u_float_gamma",type:"1f"},{name:"u_float_scale",type:"1f"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_style_zoom",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2},{name:"a_vec2_style_zoom_limits",location:3}]}),labelPoint:new Ko({vertex:as("labelPoint"),fragment:ls("label"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2f"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_buffer",type:"1f"},{name:"u_float_gamma",type:"1f"},{name:"u_float_scale",type:"1f"},{name:"u_vec4_color",type:"4fv"},{name:"u_vec2_offset",type:"2f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},...cs],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2}]}),labelPointIdentify:new Ko({vertex:as("labelPointIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2f"},{name:"u_float_scale",type:"1f"},{name:"u_vec2_offset",type:"2f"},...cs],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec4_identifier",location:2}]}),line:new Ko({vertex:as("line"),fragment:ls("line"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec3_light_direction",type:"3fv"},{name:"u_vec3_light_color",type:"3fv"},{name:"u_vec3_ambient_color",type:"3fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_limitation",type:"1f"},{name:"u_float_tile_height",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},...cs],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_normal",location:1},{name:"a_vec2_normal_delta",location:2},{name:"a_vec3_direction",location:3},{name:"a_float_distance",location:4},{name:"a_vec2_dem_position",location:5}]}),pointSprite:new Ko({vertex:as("pointSprite"),fragment:ls("pointSprite"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_rounding_factor",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},{name:"u_vec2_rotation",type:"2fv"},...cs],attributes:[{name:"a_vec3_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2},{name:"a_vec2_range",location:3},{name:"a_vec2_rescale",location:4}]}),pointSpriteIdentify:new Ko({vertex:as("pointSpriteIdentify"),fragment:ls("pointSpriteIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_height_factor",type:"1f"},{name:"u_vec2_rotation",type:"2fv"},...cs],attributes:[{name:"a_vec3_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2},{name:"a_vec2_range",location:3},{name:"a_vec2_rescale",location:4},{name:"a_vec4_identifier",location:5}]}),stripedLine:new Ko({vertex:as("stripedLine"),fragment:ls("stripedLine"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_vec2_scaler_params",type:"2fv"},{name:"u_float_dash_length",type:"1f"},{name:"u_float_space_length",type:"1f"},{name:"u_float_dash2_length",type:"1f"},{name:"u_vec4_dash_color",type:"4fv"},{name:"u_vec4_space_color",type:"4fv"},{name:"u_vec4_border_color",type:"4fv"},{name:"u_float_width",type:"1f"},{name:"u_float_width_offset",type:"1f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texture_widen",location:1},{name:"a_vec2_widen",location:2},{name:"a_float_vertex_distance",location:3},{name:"a_float_component_distance",location:4},{name:"a_float_object_length",location:5},{name:"a_vec4_identifier",location:6}]}),stripedLineIdentify:new Ko({vertex:as("stripedLineIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_vec2_scaler_params",type:"2fv"},{name:"u_float_dash_length",type:"1f"},{name:"u_float_space_length",type:"1f"},{name:"u_float_dash2_length",type:"1f"},{name:"u_vec4_dash_color",type:"4fv"},{name:"u_vec4_space_color",type:"4fv"},{name:"u_vec4_border_color",type:"4fv"},{name:"u_float_width",type:"1f"},{name:"u_float_width_offset",type:"1f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texture_widen",location:1},{name:"a_vec2_widen",location:2},{name:"a_float_vertex_distance",location:3},{name:"a_float_component_distance",location:4},{name:"a_float_object_length",location:5},{name:"a_vec4_identifier",location:6}]}),vtxColor:new Ko({vertex:as("color"),fragment:ls("color"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0}]}),vtxColorIdentify:new Ko({vertex:as("colorIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec4_identifier",location:1}]}),modelIdentify:new Ko({vertex:as("modelIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},...cs],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec4_identifier",location:1},{name:"a_vec2_dem_position",location:2}]}),buildingIdentify:new Ko({vertex:as("buildingIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_float_height_limitation",type:"1f"},{name:"u_float_tile_height",type:"1f"},{name:"u_float_height_factor",type:"1f"},...cs],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec4_identifier",location:1},{name:"a_vec2_dem_position",location:2}]}),oneWayLine:new Ko({vertex:as("oneWayLine"),fragment:ls("oneWayLine"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2f"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_vec4_color",type:"4f"},{name:"u_vec4_border_color",type:"4f"},{name:"u_vec2_wing_normal",type:"2f"},{name:"u_vec2_tip_normal",type:"2f"},{name:"u_float_width",type:"1f"},{name:"u_float_length",type:"1f"},{name:"u_float_border_width",type:"1f"},{name:"u_float_border_width_offset",type:"1f"},{name:"u_float_size_factor",type:"1f"},{name:"u_vec2_scale_limits",type:"2fv"},{name:"u_float_tip_height_multiplier",type:"1f"},{name:"u_float_wing_height_multiplier",type:"1f"},{name:"u_float_wing_width_multiplier",type:"1f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_direction",location:1},{name:"a_vec2_widen_direction",location:2}]}),model:new Ko({vertex:as("model"),fragment:ls("model"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec4_color",type:"4fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_height_factor",type:"1f"},...cs],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec2_texcoord",location:1},{name:"a_vec2_dem_position",location:2}]}),simpleLine:new Ko({vertex:as("simpleLine"),fragment:ls("simpleLine"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_width",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_height_limitation",type:"1f"},{name:"u_float_tile_height",type:"1f"},{name:"u_float_z_offset",type:"1f"},...cs],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec4_direction_distance",location:1},{name:"a_vec2_dem_position",location:2}]}),road:new Ko({vertex:as("road"),fragment:ls("road"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_width",type:"1f"},{name:"u_float_tile_to_pixel_ratio",type:"1f"},{name:"u_float_shift",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec4_normals",location:1},{name:"a_vec2_shift",location:2}]}),roadIdentify:new Ko({vertex:as("roadIdentify"),fragment:ls("roadIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_float_width",type:"1f"},{name:"u_float_tile_to_pixel_ratio",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec4_normals",location:1},{name:"a_vec4_identifier",location:2}]}),entrance:new Ko({vertex:as("entranceArrow"),fragment:ls("entranceArrow"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2f"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_vec2_scale_limits",type:"2fv"},{name:"u_vec4_color",type:"4f"},{name:"u_vec4_border_color",type:"4f"},{name:"u_vec2_wing_normal",type:"2f"},{name:"u_vec2_tip_normal",type:"2f"},{name:"u_float_width_zpt",type:"1f"},{name:"u_float_tip_height_multiplier",type:"1f"},{name:"u_float_wing_width_multiplier",type:"1f"},{name:"u_float_wing_height_multiplier",type:"1f"},{name:"u_float_border_width_zpt",type:"1f"},{name:"u_float_size_factor",type:"1f"},{name:"u_float_border_width_offset",type:"1f"},{name:"u_float_total_line_length",type:"1f"},{name:"u_float_relative_end_position",type:"1f"},{name:"u_float_vertex_shift",type:"1f"},{name:"u_float_tip_movement_amplitude",type:"1f"},{name:"u_vec2_bounce_direction",type:"2f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_segment_end",location:1},{name:"a_vec4_texture_widen_arrow_widen",location:2},{name:"a_vec2_widen",location:3},{name:"a_vec2_direction",location:4},{name:"a_float_distance_from_start",location:5},{name:"a_float_object_length",location:6},{name:"a_float_type",location:7},{name:"a_vec4_identifier",location:8}]}),entranceIdentify:new Ko({vertex:as("entranceArrow"),fragment:ls("entranceArrowIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2f"},{name:"u_vec3_projection_scale_style_scale_dpi",type:"3fv"},{name:"u_vec2_scale_limits",type:"2fv"},{name:"u_vec4_color",type:"4f"},{name:"u_vec4_border_color",type:"4f"},{name:"u_vec2_wing_normal",type:"2f"},{name:"u_vec2_tip_normal",type:"2f"},{name:"u_float_width_zpt",type:"1f"},{name:"u_float_tip_height_multiplier",type:"1f"},{name:"u_float_wing_width_multiplier",type:"1f"},{name:"u_float_wing_height_multiplier",type:"1f"},{name:"u_float_border_width_zpt",type:"1f"},{name:"u_float_size_factor",type:"1f"},{name:"u_float_border_width_offset",type:"1f"},{name:"u_float_total_line_length",type:"1f"},{name:"u_float_relative_end_position",type:"1f"},{name:"u_float_vertex_shift",type:"1f"},{name:"u_float_tip_movement_amplitude",type:"1f"},{name:"u_vec2_bounce_direction",type:"2f"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_segment_end",location:1},{name:"a_vec4_texture_widen_arrow_widen",location:2},{name:"a_vec2_widen",location:3},{name:"a_vec2_direction",location:4},{name:"a_float_distance_from_start",location:5},{name:"a_float_object_length",location:6},{name:"a_float_type",location:7},{name:"a_vec4_identifier",location:8}]}),circleMarker:new Ko({vertex:as("circleMarker"),fragment:ls("circleMarker"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_width",type:"1f"}],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_widen",location:1}]}),rect:new Ko({vertex:as("rect"),fragment:ls("rect"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec4_color",type:"4fv"}],attributes:[{name:"a_vec2_vertex",location:0}]}),rectWithTexture:new Ko({vertex:as("rectWithTexture"),fragment:ls("rectWithTexture"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]}),circleMarkerIdentify:new Ko({vertex:as("circleMarkerIdentify"),fragment:ls("colorIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_float_width",type:"1f"}],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_widen",location:1},{name:"a_vec4_identifier",location:2}]}),stretchableImage:new Ko({vertex:as("stretchableImage"),fragment:ls("stretchableImage"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_rounding_factor",type:"1f"}],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2}]}),stretchableImageIdentify:new Ko({vertex:as("stretchableImageIdentify"),fragment:ls("stretchableImageIdentify"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_rounding_factor",type:"1f"}],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2},{name:"a_vec4_identifier",location:3}]}),heatmap:new Ko({vertex:as("heatmap"),fragment:ls("heatmap"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_float_radius",type:"1f"},{name:"u_float_intensity",type:"1f"},{name:"u_float_tile_to_pixel_ratio",type:"1f"}],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_widen",location:1},{name:"a_float_weight",location:2}]}),heatmapTexture:new Ko({vertex:as("heatmapTexture"),fragment:ls("heatmapTexture"),uniforms:[{name:"u_sr2d_texture",type:"1i"},{name:"u_sr2d_ramp_texture",type:"1i"},{name:"u_float_opacity",type:"1f"}],attributes:[{name:"a_vec2_position",location:0}]}),demMesh:new Ko({vertex:as("demMesh"),fragment:ls("demMesh"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_mat4_flat_map_mvp",type:"mat4"},{name:"u_flat_tex",type:"1i"},{name:"u_hillshade_tex",type:"1i"},...cs],attributes:[{name:"a_vec2_position",location:0}]}),demElevation:new Ko({vertex:as("demElevation"),fragment:ls("demElevation"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_sr2d_texture",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]}),demHillshade:new Ko({vertex:as("demHillshade"),fragment:ls("demHillshade"),uniforms:[...cs,{name:"u_mat4_mvp",type:"mat4"},{name:"u_sr2d_texture",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]})},t.map.once("idle",(()=>function(e,t){if(window.requestIdleCallback)for(const i in e){const n=e[i];window.requestIdleCallback((()=>{t.isContextLost()||(n.link(t),setTimeout((()=>{window.requestIdleCallback((()=>{t.isContextLost()||n.locate(t)}))}),2e3))}))}}(this.shaderPrograms,this._gl))),this.symbolSettingsList={line:{solid:[{programName:"road",vaoCreator:Jt,stateBinder:Bo,objectBinder:Fo(vo,kn,Un,Zn),tileZoomBinder:ko},{identify:!0,programName:"roadIdentify",vaoCreator:ei,stateBinder:Uo,objectBinder:Fo(vo,Zn),tileZoomBinder:ko}]},polygon:{fill:[{programName:"vtxColor",vaoCreator:Yt,stateBinder:Bo,objectBinder:Fo(vo,eo,kn,Un,On)},{identify:!0,programName:"vtxColorIdentify",vaoCreator:Kt,stateBinder:No,programBinder:St,objectBinder:Fo(vo,eo)}],stroke:[{programName:"simpleLine",vaoCreator:ui,stateBinder:Bo,programBinder:Mn,layerBinder:Nt(St,Et,Rt),objectBinder:Fo(go,vo,eo,Cn,Bn,Un,Hn),subRenderIndex:1}]},polygonExtrusion:{sideFill:[{programName:"diffuse",vaoCreator:si,stateBinder:Zo,layerBinder:zt,programBinder:mn,objectBinder:Fo(vo,eo,An,Dn,Un,po,On)},{programName:"diffuse",vaoCreator:si,stateBinder:Ho,layerBinder:zt,programBinder:mn,objectBinder:Fo(vo,eo,An,Dn,Un,po,On),subRenderIndex:1},{identify:!0,programName:"buildingIdentify",vaoCreator:ri,stateBinder:Ro,programBinder:fn,objectBinder:Fo(vo,eo,to,po)}],topFill:[{programName:"diffuse",vaoCreator:si,stateBinder:Zo,layerBinder:zt,programBinder:mn,objectBinder:Fo(vo,eo,zn,Dn,Un,po,On)},{programName:"diffuse",vaoCreator:si,stateBinder:Ho,layerBinder:zt,programBinder:mn,objectBinder:Fo(vo,eo,zn,Dn,Un,po,On),subRenderIndex:1},{identify:!0,programName:"buildingIdentify",vaoCreator:ri,stateBinder:Ro,programBinder:fn,objectBinder:Fo(vo,eo,to,po)}],sideStroke:[{programName:"line",vaoCreator:ai,stateBinder:Do,programBinder:pn,layerBinder:zt,objectBinder:Fo(vo,eo,An,Nn,Dn,Un,po,On),subRenderIndex:3}],topStroke:[{programName:"simpleLine",vaoCreator:mi,stateBinder:Do,programBinder:Mn,layerBinder:Nt(It,Lt,Dt),objectBinder:Fo(vo,eo,Cn,jn,Dn,Un,Hn,po),subRenderIndex:4}]},labelLine:{raster:[{programName:"labelLine",vaoCreator:oi,stateBinder:Go,programBinder:_n,objectBinder:Fo(yo,So,Yn,no,Io,Mo,Eo),tileZoomBinder:ko,uniformSet:"fontHalo"},{programName:"labelLine",vaoCreator:oi,stateBinder:Go,programBinder:_n,objectBinder:Fo(yo,Yn,no,Io,Mo,Eo),tileZoomBinder:ko,uniformSet:"fontFill",subRenderIndex:1}]},dashedLine:{stroke:[{programName:"stripedLine",vaoCreator:ti,stateBinder:Bo,programBinder:gn,objectBinder:Fo(vo,ao,bo,ro,On)},{identify:!0,programName:"stripedLineIdentify",vaoCreator:ti,stateBinder:Uo,programBinder:gn,objectBinder:Fo(vo,ao,bo,On,ro)}]},oneWayLine:{raster:[{programName:"oneWayLine",vaoCreator:di,stateBinder:Bo,programBinder:vn,objectBinder:Fo(yo,Yn,kn,Un,lo,co)}]},point:{raster:[{programName:"pointSprite",vaoCreator:li,stateBinder:Go,programBinder:yn,layerBinder:jt,objectBinder:Fo(yo,qn,Yn,io,Kn)},{identify:!0,programName:"pointSpriteIdentify",vaoCreator:ci,stateBinder:No,programBinder:bn,layerBinder:jt,objectBinder:Fo(yo,qn,io,Kn)}],text:[{programName:"labelPoint",vaoCreator:ii,stateBinder:Go,programBinder:wn,objectBinder:Fo(yo,So,Yn,no,Io,To,Lo),uniformSet:"fontHalo",subRenderIndex:1},{programName:"labelPoint",vaoCreator:ii,stateBinder:Go,programBinder:wn,objectBinder:Fo(yo,Yn,no,Io,To,Lo),uniformSet:"fontFill",subRenderIndex:2},{identify:!0,programName:"labelPointIdentify",vaoCreator:ni,stateBinder:No,programBinder:Nt(It,dn),objectBinder:Fo(yo,$n,Io,Lo),subRenderIndex:1}]},buildingModel:{fill:[{programName:"model",vaoCreator:hi,stateBinder:Wo,programBinder:dn,objectBinder:Fo(vo,kn,Rn,Un,mo,uo),subRenderIndex:2},{programName:"modelIdentify",vaoCreator:ri,stateBinder:Ro,programBinder:It,objectBinder:Fo(vo),subRenderIndex:2,identify:!0}],stroke:[{programName:"simpleLine",vaoCreator:mi,stateBinder:Do,programBinder:Mn,layerBinder:Nt(It,Et,Rt),objectBinder:Fo(vo,Cn,Rn,Un,Hn,mo),subRenderIndex:5}]},shiftedLine:{solid:[{programName:"road",vaoCreator:Qt,stateBinder:Bo,objectBinder:Fo(vo,kn,Un,Zn,Xn),tileZoomBinder:ko}]},circle:{fill:[{programName:"circleMarker",vaoCreator:pi,stateBinder:Bo,programBinder:xn,objectBinder:Fo(vo,kn,Un,Zn),subRenderIndex:2},{programName:"circleMarker",vaoCreator:pi,stateBinder:Bo,programBinder:xn,objectBinder:Fo(vo,Cn,Un,Gn),subRenderIndex:1},{programName:"circleMarker",vaoCreator:pi,stateBinder:Bo,programBinder:xn,objectBinder:Fo(vo,Fn,Un,Wn)},{identify:!0,programName:"circleMarkerIdentify",vaoCreator:_i,stateBinder:No,programBinder:xn,objectBinder:Fo(vo,Vn)}]},arrow:{stroke:[{programName:"entrance",vaoCreator:fi,stateBinder:Bo,programBinder:In,objectBinder:Fo(vo,kn,Un,lo,ho,On)},{identify:!0,programName:"entranceIdentify",vaoCreator:fi,stateBinder:No,programBinder:In,objectBinder:Fo(vo,lo,ho,On)}]},lineExtrusion:{fill:[{programName:"diffuse",vaoCreator:si,stateBinder:Oo,layerBinder:At,programBinder:mn,objectBinder:Fo(vo,fo,An,Un,On),subRenderIndex:9}],sideStroke:[{programName:"line",vaoCreator:ai,stateBinder:Do,programBinder:pn,layerBinder:At,objectBinder:Fo(vo,fo,An,Nn,Un,On),subRenderIndex:10}],topStroke:[{programName:"simpleLine",vaoCreator:mi,stateBinder:Do,programBinder:Mn,layerBinder:Nt(It,Lt,Rt),objectBinder:Fo(vo,fo,Cn,Un,Hn),subRenderIndex:11}]},stretchableImage:{fill:[{programName:"stretchableImage",vaoCreator:vi,stateBinder:Vo,programBinder:Sn,objectBinder:Fo(vo,oo)},{identify:!0,programName:"stretchableImageIdentify",vaoCreator:gi,stateBinder:Uo,programBinder:Sn,objectBinder:Fo(vo,oo)}]},raster:{fill:[{programName:"rectWithTexture",vaoCreator:yi,stateBinder:Bo,objectBinder:Fo(vo,oo,Jn)}]},heatmap:{framebuffer:[{programName:"heatmap",vaoCreator:bi,stateBinder:qo,objectBinder:Fo(vo,wo,xo),tileZoomBinder:ko}],fill:[{programName:"heatmapTexture",vaoCreator:wi,stateBinder:Bo,objectBinder:Fo(vo,oo,so,Qn),subRenderIndex:1}]},dem:{mesh:[{programName:"demMesh",vaoCreator:xi,programBinder:dn,stateBinder:Ro,objectBinder:Fo(zo,Co)},{identify:!0,programName:"demMesh",vaoCreator:xi,programBinder:Nt(dn,hn),stateBinder:Ro,objectBinder:Fo(Ao)}],elevation:[{programName:"demElevation",vaoCreator:Ii,stateBinder:jo,objectBinder:Fo(oo)}],hillshade:[{programName:"demHillshade",vaoCreator:Si,stateBinder:jo,programBinder:dn,objectBinder:Fo()}]}},this.addExtension("OES_vertex_array_object").addExtension("OES_element_index_uint").addExtension("OES_standard_derivatives").addExtension("OES_texture_float").addExtension("OES_texture_float_linear"),this.setPixelRatio(window.devicePixelRatio).setSize(t.layout.mapContainer.clientWidth,t.layout.mapContainer.clientHeight),e.collectStats&&(this.timers=new Xo(this._gl)),t.layout.canvas.addEventListener("webglcontextlost",this.trackContextLost)}setClearColor(e){return this.clearColor=(0,ae.m2)(e),this.state.needRerender=!0,this}setSize(e,t){return this.modules.layout.setCanvasSize(e,t),this.framebuffers.forEach((e=>{e&&e.onResize()})),this.updateIdentifySize(),this}updateIdentifySize(){const e=window.devicePixelRatio,{size:t}=this.state;return this.identifyBuffer.setSize([Math.ceil(t[0]*T.identify.pixelDensity*e),Math.ceil(t[1]*T.identify.pixelDensity*e)]),this}clear(){return this.clearWithColor(this.clearColor),this}clearWithColor(e){const t=this._gl;t.depthMask(!0),t.clearDepth(1),t.clearColor.apply(t,e),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}renderTileObjects(e){this.state.collectStats&&this.timers&&this.timers.addTimer();const t=Cs(this.state,this.modules),i=this.groupObjectsByFramebuffer(e,!1);if(this.lastRenderedFramebuffers.forEach((e=>{i.groups.some((t=>t.framebuffer===e))||this.clearFramebuffer(e)})),this.lastRenderedFramebuffers=[],i.groups.forEach((({objects:e,tileObjects:n,framebuffer:o})=>{var s,r,a,l;const c=void 0===o&&this.modules.demManager.isEnabled();if(o)null===(s=o.onRenderStart)||void 0===s||s.call(o),this.lastRenderedFramebuffers.push(o),o.renderTarget.bind(this._gl),this._gl.viewport(0,0,o.renderTarget.options.size[0],o.renderTarget.options.size[1]),this.clearWithColor(o.clearColor);else{const{size:e,viewport:n}=this.state,o=window.devicePixelRatio;this._gl.viewport(n.left*o,n.bottom*o,e[0]*o,e[1]*o),this.clear(),c&&i.flatObjectsGroup&&this.renderDemMesh(t,i.flatObjectsGroup)}const d=null!==(a=null===(r=null==o?void 0:o.getViewProjectionMatrix)||void 0===r?void 0:r.call(o))&&void 0!==a?a:this.modules.camera.viewProjectionMatrix;n.forEach((e=>{e.updateMvpMatrix(d)})),us(this.state,this.modules,e,t),null==o||o.renderTarget.unbind(this._gl),null===(l=null==o?void 0:o.onRenderEnd)||void 0===l||l.call(o)})),this.state.collectStats&&this.timers){this.timers.stopTimer();const e=this.timers.tryToGetFirstTimerValue();e&&this.modules.map.emit("gpuRenderTime",e)}return this}renderIdentify(e){const t=this._gl,i=Cs(this.state,this.modules),n=this.groupObjectsByFramebuffer(e,!0);n.groups.forEach((({objects:e,tileObjects:o,framebuffer:s})=>{var r,a,l;const c=void 0===s&&this.modules.demManager.isEnabled(),d=s?s.renderTarget:this.identifyBuffer;d.bind(t),this.clearIdentify(),c&&n.flatObjectsGroup&&this.renderDemMesh(i,n.flatObjectsGroup,!0),d.bind(t),t.viewport(0,0,d.options.size[0],d.options.size[1]);const h=null!==(a=null===(r=null==s?void 0:s.getViewProjectionMatrix)||void 0===r?void 0:r.call(s))&&void 0!==a?a:this.modules.camera.viewProjectionMatrix;o.forEach((e=>{e.updateMvpMatrix(h)})),us(this.state,this.modules,e,i),d.unbind(t),null==s||s.renderTarget.unbind(this._gl),null===(l=null==s?void 0:s.onRenderEnd)||void 0===l||l.call(s)})),this.state.needRerender=!0}getPixels(){const e=this._gl,t=this.identifyBuffer.options.size,i=new Uint8Array(t[0]*t[1]*4);return this.identifyBuffer.bind(e),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,i),this.identifyBuffer.unbind(e),i}getRenderingContext(){return this._gl}getShaderProgram(e){return this.shaderPrograms[e]}destroy(){this.lastRenderedFramebuffers=[],this.framebuffers.forEach((e=>{null==e||e.renderTarget.remove(this.getRenderingContext())})),this.modules.layout.canvas.removeEventListener("webglcontextlost",this.trackContextLost);const e=this._gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.modules.layout.destroy()}addFramebuffer(e){return this.framebuffers.push(e),this.framebuffers.length-1}getFramebuffer(e){if(e!==$i.z)return this.framebuffers[e]}removeFramebuffer(e){var t;null===(t=this.framebuffers[e])||void 0===t||t.renderTarget.remove(this.getRenderingContext()),this.framebuffers[e]=void 0}renderDemMesh(e,t,i=!1){const{framebuffer:n,tiles:o}=t;if(!n)return;let s=this.modules.demManager.getFlatMapTextures();if(i&&(s=s.filter((e=>0===e.detailLevel))),!s.length)return;const r=this.modules.demManager.getMeshTiles();if(!r.length)return;const a=r[0],l=(i?a.identifyChildren:a.children)[0],c=this.state.handyStyleId,d=this.modules.styleManager.getStyleLayer(c,Mi.h);if(!d)return;const{size:h,viewport:u}=this.state,m=window.devicePixelRatio,{programBinder:f,layerBinder:p,programName:_}=l.layerSettings,v=this.modules.renderer.getShaderProgram(_),g=[];o.forEach(((e,t)=>{g.push({objects:e,tile:t})})),s.forEach((t=>{var o,s;const a=g.filter((e=>(0,Gi.M4)(t.viewport,e.tile.bounds))).reduce(((e,i)=>{i.tile.updateMvpMatrix(t.mvpMatrix);const n=0===t.detailLevel?i.objects:i.objects.filter((e=>{if(e.type===ft.H.Custom)return!1;const t=this.modules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);return!(!t||!0===t.farLimit)}));return e.concat(n)}),[]);if(null===(o=n.onRenderStart)||void 0===o||o.call(n),n.renderTarget.bind(this._gl),this._gl.viewport(0,0,n.renderTarget.options.size[0],n.renderTarget.options.size[1]),this.clearWithColor(n.clearColor),us(this.state,this.modules,a,e,!0),n.renderTarget.unbind(this._gl),null===(s=n.onRenderEnd)||void 0===s||s.call(n),i){this.identifyBuffer.bind(this._gl);const e=this.identifyBuffer.options.size;this._gl.viewport(0,0,e[0],e[1])}else this._gl.viewport(u.left*m,u.bottom*m,h[0]*m,h[1]*m);v.enable(this._gl),null==f||f(this._gl,v,this.state,this.modules),null==p||p(this._gl,v,this.state,this.modules),e.useState([l]),r.forEach((n=>{if((0,Gi.M4)(t.viewport,n.bounds)){rt.Jp(Bs,t.texMatrix,n.modelMatrix),v.bind(this._gl,{u_mat4_flat_map_mvp:Bs}),n.updateMvpMatrix(this.modules.camera.viewProjectionMatrix);const o=i?n.identifyChildren:n.children;e.drawSymbol(o,d,this.state,this.modules)}})),i&&this.identifyBuffer.unbind(this._gl)}))}clearIdentify(){const e=this._gl;e.depthMask(!0),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT),e.clearDepth(1),e.clearStencil(0)}clearFramebuffer(e){e.renderTarget.bind(this._gl),this._gl.viewport(0,0,e.renderTarget.options.size[0],e.renderTarget.options.size[1]),this.clearWithColor(e.clearColor),e.renderTarget.unbind(this._gl)}groupObjectsByFramebuffer(e,t){const i=this.modules.demManager,n={},o={framebuffer:void 0,objects:[],tileObjects:new Set},s=t?i.getIdentifyFlatFramebufferId():i.getFlatFramebufferId();let r;if(this.modules.demManager.isEnabled()){const e=this.getFramebuffer(s);e&&(r={framebuffer:e,tiles:new Map})}t||o.objects.push(...this.modules.styleManager.getCustomSceneObjects()),e.forEach((e=>{(t?e.identifyChildren:e.children).forEach((t=>{var i;const s=this.modules.styleManager.getFramebufferId(t.attributes.styleId,t.attributes.layerId),a=s?s[t.sink]:void 0;var l;a!==$i.z&&(void 0!==a?(n[a]||(n[a]={framebuffer:this.getFramebuffer(a),objects:[],tileObjects:new Set}),n[a].objects.push(t),n[a].tileObjects.add(e)):this.modules.demManager.isEnabled()&&(l=t.symbol,"mesh"!==t.sink&&"point"!==l&&"polygonExtrusion"!==l&&"lineExtrusion"!==l&&"buildingModel"!==l)?(null==r?void 0:r.tiles.has(e))?null===(i=null==r?void 0:r.tiles.get(e))||void 0===i||i.push(t):null==r||r.tiles.set(e,[t]):(o.objects.push(t),o.tileObjects.add(e)))}))}));const a=Object.values(n).filter((e=>!!e.framebuffer));return a.sort(((e,t)=>{var i,n,o,s;return(null!==(n=null===(i=e.framebuffer)||void 0===i?void 0:i.renderIndex)&&void 0!==n?n:0)-(null!==(s=null===(o=t.framebuffer)||void 0===o?void 0:o.renderIndex)&&void 0!==s?s:0)})),a.push(o),{flatObjectsGroup:r,groups:a}}}var Ns=i(8674);class Us{constructor(e,t){this.isIdle=()=>0===this.searchQueue.size,this.state=e,this.modules=t,this.identifyData=[],this.needsUpdate=!1,this.forceUpdate=!1,this.searchQueue=new Map,this.stateDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}]),this.debouncedFillCache=(0,et.D)((()=>{this.needsUpdate=!0}),T.identify.cacheDebounceTime)}resetCache(){this.colorBuffer=void 0,this.debouncedFillCache()}search(e,t,i=!1){return void 0===this.colorBuffer&&i&&(this.needsUpdate=!0),this.forceUpdate=i,new Promise((i=>{this.searchQueue.set(e,{point:t,resolve:i})}))}searchSync(e){return this.searchHigherPriority(e)}update(){this.stateDiffer.check(this.state)&&(this.resetCache(),this.searchQueue.size>0&&this.searchQueue.clear()),this.needsUpdate&&(this.forceUpdate||this.modules.tileManager.isIdle()&&this.modules.labeler.isIdle()&&this.modules.layers.entranceAnimationFinished()&&this.modules.modelLayer.isIdle()&&!this.modules.buildingHeightAnimator.isAnimating()&&this.modules.assetManager.isIdle())&&(this.fillCache(),this.needsUpdate=!1,this.forceUpdate=!1),void 0!==this.colorBuffer&&this.searchQueue.size>0&&(this.searchQueue.forEach((e=>{e.resolve(this.searchHigherPriority(e.point))})),this.searchQueue.clear())}searchHigherPriority(e){const{viewport:t}=this.state,i=X.al(e[0]-t.left,e[1]-t.top),n=this.state.identifyPickDistance*window.devicePixelRatio;let o,s=1/0,r=!1;const a=X.Ue();for(a[0]=i[0]-n;a[0]<i[0]+n;a[0]++)for(a[1]=i[1]-n;a[1]<i[1]+n;a[1]++){const e=this.searchPointInCache(a);if(!e)continue;const t=void 0!==e.dynamicObjectId;if(r&&!t)continue;const n=X.TE(i,a);(!o||!r&&t||e.phase>o.phase||e.phase===o.phase&&n<s)&&(o=e,s=n,t&&(r=!0))}return o}searchPointInCache(e){if(void 0===this.colorBuffer)return;const t=T.identify.pixelDensity*window.devicePixelRatio,i=this.modules.renderer.identifyBuffer.options.size,n=this.state.size;if(e[0]<0||e[0]>n[0]-1||e[1]<0||e[1]>n[1]-1)return;const o=Math.floor(e[0]*t),s=4*((i[1]-1-Math.floor(e[1]*t))*i[0]+o),r=(this.colorBuffer[s+3]<<24|this.colorBuffer[s+2]<<16|this.colorBuffer[s+1]<<8|this.colorBuffer[s])>>>0;return this.indexToIdentifierResponse(r)}fillCache(){const e=this.modules.tileManager.getTileObjects();this.modules.renderer.renderIdentify(e),this.colorBuffer=this.modules.renderer.getPixels();const t=this.state.metrics;Number.isNaN(t.interactive)&&(t.interactive=performance.now()-t.start),this.identifyData=this.modules.tileManager.getDisplayedIdentifyData(),this.modules.modelLayer.getDisplayedIdentifyData().forEach((e=>this.identifyData.push(e))),this.modules.floorManager.getDisplayedIdentifyData().forEach((e=>this.identifyData.push(e)));const i=this.modules.personalPoiManager.getIdentifyDataChunk();void 0!==i&&this.identifyData.push(i),this.modules.layers.getDynamicObjectLayers().forEach((e=>{e.getIdentifyData().forEach((e=>this.identifyData.push(e)))}))}indexToIdentifierResponse(e){var t,i,n;for(let o=0;o<this.identifyData.length;o++){const s=this.identifyData[o],{dynamicObjectId:r,ids:a,metatileHash:l,sourceId:c,tileKey:d}=s,{startIndex:h,endIndex:u,idBuffer:m,floorIdBuffer:f,phaseBuffer:p,sublayerBuffer:_,styleIdBuffer:v,layerIdBuffer:g,instanceIdBuffer:y,objectClassBuffer:b,centerBuffer:w,strings:x}=a;if(e<h||e>u)continue;const I=e-h,S=new Uint32Array(m,4*I*2,2),M=new Uint32Array(_)[I],T=new Uint8Array(y)[I],P=new Uint32Array(b)[I];let L,E,k="";const z=new Uint32Array(f,4*I*2,2);z[0]===Hi.gl&&z[1]===Hi.gl||(E=(0,Y.Ru)(z[0],z[1]));const A=this.modules.assetManager.getMetatile(l);if(A){(null===(t=A.reverseDictionaries.db_sublayer)||void 0===t?void 0:t[M])&&(L=A.reverseDictionaries.db_sublayer[M]);const o=x[e];k=void 0!==o?o.objectClass:null!==(n=null===(i=null==A?void 0:A.reverseDictionaries.db_object_class)||void 0===i?void 0:i[P])&&void 0!==n?n:""}const C=new Uint16Array(v)[I],F=new Uint32Array(g)[I],R=this.modules.styleManager.getStyleLayer(C,F);if(!R||"custom"===R.type)return;const D=new Int32Array(w,I*Int32Array.BYTES_PER_ELEMENT*2,2);return{id:(0,Y.Ru)(S[0],S[1]),floorId:E,phase:new Float32Array(p)[I],dynamicObjectId:r,sourceId:c,tileKey:d,sublayer:L,symbol:R.type,instanceId:T,objectClass:k,center:D[0]!==pt.Cd||D[1]!==pt.Cd?[D[0],D[1]]:void 0}}}}var Zs=i(3990);function Hs(e,t,i){const n=document.createElement("img");return n.width=t,n.height=i,new Promise((t=>{n.onload=()=>t(n),n.src=`data:image/svg+xml;base64,${btoa(e)}`}))}function Gs(e){const t=new Blob([e],{type:"image/png"}),i=URL.createObjectURL(t),n=document.createElement("img");return new Promise((t=>{n.onload=()=>{URL.revokeObjectURL(i),t(n)},0===e.byteLength?n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=":n.src=i}))}function Ws(e,t){if(t[0]===e.width&&t[1]===e.height)return e;const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t[0],i.height=t[1],n.shadowColor="transparent",n.shadowBlur=0,n.drawImage(e,0,0,t[0],t[1]),i}var Vs=i(8426),qs=i(1713),Xs=i(881);class $s extends Xs.g{constructor(e){super(),this.sync=e=>{const{dictionaries:t,reverseDictionaries:i}=e;this.dictionaries=t,this.reverseDictionaries=i},e.set("syncMetatile",this.sync)}}var Ys=i(9696);function Ks(e,t,i){return(0,H.IG)(i.fontUrlTemplate,{name:e,range:String(t)})}function Js(e,t,i){return(0,H.IG)(ir(t.legacyIconBaseUrl,t.iconNameTemplate),{name:e,subdomain:i})}function Qs(e){return tr(e.stylePath)?e.stylePath:ir(e.rootUrl,e.stylePath)}const er=new RegExp("^(?:[a-z]+:)?//","i");function tr(e){return er.test(e)}function ir(...e){let t=e[0];for(let i=1;i<e.length;i++){"/"!==t[t.length-1]&&(t+="/");const n=e[i];"/"===n[0]?t+=n.slice(1):t+=n}return t}var nr=i(6285);function or(e){const t=new nr.x;let i;for(const n of e.layers)void 0!==n.groupId&&i&&n.groupId===i.groupId?n.renderIndex=i.renderIndex:n.renderIndex=t.getIndex(),i=n;for(const t in e.groupsById){const i=e.groupsById[t];i&&(i.layers[0]&&(i.renderIndex=i.layers[0].renderIndex))}}var sr=i(947);function rr(e,t,i){const{map:{state:n},collector:o,imageManager:s,renderer:r,tileManager:a}=i;let l;try{l=function(e,t,i){const n=(0,ae.jJ)(e.styleZoom,e.styleState,[]),o=t.style.color,s=[];if(r=o.argument,"object"!=typeof r||"heatmap-density"!==r.type)throw new Error(`Heatmap color must be interpolate expression with 'heatmap-density' argument in layer ${t.id}`);var r;const a=i-1;for(let e=0;e<i;e++){const t=e/a,i=(0,ae.o4)(o,t,n);s.push(...i.value)}return new ht(new Uint8Array(s),{size:[i,1]})}(n,e,256)}catch(e){return void console.error(e)}const c=s.addPreparedTexture(l),d=r.getRenderingContext(),{downscale:h}=e.style,{size:u}=n,m=new mt({size:[Math.ceil(u[0]*window.devicePixelRatio/h),Math.ceil(u[1]*window.devicePixelRatio/h)],magFilter:ht.LinearFilter,minFilter:ht.LinearFilter,wrapS:ht.ClampToEdgeWrapping,wrapT:ht.ClampToEdgeWrapping}),f=s.addPreparedTexture(m.getTexture()),p=r.addFramebuffer({renderTarget:m,clearColor:[0,0,0,0],onResize:()=>{m.setSize([Math.ceil(n.size[0]*window.devicePixelRatio/h),Math.ceil(n.size[1]*window.devicePixelRatio/h)]),m.bind(d),m.unbind(d),s.updatePreparedTexture(f,m.getTexture())}});(0,ie.XI)({collector:o,generator:Xt.B.generateTexture,args:[t,e,f,c]});const _=o.getAccumulatedData(),v=new $.W("dynamicObject",_.data,r);return a.addObject(v),o.reset(),e.framebufferId={framebuffer:p},e=>{a.removeObject(v),v.clean(e),s.deleteTexture(f),s.deleteTexture(c),r.removeFramebuffer(p)}}class ar{constructor(e){this.modules=e,this.customLayers=new Map,this.styleIndex=1,this.handyStylesMap=new Map,this.waitingStyleRequests=new Map,this.onRemoveLayerHooks=new Map}createStyle(e,t,i){const{state:n}=this.modules.map;if(!Number.isNaN(n.handyStyleId)){const e=this.getStyle(n.handyStyleId);e&&(e.layers.forEach((e=>{const t=this.onRemoveLayerHooks.get(e.innerId);t&&t(n)})),this.onRemoveLayerHooks.clear())}const o=this.styleIndex++,s=(0,se.Cp)(e,o,i);!function(e,t){const i=tr(t.fontsPath)?t.fontsPath:ir(t.rootUrl,t.fontsPath);e.fontUrlTemplate=ir(i,"{name}_{range}.pbf"),e.iconBaseUrl=tr(t.iconsPathForMap)?t.iconsPathForMap:ir(t.rootUrl,t.iconsPathForMap),e.legacyIconBaseUrl=tr(t.iconsPath)?t.iconsPath:ir(t.rootUrl,t.iconsPath),e.iconNameTemplate=t.iconNameTemplate}(s,t),this.handyStylesMap.set(s.id,s);const r=this.waitingStyleRequests.get(o);return r&&r.resolve(s),this.modules.workers.parser.syncStyle(s),this.modules.workers.labeling.syncStyle(s),s.layers.forEach((e=>this.initHandyLayer(o,e))),s}addLayer(e,t){const i=this.getStyle(this.modules.map.state.handyStyleId);if(!i)return;const n=(0,se.ys)(e);n&&(!function(e,t,i){var n;if(void 0===e.id)throw new Error("The layer id must be set.");if(t.layerIdToInnerId[e.id])throw new Error(`The layer with id «${e.id}» already exists in the map style.`);let o=-1;if(i){const s=Object.values(t.groupsById).find((e=>e&&e.id===i));if(s)o=t.layers.findIndex((e=>e.groupId===s.innerId));else{o=t.layers.findIndex((e=>e.id===i));const s=null===(n=t.layers[o])||void 0===n?void 0:n.groupId;if(void 0!==s&&"group"===e.type)throw new Error(`Group layer with id «${e.id}» can't be added before layer with id «${i}» in group with innerId «${s}». Layer groups doesn't support nesting.`)}}else o=t.layers.length;if(-1===o)throw new Error(`The layer with beforeId «${i}» doesn't exist in the map style.`);let s=[];if("group"!==e.type){s=[e];const i=o!==t.layers.length?t.layers[o]:void 0;if(i&&void 0!==i.groupId){const n=t.groupsById[i.groupId];if(!n)return void(0,hs.cM)(`Для слоя с id «${i.id}» находящегося в группе с groupId «${i.groupId}» отсутствует группа id в стиле c id «${t.id}»`);const o=n.layers.findIndex((e=>e.id===i.id));if(-1===o)return void(0,hs.cM)(`Слой с id «${i.id}» и groupId «${i.groupId}» отсутствует группе в стиле c id «${t.id}»`);e.groupId=n.innerId,n.layers.splice(o,0,e),n.layers.forEach(((e,t)=>e.groupIndex=t))}}else t.groupsById[e.innerId]=e,t.layerIdToInnerId[e.id]=e.innerId,s=e.layers;t.revision++,t.layers.splice(o,0,...s),s.forEach((e=>{if(t.layersById[e.innerId]=e,t.layerIdToInnerId[e.id]=e.innerId,"point"===e.type){const i=Math.max(0,...Object.keys(t.rasterSets.byIndex).map((e=>Number(e)))),n=new nr.x(i+1);(0,se.z8)(e,n).forEach((e=>{t.rasterSets.byKey[e.key]||(t.rasterSets.byIndex[e.index]=e,t.rasterSets.byKey[e.key]=e)}))}})),or(t)}(n,i,t),"custom"===e.type&&"custom"===n.type?this.initCustomLayer(i.id,n,e.render):this.initHandyLayer(i.id,n),this.modules.workers.parser.syncStyle(i),this.modules.workers.labeling.syncStyle(i))}addIcon(e,t){const i=this.getStyle(this.modules.map.state.handyStyleId);if(!i)return!1;const n=i.layers.filter((t=>"point"===t.type&&void 0!==t.style.iconImage&&(0,ae.EG)(t.style.iconImage).some((t=>t===e)))),o=Boolean(i.icons[e]);if(n.some((t=>{const n=(0,Ln.fF)(e,t.style.iconAnchor[0],t.style.iconAnchor[1]);return Boolean(i.rasterSets.byKey[n])}))||o)return console.error(`The icon with the name ${e} already exists.`),!1;const s=Math.max(0,...Object.keys(i.rasterSets.byIndex).map((e=>Number(e)))),r=new nr.x(s+1);return n.forEach((t=>{const n=(0,se.Wy)(e,t,r);i.rasterSets.byIndex[n.index]=n,i.rasterSets.byKey[n.key]=n})),i.icons[e]=t,i.revision++,this.modules.workers.parser.syncStyle(i),this.modules.workers.labeling.syncStyle(i),!0}removeIcon(e){const t=this.getStyle(this.modules.map.state.handyStyleId);if(!t)return!1;delete t.icons[e];let i=!1;return t.layers.filter((e=>"point"===e.type&&void 0!==e.style.iconImage)).forEach((n=>{(0,ae.EG)(n.style.iconImage).forEach((o=>{if(o===e){const e=(0,Ln.fF)(o,n.style.iconAnchor[0],n.style.iconAnchor[1]),s=t.rasterSets.byKey[e];s&&(this.modules.assetManager.removeRasterSet(s,t.id),i=!0)}}))})),!!i&&(t.revision++,this.modules.workers.parser.syncStyle(t),this.modules.workers.labeling.syncStyle(t),!0)}removeLayer(e){const t=this.getStyle(this.modules.map.state.handyStyleId);t&&(sr.T.some((t=>t.id===e))||(!function(e,t,i){const n=t.layerIdToInnerId[e];if(void 0===n)return;t.revision++;let o=[];const s=t.groupsById[n];if(s){if(o=s.layers,delete t.groupsById[n],delete t.layerIdToInnerId[s.id],0===o.length)return}else{const i=t.layersById[n];if(!i)return void(0,hs.cM)(`Слой с id «${e}» есть в списке идентификаторов слоев стиля, но при этом отсутствует в стиле c id «${t.id}»`);if(void 0!==i.groupId&&void 0!==i.groupIndex){const e=t.groupsById[i.groupId];e&&(e.layers.splice(i.groupIndex,1),e.layers.forEach(((e,t)=>e.groupIndex=t)))}o=[i]}const r=t.layers.findIndex((e=>e.id===o[0].id));-1!==r&&(o.forEach((e=>{const{styleManager:n,map:{state:o}}=i,s=n.getRemoveLayerHook(e.innerId);s&&(s(o),n.clearRemoveLayerHook(e.innerId)),delete t.layersById[e.innerId],delete t.layerIdToInnerId[e.id]})),t.layers.splice(r,o.length),or(t))}(e,t,this.modules),this.modules.workers.parser.syncStyle(t),this.modules.workers.labeling.syncStyle(t)))}setDynamicStyle(e){this.handyStylesMap.set(oe.jf,e),this.modules.workers.parser.syncStyle(e),this.modules.workers.labeling.syncStyle(e)}getStyle(e){return this.handyStylesMap.get(e)}getStyleLayer(e,t){var i;return null===(i=this.handyStylesMap.get(e))||void 0===i?void 0:i.layersById[t]}getStyleRevision(e){var t;return(null===(t=this.getStyle(e))||void 0===t?void 0:t.revision)||0}setFramebufferId(e,t,i){var n;const o=null===(n=this.handyStylesMap.get(e))||void 0===n?void 0:n.layersById[t];o&&(o.framebufferId=i)}getFramebufferId(e,t){var i,n;return null===(n=null===(i=this.handyStylesMap.get(e))||void 0===i?void 0:i.layersById[t])||void 0===n?void 0:n.framebufferId}waitForStyle(e){const t=this.handyStylesMap.get(e);if(t)return Promise.resolve(t);const i=this.waitingStyleRequests.get(e);if(i)return i.promise;const n={resolve:void 0,promise:void 0};return n.promise=new Promise((e=>{n.resolve=e})),this.waitingStyleRequests.set(e,n),n.promise}addRemoveLayerHook(e,t){this.onRemoveLayerHooks.set(e,t)}getRemoveLayerHook(e){return this.onRemoveLayerHooks.get(e)}clearRemoveLayerHook(e){this.onRemoveLayerHooks.delete(e)}callCustomLayerRender(e){const t=this.customLayers.get(e);t&&t.renderFunction(this.modules.renderer.getRenderingContext())}getCustomSceneObjects(){const e=[];return this.customLayers.forEach((t=>e.push(t.sceneObject))),e}initHandyLayer(e,t){let i;switch(t.type){case"group":return void t.layers.forEach((t=>this.initHandyLayer(e,t)));case"heatmap":i=rr(t,e,this.modules)}i&&this.modules.styleManager.addRemoveLayerHook(t.innerId,i)}initCustomLayer(e,t,i){const n={sceneObject:{type:ft.H.Custom,attributes:{styleId:e,layerId:t.innerId,tileData:[]}},layer:t,renderFunction:i};this.customLayers.set(t.innerId,n),this.modules.styleManager.addRemoveLayerHook(t.innerId,(()=>{this.customLayers.delete(t.innerId)}))}}var lr=i(4138);class cr{constructor(e,t){this.loadFont=(e,t)=>{let i=this.requestFontRanges.get(e,t);return i||(i=this.createLoadFontRequest(e,t),this.requestFontRanges.set(e,t,i)),i},this.state=e,this.modules=t,this.requestedMetatiles=new Set,this.metatiles={},this.loadedRasters={},this.failedRasters={},this.requestedRasters={},this.requestedSvgs={},this.disableIconCache=e.disableIconCache,this.textures=[],this.fontGlyphs={},this.fontTextures=new Vs.c,this.requestFontRanges=new Vs.c,this.pendingFontRanges=0,this.loadedFontRanges=0,this.metatileLoader=(t,i)=>{const n=(0,G.GG)(t),o=(0,H.Gr)("metatile",{host:e.tileServer,tileSet:e.tileSet,protocol:e.tileProtocol,subdomain:e.subdomains[0],hash:n});fetch(o).then((e=>{if(!e.ok)throw new Error(`Failed to load metatile "${n}"`);return e.json()})).then((e=>this.setMetatile(t,i,e))).catch((e=>console.error(e)))};const{fnRegistry:i}=this.modules.workers;i.set("addNewRasterSets",((e,t)=>{const i=this.modules.styleManager.getStyle(e);if(!i)return void console.error(`Not found style ${e} in AssetManager#addNewRasterSets`);const{rasterSets:n}=i;t.forEach((e=>{n.byIndex[e.index]=e,n.byKey[e.key]=e}))})),i.set("loadFont",this.loadFont),this.setPreparedMetatile(-1,G.nF),this.setPreparedMetatile(pt.L2,(0,lr.X4)()),this.metatiles[pt.DL]=new $s(i)}loadMetatile(e,t){this.requestedMetatiles.has(e)||(this.requestedMetatiles.add(e),this.metatileLoader(e,t))}setMetatile(e,t,i){(0,Ys.lG)(i),i.tileProps=i.tileProps.map(Ys.dx);const n=(0,G.ev)(i);this.setPreparedMetatile(e,n),void 0===this.projectMetatileMetadata&&(0,ne.FP)(t)&&(this.projectMetatileMetadata={regionId:t,metatileHash:e})}setPreparedMetatile(e,t){this.metatiles[e]=t,this.modules.workers.parser.setMetatile(e,t)}prepareRasters(e,t,i){var n,o;const s=this.modules.styleManager.getStyle(e);if(!s)return void console.error(`Not found style ${e} in AssetManager#prepareRasters`);const{rasterSets:r}=s,a=this.modules.renderer.getRenderingContext(),l=t.length/7;for(let e=0;e<l;e++){const l=t[7*e],c=t[7*e+1],d=t[7*e+6],h=t[7*e+2],u=t[7*e+3],m=t[7*e+4],f=t[7*e+5],p=r.byIndex[l];if(p.isSvg){const e={rasterIndex:c,rasterSetIndex:l,x:h,y:u,w:m,h:f,anchorX:p.anchorX,anchorY:p.anchorY,atlasIndex:d,isPacked:!0};p.rasters[c]=e,null===(o=null===(n=this.requestedSvgs[s.id])||void 0===n?void 0:n[l])||void 0===o||o.then((t=>{const i=this.textures[e.atlasIndex];Hs(t,e.w,e.h).then((t=>{i.subImage(a,t,e.x,e.y),this.state.needRerender=!0}))}))}else{const e=p.rasters[c];e.x=h,e.y=u,e.atlasIndex=d,e.isPacked=!0}void 0===this.textures[d]&&(this.textures[d]=new ht(void 0,{size:T.atlasSize,flipY:!1,premultiplyAlpha:!Ue||!p.isSvg,unit:d,magFilter:ht.LinearFilter,minFilter:ht.LinearFilter}).prepare(this.modules.renderer.getRenderingContext()));const _=this.textures[d],v=i&&i[e];void 0===v||(_.subImage(a,v,h,u),this.state.needRerender=!0)}this.modules.workers.labeling.updatePackingInfo(e,t)}loadRasters(e){const t=e.length/3;for(let i=0;i<t;i++){const t=e[3*i],n=e[3*i+1],o=e[3*i+2],s=n<<16|o,r=this.modules.styleManager.getStyle(t);if(!r){console.error(`Not found style ${t} in AssetManager#loadRasters`);continue}if(this.loadedRasters[t]||(this.loadedRasters[t]=new Set,this.failedRasters[t]=new Set,this.requestedRasters[t]=new Set),this.requestedRasters[t].has(s))continue;const{rasterSets:a}=r,l=a.byIndex[n];!1!==l.rasters[o].isPacked?(this.requestedRasters[t].add(s),l.isSvg?this.loadSvg(s,r,n):this.loadPng(s,r,n,o)):console.error(`Try to load not packed raster ${l.key}`)}}removeRasterSet(e,t){const{key:i,index:n,rasters:o}=e;delete this.requestedSvgs[t][n],o.forEach((({rasterSetIndex:e,rasterIndex:i})=>{var n,o,s;const r=e<<16|i;null===(n=this.loadedRasters[t])||void 0===n||n.delete(r),null===(o=this.failedRasters[t])||void 0===o||o.delete(r),null===(s=this.requestedRasters[t])||void 0===s||s.delete(r)})),e.rasters.length=0;const s=this.modules.styleManager.getStyle(t);s&&(delete s.rasterSets.byIndex[n],delete s.rasterSets.byKey[i])}getMetatile(e){return this.metatiles[e]}getProjectMetadata(){return this.projectMetatileMetadata}getFontGlyphs(e){return this.fontGlyphs[e]||{}}getFontTextureByName(e,t){return this.fontTextures.get(e,t)}isIdle(){let e=0,t=0;for(const i in this.requestedRasters)e+=this.requestedRasters[i].size,t+=this.loadedRasters[i].size+this.failedRasters[i].size;return e===t&&this.pendingFontRanges===this.loadedFontRanges}dangerouslySetMetatiles(e){this.metatiles=e}dangerouslySetRasters(e,t){this.loadedRasters=e,this.failedRasters=t}createLoadFontRequest(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.pendingFontRanges+=1;const i=Number.isNaN(this.state.handyStyleId)?1:this.state.handyStyleId;try{const n=yield this.modules.styleManager.waitForStyle(i),o=yield fetch(Ks(e,t,n)).then((e=>{if(!e.ok)throw new Error;return e})).catch((()=>(console.error(`Could not load font ${e} for range ${t} fallback to the default font ${pt.Uo}`),fetch(Ks(pt.Uo,t,n)).then((e=>{if(!e.ok)throw new Error(`Could not load default font ${pt.Uo} for range ${t}`);return e}))))).then((e=>e.arrayBuffer())),s=(0,qs.Xq)(o);return this.prepareFontAtlas(e,t,s),this.modules.workers.labeling.appendFont(e,s.glyphData),this.loadedFontRanges+=1,this.modules.workers.labeling.markFontAsLoaded(e,t)}catch(i){return console.error(i),this.loadedFontRanges+=1,this.modules.workers.labeling.markFontAsLoaded(e,t)}}))}prepareFontAtlas(e,t,i){const{bitmap:n,width:o,height:s,glyphData:r}=i;this.fontGlyphs[e]||(this.fontGlyphs[e]={});for(const t in r)this.fontGlyphs[e][t]=r[t];const a=new ht(new Uint8Array(n),{size:[o,s],magFilter:ht.LinearFilter,minFilter:ht.LinearFilter,format:ht.AlphaFormat,premultiplyAlpha:!1,flipY:!1,unit:0});this.fontTextures.set(e,t,a),this.state.needLabeling=!0}loadPng(e,t,i,n){const o=this.modules.renderer.getRenderingContext(),{rasterSets:s}=t,r=s.byIndex[i],a=r.rasters[n],l=this.textures[a.atlasIndex];let c="";if(r.type===Zs.f.Unique){const e=(0,Y.Ak)(r.id);c=r.url?r.url.replace("image",`image_${a.w.toString()}x${a.h.toString()}`):(0,H.Gr)("dynamicPoi",{host:this.state.tileServer,tileSet:this.state.tileSet,protocol:this.state.tileProtocol,subdomain:(0,H.Sy)(this.state.subdomains,e),id:e,width:a.w.toString(),height:a.h.toString(),regionId:String(r.regionId)})}else r.type===Zs.f.Static&&(c=Js(r.name,t,(0,H.Sy)(this.state.subdomains,r.name)));this.modules.workers.parser.prepareAtlas(c).then((i=>{i?(i.isBitmap?(l.subImage(o,i.data[0],a.x,a.y),this.state.needRerender=!0):Gs(i.data[0]).then((e=>{l.subImage(o,e,a.x,a.y),this.state.needRerender=!0})),this.loadedRasters[t.id].add(e)):this.failedRasters[t.id].add(e)}))}loadSvg(e,t,i){const n=this.modules.renderer.getRenderingContext(),o=t.rasterSets.byIndex[i];if(!t.iconBaseUrl||!t.legacyIconBaseUrl)return console.error("Attempt to load svg without existing style"),void this.failedRasters[t.id].add(e);const s=t.icons[o.name];let r="";r=(null==s?void 0:s.url)?function(e,t,i){const n=tr(e)?"":t.iconBaseUrl;return(0,H.IG)(ir(n,e),{subdomain:i,appHost:window.location.host})}(s.url,t,(0,H.Sy)(this.state.subdomains,o.name)):Js(o.name,t,(0,H.Sy)(this.state.subdomains,o.name)),this.requestedSvgs[t.id]||(this.requestedSvgs[t.id]={});let a=this.requestedSvgs[t.id][i];a&&!this.disableIconCache||(a=this.requestedSvgs[t.id][i]=fetch(r,{cache:this.disableIconCache?"no-cache":"default"}).then((e=>{if(!e.ok)throw new Error("Not 2xx response");return e.text()}))),a.then((i=>{for(const e of o.rasters){if(e.w<=0&&e.h<=0)continue;const t=this.textures[e.atlasIndex];Hs(i,e.w,e.h).then((i=>{t.subImage(n,i,e.x,e.y),this.state.needRerender=!0}))}this.loadedRasters[t.id].add(e)})).catch((i=>{console.error(i),this.failedRasters[t.id].add(e)}))}}var dr=i(2182);class hr{constructor(e,t,i,n,o,s,r,a){this.modules=e,this.mapState=t,this.cache=i,this.maxStyleZoom=-1/0,this.minStyleZoom=1/0,this.ready=!1,this.useful=!1,this.status="initial",this.model=n,this.key=o,this.selectedIds=s,this.styleId=r,this.styleRevision=a,this.modelRevision=n.revision}update(){switch(this.status){case"initial":this.useful&&(this.loadModel(),this.status="generating");break;case"generating":if(this.useful&&this.processResponse&&this.model.texturesLoaded){const{objects:{data:e}}=this.processResponse;this.object=new $.W("model",e,this.modules.renderer),this.updateMinAndMaxStyleZoom(this.object),this.status="generated",this.ready=!0,this.cache.add(this.key,this)}}}getIdentifyIds(){var e;return null===(e=this.processResponse)||void 0===e?void 0:e.objects.identifyIds}remove(){"generated"===this.status&&this.cache.remove(this.key),this.status="initial",this.object&&this.object.clean(this.mapState),this.ready=!1}canBeRemoved(){return"initial"===this.status}loadModel(){const{model:{regionId:e,metatileHash:t,id:i,sourceModel:{fileName:n,matrix:o,offset:s}}}=this,r=(0,Y.IL)(i),a={url:(0,H.Gr)("model",{host:this.mapState.tileServer,tileSet:this.mapState.tileSet,protocol:this.mapState.tileProtocol,subdomain:(0,H.Sy)(this.mapState.subdomains,n),regionId:e.toString(),name:n}),id:r,regionId:e,metatileHash:t,selected:this.selectedIds.some((e=>(0,Y.v7)(e,r))),pixelRatio:window.devicePixelRatio,styleState:this.mapState.styleState,styleId:this.mapState.handyStyleId,offset:s,matrix:o};this.modules.workers.parser.generateModel(a).then((e=>{this.model.prepareTextures(e.textures),this.processResponse=e}))}updateMinAndMaxStyleZoom(e){this.minStyleZoom=Math.min(...e.children.map((e=>{var t;const i=this.modules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);return null!==(t=null==i?void 0:i.minzoom)&&void 0!==t?t:-1/0}))),this.maxStyleZoom=Math.max(...e.children.map((e=>{var t;const i=this.modules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);return null!==(t=null==i?void 0:i.maxzoom)&&void 0!==t?t:1/0})))}}class ur{constructor(e,t,i,n,o,s){this.modules=e,this.mapState=t,this.cache=i,this.regionId=n,this.metatileHash=o,this.sourceModel=s,this.revision=0,this.texturesLoaded=!1,this.textures=[],this.readiness=0,this.id=s.id,this.readinessTickerName=`model-readiness-${this.id}`}update(){var e,t;(null===(e=this.currentMod)||void 0===e?void 0:e.useful)&&this.currentMod.update(),(null===(t=this.newMod)||void 0===t?void 0:t.useful)&&this.newMod.update(),ce.Vx(this.readinessTickerName,{step:(e,t)=>this.readiness=t},this.mapState)}isAnimating(){return ce.rS(this.readinessTickerName,this.mapState)}commitMod(){this.newMod&&this.newMod.ready&&(this.currentMod=this.newMod,this.newMod=void 0)}setUsefulMod(){const e=this.mapState.handyStyleId,t=this.modules.styleManager.getStyleRevision(e),i=(0,Y.IL)(this.id),n=this.mapState.selectedIds.filter((e=>(0,Y.v7)(e,i)));if(this.currentMod||this.newMod){if(this.currentMod){if((0,Y.y5)(this.currentMod.selectedIds,n)&&this.currentMod.styleId===e&&this.currentMod.styleRevision===t&&this.currentMod.modelRevision===this.revision)return this.currentMod.useful=!0,void(this.newMod=void 0)}if(this.newMod){(0,Y.y5)(this.newMod.selectedIds,n)&&this.newMod.styleId===e&&this.newMod.styleRevision===t&&this.newMod.modelRevision===this.revision?this.newMod.useful=!0:this.createNewMod(n,e,t,this.revision)}else this.createNewMod(n,e,t,this.revision)}else this.createNewMod(n,e,t,this.revision)}getUsefulMod(){return this.currentMod&&this.currentMod.useful?this.currentMod:this.newMod&&this.newMod.useful?this.newMod:void 0}getCurrentMod(){return this.currentMod}setAllModsNeedless(){this.currentMod&&(this.currentMod.useful=!1),this.newMod&&(this.newMod.useful=!1)}getOpacity(e){return this.readiness*this.modules.buildingHeightAnimator.getBuildingHeight(e)}getTexture(e){return this.textures[e]}prepareTextures(e){this.texturesLoaded||(e.isBitmap?(this.textures=e.data.map((e=>new ht(e,{flipY:!1}))),this.texturesLoaded=!0,this.startReadinessTicker()):Promise.all(e.data.map(Gs)).then((e=>{this.textures=e.map((e=>new ht(e,{flipY:!1}))),this.texturesLoaded=!0,this.startReadinessTicker()})))}clean(){this.canBeCleaned()&&(this.texturesLoaded&&(this.textures.forEach((e=>e.remove())),this.textures=[],this.texturesLoaded=!1),this.stopReadinessTicker())}canBeCleaned(){return(!this.currentMod||this.currentMod.canBeRemoved())&&(!this.newMod||this.newMod.canBeRemoved())}createNewMod(e,t,i,n){const o=function(e,t,i,n,o){const s=t.map((e=>`${e.lo},${e.hi}`)).join("|");return`model=${e}_sId=${i}_sRev=${n}_mRev=${o}_sel=${s}`}(this.id,e,t,i,n),s=this.cache.get(o);s?(this.newMod=s,this.newMod.useful=!0):this.newMod=new hr(this.modules,this.mapState,this.cache,this,o,e,t,i)}startReadinessTicker(){this.readiness=0,ce.BL(this.readinessTickerName,{easing:T.buildingAnimation.easing},this.mapState,0,1,T.buildingAnimation.duration)}stopReadinessTicker(){this.readiness=0,ce.sT(this.readinessTickerName,this.mapState)}}class mr{constructor(e,t){this.mapState=e,this.modules=t,this.buildingsHeight=new Map,this.models=new Map,this.displayedMods=new Map,this.viewportModels=[],this.requestedModelsInfo=new Set,this.loadedModelsInfo=new Set,this.isStyleUpdateInProgress=!1,this.cache=new dr.L(T.modelCacheSize,((e,t)=>t.remove()))}onFeatureStateMapChange(){this.models.forEach((e=>{e.revision++}))}update(){this.findViewportModels(),this.mapState.styleZoom>T.loadModelsInfoStyleZoom&&this.modules.tileManager.getViewportTiles().forEach((e=>{"terrain"===e.type&&e.serverMetadata&&e.serverMetadata.forEach((e=>{this.loadModelsInfo(e.regionId,e.metatileHash)}))})),this.models.forEach((e=>e.setAllModsNeedless())),this.viewportModels.forEach((e=>e.setUsefulMod())),this.models.forEach((e=>e.update())),this.isStyleUpdateInProgress||this.models.forEach((e=>e.commitMod())),this.updateScene(),this.cleanUnnessasaryModels()}activateStyleUpdating(){this.isStyleUpdateInProgress=!0}finishStyleUpdating(){this.isStyleUpdateInProgress=!1}redraw(){this.cache.reset(),this.cleanUnnessasaryModels()}isModelsInfoLoaded(e){return this.loadedModelsInfo.has(e)}getTexture(e,t){var i;return null===(i=this.models.get(e))||void 0===i?void 0:i.getTexture(t)}getDisplayedIdentifyData(){const e=[];return this.viewportModels.forEach((t=>{const i=t.getUsefulMod();if(!i)return;const n=i.getIdentifyIds();n&&e.push({metatileHash:t.metatileHash,ids:n})})),e}getOpacity(e,t){var i;return(null===(i=this.models.get(e))||void 0===i?void 0:i.getOpacity(t))||0}hasModel(e){return this.models.has(e)}setBuildingHeight(e,t){this.buildingsHeight.set(e,t)}getBuildingHeight(e){return this.buildingsHeight.get(e)||0}getVisibleModelData(e){const t=this.models.get(e);if(!t)return;const i=t.getCurrentMod();if(!i||!i.ready)return;const n=Math.max(t.sourceModel.minZoom,i.minStyleZoom),o=Math.min(t.sourceModel.maxZoom,i.maxStyleZoom),{styleZoom:s}=this.mapState;return s<n||s>=o?void 0:{minStyleZoom:n,maxStyleZoom:o,opacity:this.getOpacity(e,n)}}isIdle(){return this.viewportModelsReady()&&!this.viewportModels.some((e=>e.isAnimating()))}viewportModelsReady(){return this.viewportModels.every((e=>{const t=e.getUsefulMod();return t&&t.ready}))}findViewportModels(){const{styleZoom:e}=this.mapState;this.viewportModels=[],this.models.forEach((t=>{const{bound:i,minZoom:n,maxZoom:o}=t.sourceModel;if(e<n||e>=o)return;if(this.modules.floorManager.hasDisplayedFloorBuilding(t.id))return;if(!!!this.modules.assetManager.getMetatile(t.metatileHash))return;(0,Gi.M4)(this.mapState.tilesBounds,i)&&this.viewportModels.push(t)}))}updateScene(){let e=!1;const t=new Map;this.viewportModels.forEach((e=>{const i=e.getCurrentMod();i&&i.ready&&t.set(i.key,i)})),this.displayedMods.forEach(((i,n)=>{t.has(n)||(i.object&&this.modules.tileManager.removeObject(i.object),e=!0)})),t.forEach(((t,i)=>{this.displayedMods.has(i)||(t.object&&this.modules.tileManager.addObject(t.object),e=!0),this.cache.get(i)})),e&&(this.displayedMods=t,this.mapState.needRerender=!0,this.modules.identifier.resetCache())}cleanUnnessasaryModels(){const e=new Set(this.cache.getData().map((e=>e.model)));this.models.forEach((t=>{e.has(t)||t.clean()}))}loadModelsInfo(e,t){if(this.requestedModelsInfo.has(e))return;this.requestedModelsInfo.add(e);const i=(0,H.Gr)("modelInfo",{host:this.mapState.tileServer,tileSet:this.mapState.tileSet,protocol:this.mapState.tileProtocol,subdomain:this.mapState.subdomains[0],regionId:e.toString()});fetch(i).then((t=>{if(!t.ok)throw new Error(`Failed to load models info for region ${e}`);return t.json()})).then((i=>{this.modules.workers.parser.appendHiddenObjectIds(i.map((e=>(0,Y.IL)(e.id)))),i.forEach((i=>{const n=new ur(this.modules,this.mapState,this.cache,e,t,i);this.models.set(n.id,n)})),this.loadedModelsInfo.add(e)})).catch((t=>{this.loadedModelsInfo.add(e),console.error(t)}))}}var fr=i(6723),pr=i(8016);class _r{constructor(e,t){this.mapState=e,this.modules=t,this.isIdle=()=>!this.isGenerating,this.modCache=new Map,this.isGenerating=!1,this.currentPois=[],this.currentIdSet=new fr.c,this.currentTrafficState=!1,this.currentSelectedIds=[],this.currentModKey="ppoi_false_"}setPersonalPoi(e){this.currentPois=e;const t=new fr.c;for(const i of e)t.add((0,Y.IL)(i.id));this.currentIdSet=t,this.modCache.clear(),this.displayedModKey=void 0}redraw(){this.modCache.clear(),this.displayedModKey=void 0}getIdentifyDataChunk(){return this.identifyDataChunk}update(){if(void 0===this.regionMetadata&&(this.regionMetadata=this.modules.assetManager.getProjectMetadata()),void 0===this.regionMetadata)return;this.updateModKey();const e=this.currentModKey,t=this.modCache.get(e);void 0!==t||this.isGenerating||this.generate(e,this.currentPois,this.regionMetadata),void 0!==t&&e!==this.displayedModKey&&this.show(e,t,this.regionMetadata)}generate(e,t,i){const{regionId:n,metatileHash:o}=i,s=this.modules.map.state;this.isGenerating=!0,this.modules.workers.parser.generatePersonalPoi(t,n,o,window.devicePixelRatio,s.selectedIds,s.handyStyleId,s.styleState,this.modules.defaultSource.getId()).then((t=>{if(void 0===t)return void(this.isGenerating=!1);const{collectorOutput:i,styleId:n}=t,{packedRasters:o,rastersToLoad:s}=i;void 0!==o&&this.modules.assetManager.prepareRasters(n,o),this.modules.assetManager.loadRasters(s),this.modCache.set(e,t),this.isGenerating=!1}))}show(e,t,i){const{metatileHash:n}=i,{collectorOutput:{labels:o,identifyIds:s},styleId:r}=t;this.modules.labeler.removeLabels("ppoi"),o.length&&this.modules.labeler.addLabels("ppoi",pr.AL.PersonalPoi,[{metatileHash:n,labels:o,styleId:r}]),this.identifyDataChunk={metatileHash:n,ids:s},this.modules.identifier.resetCache(),this.displayedModKey=e}updateModKey(){const e=(0,ne.vX)(this.mapState.selectedIds,this.currentIdSet),t=this.modules.trafficTileLayer.isEnabled();(0,Y.y5)(this.currentSelectedIds,e)&&this.currentTrafficState===t||(this.currentTrafficState=t,this.currentSelectedIds=e,this.currentModKey=`ppoi_${t}_${e}`)}}const vr=function(){var e=ENTRY_MODULE,t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.m=e,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=i(ENTRY_MODULE);return n.default||n};vr.toString();var gr="[\\.|\\-|\\+|\\w|/|@]+",yr="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function br(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function wr(e,t,n){var o={};o[n]=[];var s=t.toString(),r=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||s.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!r)return o;for(var a,l=r[1],c=new RegExp("(\\\\n|\\W)"+br(l)+yr,"g");a=c.exec(s);)"dll-reference"!==a[3]&&o[n].push(a[3]);for(c=new RegExp("\\("+br(l)+'\\("(dll-reference\\s('+gr+'))"\\)\\)'+yr,"g");a=c.exec(s);)e[a[2]]||(o[n].push(a[1]),e[a[2]]=i(a[1]).m),o[a[2]]=o[a[2]]||[],o[a[2]].push(a[4]);for(var d,h=Object.keys(o),u=0;u<h.length;u++)for(var m=0;m<o[h[u]].length;m++)d=o[h[u]][m],isNaN(1*d)||(o[h[u]][m]=1*o[h[u]][m]);return o}function xr(e){return Object.keys(e).reduce(((t,i)=>t||e[i].length>0),!1)}function Ir(e,t,i,n){let o=e[n].map((e=>`"${e}": ${t[n][e].toString()}`)).join(","),s=vr.toString().split("ENTRY_MODULE");return`${s[0]}{${o}}${s[1]}"${i}"${s[2]}`}function Sr(e,t){t=t||{};var n={main:i.m},o=t.all?{main:Object.keys(n.main)}:function(e,t){for(var i={main:[t]},n={main:[]},o={main:{}};xr(i);)for(var s=Object.keys(i),r=0;r<s.length;r++){var a=s[r],l=i[a].pop();if(o[a]=o[a]||{},!o[a][l]&&e[a][l]){o[a][l]=!0,n[a]=n[a]||[],n[a].push(l);for(var c=wr(e,e[a][l],a),d=Object.keys(c),h=0;h<d.length;h++)i[d[h]]=i[d[h]]||[],i[d[h]]=i[d[h]].concat(c[d[h]])}}return n}(n,e),s="";Object.keys(o).filter((e=>"main"!==e)).forEach((e=>{for(var t=0;o[e][t];)t++;o[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s+=`var ${e} = (${Ir(o,n,t,modules)})();\n`})),s+=`(${Ir(o,n,e,"main")})();`;var r=new window.Blob([s],{type:"text/javascript"});if(t.bare)return r;var a=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(r),l=new window.Worker(a);return l.objectURL=a,l}var Mr=i(5147),Tr=i(9472),Pr=i(8047),Lr=i(9638),Er=i(8675);class kr{constructor(){this.connector=new Mr.H,this.fnRegistry=new Tr.J(this.connector),this.classRegistry=new Lr.Z(this.fnRegistry),this.parserWorker=Sr(3893),this.connector.addWorker(Pr.P.Parser,this.parserWorker),this.labelingWorker=Sr(2109),this.connector.addWorker(Pr.P.Labeling,this.labelingWorker),this.parser=function(e,t){return{setMetatile:e.get(Pr.P.Parser,"setMetatile"),fetchTile:e.get(Pr.P.Parser,"fetchTile"),deleteTile:e.get(Pr.P.Parser,"deleteTile"),abortTileRequest:e.get(Pr.P.Parser,"abortTileRequest"),generateTile:e.get(Pr.P.Parser,"generateTile"),generateFloor:e.get(Pr.P.Parser,"generateFloor"),loadFloor:e.get(Pr.P.Parser,"loadFloor"),generateModel:e.get(Pr.P.Parser,"generateModel"),appendHiddenObjectIds:e.get(Pr.P.Parser,"appendHiddenObjectIds"),prepareAtlas:e.get(Pr.P.Parser,"prepareAtlas"),packRasters:e.get(Pr.P.Parser,"packRasters"),setFeatureStateMapToZenith:e.get(Pr.P.Parser,"setFeatureStateMapToZenith"),fetchTrafficTile:e.get(Pr.P.Parser,"fetchTrafficTile"),deleteTrafficTile:e.get(Pr.P.Parser,"deleteTrafficTile"),abortTrafficTileRequest:e.get(Pr.P.Parser,"abortTrafficTileRequest"),generateTrafficTile:e.get(Pr.P.Parser,"generateTrafficTile"),generatePersonalPoi:e.get(Pr.P.Parser,"generatePersonalPoi"),syncStyle:e.get(Pr.P.Parser,"syncStyle"),GeoJsonSource:t.set("GeoJsonSource",Er.T).get(Pr.P.Parser)}}(this.fnRegistry,this.classRegistry),this.labeling=function(e){return{appendFont:e.get(Pr.P.Labeling,"appendFont"),markFontAsLoaded:e.get(Pr.P.Labeling,"markFontAsLoaded"),addNewRasterSets:e.get(Pr.P.Labeling,"addNewRasterSets"),updatePackingInfo:e.get(Pr.P.Labeling,"updatePackingInfo"),syncStyle:e.get(Pr.P.Labeling,"syncStyle"),loadRtlPlugin:e.get(Pr.P.Labeling,"loadRtlPlugin"),markRtlPluginLoaded:e.get(Pr.P.Labeling,"markRtlPluginLoaded")}}(this.fnRegistry)}destroy(){this.parserWorker.terminate(),this.labelingWorker.terminate()}}class zr extends W.c{constructor(e,t){super(),this.options=(0,P.kn)(t,zr.options),this.uniqId=(0,V.f)(),this.labelKey=`html-${this.uniqId}`,this.mapPoint=(0,L.yq)(this.options.coordinates),this.screenPoint=[0,0],this.html=function(e){const t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex=String(e.zIndex),e.interactive||(t.style.pointerEvents="none");e.animate&&(t.style.opacity="0",t.style.transition=`opacity ${e.duration}ms`,t.style.willChange="opacity");const i=document.createElement("div");"string"==typeof e.html?i.innerHTML=e.html:i.append(e.html);return t.append(i),t}(this.options),this.isHidden=!0,this.targetOpacity=0,this.modules=e.modules,this.modules.layers.addLayer(this),this.mapState=e.state,this.rounder=!this.options.disableRounding?Ar:Cr;const{offset:i,labeling:n}=this.options;"none"!==n.type&&this.modules.labeler.addLabelBox(this.labelKey,{id:this.uniqId,width:n.width,height:n.height,position:this.mapPoint,offset:i,labelingGroup:this.getLabelingGroup(),parentPoiId:"pinnedToPoi"===n.type?n.poiId:void 0})}destroy(){this.removeHtml(),this.modules.labeler.removeLabels(this.labelKey),this.modules.layers.removeLayer(this)}update(){const e=this.checkZoom(),t=!this.isInvolvedInLabeling()||this.modules.labeler.isLabelBoxSurvived(this.uniqId);e&&t?this.show():this.hide(),this.updatePosition()}setContent(e){this.options.html=e,this.html.innerHTML="";const t=document.createElement("div");"string"==typeof e?t.innerHTML=e:t.append(e),this.html.append(t)}setLabelingSize(e,t){"none"!==this.options.labeling.type&&(this.options.labeling.width=e,this.options.labeling.height=t,this.updateLabelBox())}setPosition(e){this.mapPoint=(0,L.yq)(e),this.updateLabelBox()}setOffset(e){this.options.offset=[e[0],e[1]],this.updateLabelBox()}setMinZoom(e){this.options.minZoom=e}setMaxZoom(e){this.options.maxZoom=e}getZIndex(){return this.options.zIndex}getOffset(){return this.options.offset}getPosition(){return(0,L.PA)(this.mapPoint)}getHtmlElement(){return this.html.firstChild}dangerouslyGetRootElement(){return this.html}isShown(){return!this.isHidden}show(){if(this.isHidden&&(this.isHidden=!1,this.appendHtml(),this.emit("shown",{id:this.uniqId.toString(),point:[this.screenPoint[0],this.screenPoint[1]],object:this}),this.options.animate)){if(this.showAnimationTimer)return;this.hideAnimationTimer&&(clearTimeout(this.hideAnimationTimer),this.hideAnimationTimer=void 0),1!==this.targetOpacity&&(this.showAnimationTimer=window.setTimeout((()=>{this.setHtmlOpacity(1),this.showAnimationTimer=void 0}),0))}}hide(){if(!this.isHidden)if(this.isHidden=!0,this.options.animate){if(this.hideAnimationTimer)return;this.showAnimationTimer&&(clearTimeout(this.showAnimationTimer),this.showAnimationTimer=void 0),this.setHtmlOpacity(0),this.hideAnimationTimer=window.setTimeout((()=>{this.removeHtml(),this.hideAnimationTimer=void 0}),this.options.duration)}else this.removeHtml()}setHtmlOpacity(e){this.html.style.opacity=String(e),this.targetOpacity=e}removeHtml(){this.html.remove(),this.screenPoint=[0,0]}appendHtml(){this.getMarkerContainer().appendChild(this.html)}getMarkerContainer(){return this.options.preventMapInteractions?this.modules.layout.htmlContainerOutMap:this.modules.layout.htmlContainerInMap}updatePosition(){const e=this.modules.camera.project(this.mapPoint);this.rounder(e,e[0]+this.options.offset[0],e[1]+this.options.offset[1],this.mapState.stillness),X.fS(this.screenPoint,e)||(this.html.style.transform=`translate3d(${e[0]}px, ${e[1]}px, 0px)`,this.screenPoint=e)}updateLabelBox(){if("none"===this.options.labeling.type)return;const{labeling:{width:e,height:t},offset:i}=this.options;this.modules.labeler.removeLabels(this.labelKey),this.modules.labeler.addLabelBox(this.labelKey,{id:this.uniqId,width:e,height:t,position:this.mapPoint,offset:i,labelingGroup:this.getLabelingGroup(),parentPoiId:"pinnedToPoi"===this.options.labeling.type?this.options.labeling.poiId:void 0})}getLabelingGroup(){return this.isInvolvedInLabeling()?"markerText":"htmlLabel"}checkZoom(){const{zoom:e}=this.mapState,{minZoom:t,maxZoom:i}=this.options;return e>=t&&e<i}isInvolvedInLabeling(){return"full"===this.options.labeling.type||"pinnedToPoi"===this.options.labeling.type}}zr.options={coordinates:[0,0],html:"",offset:[0,0],animate:!0,duration:500,labeling:{type:"none"},interactive:!0,preventMapInteractions:!1,zIndex:0,minZoom:-1/0,maxZoom:1/0,disableRounding:!1};const Ar=(e,t,i,n)=>{const o=Math.round(t)-t,s=Math.round(i)-i;e[0]=t+n*o,e[1]=i+n*s},Cr=(e,t,i)=>{e[0]=t,e[1]=i};var Fr=i(2815);const Rr=k.Ue();class Dr extends q{constructor(e,t){var i,n,o,s,r,a,l;super(e),this.options=t,this.vectors=this.options.coordinates.map((e=>e.map(L.yq))),this.bouncePosition=0,this.growPosition=1;const{renderer:c,tileManager:d,dynamicStyle:h,collector:u,layers:m}=this.modules,f=(0,se.qw)({type:"arrow",id:`dynamic-entrance-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(i=this.options.color)&&void 0!==i?i:"#0085a0",strokeColor:null!==(n=this.options.borderColor)&&void 0!==n?n:"#ffffff",lineWidth:null!==(o=this.options.width)&&void 0!==o?o:3,strokeWidth:null!==(s=this.options.borderWidth)&&void 0!==s?s:1,tipWidth:null!==(r=this.options.wingWidthMultiplier)&&void 0!==r?r:2,tipHeight:null!==(a=this.options.tipHeightMultiplier)&&void 0!==a?a:4,animation:null===(l=this.options.animate)||void 0===l||l?{type:"appearance",tipMovementAmplitude:this.options.tipMovementAmplitude||20}:void 0}});if(!f)return;h.addLayer(f,this.options.zIndex),this.layerId=f.innerId;const p=this.getTileInfo();for(let e=0;e<this.vectors.length;e++){const t=this.vectors[e],i=this.getVertices(t,p),n=(0,oe.FJ)({id:[e,0]});(0,ie.XI)({collector:u,generator:Fr.l.generate,args:[h.getStyle().id,f,G.Dz,n,G.wz,G.i4,i]})}const _=u.getAccumulatedData(),v=new $.W("dynamicObject",_.data,c,p.coords,this);if(this.tileObjects.push(v),d.addObject(v),this.identifyIds.push(_.identifyIds),this.options.animate){const e=`entrance-bounce-${this.uniqId}`,t=`entrance-grow-${this.uniqId}`;this.bounceTickerUpdate=ce.Vx.bind(null,e,{step:(e,t)=>this.bouncePosition=t,complete:()=>{this.bounceTickerUpdate=void 0}},this.mapState),this.growTickerUpdate=ce.Vx.bind(null,t,{step:(e,t)=>this.growPosition=t,complete:()=>{this.growTickerUpdate=void 0}},this.mapState),ce.BL(e,{easing:T.entranceAnimation.bounceType},this.mapState,-1,0,T.entranceAnimation.bounceTime),ce.BL(t,{easing:T.entranceAnimation.growType},this.mapState,0,1,T.entranceAnimation.growTime)}else this.bouncePosition=0,this.growPosition=1;m.addLayer(this),u.reset(),this.mapState.needRerender=!0}update(){this.bounceTickerUpdate&&this.bounceTickerUpdate(),this.growTickerUpdate&&this.growTickerUpdate()}entranceAnimationInProgress(){return void 0!==this.bounceTickerUpdate||void 0!==this.growTickerUpdate}remove(){void 0!==this.layerId&&this.modules.dynamicStyle.removeLayer(this.layerId),super.destroy()}getTileInfo(){const e=z.Ue();for(let t=0;t<this.vectors.length;t++){const i=this.vectors[t];for(let t=0;t<i.length;t++)z.aM(e,i[t])}return(0,ne.Bs)((0,ne.x7)(e))}getVertices(e,t){const i=[[],[],[]];for(let n=0;n<e.length;n++)(0,ne.a2)(Rr,e[n],t),i[0][n]=Rr[0],i[1][n]=Rr[1];return i}}class Or{constructor(e){this.state=e,this.layers=[]}addLayer(e){this.layers.push(e),this.state.needRerender=!0}removeLayer(e){const t=this.layers.indexOf(e);-1!==t&&(this.layers.splice(t,1),this.state.needRerender=!0)}getLayers(){return this.layers}getDynamicObjectLayers(){return this.layers.filter((e=>e instanceof q))}getHtmlMarkers(){return this.layers.filter((e=>e instanceof zr))}entranceAnimationFinished(){return this.layers.every((e=>!(e instanceof Dr)||!e.entranceAnimationInProgress()))}}var Br=i(5828);const jr=()=>"",Nr=[.5,.5];class Ur{constructor(e){this.loadingCounter=0,this.isIdle=()=>0===this.loadingCounter,this.modules=e,this.cache={}}getRasterSet(e,t,i,n){return(0,M.mG)(this,void 0,void 0,(function*(){const o=this.getKey(e,i,n),s=this.getFromCache(o,t);if(s)return s;const r=yield this.loadIcon(e,t,i,n);return r&&this.storeInCache(r,o,t),r}))}decreaseLoadingCounter(){this.loadingCounter=Math.max(this.loadingCounter-1,0)}loadIcon(e,t,i,n){return(0,M.mG)(this,void 0,void 0,(function*(){const{dynamicStyle:o,workers:s,assetManager:r}=this.modules;let a=e;this.loadingCounter++,t&&(a=yield this.loadImageForTransformer(e).then((e=>t(e))).catch((()=>e)));const l=yield this.loadImage(a);return l?Promise.resolve().then((()=>{i=void 0!==i?i:[l.width,l.height];const e=void 0!==n?[n[0]/i[0],n[1]/i[1]]:Nr,t=[i[0]*window.devicePixelRatio,i[1]*window.devicePixelRatio],r=(0,Br.W8)([{w:t[0],h:t[1],x:0,y:0,atlasIndex:0,isPacked:!1,anchorX:e[0],anchorY:e[1]}]);o.appendRasterSet(r),s.labeling.addNewRasterSets(o.getStyle().id,[r]);const a=new Uint16Array(3);return a[0]=t[0],a[1]=t[1],a[2]=r.index,s.parser.packRasters(a).then((e=>({packedRasters:e.packedRasters,rasterSet:r,scaledSize:t})))})).then((e=>{const{packedRasters:t,rasterSet:i,scaledSize:n}=e;return void 0!==t&&r.prepareRasters(o.getStyle().id,t,[Ws(l,n)]),this.decreaseLoadingCounter(),i})):(this.decreaseLoadingCounter(),Promise.resolve(void 0))}))}getFromCache(e,t){const i=this.cache[e];if(i)return i.get(t||jr)}storeInCache(e,t,i){this.cache[t]||(this.cache[t]=new Map),this.cache[t].set(i||jr,e)}getKey(e,t,i){return`${e}_${void 0!==t?`${t[0]},${t[1]}`:""}_${void 0!==i?`${i[0]},${i[1]}`:""}`}loadImage(e){return new Promise((t=>{const i=new Image;i.crossOrigin="Anonymous",i.src=e,i.onload=()=>t(i),i.onerror=()=>t(void 0)}))}loadImageForTransformer(e){return-1===e.indexOf(".svg")?new Promise((t=>{const i=new Image;i.crossOrigin="Anonymous",i.src=e,i.onload=()=>{t({type:"raster",source:i})},i.onerror=()=>{t({type:"unknown"})}})):new Promise((t=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.onload=function(){200===i.status&&0!==i.response.byteLength?t({type:"vector",source:i.response}):t({type:"unknown"})},i.onerror=function(){t({type:"unknown"})},i.send()}))}}class Zr{constructor(e,t,i,n,o,s,r,a,l,c,d,h){this.key=i,this.id=n,this.object=void 0,this.ready=!1,this.modules=e,this.mapState=t,this.status="initial",this.regionId=o,this.metatileHash=pt.DL,this.styleId=s,this.styleRevision=r,this.floorIndex=a,this.cache=l,this.onGenerated=h,this.useful=!0,this.selectedIds=c.slice(0),this.needFilterIds=d}update(){switch(this.status){case"initial":this.useful&&(this.modules.workers.parser.generateFloor(this.id,this.regionId,window.devicePixelRatio,this.floorIndex,this.selectedIds,this.styleId,this.mapState.styleState,this.modules.defaultSource.getId(),this.mapState.mobileSdkMode).then((e=>{const{collectorOutput:{packedRasters:t},styleId:i}=e;t&&this.modules.assetManager.prepareRasters(i,t),this.processResponse=e})),this.status="generating");break;case"generating":if(this.useful&&this.processResponse){const{collectorOutput:{data:e},tileCoords:t}=this.processResponse;this.object=new $.W("floor",e,this.modules.renderer,t),this.status="generated",this.ready=!0,this.cache.add(this.key,this),this.onGenerated(this)}}}getLabels(){return this.processResponse&&this.processResponse.collectorOutput.labels.length?[{metatileHash:this.metatileHash,labels:this.processResponse.collectorOutput.labels,styleId:this.processResponse.styleId}]:[]}getGeoIds(){if(this.processResponse)return this.processResponse.collectorOutput.geoIds}canBeRemoved(){return"initial"===this.status}remove(){"generated"===this.status&&this.cache.remove(this.key),this.status="initial",this.object&&this.object.clean(this.mapState),this.ready=!1}getIdentifyIds(){if(this.processResponse){const e={};return e[this.metatileHash]=this.processResponse.collectorOutput.identifyIds,e}}isDataEmpty(){return!this.processResponse||0===this.processResponse.collectorOutput.data.length}}class Hr{constructor(e,t,i,n,o,s){this.onModGenerated=e=>{let t=this.idSetByFloorIndex.get(e.floorIndex);if(!t){t=new fr.c;const i=e.getGeoIds();i&&t.addFromFlatArray(i),this.idSetByFloorIndex.set(e.floorIndex,t)}e.needFilterIds&&(e.needFilterIds=!1,e.selectedIds=(0,ne.vX)(e.selectedIds,t))},this.modules=e,this.mapState=t,this.id=i,this.regionId=n,this.idSetByFloorIndex=new Map,this.cache=o,this.floorIndex=s,this.createNewMod(s,this.mapState.selectedIds,this.mapState.handyStyleId,this.modules.styleManager.getStyleRevision(this.mapState.handyStyleId))}update(){this.currentMod&&this.currentMod.useful&&this.currentMod.update(),this.newMod&&this.newMod.useful&&this.newMod.update()}setFloorIndex(e){this.floorIndex=e}getCurrentMod(){return this.currentMod}commitMod(){this.newMod&&this.newMod.ready&&(this.currentMod=this.newMod,this.newMod=void 0)}setUsefulMod(){const e=this.mapState.handyStyleId,t=this.modules.styleManager.getStyleRevision(e),i=this.floorIndex;let n=this.mapState.selectedIds;const o=this.idSetByFloorIndex.get(i);if(o&&(n=(0,ne.vX)(n,o)),this.currentMod||this.newMod){if(this.currentMod){if((0,Y.y5)(this.currentMod.selectedIds,n)&&this.currentMod.styleId===e&&this.currentMod.styleRevision===t&&this.currentMod.floorIndex===i)return this.currentMod.useful=!0,void(this.newMod=void 0)}if(this.newMod){(0,Y.y5)(this.newMod.selectedIds,n)&&this.newMod.styleId===e&&this.newMod.styleRevision===t&&this.newMod.floorIndex===i?this.newMod.useful=!0:this.createNewMod(i,n,e,t)}else this.createNewMod(i,n,e,t)}else this.createNewMod(i,n,e,t)}getUsefulMod(){return this.currentMod&&this.currentMod.useful?this.currentMod:this.newMod&&this.newMod.useful?this.newMod:void 0}setAllModsNeedless(){this.currentMod&&(this.currentMod.useful=!1),this.newMod&&(this.newMod.useful=!1)}canBeRemoved(){return(!this.currentMod||this.currentMod.canBeRemoved())&&(!this.newMod||this.newMod.canBeRemoved())}remove(){this.currentMod&&this.currentMod.remove(),this.newMod&&this.newMod.remove()}createNewMod(e,t,i,n){const o=function(e,t,i,n,o){const s=i.map((e=>`${e.lo},${e.hi}`)).join("|");return`floor_plan=${e}_ind=${t}_sId=${n}_sRev=${o}_sel=${s}`}(this.id,e,t,i,n),s=this.cache.get(o);if(s)this.newMod=s,this.newMod.useful=!0;else{const s=!this.idSetByFloorIndex.has(e);this.newMod=new Zr(this.modules,this.mapState,o,this.id,this.regionId,i,n,e,this.cache,t,s,this.onModGenerated)}}}const Gr={trafficOn:!1,parkingOn:!1,navigatorOn:!1};function Wr(e){return Object.assign(Object.assign({},Gr),e)}function Vr(e,t,i){return Object.assign(Object.assign({},e),{_activeFloorIds:t,_activeFloorBuildingIds:i})}class qr{constructor(e,t){this.isStyleUpdateInProgress=!1,this.state=e,this.modules=t,this.floors=new Map,this.complexDescriptors=new Map,this.hiddenObjectIds=new Map,this.displayedMods=new Map,this.requestedFloors=new Set,this.failedRequestedFloors=new Set,this.needUpdate=!1,this.cache=new dr.L(10,((e,t)=>t.remove())),this.stateDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}])}update(){if(this.stateDiffer.check(this.state)||this.needUpdate){this.needUpdate=!1;const e=this.findActiveFloor();if(this.activeFloor!==e){if(this.activeFloor&&this.modules.map.emit("floorcomplexhide",{id:this.activeFloor}),e){const t=this.complexDescriptors.get(e);if(t){const{id:i,regionId:n,defaultFloor:o,floors:s}=t;let r=this.floors.get(e);r?r.setUsefulMod():(r=new Hr(this.modules,this.state,i,n,this.cache,o),this.floors.set(e,r));const a=r.getUsefulMod();this.modules.map.emit("floorcomplexshow",{id:i,currentFloor:a?a.floorIndex:o,floorNames:s.map((({name:e})=>e)),firmsToFloorIndexMap:t.firmsToFloorIndexMap})}}this.activeFloor=e}}if(this.floors.forEach((e=>e.setAllModsNeedless())),this.activeFloor){const e=this.floors.get(this.activeFloor);e&&e.setUsefulMod()}this.floors.forEach(((e,t)=>{e.update(),e.canBeRemoved()&&this.floors.delete(t)})),this.updateStyleState(),this.isStyleUpdateInProgress||this.commitMods(),this.updateScene()}getActiveFloorHiddenIds(){const e=[];if(!this.activeFloor)return e;const t=this.complexDescriptors.get(this.activeFloor),i=this.floors.get(this.activeFloor);if(!t||!i)return e;const n=i.getCurrentMod();if(!n)return e;if(n.isDataEmpty())return e;for(let i=0;i<t.buildings.length;i++){const n=this.hiddenObjectIds.get(t.buildings[i]);n&&n.forEach((t=>e.push(t)))}return e}prepareFloors(e,t,i,n){"terrain"===n&&i.forEach(((i,n)=>{const o=(0,Y.Ak)(n);let s=this.hiddenObjectIds.get(o);void 0===s&&(s=new Set,this.hiddenObjectIds.set(o,s));for(let e=0;e<i.length;e+=2)s.add((0,Y.Ak)((0,Y.Ru)(i[e],i[e+1])));this.loadFloor(o,e,t)}))}changeFloorNumber(e,t){const i=this.floors.get(e),n=this.complexDescriptors.get(e);i&&n&&(i.setFloorIndex(t),this.modules.map.emit("floorcomplexlevelchange",{id:e,floorIndex:t,floorName:n.floors[t].name}))}resetCache(){this.floors.forEach(((e,t)=>{e.remove(),this.floors.delete(t)})),this.cache.reset(),this.activeFloor=void 0,this.needUpdate=!0}getDisplayedIdentifyData(){const e=[];return this.displayedMods.forEach((t=>{const i=t.getIdentifyIds();i&&Object.keys(i).forEach((t=>{const n=Number(t);e.push({ids:i[n],metatileHash:Number(n)})}))})),e}hasDisplayedFloorBuilding(e){if(!this.activeFloor)return!1;const t=this.complexDescriptors.get(this.activeFloor),i=this.floors.get(this.activeFloor);if(!t||!i)return!1;const n=i.getCurrentMod();if(!n||!n.ready)return!1;if(n.isDataEmpty())return!1;for(let i=0;i<t.buildings.length;i++){const n=this.hiddenObjectIds.get(t.buildings[i]);if(n&&n.has(e))return!0}return!1}activateStyleUpdating(){this.isStyleUpdateInProgress=!0,this.needUpdate=!0}finishStyleUpdating(){this.isStyleUpdateInProgress=!1}activeFloorLoadingOrReady(){if(!this.activeFloor)return!0;const e=this.floors.get(this.activeFloor);if(!e)return!0;const t=e.getUsefulMod();return Boolean(t&&t.ready)}floorsReady(){return Array.from(this.requestedFloors).every((e=>{const t=this.floors.get(e);if(!t)return this.failedRequestedFloors.has(e)||this.complexDescriptors.has(e);const i=t.getUsefulMod();return Boolean(!i||i.ready)}))}loadFloor(e,t,i){this.requestedFloors.has(e)||(this.requestedFloors.add(e),this.modules.workers.parser.loadFloor(e,this.state.floorsUrl).then((n=>{if("error"===n.type)return 404!==n.errorStatus&&console.error(`Loading floor ${e} failed`),void this.failedRequestedFloors.add(e);this.complexDescriptors.set(e,{id:e,regionId:t,metatileHash:i,center:n.center,defaultFloor:n.defaultFloor,floors:n.floors,buildings:n.buildings,bound:n.bound,firmsToFloorIndexMap:n.firmsToFloorIndexMap}),this.needUpdate=!0})))}updateStyleState(){const{styleState:e}=this.state;if(!this.activeFloor)return void((e._activeFloorIds||e._activeFloorBuildingIds)&&(this.state.styleState=Vr(e,void 0,void 0)));const t=this.complexDescriptors.get(this.activeFloor),i=this.floors.get(this.activeFloor);if(!t||!i)return;const n=i.getUsefulMod();if(!n)return;const o=t.floors[n.floorIndex].ids,s=t.buildings;o===e._activeFloorIds&&s===e._activeFloorBuildingIds||(this.state.styleState=Vr(e,o,s))}updateScene(){let e=!1;const t=new Map;if(this.activeFloor){const e=this.floors.get(this.activeFloor);if(!e)return;const i=e.getCurrentMod();i&&i.ready&&t.set(i.key,i)}this.displayedMods.forEach(((i,n)=>{t.has(n)||(this.removeFloorMod(i),e=!0)})),t.forEach(((t,i)=>{this.displayedMods.has(i)||(this.addFloorMod(t),e=!0),this.cache.get(i)})),e&&(this.displayedMods=t,this.state.needLabeling=!0,this.state.needRerender=!0,this.modules.identifier.resetCache())}addFloorMod(e){e.object&&(this.modules.tileManager.addObject(e.object),this.modules.labeler.addLabels(e.key,pr.AL.Floor,e.getLabels()))}removeFloorMod(e){e.object&&(this.modules.tileManager.removeObject(e.object),this.modules.labeler.removeLabels(e.key))}commitMods(){if(this.activeFloor){const e=this.floors.get(this.activeFloor);e&&e.commitMod()}}findActiveFloor(){const e=this.complexDescriptors,{center:t,zoom:i,styleZoom:n,rotation:o,size:s,pitch:r,viewport:a,padding:l}=this.state;if(n<T.floors.displayStyleZoom)return;const c=new E.V({center:t,zoom:i,rotation:o,size:[Math.floor(s[0]*(1-T.floors.viewportPadding)),Math.floor(s[1]*(1-T.floors.viewportPadding))],pitch:r,viewport:a,padding:l});let d,h=1/0;return e.forEach((e=>{const i=X.TE(t,e.center);h>i&&(0,Gi.M4)(c.getViewportVertices(),e.bound)&&(h=i,d=e)})),d?d.id:void 0}}class Xr{constructor(e,t){this.state=e,this.modules=t,this.tileLayers=[],this.objects=[],this.viewportDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"},{path:"elevation",type:"number"},{path:"minElevation",type:"number"}])}addTileLayer(e){-1===this.tileLayers.indexOf(e)&&(this.tileLayers.push(e),e.redraw(),this.modules.identifier.resetCache(),this.state.needLabeling=!0,this.state.needRerender=!0)}removeTileLayer(e){(0,P.VJ)(this.tileLayers,e)&&(e.resetHoverId(),this.modules.identifier.resetCache(),this.state.needLabeling=!0,this.state.needRerender=!0)}redraw(){this.modules.labeler.clearPreviousLabels();for(const e of this.tileLayers)e.resetHoverId(),e.redraw();this.state.needRerender=!0}activateStyleUpdating(){this.tileLayers.forEach((e=>e.activateStyleUpdating()))}finishStyleUpdating(){this.tileLayers.forEach((e=>e.finishStyleUpdating()))}setSelectedIds(){this.tileLayers.forEach((e=>e.setSelectedIds()))}getViewportTiles(){const e=[];for(const t of this.tileLayers)e.push(...t.getViewportTiles());return e}viewportTilesReady(){return this.tileLayers.every((e=>e.viewportTilesReady()))}displayedTilesAnimationFinished(){return this.tileLayers.every((e=>e.displayedTilesAnimationFinished()))}getDisplayedIdentifyData(){const e=[];for(const t of this.tileLayers)e.push(...t.getDisplayedIdentifyData());return e}getLabelingData(){return this.tileLayers.map((e=>e.getLabelingData()))}isIdle(){return this.viewportTilesReady()&&this.displayedTilesAnimationFinished()}update(){const e=this.state;this.viewportDiffer.check(e)&&this.tileLayers.forEach((e=>e.updateViewport()));for(const e of this.tileLayers)e.update();if(this.updateTickers(),e.collectStats){this.state.stats.tileCount=0;for(const e of this.tileLayers)this.state.stats.tileCount+=e.getTileCount();this.state.stats.dynamicTileCount=this.objects.filter((e=>"dynamicObject"===e.purpose||"floor"===e.purpose)).length}}getTileObjects(){return this.objects}addObject(e){-1===this.objects.indexOf(e)&&(this.objects.push(e),this.state.needRerender=!0)}removeObject(e){(0,P.VJ)(this.objects,e)&&(this.state.needRerender=!0)}destroy(){for(const e of this.tileLayers)e.destroy();this.objects.forEach((e=>e.clean(this.state)))}updateTickers(){this.objects.forEach((e=>e.updateTicker(this.state)))}}const $r=ce.Vx.bind(null,"labelingOpacity",{step:(e,t)=>e.labelingOpacity=t});class Yr{constructor(e,t){this.state=e,this.modules=t,this.viewportDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}]),this.useThrottleUpdate=!0,this.isLabelingInProgress=!1,this.skipHysteresisInNextLabeling=!1,this.alwaysActiveLabelKeys=[],this.survivedLabelBoxes=new Set,this.prevSurvivedCommPoiIds=new Set,this.demKeys={},this.worker=(e=>({appendLabels:e.get(Pr.P.Labeling,"appendLabels"),appendLabelBox:e.get(Pr.P.Labeling,"appendLabelBox"),removeLabels:e.get(Pr.P.Labeling,"removeLabels"),processLabels:e.get(Pr.P.Labeling,"processLabels"),clearPreviousLabels:e.get(Pr.P.Labeling,"clearPreviousLabels")}))(this.modules.workers.fnRegistry),this.setLabelingInterval(T.labeling.interval)}disableThrottleUpdateOnce(){this.useThrottleUpdate=!1}update(){$r(this.state),!this.viewportDiffer.check(this.state)&&!this.state.needLabeling||this.isLabelingInProgress||(this.state.needLabeling=!1,this.isLabelingInProgress=!0,this.useThrottleUpdate?this.throttledUpdateLabeling():(this.useThrottleUpdate=!0,this.generateLabelingTile()))}isIdle(){return void 0===this.state.tickers.labelingOpacity&&!this.isLabelingInProgress&&!this.state.needLabeling}setLabelingInterval(e){this.throttledUpdateLabeling=Ge((()=>{this.generateLabelingTile()}),e)}addLabels(e,t,i){this.worker.appendLabels(e,t,i,this.state.styleState,this.state.styleZoom),this.enrichWithElevation(i,e),this.alwaysActiveLabelKeys.push(e),this.state.needLabeling=!0}addTileLabels(e,t,i){this.worker.appendLabels(e,t,i,this.state.styleState,this.state.styleZoom),this.enrichWithElevation(i,e),this.state.needLabeling=!0}addLabelBox(e,t){this.worker.appendLabelBox(e,t),this.state.needLabeling=!0}removeLabels(e){this.worker.removeLabels(e);const t=this.alwaysActiveLabelKeys.indexOf(e);-1!==t&&this.alwaysActiveLabelKeys.splice(t,1),this.state.needLabeling=!0}isLabelBoxSurvived(e){return this.survivedLabelBoxes.has(e)}clearPreviousLabels(){this.worker.clearPreviousLabels()}resetHysteresis(){this.skipHysteresisInNextLabeling=!0,this.state.needLabeling=!0}generateLabelingTile(){const e=(0,ne.x7)((0,Gi.BS)(this.state.tilesBounds),T.labeling.tileMultiplier),t={center:this.state.center,elevation:this.state.elevation,zoom:this.state.zoom,styleZoom:this.state.styleZoom,rotation:this.state.rotation,size:this.state.size,pitch:this.state.pitch,viewport:this.state.viewport,padding:this.state.padding,styleState:this.state.styleState,buildingHeight:this.modules.buildingHeightAnimator.getDefaultBuildingHeight(),tilesBounds:this.state.tilesBounds,debugLabels:this.modules.labelsDebug.isEnabled()};this.worker.processLabels(this.modules.tileManager.getLabelingData(),this.alwaysActiveLabelKeys,t,(0,ne.Bs)(e),window.devicePixelRatio,this.modules.floorManager.getActiveFloorHiddenIds(),T.labeling.commercialMargins,this.skipHysteresisInNextLabeling).then((t=>{this.survivedLabelBoxes.clear(),t.survivedLabelBoxIds.forEach((e=>this.survivedLabelBoxes.add(e))),this.processSurvivedCommPoiIds(t.survivedCommPoiIds),this.labelTile&&(this.modules.tileManager.removeObject(this.labelTile),this.labelTile.clean(this.state)),this.modules.assetManager.loadRasters(t.collectorOutput.rastersToLoad),this.labelTile=new $.W("labeling",t.collectorOutput.data,this.modules.renderer,e),this.modules.tileManager.addObject(this.labelTile);const i=this.state.metrics;Number.isNaN(i.firstlabeling)&&t.collectorOutput.data.length>0&&(i.firstlabeling=performance.now()-i.start);const{animationTime:n,animationType:o,interval:s}=T.labeling;var r,a,l,c,d;r=this.state,a=o,l=0,c=1,d=Math.min(n,s),ce.BL("labelingOpacity",{easing:a},r,l,c,d),this.state.needRerender=!0,t.labels&&this.modules.labelsDebug.drawLabels(t.labels),this.isLabelingInProgress=!1})),this.skipHysteresisInNextLabeling=!1}processSurvivedCommPoiIds(e){if(0===e.length)return void this.prevSurvivedCommPoiIds.clear();const t=e.filter((e=>!this.prevSurvivedCommPoiIds.has(e)));0!==t.length&&this.modules.map.emit("commpoishow",{commPoiIds:t}),this.prevSurvivedCommPoiIds=new Set(e)}enrichWithElevation(e,t){const{demManager:i}=this.modules;if(i.isEnabled()){const n=this.demKeys[t],o=i.getLabelsDemKey(e);if(void 0===o||o===n)return;i.enrichWithElevation(e),this.demKeys[t]=o}}}const Kr=10,Jr=7,Qr=3,ea=2,ta=0,ia=4,na=2,oa="#ffffff",sa="#667799",ra="#ffffff",aa=5,la=4,ca=2,da=1,ha="#667799",ua="#ffffff",ma="#00000026",fa="#66779966",pa=13,_a={start:{en:"Start",ru:"Старт"},addPoint:{en:"Add point",ru:"Добавить точку"},meter:{en:"m",ru:"м"},kilometer:{en:"km",ru:"км"}};function va(e,t,i){if(t)return _a.start[i]||_a.start.en;if(e<1e3)return`${e} ${_a.meter[i]||_a.meter.en}`;return`${(e/1e3).toFixed(1)} ${_a.kilometer[i]||_a.kilometer.en}`}function ga(e,t){return`\n        <div style="font-size: ${t}px;\n            color: #667799;\n            user-select: none;\n            font-family: SuisseIntl, Helvetica, Arial, sans-serif;\n            text-shadow: 1px 0px 1px #fff, -1px 0px 1px #fff, 0px 1px 1px #fff, 0px -1px 1px #fff;\n            white-space: nowrap;\n            cursor: pointer;\n        ">\n            ${e}\n        </div>\n    `}function ya(e,t){return`\n        <div style="text-shadow: 1px 0px 1px #fff, -1px 0px 1px #fff, 0px 1px 1px #fff, 0px -1px 1px #fff;\n            user-select: none;\n            color: #667799;\n            font-family: SuisseIntl, Helvetica, Arial, sans-serif;\n            font-size: 13px;\n            margin: -12px 0 0 12px; /** отступы от точки наведения */\n            white-space: nowrap;\n            cursor: pointer;\n        ">\n            ${e}\n            <br>\n            ${function(e){return _a.addPoint[e]||_a.addPoint.en}(t)}\n        </div>\n    `}function ba(e,t,i,n){return new le(n,{coordinates:e,interactive:i,draggable:i,width:t?Jr:ta,borderWidth:t?Qr:ia,border2Width:t?ea:na,color:oa,borderColor:sa,border2Color:ra,zIndex:Kr})}function wa(e,t,i){return new Ml(i,{coordinates:e,zIndex:aa,zIndex2:aa-1,zIndex3:aa-2,width:la,width2:t?0:la+2*ca,width3:t?0:la+2*(ca+da),color:t?fa:ha,color2:ua,color3:ma,interactive:!t})}const xa="PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjIiIGhlaWdodD0iMjIiPjxkZWZzPjxwYXRoIGlkPSJBIiBkPSJNMTIgMTAuNTg2bDMuNzkzLTMuNzkzIDEuNDE0IDEuNDE0TDEzLjQxNCAxMmwzLjc5MyAzLjc5My0xLjQxNCAxLjQxNEwxMiAxMy40MTRsLTMuNzkzIDMuNzkzLTEuNDE0LTEuNDE0TDEwLjU4NiAxMiA2Ljc5MyA4LjIwN2wxLjQxNC0xLjQxNEwxMiAxMC41ODZ6Ii8+PC9kZWZzPjxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTEpIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMC41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiMwMDAiIHN0cm9rZS1vcGFjaXR5PSIuMTUiLz48bWFzayBpZD0iQiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjQSIvPjwvbWFzaz48dXNlIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0ibm9uemVybyIgeGxpbms6aHJlZj0iI0EiLz48ZyBmaWxsPSIjMjYyNjI2IiBtYXNrPSJ1cmwoI0IpIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6Ii8+PC9nPjwvZz48L3N2Zz4=";class Ia extends W.c{constructor(e,t,i,n){super(),this.markerOrLabelMouseover=()=>{this.markerOrLabelHovered||(this.markerOrLabelHovered=!0,void 0===this.hoverTimer&&this.emit("mouseover"))},this.markerOrLabelMouseout=()=>{this.markerOrLabelHovered&&(this.markerOrLabelHovered=!1,this.hoverTimer=window.setTimeout((()=>{this.markerOrLabelHovered||(this.emit("mouseout"),this.hoverTimer=void 0)}),100))},this.onClick=()=>this.emit("click"),this.labelText=va(n,i,e.state.lang),this.point=t,this.distance=n,this.label=function(e,t,i){const n=ga(t,pa),o=function(e,t){return.55*t*e.length}(t,pa);return new zr(i,{coordinates:e,html:n,offset:[(Jr+Qr+ea)/2+2,-pa/2-2],labeling:{type:"full",width:o,height:pa},animate:!1,zIndex:aa+1})}(t,this.labelText,e),this.marker=ba(t,i,!0,e),this.markerOrLabelHovered=!1;const o=this.label.dangerouslyGetRootElement();o.addEventListener("mouseover",this.markerOrLabelMouseover),o.addEventListener("mouseout",this.markerOrLabelMouseout),o.addEventListener("click",this.onClick),this.marker.on("mouseover",(()=>this.markerOrLabelMouseover())),this.marker.on("mouseout",(()=>this.markerOrLabelMouseout())),this.marker.on("dragstart",(e=>{const{lngLat:t,originalEvent:i,point:n,target:o}=e;this.emit("dragstart",{lngLat:t,originalEvent:i,point:n,targetData:this,target:o})})),this.marker.on("dragend",(e=>{const{lngLat:t,originalEvent:i,point:n,target:o}=e;this.emit("dragend",{lngLat:t,originalEvent:i,point:n,targetData:this,target:o})}))}getDistance(){return this.distance}getPoint(){return this.point}getMarkerUniqId(){return this.marker.uniqId}getLabelUniqId(){return this.label.uniqId}setPoint(e){this.point=e}remove(){this.marker.remove();const e=this.label.dangerouslyGetRootElement();e.removeEventListener("mouseover",this.markerOrLabelMouseover),e.removeEventListener("mouseout",this.markerOrLabelMouseout),e.removeEventListener("click",this.onClick),this.label.destroy()}activateHover(){this.label.setContent(`\n        <img style="\n            user-select: none;\n            width: 24px;\n            height: 24px;\n            margin-top: -4px;\n            cursor: pointer;\n        " src="data:image/svg+xml;base64,${xa}" alt="close">\n    `)}deactivateHover(){this.label.setContent(ga(this.labelText,pa))}}class Sa{constructor(e,t){this.onDocumentMouseMove=e=>{this.mousePos=D(this.modules.layout.rootContainer,e.clientX,e.clientY),this.needsUpdate=!0},this.modules=t,this.state=e,this.joints=[],this.enabled=!1,this.needsUpdate=!1,this.hidePreviewLine=!1,this.hideMouseElem=!1,this.mousePos=[0,0],document.addEventListener("mousemove",this.onDocumentMouseMove),this.langDiffer=new qe([{path:"lang",type:"string"}])}destroy(){document.removeEventListener("mousemove",this.onDocumentMouseMove)}enable(){this.enabled||(this.enabled=!0,this.state.identifyPickDistance=2*T.identify.pickDistance,this.popup=new zr(this.modules.map,{coordinates:[0,0],html:"",interactive:!1,animate:!1,zIndex:1}))}disable(){this.enabled=!1,this.reset(),void 0!==this.mouseElem&&(this.mouseElem.remove(),this.mouseElem=void 0),this.state.identifyPickDistance=T.identify.pickDistance,this.popup&&(this.popup.destroy(),this.popup=void 0)}update(){this.enabled&&(this.langDiffer.check(this.state)&&this.recalculate(),this.needsUpdate&&(this.needsUpdate=!1,this.drawMousePoint(),this.drawPreviewLine()))}setPoints(e){this.reset(),e.forEach((e=>this.addPointToEnd(e))),this.drawPolyline(),this.sendRulerChangeEvent(!1)}handleClick(e,t){const i=this.getJointByUniqId(t&&t.dynamicObjectId);if(i){const e=this.getJointIndexByReferer(i);void 0!==e&&(i.remove(),this.joints.splice(e,1),this.recalculate(),this.hidePreviewLine=!1,this.hideMouseElem=!1),this.popup&&this.popup.setContent("")}else if(t&&this.polyline&&this.polyline.uniqId===t.dynamicObjectId){const t=this.polyline.snapPoint(e),i=this.getJointIndexByDistance(t.distance),n=this.createJoint(t.point,!1,t.distance);this.joints.splice(i,0,n),this.hidePreviewLine=!0,this.hideMouseElem=!0,this.drawPolyline(),this.sendRulerChangeEvent(!0),this.popup&&this.popup.setContent("")}else{const t=(0,L.PA)(this.modules.camera.unproject(e));this.addPointToEnd(t),this.drawPolyline(),this.sendRulerChangeEvent(!0)}}recalculate(){const e=[];this.joints.forEach(((t,i)=>{t.remove();const n=0===i;let o=0;if(!n){const n=e[i-1];o=n.getDistance()+(0,L.vn)(n.getPoint(),t.getPoint())}const s=this.createJoint(t.getPoint(),n,o);e.push(s)})),this.joints=e,this.drawPolyline(),this.sendRulerChangeEvent(!0)}sendRulerChangeEvent(e){this.modules.map.emit("rulerchange",{points:this.getPoints(),isUser:e})}getJointByUniqId(e){if(void 0!==e)for(const t of this.joints)if(e===t.getMarkerUniqId()||e===t.getLabelUniqId())return t}getJointIndexByDistance(e){let t=0;for(const i of this.joints){if(e<i.getDistance())break;t++}return t}getJointIndexByReferer(e){let t=0;for(const i of this.joints){if(i===e)return t;t++}}getPoints(){return this.joints.map((e=>e.getPoint()))}reset(){this.joints.forEach((e=>e.remove())),this.joints=[],void 0!==this.polyline&&(this.polyline.remove(),this.polyline=void 0),void 0!==this.previewLine&&(this.previewLine.remove(),this.previewLine=void 0),this.hidePreviewLine=!1,this.hideMouseElem=!1,this.popup&&this.popup.setContent("")}createJoint(e,t,i){const n=new Ia(this.modules.map,e,t,i);return n.on("mouseover",(()=>{void 0===this.draggableJointIndex&&(this.requestUpdate(!0,!0),n.activateHover())})),n.on("mouseout",(()=>{void 0===this.draggableJointIndex&&(this.requestUpdate(!1,!0),n.deactivateHover())})),n.on("dragstart",(()=>{this.requestUpdate(!1,!0),this.draggableJointIndex=this.getJointIndexByReferer(n)})),n.on("dragend",(e=>{this.requestUpdate(!1,!0),this.draggableJointIndex=void 0,n.setPoint(e.lngLat),this.recalculate()})),n.on("click",(()=>{const e=this.getJointIndexByReferer(n);void 0!==e&&(n.remove(),this.joints.splice(e,1),this.recalculate(),this.hidePreviewLine=!1,this.hideMouseElem=!1),this.popup&&this.popup.setContent("")})),n}addPointToEnd(e){let t=!0,i=0;if(this.joints.length>0){t=!1;const n=this.joints[this.joints.length-1];i=n.getDistance()+(0,L.vn)(n.getPoint(),e)}const n=this.createJoint(e,t,i);this.joints.push(n)}drawPolyline(){void 0!==this.polyline&&(this.polyline.remove(),this.polyline=void 0);const e=this.getPoints();if(e.length<2)return;const t=wa(e,!1,this.modules.map);t.on("mousemove",(e=>{if(void 0===this.draggableJointIndex){if(this.popup){const i=t.snapPoint(e.point),n=va(i.distance,!1,this.state.lang);this.popup.setPosition(i.point),this.popup.setContent(ya(n,this.state.lang)),this.snapPoint=i.point}this.requestUpdate(!0,!1)}})),t.on("mouseout",(()=>{void 0===this.draggableJointIndex&&(this.popup&&this.popup.setContent(""),this.requestUpdate(!1,!0))})),this.polyline=t}requestUpdate(e,t){this.hidePreviewLine=e,this.hideMouseElem=t,this.needsUpdate=!0}getPreviewPoints(){const e=this.getPoints();if(this.hidePreviewLine||e.length<1)return[];const t=this.draggableJointIndex,i=(0,L.PA)(this.modules.camera.unproject(this.mousePos));if(void 0===t||1===e.length)return[];if(t===this.joints.length-1)return[e[e.length-2],i];if(0===t)return[e[1],i];const n=this.joints[t-1],o=this.joints[t+1];return[n.getPoint(),i,o.getPoint()]}drawPreviewLine(){void 0!==this.previewLine&&(this.previewLine.remove(),this.previewLine=void 0);const e=this.getPreviewPoints();e.length<1||(this.previewLine=wa(e,!0,this.modules.map))}drawMousePoint(){void 0!==this.mouseElem&&(this.mouseElem.remove(),this.mouseElem=void 0),this.hideMouseElem||void 0===this.snapPoint||(this.mouseElem=ba(this.snapPoint,!0,!1,this.modules.map))}}class Ma{constructor(e,t,i){this.type=e,this.handler=i,this.mouseDownPoint=t,this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionstart",{target:"pitch/rotation"})}processAction(e){switch(e.type){case"mousemove":return this.processMouseMoveAction(e);case"mouseup":return this.processMouseUpAction(e);case"keyup":return this.processKeyUpAction(e);default:return this}}processMouseMoveAction(e){const t=D(this.handler.container,e.clientX,e.clientY);return new Ta(this.type,this.mouseDownPoint,t,this.handler)}processMouseUpAction(e){switch(this.type){case"keyPrimary":if(0===e.button&&(e.ctrlKey||e.metaKey))return this.returnToInitialState();break;case"secondary":if(2===e.button){const t=D(this.handler.container,e.clientX,e.clientY);return this.handler.modules.identifier.search("contextmenu",t,!0).then((i=>{ee("contextmenu",i,e,t,this.handler.modules)})),this.returnToInitialState()}break;case"auxiliary":if(1===e.button)return this.returnToInitialState()}return this}processKeyUpAction(e){return"keyPrimary"!==this.type||"Control"!==e.key&&"Meta"!==e.key?this:(this.handler.modules.map.emit("interactionend",{target:"pitch/rotation"}),new Pa(this.mouseDownPoint,this.handler))}returnToInitialState(){return this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:"pitch/rotation"}),new Ra(this.handler)}}class Ta{constructor(e,t,i,n){this.type=e,this.mouseDownPoint=t,this.mouseMovePoint=i,this.handler=n,this.handler.mapState.userHasInteracted=!0,this.handler.mapState.disablePitchByUserInteraction&&this.handler.mapState.disableRotationByUserInteraction||this.handler.container.classList.add("mapgl-rotating"),this.update(this.handler.mapState)}processAction(e){switch(e.type){case"mousemove":return this.processMouseMoveAction(e);case"mouseleave":return this.returnToInitialState();case"mouseup":return this.processMouseUpAction(e);case"keyup":return this.processKeyUpAction(e);default:return this}}update(e){0===this.mouseDownPoint[0]&&0===this.mouseDownPoint[1]&&(this.mouseDownPoint=this.mouseMovePoint);const t=(0,P.Te)(e.size,this.mouseDownPoint),i=(0,P.Te)(e.size,this.mouseMovePoint),n=(t[0]-i[0])*T.zoom.mouseRotateDelta,o=(i[1]-t[1])*T.zoom.mousePitchDelta;We(e),e.disableRotationByUserInteraction||Ie(e,e.rotation+n,{animate:!1}),e.disablePitchByUserInteraction||Pe(e,(0,P.uZ)(e.pitch+o,e.minPitch,e.maxPitch),{animate:!1}),this.mouseDownPoint=this.mouseMovePoint,e.needRerender=!0}processMouseMoveAction(e){return this.mouseMovePoint=D(this.handler.container,e.clientX,e.clientY),this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState),this}processMouseUpAction(e){switch(this.type){case"keyPrimary":if(0===e.button&&(e.ctrlKey||e.metaKey))return this.returnToInitialState();break;case"secondary":if(2===e.button)return this.returnToInitialState();break;case"auxiliary":if(1===e.button)return this.returnToInitialState()}return this}processKeyUpAction(e){return"keyPrimary"!==this.type||"Control"!==e.key&&"Meta"!==e.key?this:(this.handler.container.classList.remove("mapgl-rotating"),this.handler.modules.map.emit("interactionend",{target:"pitch/rotation"}),new Pa(this.mouseMovePoint,this.handler))}returnToInitialState(){return this.handler.mapState.userHasInteracted=!0,this.handler.container.classList.remove("mapgl-rotating"),this.handler.modules.map.emit("interactionend",{target:"pitch/rotation"}),new Ra(this.handler)}}class Pa{constructor(e,t){this.handler=t,this.toInitialOnMouseUp=!1,this.mouseDownPoint=e,this.dragStartPoint=e,this.isTimerStarted=void 0!==this.handler.dblClickTimer,this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionstart",{target:"center"}),this.isTimerStarted&&(window.clearTimeout(this.handler.dblClickTimer),this.handler.dblClickTimer=void 0)}processAction(e){switch(e.type){case"mousedown":return this.toInitialOnMouseUp=!0,this;case"mouseup":return this.processMouseUpAction(e);case"mousemove":return this.processMouseMoveAction(e);case"click":return this.processMouseClickAction(e);case"keydown":return this.processKeyDownAction(e);default:return this}}processMouseUpAction(e){return 0!==e.button||!this.toInitialOnMouseUp&&this.handler.modules.layout.isActionWithCanvas(e)?this:(this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:"center"}),new Ra(this.handler))}processMouseMoveAction(e){const t=D(this.handler.container,e.clientX,e.clientY);return this.handler.mapState.disableDragging?(this.mouseDownPoint=t,this.dragStartPoint=t,this.toInitialOnMouseUp=!0,this):X.TE(this.mouseDownPoint,t)<T.events.dragThreshold?(this.dragStartPoint=t,this):new La(t,this.dragStartPoint,this.handler)}processMouseClickAction(e){if(!this.handler.modules.layout.isActionWithCanvas(e))return this;if(this.isTimerStarted){if(this.handler.mapState.zoom<this.handler.mapState.maxZoom){const t=this.handler.mapState,i=Math.min(t.zoom+1,t.maxZoom),n=D(this.handler.container,e.clientX,e.clientY);We(t),ze(t,i,{duration:T.zoom.animDuration,zoomPoint:t.keepCenterWhileUserZoomRotate?void 0:n,blockBuildingAnimation:!0}),this.handler.mapState.needRerender=!0}}else{const t=D(this.handler.container,e.clientX,e.clientY);this.handler.modules.identifier.search("mouseClick",t,!0).then((i=>{const n=this.handler.modules.ruler;n.enabled?n.handleClick(t,i):this.handler.dblClickTimer||(this.handler.dblClickTimer=window.setTimeout((()=>{ee("click",i,e,t,this.handler.modules),this.handler.dblClickTimer=void 0}),T.events.doubleClickTime))}))}return this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:"center"}),new Ra(this.handler)}processKeyDownAction(e){return"Control"===e.key||"Meta"===e.key?(this.handler.modules.map.emit("interactionend",{target:"center"}),new Ma("keyPrimary",this.mouseDownPoint,this.handler)):this}}class La{constructor(e,t,i){this.mouseMovePoint=e,this.dragStartPoint=t,this.handler=i,this.handler.container.classList.add("mapgl-dragging"),this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState)}processAction(e){switch(e.type){case"mousemove":return this.processMouseMoveAction(e);case"mouseup":return this.processMouseUpAction(e);case"keydown":return this.processKeyDownAction(e);default:return this}}update(e){const t=this.handler.modules.camera.unproject(this.dragStartPoint),i=this.handler.modules.camera.unproject(this.mouseMovePoint),n=k.d9(e.center);k.IH(n,n,t),k.lu(n,n,i),We(e),ge(e,n,{animate:!1}),this.dragStartPoint=this.mouseMovePoint,e.needRerender=!0}processMouseMoveAction(e){return this.mouseMovePoint=D(this.handler.container,e.clientX,e.clientY),this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState),this}processMouseUpAction(e){return 0===e.button?this.returnToInitialState():this}processKeyDownAction(e){return"Control"===e.key||"Meta"===e.key?(this.handler.container.classList.remove("mapgl-dragging"),this.handler.modules.map.emit("interactionend",{target:"center"}),new Ma("keyPrimary",this.mouseMovePoint,this.handler)):this}returnToInitialState(){return this.handler.container.classList.remove("mapgl-dragging"),this.handler.modules.map.emit("interactionend",{target:"center"}),this.handler.mapState.userHasInteracted=!0,new Ra(this.handler)}}class Ea{constructor(e,t,i){this.handler=i,this.touchStartPoints=t,this.touchMovePoints=e,this.handler.mapState.userHasInteracted=!0,this.handler.mapState.disablePitchByUserInteraction||this.handler.container.classList.add("mapgl-rotating"),this.update(this.handler.mapState)}processAction(e){switch(e.type){case"touchstart":return this.processTouchStartAction(e);case"touchmove":return this.processTouchMoveAction(e);case"touchend":return this.processTouchEndAction(e);default:return this}}processTouchStartAction(e){return this.handler.container.classList.remove("mapgl-rotating"),this.handler.modules.map.emit("interactionend",{target:"pitch/zoom/rotation"}),new Aa(e,this.handler,!1)}processTouchMoveAction(e){return e.preventDefault(),this.touchMovePoints=O(e.touches,this.handler.container),this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState),this}processTouchEndAction(e){return this.handler.container.classList.remove("mapgl-rotating"),this.handler.modules.map.emit("interactionend",{target:"pitch/zoom/rotation"}),0===e.touches.length?(this.handler.mapState.userHasInteracted=!0,new Ra(this.handler)):new Aa(e,this.handler,!1)}}class ka extends Ea{constructor(e,t,i){super(e,t,i),this.startPxAngle=0,this.rotationDetected=!1,t.length>1&&(this.startPxAngle=(0,A.Hl)(t[0],t[1]))}update(e){if(this.touchStartPoints.length<2||this.touchMovePoints.length<2)return;const t=(0,A.L$)(this.touchMovePoints[0],this.touchMovePoints[1]),i=X.TK(this.touchMovePoints[0],this.touchMovePoints[1])/X.TK(this.touchStartPoints[0],this.touchStartPoints[1]),n=e.zoom+Math.log(i)/Math.log(2)*T.zoom.mobilePinchDelta;let o=0,s=0;if(!this.rotationDetected){const e=(0,A.Hl)(this.touchMovePoints[0],this.touchMovePoints[1]);s=Math.abs(this.startPxAngle-e),s>Math.PI&&(s=2*Math.PI-s),s>=this.handler.mapState.touchRotationThreshold&&(this.rotationDetected=!0)}if(this.rotationDetected){const e=this.handler.modules.camera.unproject(this.touchStartPoints[0]),t=this.handler.modules.camera.unproject(this.touchStartPoints[1]),i=this.handler.modules.camera.unproject(this.touchMovePoints[0]),n=this.handler.modules.camera.unproject(this.touchMovePoints[1]);if(e&&t&&i&&n){o=(0,A.Hl)(e,t)-(0,A.Hl)(i,n)}}const r=e.rotation+o,a=e.center;e.keepCenterWhileUserZoomRotate||k.IH(a,e.center,(0,P.Kv)(e,t,{zoom:n,rotation:r})),We(e),ge(e,a,{animate:!1}),ze(e,n,{animate:!1}),this.handler.mapState.disableRotationByUserInteraction||Ie(e,r,{animate:!1}),this.touchStartPoints=this.touchMovePoints,e.needRerender=!0}}class za extends Ea{constructor(e,t,i){super(e,t,i)}update(e){const t=this.touchStartPoints.map((t=>(0,P.Te)(e.size,t))),i=this.touchMovePoints.map((t=>(0,P.Te)(e.size,t))),n=(0,A.L$)(t[0],t[1]),o=((0,A.L$)(i[0],i[1])[1]-n[1])*T.zoom.mousePitchDelta;We(e),Pe(e,(0,P.uZ)(e.pitch+o,e.minPitch,e.maxPitch),{animate:!1}),this.touchStartPoints=this.touchMovePoints,e.needRerender=!0}}class Aa{constructor(e,t,i){this.handler=t,this.needClickOnTouchEnd=i,this.toZoomRotate=!1,this.touchStartPoints=O(e.touches,this.handler.container),this.handler.mapState.userHasInteracted=!0,this.isTimerStarted=void 0!==this.handler.dblClickTimer,B(e)?this.startedInteractionTarget="pitch/zoom/rotation":this.isTimerStarted?(this.startedInteractionTarget="zoom/rotation",window.clearTimeout(this.handler.dblClickTimer),this.handler.dblClickTimer=void 0):this.startedInteractionTarget="center",this.handler.modules.map.emit("interactionstart",{target:this.startedInteractionTarget})}processAction(e){switch(e.type){case"touchstart":return this.processTouchStartAction(e);case"touchmove":return this.processTouchMoveAction(e);case"touchend":return this.processTouchEndAction(e);default:return this}}getStartedInteractionTarget(){return this.startedInteractionTarget}processTouchStartAction(e){return e.preventDefault(),1===this.touchStartPoints.length&&(this.needClickOnTouchEnd=!1,this.handler.modules.map.emit("interactionend",{target:"center"}),this.startedInteractionTarget="pitch/zoom/rotation",this.handler.modules.map.emit("interactionstart",{target:this.startedInteractionTarget}),this.handler.mapState.userHasInteracted=!0),this.touchStartPoints=O(e.touches,this.handler.container),this}processTouchMoveAction(e){e.preventDefault();const t=O(e.touches,this.handler.container);if(!B(e))return X.TE(this.touchStartPoints[0],t[0])<T.events.dragThreshold?(this.touchStartPoints=t,this):this.isTimerStarted?new Fa(t[0],this.touchStartPoints[0],this.handler):this.handler.mapState.disableDragging?(this.touchStartPoints=t,this.needClickOnTouchEnd=!1,this):new Ca(t[0],this.touchStartPoints[0],this.handler);if(this.touchStartPoints.length<2)return this.processTouchStartAction(e);const i=X.Ue(),n=X.Ue();X.lu(i,t[0],this.touchStartPoints[0]),X.lu(n,t[1],this.touchStartPoints[1]);const o=X.AK(i,n);if(o>0){const e=X.TE(this.touchStartPoints[0],t[0]),i=X.TE(this.touchStartPoints[1],t[1]);return e<T.events.pitchThreshold||i<T.events.pitchThreshold?(this.touchStartPoints=t,this):this.handler.mapState.disablePitchByUserInteraction?this:new za(t,this.touchStartPoints,this.handler)}if(o<0)return new ka(t,this.touchStartPoints,this.handler);return(0,A.se)(i)||(0,A.se)(n)?this.pitchWaitingTimer?this:this.toZoomRotate?(this.toZoomRotate=!1,new ka(t,this.touchStartPoints,this.handler)):(this.pitchWaitingTimer=window.setTimeout((()=>{this.toZoomRotate=!0,this.pitchWaitingTimer=void 0}),T.events.pitchWaitingTime),this):new ka(t,this.touchStartPoints,this.handler)}processTouchEndAction(e){return e.cancelable&&e.preventDefault(),0===e.touches.length?1===e.changedTouches.length&&this.needClickOnTouchEnd?this.processTouchClickAction(this.touchStartPoints[0],e):(this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:e.changedTouches.length>1?"pitch/zoom/rotation":"center"}),new Ra(this.handler)):(B(e)||(this.handler.modules.map.emit("interactionend",{target:"pitch/zoom/rotation"}),this.startedInteractionTarget="center",this.handler.modules.map.emit("interactionstart",{target:this.startedInteractionTarget}),this.handler.mapState.userHasInteracted=!0),this.touchStartPoints=O(e.touches,this.handler.container),this)}processTouchClickAction(e,t){if(this.isTimerStarted){if(this.handler.mapState.zoom<this.handler.mapState.maxZoom){const t=this.handler.mapState,i=Math.min(t.zoom+1,t.maxZoom),n=t.keepCenterWhileUserZoomRotate?void 0:e;We(t),ze(t,i,{duration:T.zoom.animDuration,zoomPoint:n,blockBuildingAnimation:!0}),this.handler.mapState.needRerender=!0}}else if(this.handler.modules.layout.isActionWithCanvas(t))this.handler.modules.identifier.search("mouseClick",e,!0).then((i=>{const n=this.handler.modules.ruler;n.enabled?n.handleClick(e,i):this.handler.dblClickTimer||(this.handler.dblClickTimer=window.setTimeout((()=>{ee("click",i,t,e,this.handler.modules),this.handler.dblClickTimer=void 0}),T.events.doubleClickTime))}));else{const e=t.changedTouches[0];t.target&&e&&t.target.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY}))}return this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:"center"}),new Ra(this.handler)}}class Ca{constructor(e,t,i){this.handler=i,this.touchMovePoint=e,this.touchStartPoint=t,this.handler.mapState.userHasInteracted=!0,this.handler.container.classList.add("mapgl-dragging"),this.update(this.handler.mapState)}processAction(e){switch(e.type){case"touchstart":return this.processTouchStartAction(e);case"touchmove":return this.processTouchMoveAction(e);case"touchend":return this.processTouchEndAction();default:return this}}update(e){const t=this.handler.modules.camera.unproject(this.touchStartPoint),i=this.handler.modules.camera.unproject(this.touchMovePoint),n=k.d9(e.center);k.IH(n,n,t),k.lu(n,n,i),We(e),ge(e,n,{animate:!1}),this.touchStartPoint=this.touchMovePoint,e.needRerender=!0}processTouchStartAction(e){return this.handler.container.classList.remove("mapgl-dragging"),this.handler.modules.map.emit("interactionend",{target:"center"}),new Aa(e,this.handler,!1)}processTouchMoveAction(e){e.preventDefault();const t=O(e.touches,this.handler.container);return this.touchMovePoint=t[0],this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState),this}processTouchEndAction(){return this.handler.container.classList.remove("mapgl-dragging"),this.handler.modules.map.emit("interactionend",{target:"center"}),this.handler.mapState.userHasInteracted=!0,new Ra(this.handler)}}class Fa{constructor(e,t,i){this.handler=i,this.mapHeight=i.mapState.size[1],this.startZoom=i.mapState.zoom,this.touchMovePointY=e[1],this.touchStartPoint=t,this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState)}processAction(e){switch(e.type){case"touchstart":return this.processTouchStartAction(e);case"touchmove":return this.processTouchMoveAction(e);case"touchend":return this.processTouchEndAction();default:return this}}update(e){const t=this.touchMovePointY-this.touchStartPoint[1];if(0===t)return;const i=t/this.mapHeight,n=(0,P.uZ)(this.startZoom+i*T.zoom.mobileTapDelta,e.minZoom,e.maxZoom),o=e.center;e.keepCenterWhileUserZoomRotate||k.IH(o,e.center,(0,P.Kv)(e,this.touchStartPoint,{zoom:n})),We(e),ge(e,o,{animate:!1}),ze(e,n,{animate:!1}),e.needRerender=!0}processTouchStartAction(e){return this.handler.modules.map.emit("interactionend",{target:"zoom/rotation"}),new Aa(e,this.handler,!1)}processTouchMoveAction(e){e.preventDefault();const t=O(e.touches,this.handler.container);return this.touchMovePointY=t[0][1],this.handler.mapState.userHasInteracted=!0,this.update(this.handler.mapState),this}processTouchEndAction(){return this.handler.modules.map.emit("interactionend",{target:"zoom/rotation"}),this.handler.mapState.userHasInteracted=!0,new Ra(this.handler)}}class Ra{constructor(e){this.handler=e}processAction(e){switch(e.type){case"mousedown":return this.processMouseDownAction(e);case"touchstart":return this.processTouchStartAction(e);default:return this}}processMouseDownAction(e){const t=D(this.handler.container,e.clientX,e.clientY);switch(e.button){case 0:if(e.ctrlKey||e.metaKey)return new Ma("keyPrimary",t,this.handler);if(this.handler.modules.layout.isActionWithCanvas(e)){ee("mousedown",this.handler.modules.identifier.searchSync(t),e,t,this.handler.modules)}return new Pa(t,this.handler);case 1:return new Ma("auxiliary",t,this.handler);case 2:return new Ma("secondary",t,this.handler);default:return this}}processTouchStartAction(e){if(e.preventDefault(),!e.touches)return this;if(this.handler.modules.layout.isActionWithCanvas(e)){const t=D(this.handler.container,e.changedTouches[0].clientX,e.changedTouches[0].clientY);ee("touchstart",this.handler.modules.identifier.searchSync(t),e,t,this.handler.modules)}return new Aa(e,this.handler,1===e.touches.length)}}class Da{processAction(){return this}}class Oa{constructor(e,t){this.preventDefault=e=>{e.preventDefault()},this.onMouseMove=e=>{this.dblClickTimer&&(this.dblClickTimer=void 0),this.switchState(e)},this.onTouchStart=e=>{this.modules.layout.isActionWithMap(e)&&this.switchState(e)},this.switchState=e=>{this.state;const t=this.state.processAction(e);this.state instanceof Da||(this.state=t)},this.state=new Ra(this),this.mapState=e,this.modules=t,this.container=t.layout.mapContainer,document.addEventListener("mouseup",this.switchState),document.addEventListener("keydown",this.switchState),document.addEventListener("keyup",this.switchState),document.addEventListener("mouseleave",this.switchState),document.addEventListener("mousemove",this.onMouseMove),this.container.addEventListener("click",this.switchState),this.container.addEventListener("mousedown",this.switchState),this.container.addEventListener("mouseout",this.switchState),document.addEventListener("touchstart",this.onTouchStart),document.addEventListener("touchend",this.switchState),document.addEventListener("touchmove",this.switchState),this.container.addEventListener("dragstart",this.preventDefault),this.container.addEventListener("drag",this.preventDefault),this.container.addEventListener("dragend",this.preventDefault),this.container.addEventListener("contextmenu",this.preventDefault),this.container.addEventListener("touchmove",this.preventDefault)}destroy(){document.removeEventListener("mouseup",this.switchState),document.removeEventListener("keydown",this.switchState),document.removeEventListener("keyup",this.switchState),document.removeEventListener("mouseleave",this.switchState),document.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("click",this.switchState),this.container.removeEventListener("mousedown",this.switchState),this.container.removeEventListener("mouseout",this.switchState),document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchend",this.switchState),document.removeEventListener("touchmove",this.switchState),this.container.removeEventListener("dragstart",this.preventDefault),this.container.removeEventListener("drag",this.preventDefault),this.container.removeEventListener("dragend",this.preventDefault),this.container.removeEventListener("contextmenu",this.preventDefault),this.container.removeEventListener("touchmove",this.preventDefault)}block(){if(this.state instanceof Da)return;const{map:e}=this.modules;switch(this.container.classList.remove("mapgl-dragging"),this.container.classList.remove("mapgl-rotating"),this.state.constructor){case Pa:case La:case Ca:e.emit("interactionend",{target:"center"});break;case Ma:case Ta:e.emit("interactionend",{target:"pitch/rotation"});break;case Fa:e.emit("interactionend",{target:"zoom/rotation"});break;case ka:case za:e.emit("interactionend",{target:"pitch/zoom/rotation"});break;case Aa:{const t=this.state.getStartedInteractionTarget();e.emit("interactionend",{target:t});break}}this.state=new Da}unblock(){this.state instanceof Ra||this.state instanceof Da&&(this.state=new Ra(this))}}var Ba=i(7184),ja=i(1558),Na=i(4304),Ua=i(6165),Za=i(4915),Ha=i(9430);class Ga{constructor(e,t){this.mapState=e,this.modules=t,this.enabled=!1,this.justEnabled=!1,this.isMetaLoading=!1,this.lastUpdateTime=-1/0,this.regionIds=new Set,this.id=(0,V.f)(),this.gridState=(0,Na.y7)("traffic",0,this.id,T.traffic.minZoom,T.traffic.maxZoom,T.traffic.minZoom,T.traffic.maxDetailLevel,t,e),this.viewportDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"demMode",type:"boolean"}])}show(){this.enabled||(this.enabled=!0,this.justEnabled=!0,this.modules.map.emit("trafficshow"))}hide(){this.enabled&&((0,Na.d1)(this.gridState),this.enabled=!1,this.modules.map.emit("traffichide"))}isEnabled(){return this.enabled}destroy(){(0,Na.d1)(this.gridState)}redraw(){this.enabled&&((0,Na.d1)(this.gridState),(0,Ba.o)(this.gridState,this.mapState))}activateStyleUpdating(){this.enabled&&(0,Ha.I2)(this.gridState,this.mapState.handyStyleId,this.modules.styleManager.getStyleRevision(this.mapState.handyStyleId))}finishStyleUpdating(){this.enabled&&(0,Ha.cA)(this.gridState)}update(){if(!this.enabled)return;if((0,P.TH)(this.regionIds,this.mapState.shownRegionIds)||(this.regionIds=new Set(this.mapState.shownRegionIds),this.fetchMeta()),Date.now()-this.lastUpdateTime>T.traffic.updateInterval&&this.fetchMeta(),void 0===this.timestamp)return;(this.viewportDiffer.check(this.mapState)||this.justEnabled)&&(this.justEnabled=!1,(0,Ba.o)(this.gridState,this.mapState),this.mapState.needRerender=!0);const e=Object.assign({},this.gridState.displayedMods);(0,ja.r)(this.gridState,this.mapState,this.modules),this.fetch((0,Na.w1)(this.gridState),this.timestamp),this.abortFetch((0,Na.lH)(this.gridState)),this.generate((0,Na.e)(this.gridState)),this.clearTiles((0,Na.HM)(this.gridState)),(0,Na.aq)(this.modules.tileManager,this.mapState,this.gridState,e)}viewportTilesReady(){return(0,Na.ej)(this.gridState.tiles,this.gridState.viewportTiles)}fetch(e,t){e.sort(((e,t)=>(0,ne.qu)(this.mapState.center,e,t))).forEach((e=>function(e,t,i,n,o){if(!n.size)return;t.workers.parser.fetchTrafficTile({coords:e.coords,tileServer:i.trafficServer,tileProtocol:i.trafficProtocol||i.tileProtocol,regionIds:Array.from(n),timestamp:o}).then((()=>{e.status===Ua.z3.Loading&&(e.serverMetadata=[{regionId:0,metatileHash:-2}])}))}(e,this.modules,this.mapState,this.regionIds,t)))}abortFetch(e){e.forEach((e=>this.modules.workers.parser.abortTrafficTileRequest(e.key)))}generate(e){e.sort(((e,t)=>(0,ne.qu)(this.mapState.center,e,t))).forEach((e=>{const t=(0,Ua._v)(e);t&&this.modules.workers.parser.generateTrafficTile({styleId:this.mapState.handyStyleId,coords:e.coords,pixelRatio:window.devicePixelRatio,styleState:this.mapState.styleState,sourceId:this.modules.defaultSource.getId()}).then((({results:e})=>(0,Za.aK)(t,e)))}))}clearTiles(e){for(const t of e)this.modules.workers.parser.deleteTrafficTile(t.key),delete this.gridState.tiles[t.key]}fetchMeta(){if(this.isMetaLoading||!this.regionIds.size)return;this.isMetaLoading=!0;const e=this.mapState,t=(0,H.XK)(T.traffic.timestampUrl,{host:e.trafficServer,protocol:e.trafficProtocol||e.tileProtocol,regions:Array.from(this.regionIds).join(",")});fetch(t).then((e=>{if(e.ok)return e.json();throw new Error(`Request traffic timestamp error with status ${e.status}`)})).then((e=>{var t,i;if(!e.length||void 0===(null===(t=e[0])||void 0===t?void 0:t.time)||void 0===(null===(i=e[0])||void 0===i?void 0:i.score))throw new Error(`Bad traffic timestamp and score response ${e}`);let n=0;e.forEach((e=>n+=e.score)),n=Math.round(n/e.length),this.modules.map.emit("trafficscore",{score:n}),this.timestamp=e[0].time,this.isMetaLoading=!1,this.lastUpdateTime=Date.now(),this.redraw()})).catch((e=>console.error(e)))}}class Wa{constructor(e){this.externalContainer=e,this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.style.height="100%",this.rootContainer.style.width="100%",this.rootContainer.style.overflow="hidden",this.externalContainer.appendChild(this.rootContainer),this.mapContainer=document.createElement("div"),this.mapContainer.style.position="relative",this.mapContainer.style.height="100%",this.mapContainer.style.width="100%",this.mapContainer.style.touchAction="none",this.mapContainer.style.webkitUserSelect="none",this.mapContainer.style.userSelect="none",this.rootContainer.appendChild(this.mapContainer),this.canvas=document.createElement("canvas"),this.mapContainer.appendChild(this.canvas),this.htmlContainerInMap=document.createElement("div"),this.htmlContainerInMap.style.position="absolute",this.htmlContainerInMap.style.left="0",this.htmlContainerInMap.style.top="0",this.htmlContainerInMap.style.width="100%",this.htmlContainerInMap.style.height="0",this.htmlContainerInMap.style.webkitUserSelect="auto",this.htmlContainerInMap.style.userSelect="auto",this.mapContainer.appendChild(this.htmlContainerInMap),this.htmlContainerOutMap=document.createElement("div"),this.htmlContainerOutMap.style.position="absolute",this.htmlContainerOutMap.style.left="0",this.htmlContainerOutMap.style.top="0",this.htmlContainerOutMap.style.width="100%",this.htmlContainerOutMap.style.height="0",this.mapContainer.after(this.htmlContainerOutMap)}setCanvasSize(e,t){const i=window.devicePixelRatio;return this.canvas.width=e*i,this.canvas.height=t*i,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this}destroy(){for(;this.externalContainer.lastChild;)this.externalContainer.removeChild(this.externalContainer.lastChild)}isActionWithCanvas(e){return e.target===this.canvas}isActionWithMap(e){if(e instanceof MouseEvent||e instanceof KeyboardEvent)return this.isTargetInMap(e.target);return Array.from(e.touches).map((e=>e.target)).some((e=>this.isTargetInMap(e)))}isTargetInMap(e){return!!(e&&e instanceof Node)&&this.mapContainer.contains(e)}}class Va{constructor(e,t){this.loadingCounter=0,this.isIdle=()=>0===this.loadingCounter,this.state=e,this.modules=t,this.textureKeys=[],this.texturesMap=new Map}addTexture(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.loadingCounter++;const i=yield Gs(e);return yield this.storeTexture(i,t)}))}addPreparedTexture(e){const t=`prepared-${(0,V.f)()}`;return this.textureKeys.push(t),this.texturesMap.set(t,e),this.textureKeys.length-1}updatePreparedTexture(e,t){this.deleteTexture(e),this.texturesMap.set(this.textureKeys[e],t)}loadTexture(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.loadingCounter++;const i=yield this.loadImage(e);if(i)return yield this.storeTexture(i,t);this.decreaseLoadingCounter()}))}getTexture(e){return this.texturesMap.get(this.textureKeys[e])}destroy(){this.textureKeys=[],this.texturesMap.clear()}deleteTexture(e){var t;const i=this.textureKeys[e];return null===(t=this.texturesMap.get(i))||void 0===t||t.remove(),this.texturesMap.delete(i)}decreaseLoadingCounter(){this.loadingCounter=Math.max(this.loadingCounter-1,0)}storeTexture(e,t){var i,n;return(0,M.mG)(this,void 0,void 0,(function*(){const o=null==t?void 0:t.size,s=null!==(i=null==t?void 0:t.pixelRatio)&&void 0!==i?i:window.devicePixelRatio,r=null!==(n=null==t?void 0:t.imagePadding)&&void 0!==n?n:1;this.decreaseLoadingCounter();const a=function(e,t){const i=void 0!==t?`_${t[0]},${t[1]}`:"";return`${e}${i}`}(e.getAttribute("src")||e.currentSrc,o),l=this.textureKeys.indexOf(a);if(l>-1&&this.texturesMap.has(a))return l;const c=this.modules.renderer.getRenderingContext(),d=(o||[e.width,e.height]).map((e=>e*s)),h=Ws(e,d),u=d.map((e=>e+2*r));if(!(null==t?void 0:t.skipAtlasSizeChecking)&&(u[0]>T.atlasSize[0]||u[1]>T.atlasSize[1]))throw new Error(`Image texture dimensions ${u} are larger than the maximum possible ${T.atlasSize}`);const m=new Bi(void 0,{size:u,flipY:!1,magFilter:Bi.LinearFilter,minFilter:Bi.LinearFilter}).prepare(c);return m.subImage(c,h,r,r),this.texturesMap.set(a,m),this.textureKeys.push(a),this.state.needRerender=!0,this.textureKeys.length-1}))}loadImage(e){return(0,M.mG)(this,void 0,void 0,(function*(){return new Promise((t=>{const i=new Image;i.crossOrigin="Anonymous",i.src=e,i.onload=()=>t(i),i.onerror=()=>t(void 0)}))}))}}var qa=i(9102),Xa=i(7202);class $a{constructor(e){this.isLoading=!1,this.getKeyInfo=()=>(0,M.mG)(this,void 0,void 0,(function*(){return yield this.request})),this.isIdle=()=>!this.isLoading;const{tileKey:t}=e;if(t===T.tiles.tileKey||Xa.X)this.request=Promise.resolve({showCommPoi:!1,showSberLogo:!1});else{const e=(0,H.IG)(qa.ns,{keyID:t});this.isLoading=!0,this.request=fetch(e).then((e=>{if(e.ok)return e.json()}),(()=>{console.error("Could not load tile key info. A style layers with commercial POI will be added to applied styles.")})).then((e=>{if(this.isLoading=!1,!e||!e.result||200!==e.meta.code)return{showCommPoi:true,showSberLogo:false};const{showCommPoi:t,showSberLogo:i}=e.result.service.properties.public;return{showCommPoi:null==t||t,showSberLogo:null!=i&&i}}))}}}class Ya{constructor(){this.sources=[]}addSource(e){this.sources.push(e)}removeSource(e){this.sources=this.sources.filter((t=>t.getId()!==e))}getSourceById(e){return this.sources.find((t=>t.getId()===e))}}var Ka=i(2298);class Ja{constructor(e,t){this.state=e,this.modules=t,this.type="default",this.id=(0,Ut.Q)(),this.zenithSource=new Ys.nt(this.id,this.modules,{tileServer:e.tileServer,tileSet:e.tileSet,tileProtocol:e.tileProtocol,tileKey:e.tileKey,subdomains:e.subdomains,appId:e.appId,defaultLang:e.tileServerDefaultLang,sessionId:e.sessionId}),this.universeTileLayer=new Zt.I(0,T.tiles.maxUniverseZoom,0,T.tiles.maxUniverseZoom,this.modules,e,this.zenithSource),this.universeTileLayer.getLabelingData=()=>{const e=Zt.I.prototype.getLabelingData.call(this.universeTileLayer);return this.regionalTileLayer.isBlank()||(e.labelsKeys=[]),e},this.modules.tileManager.addTileLayer(this.universeTileLayer),this.regionalTileLayer=new Zt.I(T.tiles.maxUniverseZoom+1,T.tiles.maxRegionalZoom,T.tiles.maxUniverseZoom+1,T.tiles.maxDetailLevel,this.modules,e,this.zenithSource),this.modules.tileManager.addTileLayer(this.regionalTileLayer),this.commercialPoiSource=new Ka.n(this.id,this.modules,{url:`${e.tileProtocol}://${e.tileServer}/v2/ald?ts=${e.commercialTileSet}&x={x}&y={y}&z={z}&lang=${e.lang}`,flipY:!0,identifyAsDefaultSource:!0}),this.commercialPoiTileLayer=new Zt.I(T.commercialPoi.minZoom,T.commercialPoi.maxZoom,T.commercialPoi.minZoom,Pn.rR,this.modules,e,this.commercialPoiSource),this.modules.tileManager.addTileLayer(this.commercialPoiTileLayer),this.modules.sourceStorage.addSource(this)}destroy(){var e,t;this.modules.tileManager.removeTileLayer(this.universeTileLayer),this.universeTileLayer.destroy(),this.modules.tileManager.removeTileLayer(this.regionalTileLayer),this.regionalTileLayer.destroy(),this.zenithSource.destroy(),this.commercialPoiTileLayer&&(this.modules.tileManager.removeTileLayer(this.commercialPoiTileLayer),this.commercialPoiTileLayer.destroy()),null===(e=this.commercialPoiSource)||void 0===e||e.destroy(),this.hillshadeTileLayer&&(this.modules.tileManager.removeTileLayer(this.hillshadeTileLayer),this.hillshadeTileLayer.destroy()),null===(t=this.hillshadeTileLayer)||void 0===t||t.destroy(),this.modules.sourceStorage.removeSource(this.id)}setAttributes(e){var t,i,n,o;this.zenithSource.setAttributes(e),this.universeTileLayer.redraw(),this.regionalTileLayer.redraw(),null===(t=this.hillshadeSource)||void 0===t||t.setAttributes(e),null===(i=this.hillshadeTileLayer)||void 0===i||i.redraw(),null===(n=this.commercialPoiSource)||void 0===n||n.setAttributes(e),null===(o=this.commercialPoiTileLayer)||void 0===o||o.redraw()}getAttributes(){return this.zenithSource.getAttributes()}getId(){return this.id}setHoverId(e){this.regionalTileLayer.setHoverId(e)}resetHoverId(){this.regionalTileLayer.resetHoverId()}enableHillshade(e){var t,i,n;const o={url:null!==(t=e.url)&&void 0!==t?t:`${this.state.tileProtocol}://${this.state.tileServer}/v2/ald?ts=hillshade&x={x}&y={y}&z={z}`,minZoom:null!==(i=e.minZoom)&&void 0!==i?i:T.hillshade.minZoom,maxZoom:null!==(n=e.maxZoom)&&void 0!==n?n:T.hillshade.maxZoom};this.hillshadeSource=new Ka.n(this.id,this.modules,{url:o.url,hillshadeEncoded:!0,attributes:{sourceName:"External_GeoJSON"}}),this.hillshadeTileLayer=new Zt.I(o.minZoom,o.maxZoom,o.minZoom,Pn.rR,this.modules,this.state,this.hillshadeSource),this.modules.tileManager.addTileLayer(this.hillshadeTileLayer)}setFeatureStateMap(e){this.zenithSource.setFeatureStateMap(e),this.universeTileLayer.onFeatureStateMapChange(),this.regionalTileLayer.onFeatureStateMapChange(),this.modules.modelLayer.onFeatureStateMapChange()}disableHillshade(){this.hillshadeTileLayer&&(this.modules.tileManager.removeTileLayer(this.hillshadeTileLayer),this.hillshadeTileLayer.destroy()),this.hillshadeSource&&this.hillshadeSource.destroy()}}const Qa={dead:!0,alive:!0,unused:!0,commercialDead:!1,commercialAlive:!1};class el{constructor(e,t){this.mapState=e,this.modules=t,this.options={},this.viewportDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}]),this.sizeDiffer=new qe([{path:"size",type:"vec2"}])}update(){this.isEnabled()&&(this.sizeDiffer.check(this.mapState)&&this.updateSize(),this.viewportDiffer.check(this.mapState)&&this.clear())}isEnabled(){return!!this.canvas}show(e=Qa){this.options=e;Object.values(e).every((e=>!1===e))?this.hide():(this.createCanvas(),this.mapState.needLabeling=!0)}hide(){this.canvas&&(this.modules.layout.mapContainer.removeChild(this.canvas),this.ctx=void 0,this.canvas=void 0)}drawLabels(e){if(!this.canvas||!this.ctx)return;const t=this.ctx,i=this.options,n={[pr.m3.Dead]:"#ff0000",[pr.m3.Alive]:"#30763c",[pr.m3.Unused]:"#aaa",[pr.m3.CommercialAlive]:"#3a9f22",[pr.m3.CommercialDead]:"#ff0000"},o=new Int32Array(e),s={[pr.m3.Dead]:[],[pr.m3.Alive]:[],[pr.m3.Unused]:[],[pr.m3.CommercialAlive]:[],[pr.m3.CommercialDead]:[]};for(let e=0;e<o.length;e+=5){const t=o[e+4];s[t].push({x:o[e],y:o[e+1],width:o[e+2],height:o[e+3]})}this.clear();const r=window.devicePixelRatio,a=e=>{t.strokeStyle=n[e],s[e].forEach((e=>t.strokeRect(e.x*r+.5,e.y*r+.5,e.width*r,e.height*r)))};t.setLineDash([]),i.unused&&a(pr.m3.Unused),i.dead&&a(pr.m3.Dead),i.alive&&a(pr.m3.Alive),t.setLineDash([6]),i.commercialDead&&a(pr.m3.CommercialDead),i.commercialAlive&&a(pr.m3.CommercialAlive)}clear(){if(this.canvas&&this.ctx){const{clientWidth:e,clientHeight:t}=this.canvas;this.ctx.clearRect(0,0,e*window.devicePixelRatio,t*window.devicePixelRatio)}}createCanvas(){this.canvas||(this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.canvas.style.pointerEvents="none",this.modules.layout.mapContainer.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d")||void 0,this.updateSize())}updateSize(){if(!this.canvas)return;const{clientWidth:e,clientHeight:t}=this.modules.layout.rootContainer;this.canvas.width=e*window.devicePixelRatio,this.canvas.height=t*window.devicePixelRatio,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px"}}class tl{constructor(e,t,i){this.map=i,this.camera=new E.V(e),this.layout=new Wa(t),this.collector=new st.P("main"),this.workers=new kr,this.styleManager=new ar(this),this.assetManager=new cr(e,this),this.imageManager=new Va(e,this),this.floorManager=new qr(e,this),this.personalPoiManager=new _r(e,this),this.buildingHeightAnimator=new ot(e,this),this.renderer=new js(e,this),this.layers=new Or(e),this.sourceStorage=new Ya,this.tileManager=new Xr(e,this),this.modelLayer=new mr(e,this),this.dynamicStyle=new oe.hX,this.imageCache=new Ur(this),this.identifier=new Us(e,this),this.labeler=new Yr(e,this),this.ruler=new Sa(e,this),this.trafficTileLayer=new Ga(e,this),this.handler=new Oa(e,this),this.mouseMoveHandler=new it(this),this.tileKeyInfo=new $a(e),this.demManager=new ln(this),this.defaultSource=new Ja(e,this),this.labelsDebug=new el(e,this)}destroy(){this.demManager.disable(),this.imageManager.destroy(),this.trafficTileLayer.destroy(),this.tileManager.destroy(),this.workers.destroy(),this.renderer.destroy(),this.handler.destroy(),this.mouseMoveHandler.destroy(),this.ruler.destroy(),this.labelsDebug.hide(),this.layout.destroy()}}class il{constructor(e,t={},i){var n;this.isStyleUpdateInProgress=!1,this.renderLoop=()=>{this.requestedFrame=requestAnimationFrame(this.renderLoop),this.modules.map.emit("framestart");const e=this.state;e.time=Date.now(),e.collectStats&&(e.stats.drawCount=0,e.stats.vertexCount=0,e.stats.tileCount=0);const t=e.metrics;if(Number.isNaN(t.interactive+t.firstlabeling+t.ready)||e.metricsSent||(this.modules.map.emit("metrics",e.metrics),e.metricsSent=!0),this.modules.mouseMoveHandler.update(),this.handlers.forEach((e=>e.update())),Ce(e),be(e),Me(e),Ee(e),this.stillnessUpdater.update(e),pe(e,this.modules.layout.rootContainer),((e,t,i)=>{ce.Vx("viewport",{step:(e,n)=>{e.viewport={top:n[0],right:n[1],bottom:n[2],left:n[3]},de(e,t,i)}},e)})(e,this.modules.layout.rootContainer,this.modules.renderer),((e,t)=>{ce.Vx("padding",{step:(e,i)=>{e.padding={top:i[0],right:i[1],bottom:i[2],left:i[3]},ue(e,t)}},e)})(e,this.modules.renderer),this.modules.buildingHeightAnimator.update(),e.demMode=this.modules.demManager.isEnabled(),this.updateElevation(),this.modules.camera.update(),this.updateTilesBounds(),this.modules.demManager.update(),this.modules.labelsDebug.update(),this.modules.trafficTileLayer.update(),this.modules.layers.getLayers().forEach((e=>{void 0!==e.update&&e.update()})),this.modules.tileManager.update(),this.modules.floorManager.update(),this.modules.modelLayer.update(),this.modules.personalPoiManager.update(),this.modules.ruler.update(),this.modules.dynamicStyle.update(),this.modules.map.emit("update"),this.modules.labeler.update(),this.performanceChecker.update(),this.modules.identifier.update(),T.render.alwaysRerender||e.needRerender){const t=this.modules.tileManager.getTileObjects();Number.isNaN(e.metrics.firstdraw)&&(e.metrics.firstdraw=performance.now()-e.metrics.start),this.modules.renderer.renderTileObjects(t),e.needRerender=!1,e.collectStats&&this.modules.map.emit("stats",e.stats)}this.finishStyleUpdatingCheck(),this.modules.map.update(),e.shouldIsReadyWaitForUpdates=!1,this.modules.map.emit("frameend")},this.onWindowUnload=()=>{const e=this.performanceChecker.getEarlyFps();void 0!==e&&He({eventAction:"FPS",eventLabel:"Early",eventValue:e})};const o=Object.assign(Object.assign({},il.options),t),s=Object.assign(Object.assign({},il.options.padding),o.padding),r=Object.assign(Object.assign({},il.options.viewport),o.viewport),a=o.maxBounds?z.X3(o.maxBounds):L.Vv,l=(0,L.yq)(o.center);z.Rk(l,a,l);const c=this.state={time:Date.now(),center:l,zoom:void 0!==o.styleZoom?(0,L.Z3)(o.styleZoom,l):o.zoom,styleZoom:void 0!==o.styleZoom?o.styleZoom:(0,L.X$)(o.zoom,l),zoomTypePreserving:void 0!==o.styleZoom?"styleZoom":"zoom",minZoom:o.minZoom,maxZoom:o.maxZoom,maxBounds:a,rotation:(0,P.Id)(o.rotation),touchRotationThreshold:(0,P.Id)(o.touchRotationThreshold),pitch:(0,P.Id)(o.pitch),minPitch:(0,P.Id)(o.minPitch),maxPitch:(0,P.Id)(o.maxPitch),size:[Math.max(1,e.clientWidth-r.left-r.right),Math.max(1,e.clientHeight-r.top-r.bottom)],selectedIds:[],tickers:{},stillness:1,needRerender:!0,needLabeling:!1,userHasInteracted:!1,viewport:r,padding:s,labelingOpacity:0,tileServer:o.tileServer,tileSet:o.tileSet,tileProtocol:o.tileProtocol,commercialTileSet:o.commercialTileSet,subdomains:o.subdomains.split(""),floorsEnabled:o.floorsEnabled,floorsUrl:o.floorsUrl,collectStats:o.collectStats,stats:{tileCount:0,dynamicTileCount:0,drawCount:0,vertexCount:0},trafficServer:o.trafficServer,trafficProtocol:o.trafficProtocol,identifyPickDistance:T.identify.pickDistance,lang:o.lang,tileServerDefaultLang:o.tileServerDefaultLang,tileKey:o.key,appId:o.appId,disableHoverStyles:o.disableHoverStyles,keepCenterWhileUserZoomRotate:!!o.keepCenterWhileUserZoomRotate,disableRotationByUserInteraction:!!o.disableRotationByUserInteraction,disablePitchByUserInteraction:!!o.disablePitchByUserInteraction,disableDragging:!!o.disableDragging,performanceCaveatEmitted:!1,sessionId:o.sessionId,shownRegionIds:new Set,preserveDrawingBuffer:!!o.preserveDrawingBuffer,defaultBackgroundColor:o.defaultBackgroundColor,handyStyleId:NaN,styleState:Wr(o.styleState),disableIconCache:o.disableIconCache,rtlPluginScenario:null!==(n=o.useRtlTextPlugin)&&void 0!==n?n:"depends-on-language",mobileSdkMode:o.mobileSdkMode,demMode:!1,tilesBounds:[[0,0],[0,0],[0,0],[0,0]],demTilesBounds:[[0,0],[0,0],[0,0],[0,0]],elevation:void 0,minElevation:void 0,metrics:{start:performance.now(),init:NaN,firstdraw:NaN,firstlabeling:NaN,firstcontent:NaN,interactive:NaN,ready:NaN},metricsSent:!1,shouldIsReadyWaitForUpdates:!1};var d,h,u,m,f,p;this.modules=new tl(c,e,i),this.modules.styleManager.setDynamicStyle(this.modules.dynamicStyle.getStyle()),this.handlers=[new $e(c,this.modules.layout.mapContainer),new Ye(this.modules)],o.disableZoomOnScroll||this.handlers.push(new Ve(c,this.modules.layout.mapContainer)),je&&Ne&&this.handlers.push(new Ke(c,e,i)),this.performanceChecker=new Je(c),this.stillnessUpdater=new tt,this.requestedFrame=requestAnimationFrame(this.renderLoop),o.sendAnalytics&&(d=window,h=document,u="script",m="ga",d.GoogleAnalyticsObject=m,d.ga=d.ga||function(){(d.ga.q=d.ga.q||[]).push(arguments)},d.ga.l=Date.now(),f=h.createElement(u),p=h.getElementsByTagName(u)[0],f.async=1,f.src="https://www.google-analytics.com/analytics.js",p.parentNode.insertBefore(f,p),window.ga&&(window.ga("create",T.analytics.gaCode,{storage:"none",name:T.analytics.gaName,sampleRate:80}),window.ga(`${T.analytics.gaName}.set`,"anonymizeIp",!0),window.ga(`${T.analytics.gaName}.send`,"pageview")),window.addEventListener("unload",this.onWindowUnload))}destroy(){cancelAnimationFrame(this.requestedFrame),this.modules.destroy(),this.handlers.forEach((e=>e.destroy())),window.removeEventListener("unload",this.onWindowUnload)}isIdle(){return!this.state.needRerender&&this.modules.tileManager.isIdle()&&this.modules.assetManager.isIdle()&&this.modules.trafficTileLayer.viewportTilesReady()&&this.modules.floorManager.activeFloorLoadingOrReady()&&this.modules.layers.entranceAnimationFinished()&&this.modules.modelLayer.isIdle()&&!this.modules.buildingHeightAnimator.isAnimating()&&this.modules.labeler.isIdle()}isReady(){return this.isIdle()&&this.modules.floorManager.floorsReady()&&this.modules.identifier.isIdle()&&this.modules.imageManager.isIdle()&&this.modules.imageCache.isIdle()&&this.modules.personalPoiManager.isIdle()&&this.modules.tileKeyInfo.isIdle()&&!this.state.shouldIsReadyWaitForUpdates}redrawMap(){this.modules.tileManager.redraw(),this.modules.trafficTileLayer.redraw(),this.modules.modelLayer.redraw(),this.modules.floorManager.resetCache(),this.modules.personalPoiManager.redraw()}activateStyleUpdating(){this.modules.tileManager.activateStyleUpdating(),this.modules.floorManager.activateStyleUpdating(),this.modules.modelLayer.activateStyleUpdating(),this.modules.trafficTileLayer.activateStyleUpdating(),this.isStyleUpdateInProgress=!0}finishStyleUpdatingCheck(){if(this.isStyleUpdateInProgress&&this.modules.tileManager.viewportTilesReady()&&this.modules.trafficTileLayer.viewportTilesReady()&&this.modules.floorManager.activeFloorLoadingOrReady()&&this.modules.modelLayer.viewportModelsReady()){this.modules.tileManager.finishStyleUpdating(),this.modules.floorManager.finishStyleUpdating(),this.modules.trafficTileLayer.finishStyleUpdating(),this.modules.modelLayer.finishStyleUpdating(),this.modules.personalPoiManager.redraw();const e=this.modules.styleManager.getStyle(this.state.handyStyleId);e&&this.modules.renderer.setClearColor(e.background.color),this.isStyleUpdateInProgress=!1,this.state.needRerender=!0,this.state.needLabeling=!0}}updateTilesBounds(){const{size:e,zoom:t}=this.state,[i,n,o,s]=this.modules.camera.getViewportVertices(),r=(0,Ki.hS)(i,n);let a=(0,Ki.Oy)(o,r);const l=(0,L.h0)(e[1],t)*T.camera.viewportLimitRatio;if(a>l){const e=l/a;k.t7(o,n,o,e),k.t7(s,i,s,e),a=l}if(this.state.tilesBounds[0]=i.slice(),this.state.tilesBounds[1]=n.slice(),this.state.tilesBounds[2]=o.slice(),this.state.tilesBounds[3]=s.slice(),this.state.demMode){const e=(0,Ki.iE)(this.modules.camera.position,r);if(e<0){const t=(a+Math.abs(e))/a;k.t7(i,s,i,t),k.t7(n,o,n,t)}if(this.state.elevation){const e=this.modules.camera.position[2],t=this.state.minElevation?this.state.minElevation:this.state.elevation,r=Math.max(this.state.elevation-t,0)*L.k3/e+1,a=(r-1)*Math.max(1-this.state.pitch/this.state.maxPitch,.1)+1,l=Math.max(this.state.pitch/this.state.maxPitch*30,4);k.t7(i,this.modules.camera.position,i,Math.min(a,l)),k.t7(n,this.modules.camera.position,n,Math.min(a,l)),k.t7(s,this.modules.camera.position,s,Math.min(r,l)),k.t7(o,this.modules.camera.position,o,Math.min(r,l))}}this.state.demTilesBounds[0]=i,this.state.demTilesBounds[1]=n,this.state.demTilesBounds[2]=o,this.state.demTilesBounds[3]=s}updateElevation(){if(!this.modules.demManager.isEnabled())return void(void 0!==this.state.elevation&&(this.state.needRerender=!0,this.state.elevation=void 0));const e=this.modules.demManager.getElevation(this.state.center);if(void 0!==e&&this.state.elevation!==e)if(void 0===this.state.elevation)this.state.elevation=e;else{const t=this.modules.demManager.centerCorrectionFactor*(e-this.state.elevation);Math.abs(t)<.3?this.state.elevation=e:this.state.elevation+=t}const t=this.modules.demManager.getMinElevation();void 0!==t&&(this.state.minElevation=t)}}il.options={center:[0,0],zoom:0,minZoom:T.MAP_DEFAULTS.minZoom,maxZoom:T.MAP_DEFAULTS.maxZoom,rotation:0,touchRotationThreshold:10,pitch:0,minPitch:0,maxPitch:45,viewport:{top:0,right:0,bottom:0,left:0},padding:{top:0,right:0,bottom:0,left:0},tileServer:T.tiles.server,tileSet:T.tiles.tileSet,tileProtocol:T.tiles.protocol,commercialTileSet:T.commercialPoi.tileSet,key:T.tiles.tileKey,subdomains:T.tiles.subdomains,floorsEnabled:T.floors.enabled,floorsUrl:T.floors.url,trafficProtocol:T.traffic.protocol,trafficServer:T.traffic.host,collectStats:!1,style:"",styleState:Object.assign({},Gr),styleOptions:{rootUrl:"",iconsPath:"",fontsPath:"",stylePath:""},sendAnalytics:!0,lang:T.defaultLang,appId:T.tiles.appId,disableHoverStyles:!1,disableZoomOnScroll:!1,disableDragging:!1,disableRotationByUserInteraction:!1,disablePitchByUserInteraction:!1,defaultBackgroundColor:"#f6f2de",disableIconCache:!1,mobileSdkMode:!1};var nl=i(3379),ol=i.n(nl),sl=i(7795),rl=i.n(sl),al=i(569),ll=i.n(al),cl=i(3565),dl=i.n(cl),hl=i(9216),ul=i.n(hl),ml=i(4589),fl=i.n(ml),pl=i(4335),_l={};_l.styleTagTransform=fl(),_l.setAttributes=dl(),_l.insert=ll().bind(null,"head"),_l.domAPI=rl(),_l.insertStyleElement=ul();ol()(pl.Z,_l);pl.Z&&pl.Z.locals&&pl.Z.locals;var vl=i(9110),gl=i(3951);const yl=["zoom","rotation","pitch","center"],bl="eb10e2c3-3c28-4b81-b74b-859c9c4cf47e";class wl extends W.c{constructor(e,t){var i;super();const n=this.core=new il(e,t,this);this.state=n.state,this.modules=n.modules,this.performanceChecker=n.performanceChecker,this.values={isMoveChanging:!1,isIdle:!1},yl.forEach((e=>{this.cloneFromStateToValues(e,`${e}1`),this.cloneFromStateToValues(e,`${e}2`),this.cloneFromStateToValues(e,`${e}End1`),this.cloneFromStateToValues(e,`${e}End2`),this.values[`${e}EndTime`]=0,this.values[`is${e}Changing`]=!1})),this.cloneFromStateToValues("size","size"),this.performanceChecker.on("performancecaveat",(()=>{this.emit("performancecaveat"),He({eventAction:"FPS",eventLabel:"performancecaveat"})})),this.performanceChecker.on("fps",(e=>He({eventAction:"FPS",eventLabel:"Average",eventValue:e})));this.setStyle(null!==(i=null==t?void 0:t.style)&&void 0!==i?i:bl,null==t?void 0:t.styleOptions).catch((e=>{if(e instanceof Error)throw e})),(0,gl.w7)(this.state.rtlPluginScenario,this.modules,this.state.lang),(null==t?void 0:t.hillshade)&&this.modules.defaultSource.enableHillshade(t.hillshade),this.state.metrics.init=performance.now()-this.state.metrics.start}setCenter(e,t){if(!(0,L.Iy)(e))return this;this.state.userHasInteracted=!1;const i=(0,L.yq)(e);return ge(this.state,i,t),this}setZoom(e,t){return(0,P.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.zoomTypePreserving="zoom",this.state.userHasInteracted=!1,ze(this.state,e,t),this.state.shouldIsReadyWaitForUpdates=!0,this):this}setStyleZoom(e,t){if(!(0,P.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER))return this;const i=(0,L.Z3)(e,this.state.center);return this.state.zoomTypePreserving="styleZoom",this.state.userHasInteracted=!1,ze(this.state,i,t),this}setMinZoom(e,t){return this.state.minZoom=e,this.setZoom(this.state.zoom,t),this}setMaxZoom(e,t){return this.state.maxZoom=e,this.setZoom(this.state.zoom,t),this}setRotation(e,t){return(0,P.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.userHasInteracted=!1,Ie(this.state,(0,P.Id)(e),t),this):this}setPitch(e,t){return(0,P.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.userHasInteracted=!1,Pe(this.state,(0,P.Id)(e),t),this):this}setMinPitch(e,t){return this.state.minPitch=(0,P.Id)(e),this.setPitch((0,P.ZY)(this.state.pitch),t),this}setMaxPitch(e,t){return this.state.maxPitch=(0,P.Id)(e),this.setPitch((0,P.ZY)(this.state.pitch),t),this}setViewport(e,t){return this.state.userHasInteracted=!1,((e,t,i,n,o={})=>{const s=Object.assign({top:0,right:0,bottom:0,left:0},n);if(!1===o.animate||0===o.duration)e.viewport=s,de(e,t,i);else{const t=e.viewport,i=void 0!==o.easing?o.easing:"easeOutCubic",n=void 0!==o.duration?o.duration:300;ce.BL("viewport",{easing:i},e,[t.top,t.right,t.bottom,t.left],[s.top,s.right,s.bottom,s.left],n)}})(this.state,this.modules.layout.rootContainer,this.modules.renderer,e,t),this}setMaxBounds(e){return this.state.maxBounds=(0,z.X3)(e),this}setPadding(e,t){var i,n,o,s;const r={top:null!==(i=e.top)&&void 0!==i?i:0,left:null!==(n=e.left)&&void 0!==n?n:0,right:null!==(o=e.right)&&void 0!==o?o:0,bottom:null!==(s=e.bottom)&&void 0!==s?s:0};return this.state.userHasInteracted=!1,((e,t,i,n={})=>{const o=he(i,e.size);if(!1===n.animate||0===n.duration)e.padding=o,ue(e,t);else{const t=e.padding,i=void 0!==n.easing?n.easing:"easeOutCubic",s=void 0!==n.duration?n.duration:300;ce.BL("padding",{easing:i},e,[t.top,t.right,t.bottom,t.left],[o.top,o.right,o.bottom,o.left],s)}})(this.state,this.modules.renderer,r,t),this}getPadding(){return this.state.padding}getCenter(){return(0,L.PA)(this.state.center)}getZoom(){return this.state.zoom}getStyleZoom(){return this.state.styleZoom}getMinZoom(){return this.state.minZoom}getMaxZoom(){return this.state.maxZoom}getRotation(){return(0,P.ZY)(this.state.rotation)}getPitch(){return(0,P.ZY)(this.state.pitch)}getViewport(){return this.state.viewport}getSize(){return[this.state.size[0],this.state.size[1]]}getBounds(){this.modules.camera.update();const e=(0,Gi.BS)(this.modules.camera.getViewportVertices());return{southWest:(0,L.PA)(e.min),northEast:(0,L.PA)(e.max)}}getDefaultSource(){return this.modules.defaultSource}getWebGLContext(){return this.modules.renderer.getRenderingContext()}getCanvas(){return this.modules.layout.canvas}enableRuler(){this.modules.ruler.enable()}setRulerPoints(e){this.modules.ruler.enabled||this.modules.ruler.enable(),this.modules.ruler.setPoints(e)}disableRuler(){this.modules.ruler.disable()}showTraffic(){this.modules.trafficTileLayer.show()}hideTraffic(){this.modules.trafficTileLayer.hide()}setPersonalPoi(e){this.modules.personalPoiManager.setPersonalPoi(e)}setSelectedIds(e=[]){return this.state.selectedIds=e.map(Y.IL).filter((e=>!Number.isNaN(e.lo)&&!Number.isNaN(e.hi))).sort(((e,t)=>e.hi-t.hi||e.lo-t.lo)),this.modules.tileManager.setSelectedIds(),this.modules.identifier.debouncedFillCache(),this}project(e){return this.modules.camera.project((0,L.yq)(e))}unproject(e){return(0,L.PA)(this.modules.camera.unproject(e))}getCameraProjectionMatrix(){return this.modules.camera.projectionMatrix}getCameraViewMatrix(){return this.modules.camera.viewMatrix}getCameraViewProjectionMatrix(){return this.modules.camera.viewProjectionMatrix}invalidateSize(){this.state.userHasInteracted=!1;const e=window.devicePixelRatio,{viewport:t}=this.state,{clientWidth:i,clientHeight:n}=this.modules.layout.rootContainer;return this.state.size=[Math.max(1,i-t.left-t.right),Math.max(1,n-t.top-t.bottom)],this.modules.renderer.setPixelRatio(e),this.modules.renderer.setSize(i,n),this.state.needRerender=!0,this}destroy(){this.core.destroy()}refresh(){return this.state.needRerender=!0,this.state.needLabeling=!0,this.modules.identifier.resetCache(),this}changeFloorNumber(e,t){return this.modules.floorManager.changeFloorNumber(e,t),this.state.shouldIsReadyWaitForUpdates=!0,this}addLayer(e,t){return this.modules.styleManager.addLayer(e,t),this.core.activateStyleUpdating(),this}removeLayer(e){return this.modules.styleManager.removeLayer(e),this.core.activateStyleUpdating(),this}setStyle(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){let i;return"string"==typeof e?i=(0,vl.aU)(e)?yield this.setCustomStyleById(e,t):yield this.setCustomStyleFromUrl(e,t):(yield this.setCustomStyleDirectly(e,t),i=e),this.emit("styleload",{style:i}),i}))}addIcon(e,t){if(!e)return console.error("The icon name is empty."),this;return this.modules.styleManager.addIcon(e,t)&&this.core.activateStyleUpdating(),this}removeIcon(e){if(!e)return this;return this.modules.styleManager.removeIcon(e)&&this.core.activateStyleUpdating(),this}useOldStyles(e){return this.setCustomStyleById(bl,e),this}waitForGpuToFinishDrawing(){return this.modules.renderer.getPixels(),this}setLang(e){this.state.lang=e,(0,gl.w7)(this.state.rtlPluginScenario,this.modules,e),this.modules.tileManager.redraw()}showLabelsDebug(e){this.modules.labelsDebug.show(e)}hideLabelsDebug(){this.modules.labelsDebug.hide()}getContainer(){return this.modules.layout.mapContainer}getExternalContainer(){return this.modules.layout.externalContainer}fitBounds({northEast:e,southWest:t},i){const n=Object.assign({top:0,left:0,right:0,bottom:0},(null==i?void 0:i.padding)?i.padding:{}),o=this.getViewport(),s=this.getPadding(),r=(null==i?void 0:i.skipMapPadding)?n:(l=n,{top:(a=s).top+l.top,bottom:a.bottom+l.bottom,left:a.left+l.left,right:a.right+l.right});var a,l;const c=this.getSize(),d=(null==i?void 0:i.considerRotation)?this.getRotation():0;if(c[0]-r.left-r.right<=0||c[1]-r.top-r.bottom<=0)return console.warn("Map cannot fit within canvas with the given bounds and padding."),this;(null==i?void 0:i.considerRotation)||Ie(this.state,d,{animate:!1});const h=C([[t[0],e[1]],e,[e[0],t[1]],t],d,[c[0]-r.left-r.right,c[1]-r.top-r.bottom]);if(!h)return console.warn("Map cannot fit within canvas with the given bounds and padding."),this;const u=[(c[0]-r.left-r.right)/2+r.left+o.left,(c[1]-r.top-r.bottom)/2+r.top+o.top],m=new E.V({rotation:this.state.rotation,size:this.state.size,padding:this.state.padding,viewport:this.state.viewport,zoom:(0,P.uZ)(h.zoom,this.state.minZoom,this.state.maxZoom),pitch:0,center:h.center}).unproject(u),f=[0,0];X.lu(f,h.center,m);const p=[0,0,0];return X.IH(p,h.center,f),ge(this.state,p,null==i?void 0:i.animation),ze(this.state,h.zoom,null==i?void 0:i.animation),Pe(this.state,0,null==i?void 0:i.animation),this}update(){const e=this.state,{time:t,userHasInteracted:i}=e,n=this.values,o={};yl.forEach((i=>{let s=e[i];"zoom"===i&&"styleZoom"===e.zoomTypePreserving&&(s=e.styleZoom),o[`${i}start`]=!n[`is${i}Changing`]&&!this.areEqual(s,n[`${i}1`])&&this.areEqual(n[`${i}1`],n[`${i}2`]),o[`${i}start`]&&(n[`is${i}Changing`]=!0),n[`is${i}Changing`]&&(o[i]=!this.areEqual(s,n[`${i}1`]),t-n[`${i}EndTime`]>150&&(o[`${i}end`]=this.areEqual(s,n[`${i}End1`])&&!this.areEqual(n[`${i}End1`],n[`${i}End2`]),o[`${i}end`]&&(n[`is${i}Changing`]=!1),this.copyFromValuesToValues(`${i}End2`,`${i}End1`),this.copyFromStateToValues(s,`${i}End1`),n[`${i}EndTime`]=t)),this.copyFromValuesToValues(`${i}2`,`${i}1`),this.copyFromStateToValues(s,`${i}1`)})),o.resize=!this.areEqual(e.size,n.size),this.copyFromStateToValues(e.size,"size"),o.movestart=(o.zoomstart||o.rotationstart||o.centerstart||o.pitchstart)&&!n.isMoveChanging,o.movestart&&(n.isMoveChanging=!0),o.move=n.iszoomChanging||n.isrotationChanging||n.iscenterChanging||n.ispitchChanging,o.moveend=(o.zoomend||o.rotationend||o.centerend||o.pitchend)&&!o.move,o.moveend&&(n.isMoveChanging=!1);const s=n.isIdle,r=n.isReady;n.isIdle=this.isIdle(),n.isReady=this.isReady(),o.idle=!s&&n.isIdle,o.ready=!r&&n.isReady,Number.isNaN(e.metrics.ready)&&o.ready&&(e.metrics.ready=performance.now()-e.metrics.start);for(const e in o){const t=e;o[t]&&this.emit(t,{isUser:i})}}isIdle(){return!this.values.isMoveChanging&&!this.currentPendingStyle&&this.core.isIdle()}isReady(){return!this.values.isMoveChanging&&!this.currentPendingStyle&&this.core.isReady()}setAutoHoverMode(e){this.modules.defaultSource.resetHoverId(),this.state.disableHoverStyles=!e}setStyleState(e){this.state.styleState=Wr(e),this.state.needRerender=!0}patchStyleState(e){var t,i;this.state.styleState=(t=this.state.styleState,i=e,Object.assign(Object.assign(Object.assign({},t),i),{_activeFloorIds:t._activeFloorIds,_activeFloorBuildingIds:t._activeFloorBuildingIds})),this.state.needRerender=!0}setOption(e,t){if("disableDragging"===e)this.state[e]=t;else console.error(`The change of ${e} option is not supported.`)}setCustomStyleById(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.currentPendingStyle=e;const i=(0,P.kn)(t||{},{rootUrl:T.styles.url,stylePath:T.styles.path,iconsPathForMap:T.icons.defaultUrl,iconsPath:T.icons.legacyIconsUrl,fontsPath:T.fonts.defaultUrl,iconNameTemplate:"{name}"}),n=yield this.fetchStyleById(Qs(i),e,bl);if(this.currentPendingStyle!==e)return Promise.reject(`Cancel setting the style «${e}», there is a newer style was set`);if(!n)throw this.currentPendingStyle=void 0,new Error(`There is no correct style with id «${e}»`);const{style:o,loadedId:s}=n;return i.iconsPath=function(e,t){return e.replace("{id}",t)}(T.icons.legacyIconsUrl,s),i.iconsPathForMap=T.icons.defaultUrl,yield this.setCustomStyle(o,i),e}))}setCustomStyleFromUrl(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.currentPendingStyle=e;const i=(0,P.kn)(t||{},{rootUrl:e,iconsPath:"",iconsPathForMap:"",fontsPath:"",stylePath:"style.json",iconNameTemplate:"{name}.svg"}),n=yield function(e){return fetch(e).then((e=>{if(e.ok)return e.json()}))}(Qs(i));if(e!==this.currentPendingStyle)return Promise.reject(`Cancel setting the style «${e}», there is a newer style was set`);if(!n)throw this.currentPendingStyle=void 0,new Error(`There are no correct styles by url «${e}»`);return yield this.setCustomStyle(n,i),e}))}setCustomStyleDirectly(e,t){const i=window.location.host,n=(0,P.kn)(t||{},{rootUrl:`//${i}`,stylePath:"",iconsPathForMap:"",iconsPath:"",fontsPath:"",iconNameTemplate:"{name}.svg"});return this.setCustomStyle(e,n)}setCustomStyle(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){if(this.currentPendingStyle=void 0,!e)throw new Error("Can't set empty style");e.dem||this.modules.demManager.disable();const{showCommPoi:i}=yield this.modules.tileKeyInfo.getKeyInfo(),n=this.modules.styleManager.createStyle(e,t,i);this.state.handyStyleId=n.id,e.dem&&this.modules.demManager.enable(),this.core.activateStyleUpdating()}))}copyFromStateToValues(e,t){xl(e)?X.JG(this.values[t],e):this.values[t]=e}cloneFromStateToValues(e,t){const i=this.state[e];xl(i)?this.values[t]=X.d9(i):this.values[t]=i}copyFromValuesToValues(e,t){const i=this.values[t];xl(i)?X.JG(this.values[e],i):this.values[e]=i}areEqual(e,t){return xl(e)&&xl(t)?X.I6(e,t):e===t}fetchStyleById(e,t,i){return(0,M.mG)(this,void 0,void 0,(function*(){const n=new URL((0,H.XK)(e,{id:t}));n.searchParams.append("key",this.state.tileKey);const o=yield fetch(n.toString());if(404===o.status&&i&&Number.isNaN(this.state.handyStyleId))return console.warn(`No access to style with id «${t}». Fallback to default style «${i}».`),this.fetchStyleById(e,i);if(!o.ok)return;const s=yield o.json();return s&&s.result?{loadedId:t,style:s.result}:void 0}))}}function xl(e){return void 0!==e.length}var Il=i(5881),Sl=i(1993);class Ml extends q{constructor(e,t){var i,n,o,s,r,a,l,c,d,h;super(e),this.length=1,this.removed=!1,this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i,this.geoPoints=this.options.coordinates.filter(((e,t,i)=>0===t||!k.I6(i[t],i[t-1]))),this.points=this.geoPoints.map(L.yq);let u=0;this.distances=[],this.distances.push(u);for(let e=1;e<this.geoPoints.length;e++)u+=(0,L.vn)(this.geoPoints[e-1],this.geoPoints[e]),this.distances.push(u);t.showAnimation&&!1!==t.showAnimation.animate&&this.points.length>1&&(this.animationTickerName=`polyline-${this.uniqId}`,this.startShowTicker(this.animationTickerName)),this.stateDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}]),this.debouncedGenerate=(0,et.D)((()=>{this.generate()}),200),this.tileAttrs=(0,oe.FJ)({id:this.isInteractive?(0,Y.Ru)(0,0):NaN,beginningIsCut:0,endingIsCut:0});const{dynamicStyle:m,layers:f}=this.modules;if(0!==this.options.width){this.rawStyleLayer={type:"line",id:`dynamic-polyline-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(n=this.options.color)&&void 0!==n?n:"#3388ff",width:null!==(o=this.options.width)&&void 0!==o?o:3}};const e=(0,se.qw)(this.rawStyleLayer);e&&(this.styleLayerId=e.innerId,m.addLayer(e,null!==(s=this.options.zIndex)&&void 0!==s?s:0))}if(this.options.width2){this.rawStyleLayer2={type:"line",id:`dynamic-polyline2-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(r=this.options.color2)&&void 0!==r?r:"#00000000",width:null!==(a=this.options.width2)&&void 0!==a?a:0}};const e=(0,se.qw)(this.rawStyleLayer2);e&&(this.styleLayer2Id=e.innerId,m.addLayer(e,null!==(l=this.options.zIndex2)&&void 0!==l?l:-1))}if(this.options.width3){this.rawStyleLayer3={type:"line",id:`dynamic-polyline3-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(c=this.options.color3)&&void 0!==c?c:"#00000000",width:null!==(d=this.options.width3)&&void 0!==d?d:0}};const e=(0,se.qw)(this.rawStyleLayer3);e&&(this.styleLayer3Id=e.innerId,m.addLayer(e,null!==(h=this.options.zIndex3)&&void 0!==h?h:-2))}void 0===this.styleLayerId&&void 0===this.styleLayer2Id&&void 0===this.styleLayer3Id||(f.addLayer(this),this.generate())}update(){this.removed||(this.stateDiffer.check(this.mapState)&&this.debouncedGenerate(),this.animationTickerName&&this.updateShowTicker(this.animationTickerName))}snapPoint(e){const t=this.points.map((e=>this.modules.camera.project(e)));let i=1/0,n=t[0],o=0;for(let s=0;s<t.length-1;s++){const r=t[s],a=t[s+1],l=(0,Ki.Z4)(e,r,a),c=l[0]-e[0],d=l[1]-e[1],h=c*c+d*d;h<i&&(i=h,n=l,o=s)}const s=(0,L.PA)(this.modules.camera.unproject(n));return{point:s,distance:this.distances[o]+(0,L.vn)(s,this.geoPoints[o])}}setStyle(e){this.setSubLayerStyle(this.styleLayerId,this.rawStyleLayer,e.color),this.setSubLayerStyle(this.styleLayer2Id,this.rawStyleLayer2,e.color2),this.setSubLayerStyle(this.styleLayer3Id,this.rawStyleLayer3,e.color3)}remove(){this.removed||(this.removed=!0,this.animationTickerName&&ce.sT(this.animationTickerName,this.mapState),this.isInteractive&&this.modules.identifier.resetCache(),void 0!==this.styleLayerId&&this.modules.dynamicStyle.removeLayer(this.styleLayerId),void 0!==this.styleLayer2Id&&this.modules.dynamicStyle.removeLayer(this.styleLayer2Id),void 0!==this.styleLayer3Id&&this.modules.dynamicStyle.removeLayer(this.styleLayer3Id),super.destroy())}startShowTicker(e){var t,i,n;const o=void 0!==(null===(t=this.options.showAnimation)||void 0===t?void 0:t.easing)?this.options.showAnimation.easing:"linear",s=void 0!==(null===(i=this.options.showAnimation)||void 0===i?void 0:i.duration)?this.options.showAnimation.duration:250;ce.BL(e,{easing:o,animationGroup:null===(n=this.options.showAnimation)||void 0===n?void 0:n.animationGroup},this.mapState,0,1,s),this.length=0}setSubLayerStyle(e,t,i){if(void 0!==e&&i&&t&&i!==t.style.color){const{dynamicStyle:n}=this.modules;t.style.color=i;const o=(0,se.qw)(t);o&&(n.updateLayerStyle(e,o),this.mapState.needRerender=!0)}}updateShowTicker(e){ce.Vx(e,{step:(e,t)=>{var i,n,o,s;const r=(0,P.sB)((null===(n=null===(i=this.options.showAnimation)||void 0===i?void 0:i.durationRange)||void 0===n?void 0:n.start)||0,(null===(s=null===(o=this.options.showAnimation)||void 0===o?void 0:o.durationRange)||void 0===s?void 0:s.end)||1,t);r!==this.length&&(this.length=r,this.generate())}},this.mapState)}generate(){if(this.points.length<2||this.removed)return;const{dynamicStyle:e,collector:t,renderer:i,tileManager:n,identifier:o,map:s}=this.modules,{tileProps:r}=G.nF,a=Math.min(Math.floor(s.getZoom()),12),l=(0,ne.aq)(a),c=(0,Ki.z_)(this.points,this.distances,this.length),d=(0,Ki.Jh)(c,l),h=k.Ue(),u=z.Ue();this.tileObjects.forEach((e=>{e.clean(this.mapState),n.removeObject(e)})),this.tileObjects=[];for(let o=0;o<d.length;o++){const s=d[o];z.mc(u);for(let e=0;e<s.length;e++)z.aM(u,s[e]);z.be(h,u);const l=(0,ne.z6)(h,a);if(!(0,ne.Ny)(l,this.mapState.tilesBounds))continue;if(this.options.displayTileBounds){const o=e.getStyle().layers.find((e=>"debug-tile-bounds"===e.id));(0,Ns.cX)(t,o);const s=t.getAccumulatedData(),r=new $.W("dynamicObject",s.data,i,l);this.tileObjects.push(r),n.addObject(r)}const c=(0,ne.Bs)(l),m=[[],[]];for(let e=0;e<s.length;e++)(0,ne.a2)(h,s[e],c),m[0][e]=h[0],m[1][e]=h[1];if(this.tileAttrs[r.beginningIsCut]=0,this.tileAttrs[r.endingIsCut]=0,0!==o&&(this.tileAttrs[r.beginningIsCut]=1),o+1!==d.length&&(this.tileAttrs[r.endingIsCut]=1),void 0!==this.styleLayerId){const i=e.getStyle().layersById[this.styleLayerId];(0,Il.ot)(i)&&(0,ie.XI)({collector:t,generator:Sl.z.generate,args:[e.getStyle().id,i,G.Dz,this.tileAttrs,G.wz,G.i4,m]})}if(void 0!==this.styleLayer2Id){const i=e.getStyle().layersById[this.styleLayer2Id];(0,Il.ot)(i)&&(0,ie.XI)({collector:t,generator:Sl.z.generate,args:[e.getStyle().id,i,G.Dz,this.tileAttrs,G.wz,G.i4,m]})}if(void 0!==this.styleLayer3Id){const i=e.getStyle().layersById[this.styleLayer3Id];(0,Il.ot)(i)&&(0,ie.XI)({collector:t,generator:Sl.z.generate,args:[e.getStyle().id,i,G.Dz,this.tileAttrs,G.wz,G.i4,m]})}const f=t.getAccumulatedData(),p=new $.W("dynamicObject",f.data,i,c.coords);n.addObject(p),this.tileObjects.push(p),this.isInteractive&&this.identifyIds.push(f.identifyIds)}this.isInteractive&&o.resetCache(),t.reset(),this.mapState.needRerender=!0}}var Tl=i(5180);class Pl extends q{constructor(e,t){var i,n,o,s,r,a;if(super(e),this.length=1,this.removed=!1,this.options=t,this.interactive=null===(i=t.interactive)||void 0===i||i,this.points=this.options.coordinates.map(L.yq),this.distances=[],t.showAnimation&&!1!==t.showAnimation.animate&&this.points.length>1){let e=0;this.distances.push(e);for(let t=1;t<this.options.coordinates.length;t++)e+=(0,L.vn)(this.options.coordinates[t-1],this.options.coordinates[t]),this.distances.push(e);this.animationTickerName=`dashedLine-${this.uniqId}`,this.startShowTicker(this.animationTickerName)}this.stateDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"},{path:"demMode",type:"boolean"}]),this.debouncedGenerate=(0,et.D)((()=>{this.generate()}),200),this.tileAttrs=(0,oe.FJ)({previousPointX:0,previousPointY:0,nextPointX:0,nextPointY:0,beginningIsCut:0,endingIsCut:0,componentDistanceStart:0,objectLength:0,id:this.interactive?(0,Y.Ru)(0,0):NaN});const{layers:l}=this.modules;l.addLayer(this),this.dashLayerRaw={type:"dashedLine",id:`dynamic-dashed-polyline-dash-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.dashColor||"#2480ff",dashLength:null!==(n=this.options.dashLength)&&void 0!==n?n:6,gapColor:this.options.gapColor||"#ffffff00",gapLength:null!==(o=this.options.gapLength)&&void 0!==o?o:20,width:null!==(s=this.options.width)&&void 0!==s?s:8}},this.baseLayerRaw={type:"line",id:`dynamic-dashed-polyline-base-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.dash2Color||"#ffffff",width:null!==(a=null===(r=this.options)||void 0===r?void 0:r.width2)&&void 0!==a?a:12}},this.dashLayer=(0,se.qw)(this.dashLayerRaw),this.baseLayer=(0,se.qw)(this.baseLayerRaw),this.generate()}update(){this.removed||(this.stateDiffer.check(this.mapState)&&this.debouncedGenerate(),this.animationTickerName&&this.updateShowTicker(this.animationTickerName))}setStyle(e){const{dashColor:t,dash2Color:i,gapColor:n}=e,{dynamicStyle:o}=this.modules;if(this.dashLayer){void 0!==t&&(this.dashLayerRaw.style.color=t),void 0!==n&&(this.dashLayerRaw.style.gapColor=n);const e=(0,se.qw)(this.dashLayerRaw);e&&o.updateLayerStyle(this.dashLayer.innerId,e)}if(this.baseLayer){void 0!==i&&(this.baseLayerRaw.style.color=i);const e=(0,se.qw)(this.baseLayerRaw);e&&o.updateLayerStyle(this.baseLayer.innerId,e)}this.mapState.needRerender=!0}remove(){this.removed||(this.removed=!0,this.animationTickerName&&ce.sT(this.animationTickerName,this.mapState),this.interactive&&this.modules.identifier.resetCache(),this.baseLayer&&this.modules.dynamicStyle.removeLayer(this.baseLayer.innerId),this.dashLayer&&this.modules.dynamicStyle.removeLayer(this.dashLayer.innerId),super.destroy())}updateShowTicker(e){ce.Vx(e,{step:(e,t)=>{var i,n,o,s;const r=(0,P.sB)((null===(n=null===(i=this.options.showAnimation)||void 0===i?void 0:i.durationRange)||void 0===n?void 0:n.start)||0,(null===(s=null===(o=this.options.showAnimation)||void 0===o?void 0:o.durationRange)||void 0===s?void 0:s.end)||1,t);r!==this.length&&(this.length=r,this.generate())}},this.mapState)}startShowTicker(e){var t,i,n;const o=void 0!==(null===(t=this.options.showAnimation)||void 0===t?void 0:t.easing)?this.options.showAnimation.easing:"linear",s=void 0!==(null===(i=this.options.showAnimation)||void 0===i?void 0:i.duration)?this.options.showAnimation.duration:250;ce.BL(e,{easing:o,animationGroup:null===(n=this.options.showAnimation)||void 0===n?void 0:n.animationGroup},this.mapState,0,1,s),this.length=0}generate(){if(this.points.length<2||this.removed)return;const{dynamicStyle:e,collector:t,renderer:i,tileManager:n,map:o,identifier:s}=this.modules,{tileProps:r}=G.nF,a=Math.min(Math.floor(o.getZoom()),12),l=(0,ne.aq)(a),c=(0,Ki.z_)(this.points,this.distances,this.length),d=(0,Ki.Jh)(c,l),h=k.Ue(),u=z.Ue();this.tileObjects.forEach((e=>{e.clean(this.mapState),n.removeObject(e)})),this.tileObjects=[];const m=[];let f=0;for(const e of d){z.mc(u);for(let t=0;t<e.length;t++)z.aM(u,e[t]);z.be(h,u);const t=(0,ne.z6)(h,a),i=(0,ne.Bs)(t),n=[[],[]];let o=0;for(let t=0;t<e.length;t++)if((0,ne.a2)(h,e[t],i),n[0][t]=h[0],n[1][t]=h[1],0!==t){const e=n[0][t]-n[0][t-1],i=n[1][t]-n[1][t-1];o+=Math.sqrt(e*e+i*i)}f+=o,m.push({vertices:n,tileInfo:i,distance:o})}let p=0;m.forEach(((o,s)=>{var a,l;const{tileInfo:c,distance:u,vertices:_}=o;if(this.tileAttrs[r.beginningIsCut]=0,this.tileAttrs[r.endingIsCut]=0,this.tileAttrs[r.previousPointX]=0,this.tileAttrs[r.previousPointY]=0,this.tileAttrs[r.nextPointX]=0,this.tileAttrs[r.nextPointY]=0,this.tileAttrs[r.componentDistanceStart]=p,p+=u,this.tileAttrs[r.objectLength]=f,0!==s){const e=d[s-1],t=e[e.length-2];(0,ne.a2)(h,t,c),this.tileAttrs[r.beginningIsCut]=1,this.tileAttrs[r.previousPointX]=h[0],this.tileAttrs[r.previousPointY]=h[1]}if(s!==m.length-1){const e=d[s+1][1];(0,ne.a2)(h,e,c),this.tileAttrs[r.endingIsCut]=1,this.tileAttrs[r.nextPointX]=h[0],this.tileAttrs[r.nextPointY]=h[1]}if(!(0,ne.Ny)(c.coords,this.mapState.tilesBounds))return;this.dashLayer&&(e.addLayer(this.dashLayer,null!==(a=this.options.zIndex)&&void 0!==a?a:0),(0,ie.XI)({collector:t,generator:Tl.L.generate,args:[e.getStyle().id,this.dashLayer,G.Dz,this.tileAttrs,G.wz,G.i4,_]})),this.baseLayer&&(e.addLayer(this.baseLayer,null!==(l=this.options.zIndex2)&&void 0!==l?l:-1),(0,ie.XI)({collector:t,generator:Sl.z.generate,args:[e.getStyle().id,this.baseLayer,G.Dz,this.tileAttrs,G.wz,G.i4,_]}));const v=t.getAccumulatedData(),g=new $.W("dynamicObject",v.data,i,c.coords);n.addObject(g),this.tileObjects.push(g),this.interactive&&this.identifyIds.push(v.identifyIds)})),this.interactive&&s.resetCache(),t.reset(),this.mapState.needRerender=!0}}var Ll=i(7084),El=i(752);class kl extends q{constructor(e,t){var i;super(e),this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i;const n=this.options.coordinates.map((e=>{const t=e.map(L.yq);if(t.length>1){const e=t[0],i=t[t.length-1];e[0]===i[0]&&e[1]===i[1]||t.push(e)}return t}));let o=[];const s=[],{dynamicStyle:r,collector:a,renderer:l,tileManager:c,identifier:d,layers:h}=this.modules;n.forEach((e=>{o.length&&s.push(o.length),o=o.concat(e)}));const u=(0,se.qw)({type:"polygon",id:`dynamic-polygon-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.color||"#3388ff33"}});if(!u)return;r.addLayer(u,this.options.zIndex),this.fillLayerId=u.innerId;const m=(0,oe.FJ)({id:this.isInteractive?(0,Y.Ru)(0,0):NaN}),f=z.Ue();for(let e=0;e<o.length;e++)z.aM(f,o[e]);const p=(0,ne.x7)(f),_=(0,ne.Bs)(p),v=[];for(let e=0;e<o.length;e++)v.push(o[e][0]),v.push(o[e][1]);const g=Ll(v,s),y=k.Ue(),b=[[],[],[]];for(let e=0;e<g.length;e+=3){for(let t=0;t<3;t++)(0,ne.a2)(y,o[g[e+t]],_),b[0][t]=y[0],b[1][t]=y[1],b[2][t]=0;(0,ie.XI)({collector:a,generator:El.a.generate,args:[r.getStyle().id,u,G.Dz,m,G.wz,G.i4,b]})}if(0!==this.options.strokeWidth){const e=(0,se.qw)({type:"line",id:`dynamic-polygon-stroke-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.strokeColor||"#3388ff",width:this.options.strokeWidth||3}});if(e){r.addLayer(e,this.options.zIndex),this.borderLayerId=e.innerId;const t=(0,oe.FJ)({id:this.isInteractive?(0,Y.Ru)(0,0):NaN,beginningIsCut:0,endingIsCut:0});n.forEach((i=>{const n=[[],[],[]];i.forEach(((e,t)=>{(0,ne.a2)(y,e,_),n[0][t]=y[0],n[1][t]=y[1]})),(0,ie.XI)({collector:a,generator:Sl.z.generate,args:[r.getStyle().id,e,G.Dz,t,G.wz,G.i4,n]})}))}}const w=a.getAccumulatedData(),x=new $.W("dynamicObject",w.data,l,_.coords);c.addObject(x),this.tileObjects.push(x),this.isInteractive&&this.identifyIds.push(w.identifyIds),h.addLayer(this),a.reset(),this.mapState.needRerender=!0,this.isInteractive&&d.resetCache()}remove(){this.isInteractive&&this.modules.identifier.resetCache(),this.fillLayerId&&this.modules.dynamicStyle.removeLayer(this.fillLayerId),this.borderLayerId&&this.modules.dynamicStyle.removeLayer(this.borderLayerId),super.destroy()}}class zl extends q{constructor(e,t){var i,n,o,s,r;if(super(e),this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i,t.segments&&t.segments<=0)return;const{dynamicStyle:a,collector:l,renderer:c,tileManager:d,identifier:h,layers:u}=this.modules,m=function(e,t,i){const n=[];if(i>0){n.push(k.al(e[0]+t,e[1],e[2]));const o=Math.PI/Math.ceil(i/2);for(let i=o;i<Math.PI;i+=o){const o=t*Math.cos(i),s=t*Math.sin(i);n.push(k.al(e[0]+o,e[1]+s,e[2]),k.al(e[0]+o,e[1]-s,e[2]))}n.push(k.al(e[0]-t,e[1],e[2]))}return n}((0,L.yq)(this.options.coordinates),(0,L.a4)(this.options.coordinates,this.options.radius),null!==(n=this.options.segments)&&void 0!==n?n:150),f=(0,se.qw)({type:"polygon",id:`dynamic-circle-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(o=this.options.color)&&void 0!==o?o:"#3388ff33",strokeWidth:null!==(s=this.options.borderWidth)&&void 0!==s?s:1,strokeColor:null!==(r=this.options.borderColor)&&void 0!==r?r:"#3388ff"}});if(!f)return;a.addLayer(f,this.options.zIndex),this.layerId=f.innerId;const p=(0,oe.FJ)({id:this.isInteractive?(0,Y.Ru)(0,0):NaN}),_=z.Ue();for(let e=0;e<m.length;e++)z.aM(_,m[e]);const v=(0,ne.x7)(_),g=(0,ne.Bs)(v),y=[[],[],[]],b=k.Ue(),w=0!==this.options.borderWidth?1:0;for(let e=0;e<m.length;e++)(0,ne.a2)(b,m[e],g),y[0][e]=b[0],y[1][e]=b[1],y[2][e]=w;(0,ie.XI)({collector:l,generator:El.a.generate,args:[a.getStyle().id,f,G.Dz,p,G.wz,G.i4,y]});const x=l.getAccumulatedData(),I=new $.W("dynamicObject",x.data,c,g.coords);d.addObject(I),this.tileObjects.push(I),this.isInteractive&&this.identifyIds.push(x.identifyIds),u.addLayer(this),l.reset(),this.mapState.needRerender=!0,this.isInteractive&&h.resetCache()}remove(){this.isInteractive&&this.modules.identifier.resetCache(),this.layerId&&this.modules.dynamicStyle.removeLayer(this.layerId),super.destroy()}}function Al(e,t,i,n,o,s){if(o-n<=i)return;const r=n+o>>1;Cl(e,t,r,n,o,s%2),Al(e,t,i,n,r-1,s+1),Al(e,t,i,r+1,o,s+1)}function Cl(e,t,i,n,o,s){for(;o>n;){if(o-n>600){const r=o-n+1,a=i-n+1,l=Math.log(r),c=.5*Math.exp(2*l/3),d=.5*Math.sqrt(l*c*(r-c)/r)*(a-r/2<0?-1:1);Cl(e,t,i,Math.max(n,Math.floor(i-a*c/r+d)),Math.min(o,Math.floor(i+(r-a)*c/r+d)),s)}const r=t[2*i+s];let a=n,l=o;for(Fl(e,t,n,i),t[2*o+s]>r&&Fl(e,t,n,o);a<l;){for(Fl(e,t,a,l),a++,l--;t[2*a+s]<r;)a++;for(;t[2*l+s]>r;)l--}t[2*n+s]===r?Fl(e,t,n,l):(l++,Fl(e,t,l,o)),l<=i&&(n=l+1),i<=l&&(o=l-1)}}function Fl(e,t,i,n){Rl(e,i,n),Rl(t,2*i,2*n),Rl(t,2*i+1,2*n+1)}function Rl(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Dl(e,t,i,n){const o=e-i,s=t-n;return o*o+s*s}const Ol=e=>e[0],Bl=e=>e[1];class jl{constructor(e,t=Ol,i=Bl,n=64,o=Float64Array){this.nodeSize=n,this.points=e;const s=e.length<65536?Uint16Array:Uint32Array,r=this.ids=new s(e.length),a=this.coords=new o(2*e.length);for(let n=0;n<e.length;n++)r[n]=n,a[2*n]=t(e[n]),a[2*n+1]=i(e[n]);Al(r,a,n,0,r.length-1,0)}range(e,t,i,n){return function(e,t,i,n,o,s,r){const a=[0,e.length-1,0],l=[];let c,d;for(;a.length;){const h=a.pop(),u=a.pop(),m=a.pop();if(u-m<=r){for(let r=m;r<=u;r++)c=t[2*r],d=t[2*r+1],c>=i&&c<=o&&d>=n&&d<=s&&l.push(e[r]);continue}const f=Math.floor((m+u)/2);c=t[2*f],d=t[2*f+1],c>=i&&c<=o&&d>=n&&d<=s&&l.push(e[f]);const p=(h+1)%2;(0===h?i<=c:n<=d)&&(a.push(m),a.push(f-1),a.push(p)),(0===h?o>=c:s>=d)&&(a.push(f+1),a.push(u),a.push(p))}return l}(this.ids,this.coords,e,t,i,n,this.nodeSize)}within(e,t,i){return function(e,t,i,n,o,s){const r=[0,e.length-1,0],a=[],l=o*o;for(;r.length;){const c=r.pop(),d=r.pop(),h=r.pop();if(d-h<=s){for(let o=h;o<=d;o++)Dl(t[2*o],t[2*o+1],i,n)<=l&&a.push(e[o]);continue}const u=Math.floor((h+d)/2),m=t[2*u],f=t[2*u+1];Dl(m,f,i,n)<=l&&a.push(e[u]);const p=(c+1)%2;(0===c?i-o<=m:n-o<=f)&&(r.push(h),r.push(u-1),r.push(p)),(0===c?i+o>=m:n+o>=f)&&(r.push(u+1),r.push(d),r.push(p))}return a}(this.ids,this.coords,e,t,i,this.nodeSize)}}function Nl(e){const t=new Error("The palette is not valid. The heatmap won't be rendered."),i=Object.getOwnPropertyNames(e);if(0===i.length)throw t;const n=i.map((e=>Number(e)));if(n.some((e=>Number.isNaN(e)||e<0||e>1)))throw t;const o={};n.forEach((i=>{if("string"!=typeof e[i])throw t;o[i]=(0,ds.MV)(e[i])}));const s=Math.min(...n),r=Math.max(...n);return s>0&&(o[0]=o[s]),r<1&&(o[1]=o[r]),o}function Ul(e,t){const i=Object.keys(e).map((e=>Number(e))).sort(((e,t)=>e-t));let n=0;const o=[],s=t-1;for(let r=0;r<t;r++){const t=r/s;t>i[n+1]&&n++;const a=i[n],l=i[n+1],c=(t-a)/(l-a);for(let t=0;t<4;t++)o[4*r+t]=Zl(e[a].value[t],e[l].value[t],c)}return o.map((e=>Math.round(e)))}function Zl(e,t,i){return e*(1-i)+t*i}const Hl={0:"rgba(89, 0, 89, 0)",.25:"rgba(0, 0, 89, 0.78)",.5:"rgba(0, 198, 68, 1)",.7:"rgba(198, 186, 0, 1)",.8:"rgba(249, 152, 0, 1)",1:"rgba(200, 0, 0, 1)"};class Gl extends q{constructor(e,t={}){super(e),this.fillBuffers=()=>{if(!this.tree)return;const e=(0,Gi.BS)(this.mapState.tilesBounds),t=(0,ne.x7)(e);if(this.tileCoords&&(i=t,n=this.tileCoords,i.every(((e,t)=>e===n[t]))))return;var i,n;this.resetBuffers(),this.tileCoords=t;const o=(0,ne.aq)(t[2]),s=(0,ne.Oy)(t);rt.wA(this.matrix,s,k.al(o,o,pt._9));const r=this.tree.range(s[0],s[1],s[0]+o,s[1]+o).map((e=>this.points[e])),a=(0,ne.Bs)(t);this.buffers=function(e,t){const i=[],n=[],o=[],s=k.Ue();return e.forEach((({mapCoords:e,weight:r})=>{(0,ne.a2)(s,e,t);const a=s[0],l=s[1];for(let e=0;e<6;e++)i.push(a,l),o.push(r);n.push(-1,-1,1,-1,-1,1,-1,1,1,-1,1,1)})),{vertices:new Ht.Z(new Uint16Array(i),{itemSize:2,dataType:Ht.Z.UnsignedShort,stride:0,offset:0,normalized:!0}),widens:new Ht.Z(new Int8Array(n),{itemSize:2,dataType:Ht.Z.Byte,stride:0,offset:0,normalized:!1}),weights:new Ht.Z(new Float32Array(o),{itemSize:1,dataType:Ht.Z.Float,stride:0,offset:0,normalized:!1})}}(r,a),this.vertexCount=6*r.length,this.vao=new Wt(this.offscreenProgram,{a_vec2_position:this.buffers.vertices,a_vec2_widen:this.buffers.widens,a_float_weight:this.buffers.weights})},this.resizeFrameBuffer=()=>{this.frameBuffer.setSize([Math.ceil(this.mapState.size[0]*window.devicePixelRatio/this.downscale),Math.ceil(this.mapState.size[1]*window.devicePixelRatio/this.downscale)]),this.frameBuffer.bind(this.gl),this.frameBuffer.unbind(this.gl),this.modules.imageManager.updatePreparedTexture(this.offscreenTextureIndex,this.frameBuffer.getTexture()),this.needRerender=!0,this.mapState.needRerender=!0};const{downscale:i,palette:n,points:o,minZoom:s,maxZoom:r,zIndex:a,pointRadius:l,intensity:c,opacity:d}=t;this.rampTextureIndex=this.modules.imageManager.addPreparedTexture(function(e,t){const i=Ul(Nl(e),t);return new ht(new Uint8Array(i),{size:[t,1]})}(null!=n?n:Hl,256)),this.gl=this.modules.renderer.getRenderingContext(),this.downscale=null!=i?i:1,this.frameBuffer=new mt({size:[Math.ceil(this.mapState.size[0]*window.devicePixelRatio/this.downscale),Math.ceil(this.mapState.size[1]*window.devicePixelRatio/this.downscale)],magFilter:ht.LinearFilter,minFilter:ht.LinearFilter,wrapS:ht.ClampToEdgeWrapping,wrapT:ht.ClampToEdgeWrapping}),this.offscreenTextureIndex=this.modules.imageManager.addPreparedTexture(this.frameBuffer.getTexture()),this.offscreenProgram=new Ko({vertex:as("heatmap"),fragment:ls("heatmap"),uniforms:[{name:"u_mat4_mvp",type:"mat4"},{name:"u_float_radius",type:"1f"},{name:"u_float_intensity",type:"1f"},{name:"u_float_tile_to_pixel_ratio",type:"1f"}],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_widen",location:1},{name:"a_float_weight",location:2}]}),this.points=[],this.vertexCount=0,this.isDestroyed=!1,this.needRerender=!1,this.matrix=rt.Ue(),this.mvpMatrix=rt.Ue(),this.viewDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"}]),this.sizeDiffer=new qe([{path:"size",type:"vec2"}]),this.throttledFillBuffer=Ge(this.fillBuffers,50);const h=(0,se.qw)({type:"heatmap",id:`dynamic-heatmap-${this.uniqId}`,minzoom:s,maxzoom:r,style:{opacity:null!=d?d:.5,intensity:null!=c?c:3,radius:null!=l?l:10}});if(!h)throw new Error("There is no correct style layer for heatmap");this.layer=h,this.modules.dynamicStyle.addLayer(h,a),o&&this.setPoints(o)}setPoints(e){if(!this.isDestroyed){if(this.points=e.map((({coordinates:e,weight:t})=>({mapCoords:(0,L.yq)(e),weight:null!=t?t:1}))),this.tree=new jl(this.points,(e=>e.mapCoords[0]),(e=>e.mapCoords[1])),this.tileCoords=void 0,!this.tileObjects.length){const{layers:e,collector:t,dynamicStyle:i,renderer:n,tileManager:o}=this.modules;(0,ie.XI)({collector:t,generator:Xt.B.generateTexture,args:[i.getStyle().id,this.layer,this.offscreenTextureIndex,this.rampTextureIndex]});const s=t.getAccumulatedData(),r=new $.W("dynamicObject",s.data,n);o.addObject(r),this.tileObjects.push(r),e.addLayer(this),t.reset()}this.mapState.needRerender=!0,this.needRerender=!0}}update(){if(this.sizeDiffer.check(this.mapState)&&this.resizeFrameBuffer(),!this.needRerender&&!this.viewDiffer.check(this.mapState))return;if(!this.tree)return;const{zoom:e,styleZoom:t,styleState:i}=this.mapState,n=this.gl;if(this.throttledFillBuffer(),!(this.vao&&this.buffers&&this.tree&&this.tileCoords))return;const o=(0,ae.jJ)(t,i,[]),s=(0,ae.vn)(this.layer.style.radius,o),r=(0,ae.vn)(this.layer.style.intensity,o),a=pt.y4*Math.pow(2,e-this.tileCoords[2])*window.devicePixelRatio;this.offscreenProgram.enable(n),this.offscreenProgram.bind(n,{u_mat4_mvp:rt.dC(this.mvpMatrix,this.modules.camera.viewProjectionMatrix,this.matrix),u_float_radius:s*window.devicePixelRatio,u_float_intensity:r,u_float_tile_to_pixel_ratio:1/a}),this.vao.bind({gl:n,extensions:this.modules.renderer.webGlExtensions}),this.gl.viewport(0,0,Math.ceil(this.mapState.size[0]*window.devicePixelRatio/this.downscale),Math.ceil(this.mapState.size[1]*window.devicePixelRatio/this.downscale)),this.frameBuffer.bind(n),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.blendFunc(n.ONE,n.ONE),n.enable(n.BLEND),n.drawArrays(n.TRIANGLES,0,this.vertexCount),this.frameBuffer.unbind(n),this.needRerender=!1}destroy(){if(this.isDestroyed)return;super.destroy(),this.points=[],this.tree=void 0,this.isDestroyed=!0,this.resetBuffers(),this.layer&&this.modules.dynamicStyle.removeLayer(this.layer.innerId),this.frameBuffer.remove(this.gl);const{imageManager:e}=this.modules;e.deleteTexture(this.offscreenTextureIndex),e.deleteTexture(this.rampTextureIndex)}resetBuffers(){this.buffers&&(Object.values(this.buffers).forEach((e=>e.remove())),this.buffers=void 0),this.vao&&(this.vao.remove(),this.vao=void 0)}}var Wl=i(2158);class Vl extends q{constructor(e,t){super(e),this.options=t,this.isHidden=!1,this.isInteractive=!!this.options.interactive,this.position=(0,L.yq)(this.options.coordinates),this.isDestroyed=!1;const{dynamicStyle:i,collector:n,renderer:o,tileManager:s,identifier:r,layers:a,imageManager:l}=this.modules;Promise.resolve().then((()=>{const{url:e,size:t,pixelRatio:i}=this.options.image;return l.loadTexture(e,{size:t,pixelRatio:i,imagePadding:pt.Hg})})).then((e=>{if(void 0===e||this.isDestroyed)return;const{image:t,targetSize:l,offset:c}=this.options,d=(0,se.qw)({type:"stretchableImage",id:`dynamic-polygon-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{sourceSize:t.size,targetSize:l,offset:c,stretchX:t.stretchX,stretchY:t.stretchY,pixelRatio:t.pixelRatio}});if(!d)return;i.addLayer(d,this.options.zIndex),this.styleLayerId=d.innerId,(0,ie.XI)({collector:n,generator:Vt.z.generate,args:[i.getStyle().id,d,G.Dz,(0,oe.FJ)({id:this.isInteractive?(0,Y.Ru)(0,0):NaN}),e,[0,0]]});const h=n.getAccumulatedData(),u=new $.W("dynamicObject",h.data,o,(0,ne.IR)(this.position));this.isInteractive&&this.identifyIds.push(h.identifyIds),this.isHidden||s.addObject(u),this.tileObjects.push(u),a.addLayer(this),n.reset(),this.mapState.needRerender=!0,this.isInteractive&&r.resetCache()}))}destroy(){this.isDestroyed=!0,this.isInteractive&&this.modules&&this.modules.identifier.resetCache(),this.styleLayerId&&this.modules.dynamicStyle.removeLayer(this.styleLayerId),super.destroy()}hide(){this.isHidden||(this.isHidden=!0,this.tileObjects.length&&this.tileObjects.forEach((e=>{this.modules.tileManager.removeObject(e)})))}show(){this.isHidden&&(this.isHidden=!1,this.tileObjects.length&&this.tileObjects.forEach((e=>{this.modules.tileManager.addObject(e)})))}setCoordinates(e){this.position=(0,L.yq)(e),this.tileObjects.forEach((e=>{e.setTileCoords((0,ne.IR)(this.position))})),0===this.tileObjects.length||this.isHidden||(this.mapState.needRerender=!0)}}var ql=i(504);const Xl=[0,0],$l=[0,0,0,0];class Yl extends q{constructor(e,t){var i,n,o,s,r,a,l,c,d;super(e),this.status="visible",this.coordinates=t.coordinates,this.options=t;const h=null!==(i=t.font)&&void 0!==i?i:"Open_Sans",u=null!==(n=t.fontSize)&&void 0!==n?n:T.fonts.baseSize,m=null!==(o=t.letterSpacing)&&void 0!==o?o:0,f=null!==(s=t.lineHeight)&&void 0!==s?s:T.fonts.baseLineHeight,p=null!==(r=this.options.offset)&&void 0!==r?r:Xl,_=(0,se.qw)({type:"point",id:`dynamic-pointLabel-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{textFont:h,textFontSize:u,textColor:null!==(a=t.color)&&void 0!==a?a:"#000000",textHaloWidth:null!==(l=t.haloRadius)&&void 0!==l?l:0,textHaloColor:null!==(c=t.haloColor)&&void 0!==c?c:"#ffffff",textLetterSpacing:m,textLineHeight:f,textOffset:p}});if(this.position=(0,L.yq)(this.options.coordinates),!_)return;const{dynamicStyle:v,collector:g,assetManager:y,styleManager:b,renderer:w,tileManager:x,layers:I,defaultSource:S}=this.modules,M=null!==(d=this.options.zIndex)&&void 0!==d?d:0;v.addLayer(_,M+(this.options.image?1e-5:0));const E=(0,oe.FJ)({db_label:this.options.text}),k=(0,ne.IR)(this.position);(0,ie.XI)({collector:g,generator:ql.p,args:[v.getStyle(),_,k,S.getId(),G.i4,G.nF,E,G.wz,[[0],[0]],(0,vl.o1)(window.devicePixelRatio)]});const z=g.getAccumulatedData();if(!z.labels.length)return;const A=[{metatileHash:-1,labels:z.labels,styleId:v.getStyle().id}],C=(0,Wl.v)(A,pr.AL.DynamicObject,b,this.mapState.styleState,this.mapState.styleZoom);if(1!==C.length)return;const F=C[0];gl.GY.then((()=>{var e;F.label=null!==(e=(0,gl.iY)(F.label))&&void 0!==e?e:"",F.updateRanges()})).then((()=>Promise.all(F.ranges.map((e=>y.loadFont(h,e)))))).then((()=>{if("destroyed"===this.status)return;F.textMetrics=(0,qs.JA)(F.label,m,y.getFontGlyphs(h));const{image:i}=this.options,n=function(e){return[e&&void 0!==e[0]?(0,P.uZ)(e[0],0,1):.5,e&&void 0!==e[1]?(0,P.uZ)(e[1],0,1):.5]}(t.anchor),o=u/T.fonts.baseSize,s=u*f*F.textMetrics.lines.length,r=o*F.textMetrics.maxWidth,a=[-r*(n[0]-.5),-s*(n[1]-.5)],[l,c]=p;(0,ie.XI)({collector:g,generator:Tn.qp,args:[F,1,F.textMetrics,[0,0,0],0,[l+a[0],c+a[1]],_,v.getStyle().fontNameToIndex[h]]});const d=g.getAccumulatedData();if(this.tileObject=new $.W("dynamicObject",d.data,w,(0,ne.IR)(this.position)),"visible"===this.status&&x.addObject(this.tileObject),I.addLayer(this),this.tileObjects.push(this.tileObject),g.reset(),this.mapState.needRerender=!0,i){const[t,n,o,d]=i.padding||$l;this.backgroundImage=new Vl(e,{image:i,coordinates:this.coordinates,targetSize:[r+d+n,s+t+o],offset:[(n-d)/2+l+a[0],(o-t)/2+c+a[1]],zIndex:M,minZoom:this.options.minZoom,maxZoom:this.options.maxZoom}),"hidden"===this.status&&this.backgroundImage.hide()}}))}hide(){"visible"===this.status&&(this.status="hidden",this.tileObject&&this.modules.tileManager.removeObject(this.tileObject),this.backgroundImage&&this.backgroundImage.hide())}show(){"hidden"===this.status&&(this.status="visible",this.tileObject&&this.modules.tileManager.addObject(this.tileObject),this.backgroundImage&&this.backgroundImage.show())}remove(){"destroyed"!==this.status&&(super.destroy(),this.backgroundImage&&this.backgroundImage.destroy(),this.status="destroyed")}setCoordinates(e){"destroyed"!==this.status&&(this.coordinates=e,this.position=(0,L.yq)(e),this.tileObjects.forEach((e=>{e.setTileCoords((0,ne.IR)(this.position))})),this.backgroundImage&&this.backgroundImage.setCoordinates(e),0!==this.tileObjects.length&&"visible"===this.status&&(this.mapState.needRerender=!0))}getCoordinates(){return(0,L.PA)(this.position)}}const Kl=[.5,.5],Jl=[0,18];class Ql extends te{constructor(e,t){super(e,t.draggable),this.map=e;const{coordinates:i,size:n,zIndex:o,minZoom:s,maxZoom:r,interactive:a,hoverIcon:l,hoverSize:c,hoverAnchor:d,label:h,rotation:u}=t;this.status="normal",this.position=(0,L.yq)(i),this.rotation=(0,P.Id)(null!=u?u:0),this.zIndex=void 0!==o?o:0,this.minZoom=null!=s?s:-1/0,this.maxZoom=null!=r?r:1/0,this.interactive=void 0===a||a;const m=void 0!==t.icon?t.icon:T.defaultMarkerIcon,f=void 0!==t.icon?t.anchor:T.defaultMarkerAnchor;this.on("mouseover",this.switchToHoveredStyle),this.on("mouseout",this.switchToNormalStyle),this.modules.layers.addLayer(this),this.setIcon({icon:m,anchor:f,size:n}),void 0!==l&&this.setHoverIcon({icon:l,anchor:d,size:c}),this.setLabel(h)}destroy(){var e;"destroyed"!==this.status&&(this.status="destroyed",null===(e=this.label)||void 0===e||e.remove(),this.interactive&&this.modules.identifier.resetCache(),this.off("mouseover",this.switchToHoveredStyle),this.off("mouseout",this.switchToNormalStyle),super.destroy())}setRotation(e){"destroyed"!==this.status&&(this.rotation=(0,P.Id)(e),this.normalStateData&&(this.normalStateData.styleLayer.style.iconRotation=this.rotation,this.mapState.needRerender=!0),this.hoverStateData&&(this.hoverStateData.styleLayer.style.iconRotation=this.rotation,this.mapState.needRerender=!0))}getRotation(){return(0,P.ZY)(this.rotation)}setIcon(e){"destroyed"!==this.status&&this.modules.imageCache.getRasterSet(e.icon,void 0,e.size,e.anchor).then((t=>{if("destroyed"===this.status||!t)return;const i=this.normalStateData,n=this.getMarkerStateData(t,e);"normal"===this.status&&(i&&this.modules.tileManager.removeObject(i.tileObject),this.modules.tileManager.addObject(n.tileObject),this.mapState.needRerender=!0,this.interactive&&this.modules.identifier.resetCache()),i&&((0,P.VJ)(this.tileObjects,i.tileObject),(0,P.VJ)(this.identifyIds,i.identifyIds),i.tileObject.clean(this.mapState)),this.tileObjects.push(n.tileObject),this.interactive&&this.identifyIds.push(n.identifyIds),this.normalStateData=n}))}setHoverIcon(e){if("destroyed"!==this.status)return e?void this.modules.imageCache.getRasterSet(e.icon,void 0,e.size,e.anchor).then((t=>{if("destroyed"===this.status||!t)return;const i=this.hoverStateData,n=this.getMarkerStateData(t,e);"hover"===this.status&&(i&&this.modules.tileManager.removeObject(i.tileObject),this.modules.tileManager.addObject(n.tileObject),this.mapState.needRerender=!0,this.interactive&&this.modules.identifier.resetCache()),i&&((0,P.VJ)(this.tileObjects,i.tileObject),(0,P.VJ)(this.identifyIds,i.identifyIds),i.tileObject.clean(this.mapState)),this.tileObjects.push(n.tileObject),this.interactive&&this.identifyIds.push(n.identifyIds),this.hoverStateData=n})):("hover"===this.status&&this.switchToNormalStyle(),void(this.hoverStateData&&((0,P.VJ)(this.tileObjects,this.hoverStateData.tileObject),(0,P.VJ)(this.identifyIds,this.hoverStateData.identifyIds),this.hoverStateData.tileObject.clean(this.mapState),this.hoverStateData=void 0)))}setLabel(e){var t,i,n,o,s;"destroyed"!==this.status&&(null===(t=this.label)||void 0===t||t.remove(),e&&(this.label=new Yl(this.map,Object.assign(Object.assign({coordinates:this.getCoordinates()},e),{minZoom:Math.max(null!==(i=e.minZoom)&&void 0!==i?i:this.minZoom,this.minZoom),maxZoom:Math.min(null!==(n=e.maxZoom)&&void 0!==n?n:this.maxZoom,this.maxZoom),fontSize:null!==(o=e.fontSize)&&void 0!==o?o:18,anchor:e.anchor||Kl,offset:e.offset||Jl,zIndex:null!==(s=e.zIndex)&&void 0!==s?s:this.zIndex+1e-5}))))}setCoordinates(e){var t;this.setPosition((0,L.yq)(e)),null===(t=this.label)||void 0===t||t.setCoordinates(e)}getCoordinates(){return(0,L.PA)(this.getPosition())}show(){var e;"hidden"===this.status&&(null===(e=this.label)||void 0===e||e.show(),this.normalStateData&&(this.modules.tileManager.addObject(this.normalStateData.tileObject),this.mapState.needRerender=!0,this.interactive&&this.modules.identifier.resetCache()),this.status="normal")}hide(){var e,t,i;if("destroyed"===this.status||"hidden"===this.status)return;null===(e=this.label)||void 0===e||e.hide();const n="normal"===this.status?null===(t=this.normalStateData)||void 0===t?void 0:t.tileObject:null===(i=this.hoverStateData)||void 0===i?void 0:i.tileObject;n&&(this.modules.tileManager.removeObject(n),this.mapState.needRerender=!0,this.interactive&&this.modules.identifier.resetCache()),this.status="hidden"}setPosition(e){this.position=e,this.tileObjects.length&&(this.tileObjects.forEach((t=>{t.setTileCoords((0,ne.IR)(e))})),"hidden"!==this.status&&(this.mapState.needRerender=!0,this.interactive&&this.modules.identifier.resetCache()))}getPosition(){return this.position}isInteractive(){return this.interactive}contains(e){if(!this.normalStateData)return!1;const{hoverStateData:t,normalStateData:i}=this,n=void 0!==t?t.size:i.size,o=void 0!==t?t.anchor:i.anchor,s=this.modules.camera.project(this.position),r=s[0]-n[0]*o[0],a=s[0]+n[0]*(1-o[0]),l=s[1]-n[1]*o[1],c=s[1]+n[1]*(1-o[1]);return e[0]>r&&e[0]<a&&e[1]>l&&e[1]<c}switchToHoveredStyle(){if("normal"===this.status&&this.hoverStateData&&this.normalStateData){const{tileManager:e}=this.modules;e.removeObject(this.normalStateData.tileObject),e.addObject(this.hoverStateData.tileObject),this.status="hover",this.mapState.needRerender=!0}}switchToNormalStyle(){if("hover"===this.status&&this.normalStateData&&this.hoverStateData){const{tileManager:e}=this.modules;e.removeObject(this.hoverStateData.tileObject),e.addObject(this.normalStateData.tileObject),this.status="normal",this.mapState.needRerender=!0}}getMarkerStateData(e,{icon:t,anchor:i,size:n}){const{zIndex:o,interactive:s,position:r}=this,{collector:a,renderer:l,dynamicStyle:c,styleManager:d,defaultSource:h}=this.modules,u=(0,oe.FJ)({id:s?(0,Y.Ru)(0,0):NaN,dpi:96*window.devicePixelRatio}),m=(0,ne.IR)(r),f=(0,se.qw)({type:"point",id:`dynamic-marker-${this.uniqId}`,minzoom:this.minZoom,maxzoom:this.maxZoom,style:{iconImage:t,iconAnchor:i,iconRotation:this.rotation}});if(!f)throw new Error(`Marker with icon ${t} was created with null style layer`);c.addLayer(f,o),c.appendRasterSet(e,(0,Ln.fF)(t,f.style.iconAnchor[0],f.style.iconAnchor[1])),(0,ie.XI)({collector:a,generator:ql.p,args:[c.getStyle(),f,m,h.getId(),G.i4,G.nF,u,G.wz,[[0],[0]],(0,vl.o1)(window.devicePixelRatio)]});const{identifyIds:p,labels:_}=a.getAccumulatedData();if(!_.length)throw new Error(`Marker with icon ${t} was created with empty labels`);const v=[{metatileHash:-1,labels:_,styleId:c.getStyle().id}],g=(0,Wl.v)(v,pr.AL.DynamicObject,d,this.mapState.styleState,this.mapState.styleZoom);if(1!==g.length)throw new Error(`Marker with icon ${t} has empty unpacked labels`);const y=g[0];(0,Tn.vg)(a,y,[0,0,0],0,e.rasters[0]);const{data:b}=a.getAccumulatedData();a.reset();return{styleLayer:f,tileObject:new $.W("dynamicObject",b,l,m,this),identifyIds:p,icon:t,anchor:[e.rasters[0].anchorX,e.rasters[0].anchorY],size:n||[e.rasters[0].w/window.devicePixelRatio,e.rasters[0].h/window.devicePixelRatio]}}}var ec=i(303),tc=i(590);const ic=(0,ec.D)({symbol:"polygon",sinks:{fill:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.localID=new Uint32Array(t,4)},packObjectAttributes:(e,t,i,n,o)=>(0,tc.v$)([e,t],i,n,o,G.wz),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,o,s){const r=s[0],a=s[1],l=e.idIndexer.getIndex({id:o[n.id],styleId:t,layer:i,sublayer:o[n.db_sublayer]}),c=e.getBucket(i.type,"fill",El.a.sinks.fill.packObjectAttributes(t,i.innerId,NaN,i.dataKeys,n,o,G.wz,G.i4),El.a.sinks.fill.binder);let d=c.elements.offset;!function(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}(c.indices,d,0,1,2,2,1,3),nc(c,d++,r[0],a[0],l),nc(c,d++,r[1],a[1],l),nc(c,d++,r[2],a[2],l),nc(c,d++,r[3],a[3],l),c.elements.offset=d}});function nc(e,t,i,n,o){const s=4*t;e.views.position[s]=i,e.views.position[s+1]=n;const r=2*t;e.views.localID[r]=o}class oc extends q{constructor(e,t){super(e);const{dynamicStyle:i,collector:n,renderer:o,tileManager:s,identifier:r,layers:a}=this.modules;this.options=t,this.points=[];const l=(0,se.qw)({type:"polygon",id:`dynamic-polygon-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.color||"#0085a0"}});if(!l)return;i.addLayer(l,this.options.zIndex),this.layerId=l.innerId;const c=(0,oe.FJ)({id:this.options.interactive?[0,this.uniqId]:NaN});this.points=function(e,t,i){const n=t/2,o=i/2,s=e[0],r=e[1],a=e[2];return[[s-n,r-o,a],[s+n,r-o,a],[s-n,r+o,a],[s+n,r+o,a]]}((0,L.yq)(this.options.center),(0,L.a4)(this.options.center,this.options.width),(0,L.a4)(this.options.center,this.options.height));const d=z.Ue();for(let e=0;e<this.points.length;e++)z.aM(d,this.points[e]);const h=(0,ne.x7)(d),u=(0,ne.Bs)(h),m=[[],[]],f=k.Ue();for(let e=0;e<this.points.length;e++)(0,ne.a2)(f,this.points[e],u),m[0][e]=f[0],m[1][e]=f[1];(0,ie.XI)({collector:n,generator:ic.generate,args:[i.getStyle().id,l,G.Dz,c,m]});const p=n.getAccumulatedData(),_=new $.W("dynamicObject",p.data,o,h);s.addObject(_),this.tileObjects.push(_),this.options.interactive&&this.identifyIds.push(p.identifyIds),a.addLayer(this),n.reset(),this.mapState.needRerender=!0,this.options.interactive&&r.resetCache()}destroy(){void 0!==this.layerId&&this.modules.dynamicStyle.removeLayer(this.layerId),this.options.interactive&&this.modules&&this.modules.identifier.resetCache(),super.destroy()}}class sc extends q{constructor(e,t){super(e);const{dynamicStyle:i}=this.modules;this.options=Object.assign(Object.assign({},t),{image:{url:t.image.url}}),this.points=[],this.styleLayer=(0,se.qw)({type:"raster",id:`dynamic-raster-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{opacity:this.options.opacity}}),this.styleLayer&&(i.addLayer(this.styleLayer,this.options.zIndex),this.layerId=this.styleLayer.innerId,this.modules.imageManager.loadTexture(this.options.image.url,{skipAtlasSizeChecking:!0}).then((e=>{this.textureIndex=e,this.generate()})))}destroy(){void 0!==this.layerId&&this.modules.dynamicStyle.removeLayer(this.layerId),super.destroy()}updateImage(e){const{url:t,bounds:i}=e;if(!t&&!i)return Promise.resolve();t&&(this.options.image.url=t),i&&(this.options.bounds=i);return(t?this.modules.imageManager.loadTexture(t,{skipAtlasSizeChecking:!0}):Promise.resolve(this.textureIndex)).then((e=>{this.textureIndex=e,this.clean(),this.generate()}))}generate(){if(!this.styleLayer||void 0===this.textureIndex)return;const{collector:e,dynamicStyle:t,tileManager:i,layers:n,renderer:o}=this.modules;this.points=function(e){const{min:t,max:i}=z.X3(e);return[t,[i[0],t[1]],[t[0],i[1]],i]}(this.options.bounds);const s=z.Ue();for(let e=0;e<this.points.length;e++)z.aM(s,this.points[e]);const r=(0,ne.x7)(s),a=(0,ne.Bs)(r),l=[[],[]],c=k.Ue();for(let e=0;e<this.points.length;e++)(0,ne.a2)(c,this.points[e],a),l[0][e]=c[0],l[1][e]=c[1];(0,ie.XI)({collector:e,generator:qt.h.generate,args:[l,t.getStyle().id,this.styleLayer,this.textureIndex]});const d=e.getAccumulatedData(),h=new $.W("dynamicObject",d.data,o,r);i.addObject(h),this.tileObjects.push(h),n.addLayer(this),e.reset(),this.mapState.needRerender=!0}clean(){const e=this.tileObjects[0];e&&(e.clean(this.mapState),this.modules.tileManager.removeObject(e),this.modules.layers.removeLayer(this),this.tileObjects=[])}}class rc{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="raster",this.textureIndices={},this.tileLoader=new Zi.U("arrayBuffer"),this.attributes={},this.tiles=new Map,this.sourceAttrs=i.attributes||{},this.url=e=>{const[t,i,n]=(0,ne._W)(e);return this.options.url(t,i,n)}}deleteTextures(){for(const e in this.textureIndices)this.modules.imageManager.deleteTexture(this.textureIndices[e]);this.textureIndices={}}abortTileFetch(e){this.tileLoader.abortRequest((0,ne.gx)(e))}deleteTile(e){const t=(0,ne.gx)(e);this.tiles.delete(t)}fetchTile(e){const t=(0,ne.gx)(e),i=this.url(e);return this.tileLoader.fetch(e,(()=>i)).then((e=>{e.rejected||this.tiles.set(t,e.data);return[{regionId:0,metatileHash:-1}]}))}generateTile(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){const i=[],n=[],o=this.modules.styleManager.getStyle(e.handyStyleId),s=(0,ne.gx)(t),r=this.tiles.get(s);if(!r||!o)return Promise.resolve({results:i,transferable:n});const a=yield this.modules.imageManager.addTexture(r,{imagePadding:0});if(void 0===a)return Promise.resolve({results:i,transferable:n});this.textureIndices[s]=a;const l=[[],[]],c=k.Ue(),d=function(e,t){const i=e[0],n=e[1],o=e[2];return[[i,n,o],[i+t,n,o],[i,n+t,o],[i+t,n+t,o]]}((0,ne.Oy)(t),(0,ne.aq)(t[2])),h=(0,ne.Bs)(t);for(let e=0;e<d.length;e++)(0,ne.a2)(c,d[e],h),l[0][e]=c[0],l[1][e]=c[1];const u=(0,ae.ci)((0,G.KP)([]),e.styleState,this.sourceAttrs,{},[],[]);o.layers.filter((e=>"raster"===e.type&&(0,ae.FR)(e.filter,u))).forEach((e=>{"raster"===e.type&&(0,ie.XI)({collector:this.modules.collector,generator:qt.h.generate,args:[l,o.id,e,a]})}));const m=this.modules.collector.getAccumulatedData();return i.push({regionId:0,metatileHash:0,styleId:o.id,collectorOutput:m}),n.push(...m.transferable),Promise.resolve({results:i,transferable:n})}))}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e}destroy(){this.tileLoader.destroy()}}class ac{constructor(e,t){var i,n;this.type="raster",this.id=(0,Ut.Q)(),this.modules=e.modules,this.source=new rc(this.id,this.modules,t);const o=null!==(i=t.minZoom)&&void 0!==i?i:T.MAP_DEFAULTS.minZoom,s=null!==(n=t.maxZoom)&&void 0!==n?n:T.MAP_DEFAULTS.maxZoom;this.layer=new Zt.I(o,s,o,s,this.modules,e.state,this.source),this.modules.tileManager.addTileLayer(this.layer)}destroy(){this.source.deleteTextures(),this.modules.tileManager.removeTileLayer(this.layer),this.layer.destroy()}getAttributes(){return this.source.getAttributes()}getId(){return this.source.id}setAttributes(e){this.source.setAttributes(e),this.layer.redraw()}}class lc extends q{constructor(e,t){var i;super(e),this.position=(0,L.yq)(t.coordinates),this.zIndex=null!==(i=t.zIndex)&&void 0!==i?i:0,this.isDestroyed=!1,this.labelKey=`onlineMarker-${this.uniqId}`,this.setIcon(t.icon)}destroy(){this.isDestroyed=!0,this.modules.identifier.resetCache(),this.modules.labeler.removeLabels(this.labelKey),super.destroy()}setIcon({url:e,transformer:t,size:i,anchor:n}){this.modules.imageCache.getRasterSet(e,t,i,n).then((t=>{if(this.isDestroyed||!t)return;this.removeIcon();const o=(0,se.qw)({type:"point",id:`dynamic-onlineMarker-${this.uniqId}`,minzoom:-1/0,maxzoom:1/0,style:{iconImage:e,iconAnchor:n}}),s=(0,oe.FJ)({id:(0,Y.Ru)(0,0)}),{collector:r,dynamicStyle:a,styleManager:l,defaultSource:c}=this.modules,d=this.zIndex;if(!o)return;a.addLayer(o,d),a.appendRasterSet(t,(0,Ln.fF)(e,o.style.iconAnchor[0],o.style.iconAnchor[1]));const h=(0,ne.IR)(this.position);(0,ie.XI)({collector:r,generator:ql.p,args:[a.getStyle(),o,h,c.getId(),G.i4,G.nF,s,G.wz,[[0],[0]],(0,vl.o1)(window.devicePixelRatio)]});const u=r.getAccumulatedData(),{identifyIds:m,labels:f}=u;if(!f.length)return;const p=[{metatileHash:-1,labels:f,styleId:a.getStyle().id}],_=(0,Wl.v)(p,pr.AL.DynamicObject,l,this.mapState.styleState,this.mapState.styleZoom);if(1!==_.length)return;const v=_[0];(0,Tn.vg)(r,v,[0,0,0],0,t.rasters[0]);const g=r.getAccumulatedData();r.reset();const y=new $.W("dynamicObject",g.data,this.modules.renderer,(0,ne.IR)(this.position),this);this.tileObjects.push(y),this.identifyIds=[m],this.modules.tileManager.addObject(y),this.modules.layers.addLayer(this),this.modules.identifier.debouncedFillCache(),this.modules.labeler.removeLabels(this.labelKey),this.modules.labeler.addLabelBox(this.labelKey,{id:this.uniqId,width:i[0],height:i[1],position:this.position,offset:[-n[0],-n[1]],labelingGroup:"marker"}),this.mapState.needRerender=!0}))}removeIcon(){const e=this.tileObjects[0];e&&(e.clean(this.mapState),this.modules.tileManager.removeObject(e),this.tileObjects=[])}}function cc(e){return{type:"data",key:(0,ne.gx)(e),coords:e,zoomLevel:e[2],detailLevel:e[3],needFetch:!1,needAbortFetch:!1,status:Ua.z3.Initial}}function dc(e,t,i,n,o){return function(e,t,i,n,o,s){return{type:e,maxDetailLevel:s,minDetailLevel:o,maxZoomLevel:n,minZoomLevel:i,zoomLevel:Math.floor(t),tiles:{},viewportTiles:[]}}("data",e,t,i,n,o)}class hc extends W.c{constructor(e,t,i){super(),this.prevZoomLevel=0,this.mapState=e,this.modules=t,this.config=i,this.gridState=dc(e.styleZoom,i.minZoom,i.maxZoom,i.minZoom,i.maxZoom),this.viewportDiffer=new qe([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"size",type:"vec2"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"demMode",type:"boolean"}]),this.dataTileLoader=new Zi.U("json"),this.modules.layers.addLayer(this)}destroy(){var e;(e=this.gridState).tiles={},e.viewportTiles=[],this.modules.layers.removeLayer(this)}update(){let e=!0;if(this.viewportDiffer.check(this.mapState)){const t=Math.floor(this.mapState.styleZoom);t!==this.prevZoomLevel&&(e=!1),this.prevZoomLevel=t,this.gridState.zoomLevel=t,function(e,t,i){if(e.zoomLevel<e.minZoomLevel)return void(e.viewportTiles=[]);const n=(0,P.uZ)(e.zoomLevel,e.minZoomLevel,e.maxZoomLevel),o=(0,P.uZ)(e.zoomLevel,e.minDetailLevel,e.maxDetailLevel);e.viewportTiles=(0,ne.b5)(t,n,e.minZoomLevel,o).map(ne.gx);for(let t=0;t<e.viewportTiles.length;t++){const n=e.viewportTiles[t];let o=e.tiles[n];o||(o=e.tiles[n]=i((0,ne.cL)(n)))}}(this.gridState,this.mapState,cc),this.emit("tilesSetChanged",{tileIds:this.gridState.viewportTiles})}for(const e in this.gridState.tiles)this.gridState.viewportTiles.includes(e)?this.gridState.tiles[e].status===Ua.z3.Initial&&(this.gridState.tiles[e].needFetch=!0,this.gridState.tiles[e].status=Ua.z3.Loading):this.gridState.tiles[e].status===Ua.z3.Loading&&(this.gridState.tiles[e].needAbortFetch=!0);e&&(this.fetch(function(e){const t=[];for(const i in e.tiles){const n=e.tiles[i];n.needFetch&&(n.needFetch=!1,t.push(n))}return t}(this.gridState)),this.abortFetch(function(e){const t=[];for(const i in e.tiles){const n=e.tiles[i];n.needAbortFetch&&(n.needAbortFetch=!1,t.push(n))}return t}(this.gridState)),this.clearTiles(function(e,t){const i=new Set(e.viewportTiles),n=[];for(const o in e.tiles){const s=e.tiles[o],r=!t||t(s);!i.has(o)&&r&&n.push(s)}return n}(this.gridState)))}fetch(e){e.sort(((e,t)=>(0,ne.qu)(this.mapState.center,e,t))).forEach((e=>this.fetchTile(e)))}abortFetch(e){e.forEach((e=>{this.dataTileLoader.abortRequest(e.key)}))}clearTiles(e){for(const t of e)delete this.gridState.tiles[t.key],this.emit("dataTileCleared",{tileId:t.key})}fetchTile(e){const{tsURLTemplate:t}=this.config;this.dataTileLoader.fetch(e.coords,t).then((t=>{t.rejected||this.emit("dataTileLoaded",{tileId:e.key,data:t.data})}))}}class uc{constructor(){this.events={}}on(e,t){let i=this.events[e];return i||(i=this.events[e]=[]),i.push(t),this}once(e,t){const i=n=>{this.off(e,i),t.call(this,n)};return this.on(e,i),this}off(e,t){const i=this.events[e];if(!i)return this;const n=i.indexOf(t);return-1!==n&&i.splice(n,1),this}emit(e,t){const i=this.events[e];if(!i)return this;const n=i.slice();for(let e=0;e<n.length;e++)n[e].call(this,t);return this}}class mc{constructor(e,t,i){var n;const{position:o}=i;this._wrap=document.createElement("div"),this._wrap.style.userSelect="none",this._wrap.innerHTML=t,this._position=o,this._controlPane=e._controlPane,this._container=this._controlPane.getContainerByPosition(o),null===(n=this._container)||void 0===n||n.append(this._wrap)}destroy(){this._wrap.remove()}getPosition(){return this._position}setPosition(e){this._container.removeChild(this._wrap),this._container=this._controlPane.getContainerByPosition(e),this._container.append(this._wrap),this._position=e}getContainer(){return this._wrap}}var fc=i(8585),pc={};pc.styleTagTransform=fl(),pc.setAttributes=dl(),pc.insert=ll().bind(null,"head"),pc.domAPI=rl(),pc.insertStyleElement=ul();ol()(fc.Z,pc);const _c=fc.Z&&fc.Z.locals?fc.Z.locals:void 0,vc=`\n    <div class="${_c.root}">\n        <button class="${_c.button} ${_c.zoomIn}">\n            <svg\n                xmlns="http://www.w3.org/2000/svg"\n                viewBox="0 0 32 32"\n                width="32"\n                height="32"\n                fill="currentColor"\n            >\n                <path d="M24 15h-7V8h-2v7H8v2h7v7h2v-7h7v-2z"></path>\n            </svg>\n        </button>\n        <button class="${_c.button} ${_c.zoomOut}">\n            <svg\n                xmlns="http://www.w3.org/2000/svg"\n                viewBox="0 0 32 32"\n                fill="currentColor"\n                width="32"\n                height="32"\n            >\n                <path d="M8 15h16v2H8z"></path>\n            </svg>\n        </button>\n    </div>\n`;class gc extends mc{constructor(e,t){super(e,vc,t),this._zoomIn=()=>{this._map.setZoom(this._map.getZoom()+1,{duration:400})},this._zoomOut=()=>{this._map.setZoom(this._map.getZoom()-1,{duration:400})},this._checkZoom=()=>{const e=this._map.getZoom();e<=this._map.getMinZoom()?this._zoomOutButton.disabled=!0:this._zoomOutButton.disabled=!1,e>=this._map.getMaxZoom()?this._zoomInButton.disabled=!0:this._zoomInButton.disabled=!1},this._map=e,this._zoomInButton=this._wrap.querySelector(`.${_c.zoomIn}`),this._zoomOutButton=this._wrap.querySelector(`.${_c.zoomOut}`),this._zoomInButton.addEventListener("click",this._zoomIn),this._zoomOutButton.addEventListener("click",this._zoomOut),this._map.on("zoom",this._checkZoom)}destroy(){this._map.off("zoom",this._checkZoom),this._zoomInButton.removeEventListener("click",this._zoomIn),this._zoomOutButton.removeEventListener("click",this._zoomOut),super.destroy()}}var yc=i(4928),bc={};bc.styleTagTransform=fl(),bc.setAttributes=dl(),bc.insert=ll().bind(null,"head"),bc.domAPI=rl(),bc.insertStyleElement=ul();ol()(yc.Z,bc);const wc=yc.Z&&yc.Z.locals?yc.Z.locals:void 0;var xc=i(5965);class Ic extends mc{constructor(e,t){super(e,"",t),this._onClick=()=>{this._trafficVisible?(this._map.hideTraffic(),this._map.patchStyleState({trafficOn:!1})):(this._map.showTraffic(),this._map.patchStyleState({trafficOn:!0}))},this._map=e,this._trafficVisible=!1,this._render(),e.on("trafficscore",(({score:e})=>{this._score=e,this._render()})),e.on("trafficshow",(()=>{this._trafficVisible=!0,this._render()})),e.on("traffichide",(()=>{this._trafficVisible=!1,this._render()}))}_render(){const e=this._trafficVisible?function(e){if(void 0===e)return"";if(e>6)return wc.hard;if(e>3)return wc.medium;return wc.easy}(this._score):wc.none,t=`\n            <div class="${wc.root}">\n                <button class="${wc.button} ${e}">\n                    ${this._trafficVisible&&void 0!==this._score?this._score:xc}\n                </button>\n            </div>\n        `;this._wrap.innerHTML=t;this._wrap.querySelector(`.${wc.button}`).addEventListener("click",this._onClick)}}var Sc=i(4306),Mc={};Mc.styleTagTransform=fl(),Mc.setAttributes=dl(),Mc.insert=ll().bind(null,"head"),Mc.domAPI=rl(),Mc.insertStyleElement=ul();ol()(Sc.Z,Mc);const Tc=Sc.Z&&Sc.Z.locals?Sc.Z.locals:void 0;var Pc;!function(e){e.osm="osm",e.api="api",e.license="license"}(Pc||(Pc={}));class Lc extends mc{constructor(e,t){var i,n;super(e,(i=!0===t.autoHide,n=!0===t.showSberLogo,`\n    <div class=${Tc.container}>\n        <div>\n            <a href="https://dev.2gis.ru" target="_blank">\n                <svg xmlns="http://www.w3.org/2000/svg" width="45" height="14">\n                    <path\n                        fill-rule="evenodd"\n                        clip-rule="evenodd"\n                        fill="#6D7173"\n                        d="M6.964 0c3.865 0 6.99 3.144 6.99 6.994 0 3.862-3.125 7.006-6.99 7.006C3.136 14 0 10.856 0 6.994 0 3.144 3.136 0 6.964 0zm.025 2.45c-2.297 0-3.85 1.805-3.85 3.735 0 .772.172 1.457.575 2.304 2.33.012 2.794 1.446 2.943 2.712l.014.126.061.573h.501l.061-.573.014-.126c.15-1.266.605-2.7 3.017-2.712.416-.847.489-1.532.489-2.291 0-1.955-1.528-3.748-3.825-3.748zm34.142-.21c2.094 0 3.6 1.04 3.869 3.017h-2.12c-.14-.735-.753-1.305-1.775-1.305-.88 0-1.404.418-1.404 1.102 0 .778.884.942 1.757 1.074l.196.029c1.367.203 3.32.596 3.32 2.776 0 2.029-1.698 2.967-3.767 2.967-2.234 0-3.754-1.116-3.881-3.195h2.094c.179.964.894 1.496 1.966 1.496.869 0 1.482-.355 1.482-1.077 0-1.065-1.226-1.09-2.478-1.332-.97-.19-2.796-.659-2.796-2.623 0-1.851 1.417-2.929 3.537-2.929zm-12.365.21c2.174 0 4.013 1.217 4.374 3.338h-2.1c-.323-.941-1.168-1.468-2.299-1.468-1.85 0-2.646 1.443-2.646 2.861 0 1.406.845 2.824 2.659 2.824 1.031 0 1.926-.464 2.323-1.443H28.53V7.006h4.61v.74c0 2.535-1.926 4.154-4.386 4.154-2.498 0-4.684-1.744-4.684-4.694 0-2.911 2.013-4.756 4.696-4.756zm-9.156 0c2.12 0 3.574 1.217 3.574 3.148 0 1.574-.966 2.496-2.658 3.234-1.116.48-1.225.548-2.386.898h5.232v1.82h-7.599V8.845c1.09-.37 2.157-.787 3.65-1.44 1.09-.479 1.68-.921 1.68-1.709 0-.787-.59-1.475-1.593-1.475-1.154 0-1.806.922-1.78 1.93h-2.032C15.685 3.84 17.353 2.45 19.61 2.45zm16.764 0v9.1h-1.978v-9.1h1.978z"\n                    /></svg\n            ></a>\n\n            ${n?'\n                    <a href="https://dev.2gis.ru" target="_blank">\n                    <svg xmlns="http://www.w3.org/2000/svg" width="54" height="16">\n                        <path\n                            fill="#6D7173"\n                            fill-rule="evenodd"\n                            d="M14.888 6.746a7 7 0 11-2.492-4.193l-1.361 1.004A5.35 5.35 0 008 2.617C5.032 2.617 2.617 5.032 2.617 8S5.032 13.383 8 13.383 13.383 10.968 13.383 8c0-.048 0-.096-.002-.144l1.507-1.11zm-9.553-.613L8 7.803l5.54-4.082c.33.427.613.894.838 1.391L8 9.812l-2.665-1.67v-2.01zm36.44-.942l1.902-1.403h-6.37v8.424h6.37V10.81h-4.552V8.652h3.883V7.25h-3.883V5.19h2.65zM30.287 7.072H32.5c2.01 0 3.115.886 3.115 2.494 0 1.682-1.22 2.646-3.35 2.646h-3.794V3.788h7.251L33.82 5.191h-3.53v1.881zm0 3.737h1.896c1.122 0 1.69-.373 1.691-1.167 0-.777-.537-1.168-1.691-1.168h-1.896v2.335zm18.55-7.02h-3.469v8.423h1.818V9.826h1.65c2.213 0 3.588-1.164 3.588-3.023 0-1.86-1.374-3.015-3.588-3.015zm-.04 4.634h-1.61V5.191h1.61c1.165 0 1.806.574 1.806 1.616 0 1.042-.64 1.616-1.806 1.616zM23.78 10.782c.56 0 1.103-.136 1.57-.393l.402-.22 1.176.866c-.775.832-1.92 1.288-3.23 1.288-1.253 0-2.395-.442-3.217-1.245-.819-.8-1.27-1.91-1.27-3.124 0-1.208.453-2.301 1.275-3.078.817-.773 1.962-1.198 3.224-1.198 1.162 0 2.18.353 2.94 1.022l.087.076-1.304.96a2.77 2.77 0 00-1.653-.517c-1.638 0-2.828 1.17-2.828 2.781 0 1.612 1.19 2.782 2.828 2.782z"\n                        ></path></svg\n                    ></a>\n                ':""}\n        </div>\n\n        <div class=${Tc.text}>\n            <div class=${i?Tc.autoHide:""}>\n                ©\n                <a\n                    href="https://www.openstreetmap.org/copyright"\n                    target="_blank"\n                    class=${Tc.link}\n                    data-type=${Pc.osm}\n                    >&nbsp;2GIS, OpenStreetMap contributors\n                </a>\n            </div>\n        </div>\n    </div>\n`),t),this._onClick=e=>{if(e.target&&((t=e.target)&&"href"in t&&"dataset"in t)){const t=e.target.dataset.type;t&&function(e){return e in Pc}(t)&&this._map.emit("copyrightclick",{type:t,href:e.target.href,originalEvent:e})}var t},this._map=e,!1===t.interactive&&(this._wrap.style.pointerEvents="none");this._wrap.querySelector(`.${Tc.container}`).addEventListener("click",this._onClick)}destroy(){this._wrap.querySelector(`.${Tc.container}`).removeEventListener("click",this._onClick),super.destroy()}}var Ec=i(438),kc={};kc.styleTagTransform=fl(),kc.setAttributes=dl(),kc.insert=ll().bind(null,"head"),kc.domAPI=rl(),kc.insertStyleElement=ul();ol()(Ec.Z,kc);const zc=Ec.Z&&Ec.Z.locals?Ec.Z.locals:void 0;const Ac=`\n    <div class=${zc.container}>\n        Your MapGL key is invalid. Please contact api@2gis.com to get MapGL key.\n    </div>\n`;class Cc extends class{constructor(e,t){this.rootContainer=e._impl.modules.layout.rootContainer,this.content=t,this.isShown=!1}display(){this.isShown||(this.wrap||(this.wrap=this.initWrap()),this.rootContainer.appendChild(this.wrap),this.isShown=!0)}hide(){this.isShown&&(this.wrap&&this.rootContainer.removeChild(this.wrap),this.isShown=!1)}isDisplayed(){return this.isShown}}{constructor(e){super(e,Ac),e._impl.on("invalidtilekey",(()=>{this.isDisplayed()||this.display()}))}initWrap(){const e=document.createElement("div");return e.classList.add(`${zc.wrap}`),e.innerHTML=this.content,e}}const Fc=()=>{let e,t="";for(let i=0;i<32;i++)e=16*Math.random()|0,i>4&&i<21&&!(i%4)&&(t+="-"),t+=(12===i?4:16===i?3&e|8:e).toString(16);return t};class Rc{constructor(e){this.northEast=e.northEast,this.southWest=e.southWest}extend(e){return this.southWest=[Math.min(this.southWest[0],e[0]),Math.min(this.southWest[1],e[1])],this.northEast=[Math.max(this.northEast[0],e[0]),Math.max(this.northEast[1],e[1])],this}}var Dc=i(1704),Oc={};Oc.styleTagTransform=fl(),Oc.setAttributes=dl(),Oc.insert=ll().bind(null,"head"),Oc.domAPI=rl(),Oc.insertStyleElement=ul();ol()(Dc.Z,Oc);const Bc=Dc.Z&&Dc.Z.locals?Dc.Z.locals:void 0,jc=`\n    <div class="${Bc.root}">\n        <div class="${Bc.container}">\n            <div class="${Bc.scroller}">\n                <div class="${Bc.content}" />\n            </div>\n        </div>\n    </div>\n`;class Nc extends mc{constructor(e,t){super(e,jc,t),this._removeButtonsEventListeners=()=>{this._content&&this._content.childNodes.forEach((e=>{if(this._handlers.has(e)){const t=this._handlers.get(e);void 0!==t&&e.removeEventListener("click",t)}}))},this._showControl=e=>{var t;const{currentFloorLevelIndex:i,floorPlanId:n,floorLevels:o}=e;let s;if(this._floor={currentFloorLevelIndex:i,floorPlanId:n},this._root.style.display="block",this._content.innerHTML="",o.forEach((({floorLevelIndex:e,floorLevelName:t})=>{const n=document.createElement("button");n.className=Bc.control,n.innerHTML=`<div class="${Bc.label}">${t}</div>`,n.name=e.toLocaleString(),i===e&&(n.disabled=!0,s=n);const o=this._controlHandler(e);n.addEventListener("click",o),this._handlers.set(n,o),this._content.append(n)})),s&&s.offsetTop){const e=null===(t=s.parentElement)||void 0===t?void 0:t.parentElement;e&&(e.scrollTop=s.offsetTop)}},this._hideControl=()=>{this._removeButtonsEventListeners(),this._floor=void 0,this._root.style.display="none"},this._onLevelChange=e=>{this._switchCurrentFloorLevel(e.floorLevelIndex)},this._controlHandler=e=>()=>{this._switchCurrentFloorLevel(e),this._floor&&this._map.setFloorPlanLevel(this._floor.floorPlanId,e)},this._switchCurrentFloorLevel=e=>{this._floor&&(this._wrap.querySelector(`.${Bc.control}[name="${this._floor.currentFloorLevelIndex}"]`).disabled=!1,this._wrap.querySelector(`.${Bc.control}[name="${e}"]`).disabled=!0,this._floor.currentFloorLevelIndex=e)},this._map=e,this._root=this._wrap.querySelector(`.${Bc.root}`),this._content=this._wrap.querySelector(`.${Bc.content}`),this._handlers=new WeakMap,this._root.style.display="none",e.on("floorplanshow",this._showControl),e.on("floorplanhide",this._hideControl),e.on("floorlevelchange",this._onLevelChange)}destroy(){this._map.off("floorplanshow",this._showControl),this._map.off("floorplanhide",this._hideControl),this._map.off("floorlevelchange",this._onLevelChange),this._removeButtonsEventListeners(),super.destroy()}}var Uc=i(3274),Zc={};Zc.styleTagTransform=fl(),Zc.setAttributes=dl(),Zc.insert=ll().bind(null,"head"),Zc.domAPI=rl(),Zc.insertStyleElement=ul();ol()(Uc.Z,Zc);const Hc=Uc.Z&&Uc.Z.locals?Uc.Z.locals:void 0;class Gc{constructor(e,t){this.wrap=document.createElement("div"),this.wrap.className=Hc.controlPane,this.containers={};const{rootContainer:i}=e._impl.modules.layout;i.appendChild(this.wrap),this.padding={top:10,right:10,bottom:10,left:10},this.setPadding(t.padding||{})}setPadding(e){Object.keys(this.padding).forEach((t=>{var i;const n=t;this.padding[n]=null!==(i=e[n])&&void 0!==i?i:10,this.wrap.style[`margin${n.replace(/^\w/,(e=>e.toUpperCase()))}`]=`${this.padding[n]}px`}))}getPadding(){return Object.assign({},this.padding)}destroy(){this.wrap.remove()}getContainerByPosition(e){let t=this.containers[e];return t||(t=this.containers[e]=this._initControlContainer(e)),t}_initControlContainer(e){const t=document.createElement("div");return t.classList.add(Hc.container,Hc[e]),this.wrap.appendChild(t),t}}class Wc{constructor(e){this.commPoiQueue=[],this.msgOrderNumber=0,this.utcOffset=function(){const e=(new Date).getTimezoneOffset(),t=e>0?"-":"+",i=`${Math.floor(Math.abs(e)/60)}`,n=""+Math.abs(e)%60;return t+(i.length>1?i:"0"+i)+":"+(n.length>1?n:"0"+n)}(),this.unsentMessages=[],this.onEvent=({commPoiIds:e})=>{const t=Date.now();this.commPoiQueue.push(...e.map((e=>({id:e,timestamp:t})))),this.timer||(this.timer=window.setTimeout(this.sendMessages,5e3))},this.onSendFail=e=>{this.unsentMessages.push(...e),this.timer||(this.timer=window.setTimeout(this.sendMessages,5e3))},this.sendMessages=()=>{this.timer=void 0;const{tileKey:e,sessionId:t}=this.map._impl.state,i=[...this.unsentMessages,...this.commPoiQueue.map((({id:i,timestamp:n})=>function(e,t,i,n,o,s){const r={type:302,eventType:"view",eventId:Fc(),eventOrdinal:i,uiElement:{name:"POI",ownerName:"map"},timestamp:t,utcOffset:o,payload:{POI:{adsHighlight:!0,entity:{id:e,type:"branch"}}},common:{formatVersion:3,appVersion:"v1",product:44,apikey:n}};s&&(r.common.sessionId=s);return r}(i,n,this.msgOrderNumber++,e,this.utcOffset,t)))];this.commPoiQueue=[],this.unsentMessages=[],i.length&&fetch("https://s1.bss.2gis.com/bss/3",{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).then((e=>{e.ok||this.onSendFail(i)}),(()=>this.onSendFail(i)))},this.map=e,e._impl.on("commpoishow",this.onEvent)}destroy(){clearTimeout(this.timer),this.commPoiQueue=[],this.timer=void 0,this.map._impl.off("commpoishow",this.onEvent)}}const Vc=2,qc=20;var Xc=i(6032),$c={};$c.styleTagTransform=fl(),$c.setAttributes=dl(),$c.insert=ll().bind(null,"head"),$c.domAPI=rl(),$c.insertStyleElement=ul();ol()(Xc.Z,$c);const Yc=Xc.Z&&Xc.Z.locals?Xc.Z.locals:void 0,Kc={en:"m",ru:"м"},Jc={en:"km",ru:"км"};class Qc extends mc{constructor(e,t){super(e,"",t),this._render=()=>{const e=this._wrap.getBoundingClientRect(),t=this._calcSize([e.x,e.y],e.width||66,0),i=`\n            <div class="${Yc.root}">\n                <div class="${Yc.label}">\n                    ${function(e,t){if(e<1e3)return`${e} ${Kc[t]||Kc.en}`;return`${(e/1e3).toFixed(1)} ${Jc[t]||Jc.en}`}(t,this._map.getLanguage())}\n                </div>\n            </div>\n        `;this._wrap.innerHTML=i},this._map=e,this._render(),e.on("zoom",this._render),e.on("pitch",this._render),e.on("changeLanguage",this._render)}destroy(){this._map.off("zoom",this._render),this._map.off("pitch",this._render),this._map.off("changeLanguage",this._render),super.destroy()}_calcSize(e,t,i){return L.$X(this._map.getCenter(),this._map.getZoom(),this._map.getRotation(),this._map.getSize(),this._map.getPitch(),e,void 0,this._map.getPadding(),t,i)}}class ed{constructor(e){this._impl=e._impl.getDefaultSource()}setFeatureStateMap(e){this._impl.setFeatureStateMap(e)}}class td extends uc{constructor(e,t){var i,n,o;let s;if(super(),"string"==typeof e){const t=document.getElementById(e);if(!t)throw new Error(`Could not found html element with id: ${e}`);s=t}else s=e;const r=Object.assign(Object.assign({},t),{disableHoverStyles:null===(i=t.disableHoverStyles)||void 0===i||i,tileServer:t.tileServer||"tile{subdomain}-sdk.maps.2gis.com",sendAnalytics:!1===t.disableAnalytics,style:t.style||"c080bb6a-8134-4993-93a1-5b4d8c36a59b",styleOptions:t.styleOptions,styleState:t.styleState,minZoom:null!==(n=t.minZoom)&&void 0!==n?n:Vc,maxZoom:null!==(o=t.maxZoom)&&void 0!==o?o:qc,sessionId:Fc(),hillshade:t.hillshade?{}:void 0});this._impl=new wl(s,r),this._impl.on("idle",(e=>this._emitMapEvent("idle",e))).on("ready",(e=>this._emitMapEvent("ready",e))).on("resize",(e=>this._emitMapEvent("resize",e))).on("move",(e=>this._emitMapEvent("move",e))).on("movestart",(e=>this._emitMapEvent("movestart",e))).on("moveend",(e=>this._emitMapEvent("moveend",e))).on("center",(e=>this._emitMapEvent("center",e))).on("centerstart",(e=>this._emitMapEvent("centerstart",e))).on("centerend",(e=>this._emitMapEvent("centerend",e))).on("zoom",(e=>this._emitMapEvent("zoom",e))).on("zoomstart",(e=>this._emitMapEvent("zoomstart",e))).on("zoomend",(e=>this._emitMapEvent("zoomend",e))).on("rotation",(e=>this._emitMapEvent("rotation",e))).on("rotationstart",(e=>this._emitMapEvent("rotationstart",e))).on("rotationend",(e=>this._emitMapEvent("rotationend",e))).on("pitch",(e=>this._emitMapEvent("pitch",e))).on("pitchstart",(e=>this._emitMapEvent("pitchstart",e))).on("pitchend",(e=>this._emitMapEvent("pitchend",e))).on("trafficshow",(()=>this.emit("trafficshow"))).on("traffichide",(()=>this.emit("traffichide"))).on("floorcomplexshow",(({id:e,currentFloor:t,floorNames:i})=>this.emit("floorplanshow",{floorPlanId:e,currentFloorLevelIndex:t,floorLevels:i.map(((e,t)=>({floorLevelIndex:t,floorLevelName:e})))}))).on("floorcomplexhide",(e=>this.emit("floorplanhide",{floorPlanId:e.id}))).on("floorcomplexlevelchange",(e=>this.emit("floorlevelchange",{floorLevelName:e.floorName,floorLevelIndex:e.floorIndex,floorPlanId:e.id}))),this._impl.on("click",(e=>this._emitMapPointerEvent("click",e))).on("dblclick",(e=>this._emitMapPointerEvent("dblclick",e))).on("contextmenu",(e=>this._emitMapPointerEvent("contextmenu",e))).on("mousemove",(e=>this._emitMapPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitMapPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitMapPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitMapPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitMapPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitMapPointerEvent("touchstart",e))).on("touchend",(e=>this._emitMapPointerEvent("touchend",e))),this._impl.on("trafficscore",(({score:e})=>this.emit("trafficscore",{score:e}))),this._impl.on("styleload",(({style:e})=>this.emit("styleload",{style:e}))),this._controlPane=new Gc(this,{padding:t.controlsLayoutPadding}),this._initControls(t),t.disableBssStatistics||(this._commPoiShowDispatcher=new Wc(this)),new Cc(this),this.defaultSource=new ed(this)}setCenter(e,t){return this._impl.setCenter(e,t),this}getCenter(){return this._impl.getCenter()}setZoom(e,t){return this._impl.setZoom(e,t),this}getZoom(){return this._impl.getZoom()}getStyleZoom(){return this._impl.getStyleZoom()}setStyleZoom(e,t){return this._impl.setStyleZoom(e,t),this}setRotation(e,t){return this._impl.setRotation(e,t),this}getRotation(){return this._impl.getRotation()}setPitch(e,t){return this._impl.setPitch(e,t),this}getPitch(){return this._impl.getPitch()}setMinZoom(e,t){return this._impl.setMinZoom(e,t),this}getMinZoom(){return this._impl.getMinZoom()}getMaxZoom(){return this._impl.getMaxZoom()}setMaxZoom(e,t){return this._impl.setMaxZoom(e,t),this}setMinPitch(e,t){return this._impl.setMinPitch(e,t),this}setMaxPitch(e,t){return this._impl.setMaxPitch(e,t),this}getSize(){return this._impl.getSize()}isIdle(){return this._impl.isIdle()}getBounds(){return new Rc(this._impl.getBounds())}project(e){return this._impl.project(e)}unproject(e){return this._impl.unproject(e)}getProjectionMatrix(){return this._impl.getCameraViewProjectionMatrix().slice()}getWebGLContext(){return this._impl.getWebGLContext()}getCanvas(){return this._impl.getCanvas()}getContainer(){return this._impl.getExternalContainer()}invalidateSize(){return this._impl.invalidateSize(),this}showTraffic(){return this._impl.showTraffic(),this}hideTraffic(){return this._impl.hideTraffic(),this}setSelectedObjects(e=[]){return this._impl.setSelectedIds(e),this}setStyleById(e){return(0,M.mG)(this,void 0,void 0,(function*(){return this._impl.setStyle(e)}))}setLanguage(e){return this._impl.setLang(e),this.emit("changeLanguage",{lang:e}),this}getLanguage(){return this._impl.state.lang}setFloorPlanLevel(e,t){this._impl.changeFloorNumber(e,t)}setMaxBounds(e){return this._impl.setMaxBounds(e),this}getPadding(){return this._impl.getPadding()}getDefaultSource(){return this.defaultSource}setPadding(e,t){return this._impl.setPadding(e,t),this}setStyle(e,t){return this._impl.setStyle(e,t)}addLayer(e,t){return this._impl.addLayer(e,t),this}addIcon(e,t){return this._impl.addIcon(e,t),this}removeIcon(e){return this._impl.removeIcon(e),this}removeLayer(e){return this._impl.removeLayer(e),this}setAutoHoverMode(e){return this._impl.setAutoHoverMode(e),this}fitBounds(e,t){return this._impl.fitBounds(e,t),this}setStyleState(e){return this._impl.setStyleState(e),this}setStyleOptions(e){return this._impl.patchStyleState({trafficOn:e.traffic}),this}setOption(e,t){return this._impl.setOption(e,t),this}patchStyleState(e){return this._impl.patchStyleState(e),this}destroy(){var e;null===(e=this._commPoiShowDispatcher)||void 0===e||e.destroy(),this._controlPane.destroy(),this._impl.destroy()}setControlsLayoutPadding(e){this._controlPane.setPadding(e)}getControlsLayoutPadding(){return this._controlPane.getPadding()}showLabelsDebug(e){this._impl.showLabelsDebug(e)}hideLabelsDebug(){this._impl.hideLabelsDebug()}_emitMapEvent(e,t){this.emit(e,{isUser:t.isUser})}_emitMapPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o,target:s,targetData:r}=t;let a,l;if(void 0!==r)switch(r.type){case"geojson":a={type:r.type,source:r.source.mapglApiSource,feature:r.feature};break;case"default":{a={type:r.type,id:r.id};const{floorId:e}=r;e&&(a.floorId=e);break}}void 0!==s&&(l={id:s.id},s.center&&(l.center=s.center)),this.emit(e,{originalEvent:i,lngLat:n,point:o,target:l,targetData:a})}_initControls(e){if(!1!==e.copyright&&this._impl.modules.tileKeyInfo.getKeyInfo().then((({showSberLogo:t})=>{new Lc(this,{position:"string"==typeof e.copyright?e.copyright:"bottomRight",interactive:e.interactiveCopyright,autoHide:e.autoHideOSMCopyright,showSberLogo:t})})),!1!==e.zoomControl){const t="string"==typeof e.zoomControl?e.zoomControl:"topRight";new gc(this,{position:t})}if(e.trafficControl){const t="string"==typeof e.trafficControl?e.trafficControl:"topRight";new Ic(this,{position:t})}if(e.scaleControl){const t="string"==typeof e.scaleControl?e.scaleControl:"bottomLeft";new Qc(this,{position:t})}if(e.floorControl){const t="string"==typeof e.floorControl?e.floorControl:"topRight";new Nc(this,{position:t})}}}function id(e,t){const i=Object.assign({},e);for(const e in t){const n=e;void 0===i[n]&&(i[n]=t[n])}return i}const nd={minZoom:-1/0,maxZoom:1/0,anchor:[.5,.5],offset:[0,18],relativeAnchor:[.5,.5],zIndex:0,lineHeight:1.2,letterSpacing:0,haloRadius:0,fontSize:18,color:"#000000",haloColor:"#ffffff"},od={minZoom:-1/0,maxZoom:1/0,zIndex:0,icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSI0OHB4IiB2aWV3Qm94PSIwIDAgMzAgNDgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1MS4yICg1NzUxOSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+PHRpdGxlPlBhZ2UgMSBDb3B5PC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9IjUwJSIgeTE9IjUwJSIgeDI9IjUwJSIgeTI9IjAlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+PHN0b3Agc3RvcC1jb2xvcj0iIzFCODlFRSIgb2Zmc2V0PSIwJSI+PC9zdG9wPjxzdG9wIHN0b3AtY29sb3I9IiMzMTk4RUMiIG9mZnNldD0iMTAwJSI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGlkPSJSZWNvdmVyeS0wMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTgzOS4wMDAwMDAsIC00MjUuMDAwMDAwKSI+PGcgaWQ9IlBhZ2UtMS1Db3B5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MzkuMDAwMDAwLCA0MjUuMDAwMDAwKSI+PGVsbGlwc2UgaWQ9Ik92YWwtMyIgZmlsbD0iIzAwMDAwMCIgb3BhY2l0eT0iMC4wMzYzODA1OTciIGN4PSIxNSIgY3k9IjQ1LjUiIHJ4PSIzIiByeT0iMS41Ij48L2VsbGlwc2U+PGVsbGlwc2UgaWQ9Ik92YWwtMy1Db3B5IiBmaWxsPSIjMDAwMDAwIiBvcGFjaXR5PSIwLjAzNjM4MDU5NyIgY3g9IjE1IiBjeT0iNDUuNSIgcng9IjQuNSIgcnk9IjIuNSI+PC9lbGxpcHNlPjxwYXRoIGQ9Ik0xNSw0NS44ODM2MzUzIEwxNS44ODIzNTI5LDQ1Ljg4MzYzNTMgQzE1Ljg4MjM1MjksMjkuMjE3NzUyOSAyMC43NzY3NjQ3LDIzLjc5NzQ1ODggMjcuOTg3MzUyOSwyMy43OTc0NTg4IEwyOC4zMjk3MDU5LDIzLjc5NzQ1ODggQzI5LjA3Nzk0MTIsMjEuNTkwNjk0MSAzMCwxNy45OTE1NzY1IDMwLDE1LjAwMDQgQzMwLDcuMTQzOTI5NDEgMjMuNzY3OTQxMiwwLjAwMDQgMTUsMC4wMDA0IEM2LjIzMjA1ODgyLDAuMDAwNCAwLDcuMTQzOTI5NDEgMCwxNS4wMDA0IEMwLDE3Ljk5MTU3NjUgMC45MjIwNTg4MjQsMjEuNTkwNjk0MSAxLjY3MDI5NDEyLDIzLjc5NzQ1ODggTDIuMDEyNjQ3MDYsMjMuNzk3NDU4OCBDOS4yMjQxMTc2NSwyMy43OTc0NTg4IDE0LjExNzY0NzEsMjkuMjE3NzUyOSAxNC4xMTc2NDcxLDQ1Ljg4MzYzNTMgTDE1LDQ1Ljg4MzYzNTMgWiIgaWQ9IkZpbGwtMSIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSI+PC9wYXRoPjwvZz48L2c+PC9nPjwvc3ZnPg==",interactive:!0,hoverSize:[15,43],rotation:0,userData:void 0};class sd extends uc{constructor(e,t){super(),t.icon||(t.anchor=[15,43]);const i=id(t,od);this.userData=i.userData,this.rootOptions={zIndex:i.zIndex,minZoom:i.minZoom,maxZoom:i.maxZoom},this._impl=new Ql(e._impl,{coordinates:i.coordinates,icon:i.icon,zIndex:i.zIndex,minZoom:i.minZoom,maxZoom:i.maxZoom,interactive:i.interactive,label:rd(this.rootOptions,t.label),anchor:t.anchor,size:t.size,rotation:t.rotation,hoverIcon:t.hoverIcon,hoverSize:t.hoverSize,hoverAnchor:t.hoverAnchor}),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}setIcon(e){return this._impl.setIcon(e),this}setHoverIcon(e){return this._impl.setHoverIcon(e),this}setRotation(e){return this._impl.setRotation(e),this}getRotation(){return this._impl.getRotation()}setLabel(e){return this._impl.setLabel(rd(this.rootOptions,e)),this}setCoordinates(e){return this._impl.setCoordinates(e),this}getCoordinates(){return this._impl.getCoordinates()}show(){return this._impl.show(),this}hide(){return this._impl.hide(),this}destroy(){this._impl.destroy()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}function rd(e,t){var i,n,o;if(!t)return;t.minZoom=Math.max(null!==(i=t.minZoom)&&void 0!==i?i:e.minZoom,e.minZoom),t.maxZoom=Math.min(null!==(n=t.maxZoom)&&void 0!==n?n:e.maxZoom,e.maxZoom),t.zIndex=null!==(o=t.zIndex)&&void 0!==o?o:e.zIndex+1e-5;const s=id(t,nd);return void 0===t.offset&&void 0!==t.anchor&&(s.offset=t.anchor.map((e=>-e))),{text:s.text,image:t.image,minZoom:s.minZoom,maxZoom:s.maxZoom,color:s.color,fontSize:s.fontSize,haloRadius:s.haloRadius,haloColor:s.haloColor,letterSpacing:s.letterSpacing,lineHeight:s.lineHeight,zIndex:s.zIndex,offset:s.offset,anchor:s.relativeAnchor,font:"Open_Sans"}}const ad={anchor:[0,0],offset:[0,0],fontSize:24,color:"#000000",haloColor:"#ffffff",haloRadius:0,minZoom:-1/0,maxZoom:1/0,zIndex:0,letterSpacing:0,lineHeight:1.2,relativeAnchor:[.5,.5],userData:void 0};class ld{constructor(e,t){this.userData=t.userData;const i=id(t,ad);void 0===t.offset&&void 0!==t.anchor&&(i.offset=t.anchor.map((e=>-e))),this._impl=new Yl(e._impl,{coordinates:i.coordinates,text:i.text,minZoom:i.minZoom,maxZoom:i.maxZoom,color:i.color,fontSize:i.fontSize,haloRadius:i.haloRadius,haloColor:i.haloColor,letterSpacing:i.letterSpacing,lineHeight:i.lineHeight,zIndex:i.zIndex,offset:i.offset,anchor:i.relativeAnchor,image:t.image,font:"Open_Sans"})}destroy(){this._impl.remove()}show(){return this._impl.show(),this}hide(){return this._impl.hide(),this}setCoordinates(e){return this._impl.setCoordinates(e),this}getCoordinates(){return this._impl.getCoordinates()}}const cd={minZoom:-1/0,maxZoom:1/0,zIndex:0,anchor:[-0,-0],preventMapInteractions:!0,userData:void 0,interactive:!0};class dd{constructor(e,t){this.userData=t.userData;const i=id(t,cd);this._impl=new zr(e._impl,{coordinates:i.coordinates,html:i.html,offset:[-i.anchor[0],-i.anchor[1]],minZoom:i.minZoom,maxZoom:i.maxZoom,zIndex:i.zIndex,preventMapInteractions:i.preventMapInteractions,interactive:i.interactive,animate:false})}destroy(){this._impl.destroy()}setCoordinates(e){return this._impl.setPosition(e),this}setAnchor(e){return this._impl.setOffset([-e[0],-e[1]]),this}setContent(e){return this._impl.setContent(e),this}getCoordinates(){return this._impl.getPosition()}getAnchor(){const e=this._impl.getOffset();return[-e[0],-e[1]]}getContent(){return this._impl.getHtmlElement()}}const hd={zIndex:0,minZoom:-1/0,maxZoom:1/0,color:"#3388ff33",strokeColor:"#3388ff",strokeWidth:1,interactive:!0,userData:void 0};class ud extends uc{constructor(e,t){super(),this.userData=t.userData,this.options=id(t,hd);const i={coordinates:this.options.coordinates,radius:this.options.radius,minZoom:this.options.minZoom,maxZoom:this.options.maxZoom,interactive:this.options.interactive,color:this.options.color,zIndex:this.options.zIndex,borderWidth:this.options.strokeWidth,borderColor:this.options.strokeColor,segments:150};this._impl=new zl(e._impl,i),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}destroy(){this._impl.remove()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}const md={interactive:!0,maxZoom:1/0,minZoom:-1/0,color:"#ffffff",radius:20,diameter:NaN,zIndex:0,strokeWidth:3,stroke2Width:0,strokeColor:"#3388ff",stroke2Color:"#00000000",userData:void 0};class fd extends uc{constructor(e,t){super(),this.userData=t.userData,this.options=id(t,md);const i={coordinates:this.options.coordinates,interactive:this.options.interactive,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,color:this.options.color,width:Number.isNaN(this.options.diameter)?this.options.radius:this.options.diameter,zIndex:this.options.zIndex,borderWidth:this.options.strokeWidth,borderColor:this.options.strokeColor,border2Width:this.options.stroke2Width,border2Color:this.options.stroke2Color,draggable:!1};this._impl=new le(e._impl,i),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}destroy(){this._impl.remove()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}const pd={interactive:!0,maxZoom:1/0,minZoom:-1/0,width:3,width2:0,width3:0,color:"#3388ff",color2:"#00000000",color3:"#00000000",zIndex:0,zIndex2:-1,zIndex3:-2,dashLength:0,gapLength:0,gapColor:"#ffffff00",userData:void 0};class _d extends uc{constructor(e,t){if(super(),this.userData=t.userData,this.options=id(t,pd),t.dashLength){const t={coordinates:this.options.coordinates,interactive:this.options.interactive,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,width:this.options.width,width2:this.options.width2,dashColor:this.options.color,dash2Color:this.options.color,gapColor:this.options.gapColor,dashLength:this.options.dashLength,dash2Length:0,zIndex:this.options.zIndex,zIndex2:this.options.zIndex2,gapLength:0===this.options.gapLength?this.options.dashLength:this.options.gapLength,displayTileBounds:!1,showAnimation:{animate:!1}};this._impl=new Pl(e._impl,t),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}else{const t={coordinates:this.options.coordinates,interactive:this.options.interactive,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,width:this.options.width,width2:this.options.width2,width3:this.options.width3,color:this.options.color,color2:this.options.color2,color3:this.options.color3,zIndex:this.options.zIndex,zIndex2:this.options.zIndex2,zIndex3:this.options.zIndex3,displayTileBounds:!1,showAnimation:{animate:!1}};this._impl=new Ml(e._impl,t),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}}destroy(){this._impl.remove()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}const vd={interactive:!0,maxZoom:1/0,minZoom:-1/0,color:"#3388ff33",zIndex:0,strokeWidth:3,strokeColor:"#3388ff",userData:void 0};class gd extends uc{constructor(e,t){super(),this.userData=t.userData,this.options=id(t,vd);const i={coordinates:this.options.coordinates,interactive:this.options.interactive,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,color:this.options.color,zIndex:this.options.zIndex,strokeWidth:this.options.strokeWidth,strokeColor:this.options.strokeColor};this._impl=new kl(e._impl,i),this._impl.on("click",(e=>this._emitPointerEvent("click",e))).on("dblclick",(e=>this._emitPointerEvent("dblclick",e))).on("mousemove",(e=>this._emitPointerEvent("mousemove",e))).on("mouseover",(e=>this._emitPointerEvent("mouseover",e))).on("mouseout",(e=>this._emitPointerEvent("mouseout",e))).on("mousedown",(e=>this._emitPointerEvent("mousedown",e))).on("mouseup",(e=>this._emitPointerEvent("mouseup",e))).on("touchstart",(e=>this._emitPointerEvent("touchstart",e))).on("touchend",(e=>this._emitPointerEvent("touchend",e)))}destroy(){this._impl.remove()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}const yd={minZoom:-1/0,maxZoom:1/0,zIndex:0,opacity:1};class bd{constructor(e,t){this.options=id(t,yd);const i={bounds:this.options.bounds,image:{url:this.options.image.url},minZoom:this.options.minZoom,maxZoom:this.options.maxZoom,zIndex:this.options.zIndex,opacity:this.options.opacity};this._impl=new sc(e._impl,i)}updateImage(e){return(0,M.mG)(this,void 0,void 0,(function*(){yield this._impl.updateImage(e)}))}destroy(){this._impl.destroy()}}const wd={attributes:{},maxZoom:17};class xd{constructor(e,t){this.options=id(t,wd),this._impl=new Pn.gs(e._impl,this.options,this)}destroy(){this._impl.destroy()}setAttributes(e){return this._impl.setAttributes(e),this}getAttributes(){return this._impl.getAttributes()}setData(e){return(0,M.mG)(this,void 0,void 0,(function*(){yield this._impl.setData(e)}))}}var Id=i(3103),Sd={};Sd.styleTagTransform=fl(),Sd.setAttributes=dl(),Sd.insert=ll().bind(null,"head"),Sd.domAPI=rl(),Sd.insertStyleElement=ul();ol()(Id.Z,Sd);const Md=Id.Z&&Id.Z.locals?Id.Z.locals:void 0;class Td extends mc{constructor(e,t){super(e,(e=>`\n    <div class=${Md.container}>\n        <div class=${Md.text}>\n            ${e}\n        </div>\n    </div>\n`)(t),{position:"bottomLeft"})}}const Pd={attributes:{},attribution:"",minZoom:Vc,maxZoom:qc};class Ld{constructor(e,t){this.options=id(t,Pd),this._impl=new ac(e._impl,this.options),this._attribution=new Td(e,this.options.attribution)}destroy(){this._impl.destroy(),this._attribution.destroy()}setAttributes(e){return this._impl.setAttributes(e),this}getAttributes(){return this._impl.getAttributes()}}function Ed(e){return!kd(e)}function kd(e){if("undefined"==typeof window||"undefined"==typeof document)return"not a browser";if(!Boolean(Function.prototype&&Function.prototype.bind))return"insufficient Function support";if(!("JSON"in window&&"parse"in JSON&&"stringify"in JSON))return"insufficient JSON support";if(!function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;const e=new Blob([""],{type:"text/javascript"}),t=URL.createObjectURL(e);let i,n=null;try{n=new Worker(t),i=!0}catch(e){i=!1}n&&n.terminate();return URL.revokeObjectURL(t),i}())return"insufficient worker support";if(!ArrayBuffer.isView)return"insufficient ArrayBuffer support";if(!function(){const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d");if(!t)return!1;const i=t.getImageData(0,0,1,1);return i&&i.width===e.width}())return"insufficient Canvas/getImageData support";const t=function(e){const t=String(e);void 0===zd[t]&&(zd[t]=function(e){const t=function(e){const t=document.createElement("canvas"),i={antialias:!1,stencil:!0,failIfMajorPerformanceCaveat:e};if(!("WebGLRenderingContext"in window))return!1;return t.getContext("webgl",i)||t.getContext("experimental-webgl",i)}(e);if(!t)return{ok:!1,msg:"error on get context"};for(const e of["OES_element_index_uint","OES_standard_derivatives","OES_vertex_array_object"])if(!t.getExtension(e))return{ok:!1,msg:`${e} extension is not supported`};let i;try{i=t.createShader(t.VERTEX_SHADER)}catch(e){return{ok:!1,msg:"browser block shader API"}}if(!i||t.isContextLost())return{ok:!1};return t.shaderSource(i,"void main() {}"),t.compileShader(i),{ok:!0===t.getShaderParameter(i,t.COMPILE_STATUS)}}(e));return zd[t]}(e&&e.failIfMajorPerformanceCaveat||!1);return t.ok?Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.isArray?Boolean(Object.keys&&Object.assign&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.freeze)?function(){const e=document.createElement("div");return e&&"function"==typeof e.after}()?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient DOM support":"insufficient Object support":"insufficient Array support":"insufficient WebGL support"+(t.msg?`: ${t.msg}`:"")}const zd={};setTimeout((()=>{const e=Array.from(document.querySelectorAll("script")).find((e=>e.src.match("https://mapgl.2gis.com/api/js")));if(!e)return;const t=function(e){const t=e.split("?")[1];if(!t)return;const i=t.split("&").map((e=>e.split("="))),n=i.find((e=>"callback"===e[0]));return n?n[1]:void 0}(e.src);if(t){if("function"!=typeof window[t])throw new Error(`Not found callback function with name "${t}"`);window[t]()}}),0);i(2205)},1525:(e,t,i)=>{i.r(t),i.d(t,{MAP_DEFAULTS:()=>s,tiles:()=>r,hillshade:()=>a,commercialPoi:()=>l,modelCacheSize:()=>c,loadModelsInfoStyleZoom:()=>d,atlasSize:()=>h,urls:()=>u,traffic:()=>m,fonts:()=>f,icons:()=>p,styles:()=>_,events:()=>v,analytics:()=>g,workerResetDebounceTime:()=>y,houseHover:()=>b,tileAnimation:()=>w,buildingAnimation:()=>x,entranceAnimation:()=>I,identify:()=>S,labeling:()=>M,render:()=>T,defaultLang:()=>P,zoom:()=>L,inertia:()=>E,camera:()=>k,floors:()=>z,fences:()=>A,performanceCheck:()=>C,commercialCitySublayers:()=>F,commercialSublayers:()=>R,personalSublayers:()=>D,landmarkPoiSublayers:()=>O,landmarkRasterSizes:()=>B,defaultMarkerIcon:()=>j,defaultMarkerAnchor:()=>N});var n=i(7202),o=i(9102);const s={minZoom:2,maxZoom:20},r={protocol:"https",server:o.X,subdomains:"0123",tileSet:n.X?"%TILESET%":"vector_b",tileKey:"empty",appId:"empty",cacheRatio:2,maxUniverseZoom:8,maxRegionalZoom:15,maxDetailLevel:17,displayBounds:!1},a={minZoom:5,maxZoom:11},l={minZoom:10,maxZoom:14,tileSet:"com_poi_web",rasterSizes:[96,84,72,60,48,36,24]},c=100,d=13.5,h=[2048,2048],u={tiles:"{protocol}://{host}/vt?r={request}&ts={tileSet}&key={tileKey}&appId={appId}&lang={lang}&default_lang={defaultLang}&s={sessionId}",metatile:"{protocol}://{host}/metafiles/{hash}/metatile.json?ts={tileSet}",modelInfo:"{protocol}://{host}/metafiles/{regionId}/models.json?ts={tileSet}",model:"{protocol}://{host}/metafiles/{regionId}/{name}?ts={tileSet}",convertData:"{protocol}://{host}/metafiles/{hash}/convert.json?ts={tileSet}",dynamicPoi:"{protocol}://{host}/metafiles/{regionId}/poi/{id}_{width}_{height}.png?ts={tileSet}"},m={protocol:"https",host:o._A,url:"{protocol}://{host}/tiles?tls={tiles}&reg={regions}&tm={time}&fmt=json&z={z}",timestampUrl:"{protocol}://{host}/meta?reg={regions}&time&score",updateInterval:12e4,minZoom:10,maxZoom:16,maxDetailLevel:17},f={defaultUrl:o.hs,gamma:.08,baseSize:24,baseLineHeight:1.2,bomCharCode:65279},p={defaultUrl:o.R_,legacyIconsUrl:o.vx,nameTemplate:"{name}"},_={url:o.k1,path:"styles/{id}"},v={doubleClickTime:185,dragThreshold:2,pitchWaitingTime:200,pitchThreshold:7},g={gaCode:"UA-25529177-4",gaName:"mapglEngine"},y=3e3,b={inAnimationTime:180,inAnimationType:"linear",outAnimationTime:800,outAnimationType:"linear"},w={time:300,type:"linear"},x={minStyleZoom:16,duration:500,easing:"easeOutQuint"},I={bounceType:"easeOutElastic",bounceTime:750,growType:"easeInOutQuad",growTime:750,stagger:0},S={pixelDensity:.5,sceneOpacity:0,cacheDebounceTime:400,pickDistance:3},M={interval:220,animationTime:200,animationType:"linear",tileMultiplier:1.5,axisAngleToleranceDeg:45,axisCheckDistancePx:13,commercialMargins:{default:{topBottom:60,leftRight:60},city:{topBottom:500,leftRight:500}},lineLabelsHidePitchDeg:40,maxLabelLength:30},T={alwaysRerender:!1},P="en",L={mouseDelta:.65,macTouchDelta:.0018,animDuration:400,throttleDelay:100,mouseRotateDelta:2.5,mousePitchDelta:2.5,mobilePinchDelta:1,mobileTapDelta:10},E={duration:1300,maxSpeed:8,minSpeed:.02,nonLinearity:5},k={fov:60,near:1e3,far:Math.pow(2,34),minCalculationScreenHeight:1e3,viewportLimitRatio:2,perspectiveDistanceLimitRatio:10},z={enabled:!0,url:o.kv,displayStyleZoom:17,wallHeight:800,islandHeight:400,wallMinBrightness:.8265,wallMaxBrightness:.95,viewportPadding:.2},A={lightIntensity:.1},C={fpsCaveat:10},F=["Commercial_poi_city"],R=["Commercial_poi_default","Commercial_poi_custom","Commercial_poi_navi",...F],D=["s_personal_poi"],O=["Landmark_poi","Landmark_point"],B=[105,84,63,42,21],j="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSI0OHB4IiB2aWV3Qm94PSIwIDAgMzAgNDgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1MS4yICg1NzUxOSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+PHRpdGxlPlBhZ2UgMSBDb3B5PC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9IjUwJSIgeTE9IjUwJSIgeDI9IjUwJSIgeTI9IjAlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+PHN0b3Agc3RvcC1jb2xvcj0iIzFCODlFRSIgb2Zmc2V0PSIwJSI+PC9zdG9wPjxzdG9wIHN0b3AtY29sb3I9IiMzMTk4RUMiIG9mZnNldD0iMTAwJSI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGlkPSJSZWNvdmVyeS0wMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTgzOS4wMDAwMDAsIC00MjUuMDAwMDAwKSI+PGcgaWQ9IlBhZ2UtMS1Db3B5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MzkuMDAwMDAwLCA0MjUuMDAwMDAwKSI+PGVsbGlwc2UgaWQ9Ik92YWwtMyIgZmlsbD0iIzAwMDAwMCIgb3BhY2l0eT0iMC4wMzYzODA1OTciIGN4PSIxNSIgY3k9IjQ1LjUiIHJ4PSIzIiByeT0iMS41Ij48L2VsbGlwc2U+PGVsbGlwc2UgaWQ9Ik92YWwtMy1Db3B5IiBmaWxsPSIjMDAwMDAwIiBvcGFjaXR5PSIwLjAzNjM4MDU5NyIgY3g9IjE1IiBjeT0iNDUuNSIgcng9IjQuNSIgcnk9IjIuNSI+PC9lbGxpcHNlPjxwYXRoIGQ9Ik0xNSw0NS44ODM2MzUzIEwxNS44ODIzNTI5LDQ1Ljg4MzYzNTMgQzE1Ljg4MjM1MjksMjkuMjE3NzUyOSAyMC43NzY3NjQ3LDIzLjc5NzQ1ODggMjcuOTg3MzUyOSwyMy43OTc0NTg4IEwyOC4zMjk3MDU5LDIzLjc5NzQ1ODggQzI5LjA3Nzk0MTIsMjEuNTkwNjk0MSAzMCwxNy45OTE1NzY1IDMwLDE1LjAwMDQgQzMwLDcuMTQzOTI5NDEgMjMuNzY3OTQxMiwwLjAwMDQgMTUsMC4wMDA0IEM2LjIzMjA1ODgyLDAuMDAwNCAwLDcuMTQzOTI5NDEgMCwxNS4wMDA0IEMwLDE3Ljk5MTU3NjUgMC45MjIwNTg4MjQsMjEuNTkwNjk0MSAxLjY3MDI5NDEyLDIzLjc5NzQ1ODggTDIuMDEyNjQ3MDYsMjMuNzk3NDU4OCBDOS4yMjQxMTc2NSwyMy43OTc0NTg4IDE0LjExNzY0NzEsMjkuMjE3NzUyOSAxNC4xMTc2NDcxLDQ1Ljg4MzYzNTMgTDE1LDQ1Ljg4MzYzNTMgWiIgaWQ9IkZpbGwtMSIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSI+PC9wYXRoPjwvZz48L2c+PC9nPjwvc3ZnPg==",N=[15,43]},7202:(e,t,i)=>{i.d(t,{X:()=>n});const n=!1},9102:(e,t,i)=>{i.d(t,{X:()=>o,_A:()=>s,kv:()=>r,k1:()=>a,hs:()=>l,R_:()=>c,vx:()=>d,ns:()=>h,k0:()=>u,aT:()=>m});var n=i(7202);const o=n.X?"%TILESERVER%":"tile{subdomain}.maps.2gis.com",s=n.X?"%TRAFFICSERVER%":"jam.api.2gis.com",r=n.X?"%FLOORSSERVER%":"https://floors.api.2gis.ru",a="https://styles.api.2gis.com",l="https://mapgl.2gis.com/api/fonts",c="https://disk.2gis.com/styles/assets/icons",d="https://disk.2gis.com/styles/{id}",h=n.X?"%KEYSERVER%":"https://keys.api.2gis.com/public/v1/keys/{keyID}/services/mapgl-js-api",u=n.X?"%RTLPLUGIN%":"https://mapgl.2gis.com/api/js/plugins/rtl-v1.0.1.js",m=n.X?"%RTLPLUGINHASH%":"sha512-YAPPEl+Atvsm/cMkrfWefmlQLAlKTGaqFjIkI6urAnDgam2uTVEVVnZZEhHCa91JjYYxa5yr4Ndb4Vl3NUovfA=="},9899:(e,t,i)=>{i.d(t,{y4:()=>n,sX:()=>o,ed:()=>s,_9:()=>r,Bq:()=>a,LF:()=>l,$U:()=>c,ax:()=>d,Gt:()=>h,Rw:()=>u,vL:()=>m,Fv:()=>f,p7:()=>p,Uo:()=>_,Hg:()=>v,CW:()=>g,DL:()=>y,L2:()=>b,Cd:()=>w});const n=256,o=Math.pow(2,32),s=o/2,r=Math.pow(2,20),a=Math.pow(2,16)-1,l=2.54,c=96,d=o/(n/c*l),h=.7071067811865475,u=4294967295,m=1175494351e-47,f=3402823466e29,p=["Arial","Helvetica","HelveticaNeueCyr","Open_Sans","Open_Sans_Semibold","Open_Sans_Italic","Segoe_UI","PT_Sans_Caption","PT_Sans","Verdana","Verdana_bold","Noto_Sans","Noto_Sans_Semibold","Noto_Sans_Italic","SuisseIntl_Bold"],_="Noto_Sans",v=1,g=v/2,y=-3,b=-4,w=2147483647},9231:(e,t,i)=>{i.d(t,{jf:()=>d,FJ:()=>p,hX:()=>_});var n=i(3990),o=i(8729),s=i(9899),r=i(9670),a=i(6158),l=i(5881),c=i(7422);const d=0,h={type:n.f.Static,index:-1,key:(0,r.fF)("",.5,.5),isSvg:!1,name:"",fileName:"",rasters:[],anchorX:.5,anchorY:.5},u=["default","marker","markerText","htmlLabel"],m={default:0,marker:1,markerText:2,htmlLabel:3},f={default:{default:!0,marker:!1,markerText:!0,htmlLabel:!0},marker:{default:!1,marker:!1,markerText:!0,htmlLabel:!1},markerText:{default:!0,marker:!0,markerText:!0,htmlLabel:!1},htmlLabel:{default:!0,marker:!1,markerText:!1,htmlLabel:!1}};function p(e){const t=[],i=Object.keys(o.Dz).length;for(let e=0;e<i;e++)t[e]=NaN;for(const i in e){if(void 0===o.Dz[i])throw new Error(`No such tile prop '${i}'`);t[o.Dz[i]]=e[i]}return t}class _{constructor(){this.style={id:d,revision:0,background:{color:(0,c.MV)("f6f2de")},layers:[],layersById:{},layerIdToInnerId:{},groupsById:{},iconBaseUrl:"",legacyIconBaseUrl:"",iconNameTemplate:"",fontUrlTemplate:"",rasterSets:{byIndex:{},byKey:{}},labelingGroups:{indexToGroup:u,groupToIndex:m,table:f},fonts:s.p7,fontNameToIndex:(0,l.PU)(s.p7),icons:{},dem:(0,a.vR)({})},this.needRenderIndexRebuild=!1,this.zIndexById={};const e=(0,a.qw)({type:"line",id:"debug-tile-bounds",minzoom:-1/0,maxzoom:1/0,style:{color:"#ff0000",width:1}});e&&this.addLayer(e,0)}getStyle(){return this.style}appendRasterSet(e,t){this.style.rasterSets.byIndex[e.index]=e,void 0!==t&&(this.style.rasterSets.byKey[t]=e)}removeRasterSet(e){this.style.rasterSets.byIndex[e]=h}getLabelingGroupIndex(e){const{groupToIndex:t}=this.style.labelingGroups;return void 0!==t[e]?t[e]:t.default}addLayer(e,t){this.style.layers.push(e),this.style.layersById[e.innerId]=e,void 0!==t&&(this.zIndexById[e.innerId]=t),this.needRenderIndexRebuild=!0}removeLayer(e){const t=this.style.layersById[e];if(!t)return;const i=this.style.layers.indexOf(t);-1!==i&&this.style.layers.splice(i,1),delete this.style.layersById[e]}update(){this.needRenderIndexRebuild&&(this.rebuildRenderIndex(),this.needRenderIndexRebuild=!1)}updateLayerStyle(e,{style:t,dataKeys:i}){const n=this.style.layersById[e];n&&(n.style=t,n.dataKeys=i)}rebuildRenderIndex(){this.style.layers.sort(((e,t)=>{var i,n;return(null!==(i=this.zIndexById[e.innerId])&&void 0!==i?i:0)-(null!==(n=this.zIndexById[t.innerId])&&void 0!==n?n:0)}));for(let e=0;e<this.style.layers.length;e++)this.style.layers[e].renderIndex=e}}},7422:(e,t,i)=>{i.d(t,{iL:()=>s,gC:()=>r,MV:()=>a});var n=i(9670);const o=(0,n.lK)([255,0,0,255]);function s(e){return"string"==typeof e&&/(#(?:[0-9a-f]{2}){2,4}|#[0-9a-f]{3}|(?:rgba?|hsla?)\((?:\d+%?(?:,|\s)+){2,3}[\s\/]*[\d\.]+%?\))/i.test(e)}function r(e){return"object"==typeof e&&e.type&&"color"===e.type}function a(e){const t=e.toLowerCase();let i=o;switch(t[0]){case"#":i=function(e){if(!new RegExp(`^#[a-f0-9]{${e.length-1}}$`).test(e)||![4,5,7,9].includes(e.length))return o;const t=function(e){if(e.length<7)return e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(5===e.length?e[4]+e[4]:"ff");if(7===e.length)return e+"ff";return e}(e),i=parseInt(t[1]+t[2],16),s=parseInt(t[3]+t[4],16),r=parseInt(t[5]+t[6],16),a=parseInt(t[7]+t[8],16);return(0,n.lK)([i,s,r,a])}(t);break;case"h":i=function(e){const t=l(e);t[0]/=360,t[1]/=100,t[2]/=100;const[i,o,s]=function(e,t,i){if(0===t)return[255*i,255*i,255*i];const n=i<.5?i*(1+t):i+t-i*t,o=2*i-n;return[255*c(o,n,e+1/3),255*c(o,n,e),255*c(o,n,e-1/3)]}(t[0],t[1],t[2]),r=void 0!==t[3]?255*t[3]:255;return(0,n.lK)([Math.round(i),Math.round(o),Math.round(s),Math.round(r)])}(t);break;case"r":i=function(e){const[t,i,o,s]=l(e),r=void 0!==s?255*s:255;return(0,n.lK)([Math.round(t),Math.round(i),Math.round(o),Math.round(r)])}(t)}return i}function l(e){return e.split("(")[1].split(")")[0].split(",").map((e=>parseFloat(e)))}function c(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}},6158:(e,t,i)=>{i.d(t,{vR:()=>L,ys:()=>x,Wy:()=>S,z8:()=>I,Cp:()=>w,qw:()=>P});var n=i(7422),o=i(6554),s=i(9670),r=i(7354),a=i(6285),l=i(9899),c=i(3990),d=i(7768);function h(e){const t=function(e){const t=(e.groups||[]).concat(o.YW.groups).reduce(((e,t)=>(e.includes(t)||e.push(t),e)),[]),i=(e.overlay||[]).concat(o.YW.overlay).concat(t.reduce(((e,t)=>(t===o.T_||t===o.R_||t===o.n3||e.push([t,o.R_]),e)),[])).reduce(((e,i)=>{const n=[];for(const e of i)t.includes(e)&&n.push(e);return n.length>1&&e.push(n),1===i.length&&1===n.length&&e.push(n),e}),[]);return{groups:t,overlay:i,intersect:o.YW.intersect}}(e),{groups:i,table:n}=function(e){const{groups:t,overlay:i,intersect:n}=e,o=t.reduce(((e,t,i)=>(e[t]=i,e)),{}),s=[];for(let e=0;e<t.length;e++){const e=[];for(let i=0;i<t.length;i++)e.push(!0);s.push(e)}for(let e=0;e<i.length;e++){const t=i[e];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){const n=o[t[e]],r=o[t[i]];s[n][r]=!1,s[r][n]=!1}}for(let e=0;e<n.length;e++){const t=n[e];for(let e=0;e<t.length;e++)for(let i=e+1;i<t.length;i++){const n=o[t[e]],r=o[t[i]];s[n][r]=!0,s[r][n]=!0}}return{groups:t,table:s}}(t),s={};for(let e=0;e<n.length;e++){const t=n[e],o=i[e];s[o]={};for(let r=0;r<t.length;r++){const t=i[r];s[o][t]=n[e][r]}}const r=i.reduce(((e,t,i)=>(e[t]=i,e)),{});return{indexToGroup:i,groupToIndex:r,table:s}}var u=i(5881),m=i(9696),f=i(6826),p=i(947);class _ extends Error{constructor(e){super(`Unknown expression type '${e[0]}' in '${JSON.stringify(e)}'`),this.name="UnknownExpressionTypeError",Object.setPrototypeOf(this,new.target.prototype)}}function v(e,t){if((0,s.aH)(e))return(0,n.iL)(e)?(0,n.MV)(e):e;switch(e[0]){case"all":return function(e,t){return{type:"all",array:e.slice(1).map((e=>v(e,t)))}}(e,t);case"any":return function(e,t){return{type:"any",array:e.slice(1).map((e=>v(e,t)))}}(e,t);case"match":return function(e,t){const i={type:"match",input:v(e[1],t),cases:[],defaultOutput:v(e[e.length-1],t)},n=e.slice(2,-1);for(let e=0;e<n.length;e+=2){const o=n[e].reduce(((e,t)=>("boolean"==typeof t&&e.push(Number(t)),e.push(t),e)),[]),s={values:new Set(o),output:v(n[e+1],t)};i.cases.push(s)}return i}(e,t);case"in":return function(e,t){const i=v(e[1],t),n=e[2][0];if("get"!==n&&"global"!==n&&"sourceAttr"!==n)throw new Error("InExpression supports only get, global or source attr expression as a second argument");const o=v(e[2],t);return{type:"in",element:i,array:o}}(e,t);case"interpolate":return y(e,t);case"step":return function(e,t){const i={type:"step",steps:[],value:v(e[1],t)},n={key:0,value:v(e[2],t)};i.steps.push(n);const o=e.slice(3);for(let e=0;e<o.length;e+=2){const n={key:o[e],value:v(o[e+1],t)};i.steps.push(n)}return i}(e,t);case"featureState":return function(e,t){const i=e[0],n=(0,m.qS)(e[1]);return{type:i,dataIndex:t?t.getUniqueIndex(`${i}:${n}`):NaN,property:n}}(e,t);case"get":case"sourceAttr":case"global":return b(e,t);case"zoom":return{type:"zoom"};case"heatmap-density":return{type:"heatmap-density"};case"shading-intensity":return{type:"shading-intensity"};case"to-boolean":case"to-color":case"!":return function(e,t){return{type:e[0],value:v(e[1],t)}}(e,t);case"==":case"!=":case"<":case"<=":case">":case">=":return function(e,t){const i=v(e[1],t),n=v(e[2],t);return{type:e[0],leftValue:i,rightValue:n}}(e,t);default:throw new _(e)}}function g(e,t){return void 0===e?e:v(e,t)}function y(e,t){const i={type:"interpolate",base:1,argument:v(e[2],t),steps:[]};"exponential"===e[1][0]&&void 0!==e[1][1]&&(i.base=e[1][1]);const n=e.slice(3);for(let e=0;e<n.length;e+=2){const o={key:n[e],value:v(n[e+1],t)};i.steps.push(o)}return i}function b(e,t){const i=e[0],n=(0,m.qS)(e[1]);return{type:i,dataIndex:t?t.getUniqueIndex(`${i}:${n}`):NaN,property:n}}function w(e,t,i){var o,s;const r=L(null!==(o=e.dem)&&void 0!==o?o:{}),c={id:t,revision:0,background:{color:(0,n.MV)(e.background.color)},layers:[],layersById:{[f.h]:r},layerIdToInnerId:{},groupsById:{},iconBaseUrl:"",legacyIconBaseUrl:"",iconNameTemplate:"",fontUrlTemplate:"",fonts:l.p7,fontNameToIndex:(0,u.PU)(l.p7),rasterSets:{byIndex:{},byKey:{}},icons:e.icons||{},labelingGroups:h(null!==(s=e.labelingGroups)&&void 0!==s?s:{}),dem:r},d=new a.x;let m=e.layers;i&&(m=function(e,t){let i=0,n=0;function o(e,t){"custom"!==e.type&&((0,u.Kx)(e.filter)&&(i=t),"point"===e.type&&e.style.iconPriority&&e.style.iconPriority>n&&(n=e.style.iconPriority))}return e.forEach(((e,t)=>{"group"===e.type?e.layers.forEach((e=>o(e,t))):o(e,t)})),t.forEach((e=>{"point"===e.type&&(e.style.iconPriority=n)})),[...e.slice(0,i+1),...t,...e.slice(i+1)]}(e.layers,p.T));for(const e of m){const t=x(e);if(!t)continue;"group"===t.type&&(c.groupsById[t.innerId]=t,c.layerIdToInnerId[t.id]=t.innerId);("group"===t.type?t.layers:[t]).forEach((e=>{if(c.layers.push(e),c.layersById[e.innerId]=e,c.layerIdToInnerId[e.id]=e.innerId,"point"===e.type){I(e,d).forEach((e=>{c.rasterSets.byKey[e.key]||(c.rasterSets.byIndex[e.index]=e,c.rasterSets.byKey[e.key]=e)}))}}))}return c}function x(e){return"group"===e.type?function(e){var t;const i=new a.x,n=null===(t=e.orderBy)||void 0===t?void 0:t.map((e=>b(e,i))),o={id:e.id,innerId:(0,f.U)(),renderIndex:M.getIndex(),type:e.type,layers:[],orderBy:null!=n?n:[]};return e.layers.forEach(((e,t)=>{const i=P(e,n);i&&(i.groupId=o.innerId,i.groupIndex=t,i.renderIndex=o.renderIndex,o.layers.push(i))})),o}(e):P(e)}function I(e,t){const i=[];return e.style.iconImage&&(0,d.EG)(e.style.iconImage).forEach((n=>{n.length&&i.push(S(n,e,t))})),i}function S(e,t,i){const n=(0,s.fF)(e,t.style.iconAnchor[0],t.style.iconAnchor[1]);return{type:c.f.Static,index:i.getUniqueIndex(n),key:n,isSvg:!0,name:e,fileName:e,anchorX:t.style.iconAnchor[0],anchorY:t.style.iconAnchor[1],rasters:[]}}const M=new a.x;function T(e,t){return"appearance"===e.type?{type:e.type,tipMovementAmplitude:v(e.tipMovementAmplitude,t)}:e}function P(e,t){if("custom"===e.type)return{type:"custom",id:e.id,innerId:(0,f.U)(),renderIndex:M.getIndex(),filter:!1,minzoom:-1/0,maxzoom:1/0,dataKeys:[],style:{}};if(!e.style||"none"===e.style.visibility)return;const i=new a.x(t?t.length:0);let n;try{const t={id:e.id,innerId:(0,f.U)(),renderIndex:M.getIndex(),filter:v(e.filter||!1),minzoom:E(e.minzoom,-1/0),maxzoom:E(e.maxzoom,1/0),dataKeys:[],farLimit:e.farLimit};switch(e.type){case"line":{const s=(0,o.q0)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),width:v(s.width,i)}});break}case"lineExtrusion":{const s=(0,o.l7)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{sideColor:v(s.sideColor,i),strokeWidth:v(s.strokeWidth,i),strokeColor:v(s.strokeColor,i),height:v(s.height,i)}});break}case"polygon":{const s=(0,o.IJ)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),strokeColor:v(s.strokeColor,i),strokeWidth:v(s.strokeWidth,i)}});break}case"polygonExtrusion":{const s=(0,o.bN)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{topColor:v(s.topColor,i),sideColor:v(s.sideColor,i),strokeColor:v(s.strokeColor,i),strokeWidth:v(s.strokeWidth,i)}});break}case"dashedLine":{const s=(0,o.N5)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),gapColor:v(s.gapColor,i),width:v(s.width,i),gapLength:v(s.gapLength,i),dashLength:v(s.dashLength,i)}});break}case"shiftedLine":{const s=(0,o.sd)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),width:v(s.width,i),shift:v(s.shift,i)}});break}case"oneWayLine":{const s=(0,o.zn)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),lineWidth:v(s.lineWidth,i),lineLength:v(s.lineLength,i),tipWidth:s.tipWidth,tipHeight:s.tipHeight,priority:s.priority,duplicationSpacing:v(s.duplicationSpacing,i),endingOffsets:s.endingOffsets,labelingGroup:s.labelingGroup}});break}case"buildingModel":{const s=(0,o._0)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),strokeColor:v(s.strokeColor,i),strokeWidth:v(s.strokeWidth,i)}});break}case"labelLine":{const s=(0,o.Ym)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{textField:v(s.textField,i),textFont:s.textFont,textColor:v(s.textColor,i),textFontSize:v(s.textFontSize,i),textLetterSpacing:s.textLetterSpacing,textHaloColor:v(s.textHaloColor,i),textHaloWidth:s.textHaloWidth,textPriority:s.textPriority,textLabelingSideMargin:s.textLabelingSideMargin,textDuplicationSpacing:v(s.textDuplicationSpacing,i),labelingGroup:s.labelingGroup,lineEndingOffsets:s.lineEndingOffsets}});break}case"point":{const r=(0,o.TI)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{allowOverlap:r.allowOverlap,allowElevation:r.allowElevation,iconImage:v(r.iconImage,i),iconAnchor:r.iconAnchor,iconOffset:r.iconOffset,iconWidth:v(r.iconWidth,i),iconTextField:v(r.iconTextField,i),iconTextFont:g(r.iconTextFont,i),iconTextAnchor:r.iconTextAnchor,iconTextOffset:r.iconTextOffset,iconTextColor:v(r.iconTextColor,i),iconTextFontSize:v(r.iconTextFontSize,i),iconTextLineHeight:r.iconTextLineHeight,iconTextLetterSpacing:r.iconTextLetterSpacing,iconTextPadding:r.iconTextPadding,iconTextHaloWidth:(0,s.Wx)(r.iconTextHaloWidth),iconTextHaloColor:v(r.iconTextHaloColor,i),iconOpacity:v(r.iconOpacity,i),iconPriority:r.iconPriority,iconLabelingMargin:r.iconLabelingMargin,iconLabelingGroup:r.iconLabelingGroup,iconRotation:v(r.iconRotation,i),textField:v((0,s.Wx)(r.textField),i),textFont:v((0,s.Wx)(r.textFont),i),textColor:v((0,s.Wx)(r.textColor),i),textFontSize:v((0,s.Wx)(r.textFontSize),i),textLineHeight:(0,s.Wx)(r.textLineHeight),textLetterSpacing:(0,s.Wx)(r.textLetterSpacing),textField2:g((0,s._e)(r.textField),i),textFont2:g((0,s._e)(r.textFont),i),textColor2:g((0,s._e)(r.textColor),i)||v((0,s.Wx)(r.textColor),i),textFontSize2:g((0,s._e)(r.textFontSize),i)||v((0,s.Wx)(r.textFontSize),i),textMaxLengthPerLine:r.textMaxLengthPerLine,textPlacement:r.textPlacement,textPriority:r.textPriority,textOffset:v((0,s.Wx)(r.textOffset),i),textOffset2:g((0,s._e)(r.textOffset),i),textHaloColor:v((0,s.Wx)(r.textHaloColor),i),textHaloColor2:g((0,s._e)(r.textHaloColor),i)||v((0,s.Wx)(r.textHaloColor),i),textHaloWidth:(0,s.Wx)(r.textHaloWidth),textHaloWidth2:(0,s._e)(r.textHaloWidth)||(0,s.Wx)(r.textHaloWidth),textLabelingMargin:(0,s.Wx)(r.textLabelingMargin),textLabelingMargin2:(0,s._e)(r.textLabelingMargin)||(0,s.Wx)(r.textLabelingMargin),textLabelingGroup:(0,s.Wx)(r.textLabelingGroup),textLabelingGroup2:(0,s._e)(r.textLabelingGroup)||(0,s.Wx)(r.textLabelingGroup),duplicationSpacing:v(r.duplicationSpacing,i),endingOffsets:r.endingOffsets}});break}case"arrow":{const s=(0,o.z4)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),strokeColor:v(s.strokeColor,i),lineWidth:v(s.lineWidth,i),strokeWidth:v(s.strokeWidth,i),tipWidth:v(s.tipWidth,i),tipHeight:v(s.tipHeight,i),animation:T(s.animation,i)}});break}case"stretchableImage":n=Object.assign(Object.assign({},t),{type:"stretchableImage",style:e.style});break;case"raster":{const s=(0,o.tC)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{opacity:v(s.opacity,i)}});break}case"circle":{const s=(0,o.th)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),strokeColor:v(s.strokeColor,i),strokeColor2:v(s.strokeColor2,i),width:v(s.width,i),strokeWidth:v(s.strokeWidth,i),strokeWidth2:v(s.strokeWidth2,i)}});break}case"heatmap":{const s=(0,o.Mk)(e.style);n=Object.assign(Object.assign({},t),{type:e.type,style:{color:v(s.color,i),radius:v(s.radius,i),opacity:v(s.opacity,i),intensity:v(s.intensity,i),weight:v(s.weight,i),downscale:s.downscale},framebufferId:{framebuffer:r.z}});break}}}catch(t){if(t instanceof _)return void console.warn(`Problem with layer #${e.id}: ${t}`);throw t}if(n){n.dataKeys=function(e){const t=[];for(const i in e){const[n,...o]=i.split(":");t[e[i]]={type:n,key:o.join(":")}}return t}(i.getIndexedKeys());for(const e of null!=t?t:[])n.dataKeys[e.dataIndex]={type:e.type,key:e.property}}return n}function L(e){const t=(0,o.sy)(e);return{id:"dem",type:"dem",innerId:f.h,filter:!0,dataKeys:[],minzoom:-1/0,maxzoom:1/0,renderIndex:-1/0,style:{lightingDirection:v(t.lightingDirection),shadingIntensity:v(t.shadingIntensity),shadingPalette:y(t.shadingPalette),verticalScale:v(t.verticalScale)},framebufferId:{elevation:r.z,hillshade:r.z}}}function E(e,t){return"number"!=typeof e||Number.isNaN(e)?t:e}},6554:(e,t,i)=>{i.d(t,{IJ:()=>s,bN:()=>r,q0:()=>a,_0:()=>l,l7:()=>c,Ym:()=>d,zn:()=>h,N5:()=>u,sd:()=>m,th:()=>f,TI:()=>p,z4:()=>_,tC:()=>v,Mk:()=>g,sy:()=>y,R_:()=>b,n3:()=>w,T_:()=>x,YW:()=>I});var n=i(5849);function o(e,t){for(const i in t)void 0!==t[i]&&(e[i]=t[i])}function s(e){const t={color:"#000000",strokeColor:"#000000",strokeWidth:1,visibility:"visible"};return o(t,e),void 0===e.strokeColor&&(t.strokeColor=t.color),t}function r(e){const t={topColor:"#000000",strokeColor:"#000000",strokeWidth:1,sideColor:"#000000",visibility:"visible"};return o(t,e),void 0===e.strokeColor&&(t.strokeColor=t.topColor),void 0===e.sideColor&&(t.sideColor=t.topColor),t}function a(e){const t={color:"#000000",width:1,visibility:"visible"};return o(t,e),t}function l(e){const t={color:"#000000",strokeColor:"#000000",strokeWidth:1,visibility:"visible"};return o(t,e),void 0===e.strokeColor&&(t.strokeColor=t.color),t}function c(e){const t={sideColor:"#000000",strokeColor:"#000000",strokeWidth:1,height:0,visibility:"visible"};return o(t,e),void 0===e.strokeColor&&(t.strokeColor=t.sideColor),t}function d(e){const t={textField:["get","db_label"],textFont:"Noto_Sans",textColor:"#000000",textFontSize:16,textLetterSpacing:0,textHaloColor:"rgba(0, 0, 0, 0)",textHaloWidth:0,textPriority:0,textLabelingSideMargin:0,textDuplicationSpacing:0,lineEndingOffsets:0,visibility:"visible",labelingGroup:x};return o(t,e),t}function h(e){const t={color:"#000000",lineWidth:2,lineLength:10,tipWidth:1.5,tipHeight:2,priority:0,duplicationSpacing:0,endingOffsets:0,visibility:"visible",labelingGroup:x};return o(t,e),t}function u(e){const t={color:"#000000",gapColor:"#00000000",width:1,gapLength:1,dashLength:1,visibility:"visible"};return o(t,e),t}function m(e){const t={color:"#000000",width:1,shift:0,visibility:"visible"};return o(t,e),t}function f(e){const t={color:"#ffffff",strokeColor:"#3388ff",strokeColor2:"#00000000",width:20,strokeWidth:3,strokeWidth2:0,visibility:"visible"};return o(t,e),t}function p(e){const t={allowOverlap:!1,allowElevation:!1,iconOpacity:1,iconImage:"",iconAnchor:[.5,.5],iconOffset:[0,0],iconWidth:16,iconTextField:["get","db_label2"],iconTextFont:"",iconTextAnchor:[.5,.5],iconTextOffset:[0,0],iconTextColor:"#000000",iconTextFontSize:16,iconTextLineHeight:1.2,iconTextLetterSpacing:0,iconTextPadding:[0,0,0,0],iconTextHaloWidth:0,iconTextHaloColor:"rgba(0, 0, 0, 0)",iconPriority:0,iconRotation:0,iconLabelingGroup:x,iconLabelingMargin:{topBottom:0,leftRight:0},textField:[["get","db_label"],["get","db_label2"]],textFont:"",textColor:"#000000",textFontSize:16,textLineHeight:1.2,textLetterSpacing:0,textPlacement:"bottomCenter",textOffset:0,textHaloColor:"rgba(0, 0, 0, 0)",textHaloWidth:0,textLabelingMargin:{topBottom:0,leftRight:0},textPriority:0,textMaxLengthPerLine:30,visibility:"visible",textLabelingGroup:x,duplicationSpacing:100,endingOffsets:0};return o(t,e),t}function _(e){const t={color:"#000000",strokeColor:"#000000",lineWidth:1,strokeWidth:0,tipWidth:1,tipHeight:1,animation:{type:"appearance",tipMovementAmplitude:0},visibility:"visible"};return void 0===e.strokeColor&&(t.strokeColor=t.color),o(t,e),t}function v(e){const t={opacity:1,visibility:"visible"};return o(t,e),t}function g(e){return(0,n.kn)(e,{color:["interpolate",["linear"],["heatmap-density"],0,"rgba(53, 136, 253, 0)",.2,"rgba(53, 136, 253, 0.2)",.4,"rgb(255, 201, 77)",.6,"rgb(255, 202, 20)",.75,"rgb(245, 0, 7)",1,"rgb(255, 0, 0)"],radius:30,opacity:1,intensity:1,weight:1,downscale:1,visibility:"visible"})}function y(e){return(0,n.kn)(e,{lightingDirection:315,shadingIntensity:.15,verticalScale:1,shadingPalette:["interpolate",["exponential",2],["shading-intensity"],0,0,1,.95]})}const b="__overlapped",w="__commercial",x="default",I={groups:[x,b,w],overlay:[[x,b]],intersect:[[]]}},9670:(e,t,i)=>{function n(e){return"number"==typeof e||"boolean"==typeof e||"string"==typeof e||null===e}function o(e){if(Array.isArray(e)){const t=e;if(!t.length)return!1;if({zoom:!0,"heatmap-density":!0,"shading-intensity":!0,step:!0,interpolate:!0,all:!0,get:!0,sourceAttr:!0,featureState:!0,global:!0,match:!0,in:!0,any:!0,"!":!0,"==":!0,"!=":!0,">=":!0,">":!0,"<=":!0,"<":!0,"to-boolean":!0,"to-color":!0}[t[0]])return!0}return!1}function s(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e&&void 0!==e.type&&"color"!==e.type}function r(e){return{type:"color",value:e}}function a(e,t,i){return`${e}_${t}_${i}`}function l(e,t){return`unique-${e}_${t}`}function c(e){return Array.isArray(e)?o(e)?e:e[0]:e}function d(e){if(Array.isArray(e)&&!o(e)&&void 0!==e[1])return e[1]}i.d(t,{aH:()=>n,Uu:()=>s,lK:()=>r,fF:()=>a,zV:()=>l,Wx:()=>c,_e:()=>d})},6285:(e,t,i)=>{i.d(t,{x:()=>n});class n{constructor(e=0){this.index=e,this.keysMap={}}getIndex(){const e=this.index;return this.index+=1,e}getUniqueIndex(e){return void 0===this.keysMap[e]&&(this.keysMap[e]=this.index,this.index+=1),this.keysMap[e]}getIndexedKeys(){return this.keysMap}}},6826:(e,t,i)=>{i.d(t,{U:()=>o,h:()=>s});let n=0;function o(){return n++}const s=o()},7768:(e,t,i)=>{i.d(t,{FR:()=>l,UP:()=>d,zn:()=>h,vn:()=>u,Q9:()=>m,o4:()=>f,jJ:()=>p,bs:()=>_,ci:()=>v,OW:()=>g,m2:()=>w,EG:()=>x});var n=i(9670),o=i(7422),s=i(660),r=i(8631);const a=null;function l(e,t){if(!(0,n.Uu)(e))return e;if(t.allowedExpressions&&!t.allowedExpressions.has(e.type))return(0,s.cM)(`Expression of type ${e.type} is not allowed here`),a;switch(e.type){case"all":return function(e,t){return e.array.every((e=>!0===l(e,t)))}(e,t);case"any":return function(e,t){return e.array.some((e=>!0===l(e,t)))}(e,t);case"featureState":return function(e,t){var i,n;if("binder"===t.type||"labeling"===t.type)return null!==(i=c(t.tileData[e.dataIndex]))&&void 0!==i?i:null;{const i=null!==(n=t.featureAttrs[t.tileProps[e.property]])&&void 0!==n?n:null;return Number.isNaN(i)?null:c(i)}}(e,t);case"get":return function(e,t){var i,n,o;if("binder"===t.type||"labeling"===t.type)return null!==(i=c(t.tileData[e.dataIndex]))&&void 0!==i?i:null;{const i=null!==(o=null===(n=t.tileAttrs)||void 0===n?void 0:n[t.tileProps[e.property]])&&void 0!==o?o:null;return Number.isNaN(i)?null:c(i)}}(e,t);case"global":return function(e,t){var i;return null!==(i=t.styleState[e.property])&&void 0!==i?i:null}(e,t);case"sourceAttr":return function(e,t){var i,n;if("geojsonFilter"===t.type||"filter"===t.type)return null!==(i=t.sourceAttrs[e.property])&&void 0!==i?i:null;if("binder"===t.type||"labeling"===t.type)return null!==(n=c(t.tileData[e.dataIndex]))&&void 0!==n?n:null;return null}(e,t);case"in":return function(e,t){const i=l(e.element,t),n=l(e.array,t);if(null===n)return!1;if(!Array.isArray(n))return(0,s.cM)(`InExpression second argument resolved to non-array value: ${n}`),null;return n.some((e=>e===i))}(e,t);case"interpolate":return function(e,t){if(0===e.steps.length)return(0,s.cM)("Interpolate expression contains 0 steps, cannot interpolate"),a;const i=l(e.steps[0].value,t),n=l(e.argument,t);if("number"!=typeof n)return(0,s.cM)(`Interpolate value resolved to non-number value: ${n} ${e.argument}`),0;if((0,o.gC)(i))return f(e,n,t);return d(e,n,t)}(e,t);case"match":return function(e,t){var i;const n=l(e.input,t),o=e.cases.find((e=>e.values.has(n)));return l(null!==(i=null==o?void 0:o.output)&&void 0!==i?i:e.defaultOutput,t)}(e,t);case"step":return function(e,t){const i=Number(l(e.value,t)),n=y(e,i)-1;return l(e.steps[n].value,t)}(e,t);case"to-boolean":return function(e,t){return Boolean(l(e.value,t))}(e,t);case"to-color":return function(e,t){const i=l(e.value,t);if((0,o.iL)(i))return(0,o.MV)(i);if((0,o.gC)(i))return i;return console.warn(`Can't resolve expression. Must be color, but got ${i}`),(0,n.lK)([0,0,0,0])}(e,t);case"!":return function(e,t){return!l(e.value,t)}(e,t);case"==":case"!=":return function(e,t){const i=l(e.leftValue,t),n=l(e.rightValue,t);switch(e.type){case"==":return i===n;case"!=":return i!==n}}(e,t);case">":case"<":case">=":case"<=":return function(e,t){const i=l(e.leftValue,t);if(null===i)return null;const n=l(e.rightValue,t);if(null===n)return null;switch(e.type){case"<":return i<n;case">":return i>n;case"<=":return i<=n;case">=":return i>=n}}(e,t);case"zoom":return"binder"===t.type||"labeling"===t.type?t.styleZoom:((0,s.cM)("Zoom expression cannot be used in filter context"),a);default:return(0,s.cM)(`Not supported expression type <<${e.type}>> in ${JSON.stringify(e)}`),a}}function c(e){return(0,r.nI)(e)?(0,r.Ak)(e):e}function d(e,t,i){const n=y(e,t);if(0===n)return Number(l(e.steps[0].value,i));if(n===e.steps.length)return function(e,t,i){const n=e.steps[e.steps.length-1],o=e.base;if(1===o)return u(n.value,t);return u(n.value,t)*Math.pow(o,i-n.key)}(e,i,t);const o=Number(l(e.steps[n-1].value,i));if("labeling"===i.type&&i.interpolateExpressionAsStep)return o;const s=b(e,t,n);return(1-s)*o+s*Number(l(e.steps[n].value,i))}function h(e,t){const i=l(e,t);return(0,o.gC)(i)?i:(console.warn(`Can't resolve expression. Must be color, but got ${i}`),(0,n.lK)([0,0,0,0]))}function u(e,t,i=NaN){const n=l(e,t);return"number"==typeof n?n:i}function m(e,t,i=""){const n=l(e,t);return"string"==typeof n?n:i}function f(e,t,i){const o=y(e,t);if(0===o)return h(e.steps[0].value,i);if(o===e.steps.length)return h(e.steps[e.steps.length-1].value,i);const s=b(e,t,o),r=h(e.steps[o-1].value,i).value,a=h(e.steps[o].value,i).value;return(0,n.lK)([r[0]*(1-s)+a[0]*s,r[1]*(1-s)+a[1]*s,r[2]*(1-s)+a[2]*s,r[3]*(1-s)+a[3]*s])}function p(e,t,i){return{type:"binder",styleZoom:e,styleState:t,tileData:i}}function _(e,t,i,n){return{type:"labeling",styleZoom:e,styleState:t,interpolateExpressionAsStep:i,tileData:n}}function v(e,t,i,n,o,s){return{type:"filter",metatile:e,styleState:t,tileProps:n,tileAttrs:o,featureAttrs:s,sourceAttrs:i}}function g(e,t,i,n,o,s){return{type:"geojsonFilter",metatile:e,styleState:t,sourceAttrs:i,tileProps:n,tileAttrs:o,featureAttrs:s}}function y(e,t){let i=0;for(;i<e.steps.length&&!(t<e.steps[i].key);)i++;return i}function b(e,t,i){const n=e.base,o=e.steps[i].key-e.steps[i-1].key,s=t-e.steps[i-1].key;return 1===n?s/o:(Math.pow(n,s)-1)/(Math.pow(n,o)-1)}function w(e){const[t,i,n,o]=e.value;return[((t*o+127)/255>>>0)/255,((i*o+127)/255>>>0)/255,((n*o+127)/255>>>0)/255,o/255]}function x(e){const t=new Set;return I(t,e),Array.from(t)}function I(e,t){if((0,n.Uu)(t))switch(t.type){case"all":return function(e,t){t.array.forEach((t=>I(e,t)))}(e,t);case"match":return function(e,t){I(e,t.defaultOutput),t.cases.forEach((t=>I(e,t.output)))}(e,t);case"step":case"interpolate":return function(e,t){t.steps.forEach((t=>I(e,t.value)))}(e,t)}else e.add(t)}},7354:(e,t,i)=>{i.d(t,{z:()=>n});const n=-1},5881:(e,t,i)=>{function n(e){return!!e&&"line"===e.type}function o(e){return e.reduce(((e,t,i)=>(e[t]=i,e)),{})}function s(e){if(void 0===e||"boolean"==typeof e)return Boolean(e);const t=JSON.stringify(e);return Boolean(t.match(/\["get","(db_)?sublayer"]/))}i.d(t,{ot:()=>n,PU:()=>o,Kx:()=>s})},3220:(e,t,i)=>{i.d(t,{V:()=>h});var n=i(9450),o=i(127),s=i(1525),r=i(5849),a=i(5951);const l=[0,0,1],c=n.Ue(),d=n.Ue();class h{constructor(e){this.state=e,this.position=[0,0,0],this.projectionMatrix=[],this.viewMatrix=[],this.viewProjectionMatrix=[],this.viewProjectionMatrixInverse=[],this.horizonPixelOffset=0,this.horizonPixelOffset=0,this.update()}setState(e){this.state=e,this.update()}update(){this.updatePosition(),this.updateProjectionMatrix(),this.updateViewMatrix(),o.Jp(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),o.U_(this.viewProjectionMatrixInverse,this.viewProjectionMatrix),this.updateHorizonPixelOffset()}putProject(e,t){const{size:i,viewport:n}=this.state,o=this.viewProjectionMatrix,s=t[0],r=t[1],a=t[2],l=i[0]/2,c=i[1]/2,d=o[3]*s+o[7]*r+o[11]*a+o[15];e[0]=l+n.left+(o[0]*s+o[4]*r+o[12])*l/d,e[1]=c+n.top-(o[1]*s+o[5]*r+o[9]*a+o[13])*c/d}project(e){const t=[0,0,0];return this.putProject(t,e),t}unproject(e){const{size:t,viewport:i}=this.state,o=[(e[0]-i.left)/t[0]*2-1,-(Math.max(this.horizonPixelOffset,e[1])-i.top)/t[1]*2+1,0];n.fF(o,o,this.viewProjectionMatrixInverse),o[0]-=this.position[0],o[1]-=this.position[1],o[2]-=this.position[2],n.Fv(o,o);const s=-this.position[2]/o[2];return o[0]=this.position[0]+o[0]*s,o[1]=this.position[1]+o[1]*s,o[2]=this.position[2]+o[2]*s,o}getViewportVertices(){const{size:e,viewport:t}=this.state;return[this.unproject([t.left,e[1]+t.top,0]),this.unproject([e[0]+t.left,e[1]+t.top,0]),this.unproject([e[0]+t.left,t.top,0]),this.unproject([t.left,t.top,0])]}getHorizonPixelOffset(){return this.horizonPixelOffset}updatePosition(){const{center:e,rotation:t,zoom:i,pitch:n,size:o}=this.state,s=(0,a.r9)(i,o),r=Math.max(s*Math.sin(n),1);this.position[0]=e[0]+Math.sin(t)*r,this.position[1]=e[1]-Math.cos(t)*r,this.position[2]=s*Math.cos(n)}updateViewMatrix(){o.zB(this.viewMatrix,this.position,this.state.center,l)}updateProjectionMatrix(){const{fov:e,near:t,far:i}=s.camera,{size:n,view:o}=this.correctViewAndSize(),a=n[0]/n[1];let l=t*Math.tan((0,r.Id)(e)/2),c=2*l,d=a*c,h=-d/2;o&&(h+=o.x*d/n[0],l-=o.y*c/n[1],d*=o.width/n[0],c*=o.height/n[1]);const u=h+d,m=l-c,f=this.projectionMatrix;f[0]=2*t/(u-h),f[5]=2*t/(l-m),f[8]=(u+h)/(u-h),f[9]=(l+m)/(l-m),f[10]=-(i+t)/(i-t),f[11]=-1,f[14]=-2*i*t/(i-t),f[1]=f[2]=f[3]=f[4]=f[6]=f[7]=f[12]=f[13]=f[15]=0}correctViewAndSize(){const{size:e,pitch:t,padding:i}=this.state,n=Math.max(0,i.top-i.bottom)*Math.tan(t),o=(0,a.pc)(e[1])+n,s={x:(i.right-i.left)/2,y:(i.bottom-i.top)/2,width:e[0],height:e[1]};s.y+=(o-e[1])/2;return{view:s,size:[e[0],o]}}updateHorizonPixelOffset(){const{viewport:e,size:t,zoom:i}=this.state,o=this.unproject([e.left,t[1]+e.top,0]),l=this.unproject([e.left+t[0]/2,t[1]+e.top,0]),h=this.unproject([t[0]+e.left,t[1]+e.top,0]);n.lu(d,h,o),n.jI(d,d,c,(0,r.Id)(90)),n.Fv(d,d);const u=(0,a.h0)(t[1]*s.camera.perspectiveDistanceLimitRatio,i);n.bA(d,d,u),n.IH(d,l,d),this.putProject(d,d),this.horizonPixelOffset=Math.max(0,Math.ceil(d[1]))}}},2298:(e,t,i)=>{i.d(t,{n:()=>o});var n=i(7731);class o{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="geojson",this.worker=new this.modules.workers.parser.GeoJsonSource(this.options,this.id),this.attributes=i.attributes||{}}fetchTile(e){return this.worker.fetchTile(e).then((()=>[{regionId:0,metatileHash:-2}]))}generateTile(e,t,i,n,o){return this.worker.generateTile(e,t,i,n,o)}getObjectAttributes(e,t){return(0,n.mG)(this,void 0,void 0,(function*(){return this.worker.getObjectAttributes(e,t)}))}abortTileFetch(e){this.worker.abortTileFetch(e)}deleteTile(e){this.worker.deleteTile(e)}setAttributes(e){this.worker.setSourceAttrs(e),this.attributes=e}getAttributes(){return this.attributes}destroy(){this.worker.destroy()}setData(e){return(0,n.mG)(this,void 0,void 0,(function*(){return this.options=this.options="string"==typeof e?Object.assign(Object.assign({},this.options),{url:e}):Object.assign(Object.assign({},this.options),{data:e}),yield this.worker.setData(e)}))}}},4138:(e,t,i)=>{i.d(t,{Y0:()=>s,Sj:()=>r,fZ:()=>l,X4:()=>c});var n=i(8729);const o={point:{point:!0,heatmap:!0},polygon:{polygon:!0,polygonExtrusion:!0},line:{line:!0,lineExtrusion:!0,labelLine:!0,dashedLine:!0,oneWayLine:!0}};function s(e,t){return!!o[e][t]}function r(e){const t=e.vertices[0],i=e.vertices[1];let n=0;for(let e=0;e<t.length-1;e++)n+=Math.hypot(t[e]-t[e+1],i[e]-i[e+1]);return n}function a(e,t){const i=new Set(t[0].map(((i,n)=>t[0][n]===e[0]&&e[1]===t[1][n]?n:-1)));return Array.from(i)}function l(e,t){const i=a([e[0][0],e[1][0]],t),n=a([e[0][1],e[1][1]],t),o=a([e[0][2],e[1][2]],t);i.forEach((t=>n.forEach((i=>o.forEach((n=>{!function(e,t,i,n){t>=0&&i>=0&&1===Math.abs(t-i)&&(e[2][0]=1),i>=0&&n>=0&&1===Math.abs(i-n)&&(e[2][1]=1),t>=0&&n>=0&&1===Math.abs(t-n)&&(e[2][2]=1)}(e,t,i,n)}))))))}function c(){return(0,n.KP)(["id","db_label","db_label2","selected","hovered","componentDistanceStart","objectLength","beginningIsCut","endingIsCut"],["Commercial_poi_default","Commercial_poi_city"])}},9329:(e,t,i)=>{i.d(t,{f7:()=>l,Jb:()=>c,rR:()=>d,gs:()=>m,Xm:()=>f});var n=i(7731),o=i(9573),s=i(2298),r=i(1525),a=i(5507);const l=15,c=256,d=17;class h{constructor(e,t,i){var n,c;this.type="geojson",this.id=(0,a.Q)(),this.modules=e.modules,this.mapglApiSource=i,this.sourceCore=new s.n(this.id,this.modules,t);const h=null!==(n=t.minZoom)&&void 0!==n?n:r.MAP_DEFAULTS.minZoom,u=Math.min(null!==(c=t.maxZoom)&&void 0!==c?c:l,d);this.layer=new o.I(h,u,h,d,this.modules,e.state,this.sourceCore),this.modules.tileManager.addTileLayer(this.layer)}destroy(){this.modules.tileManager.removeTileLayer(this.layer),this.layer.destroy(),this.modules.sourceStorage.removeSource(this.getId()),this.sourceCore.destroy()}setAttributes(e){this.sourceCore.setAttributes(e),this.layer.redraw()}getAttributes(){return this.sourceCore.getAttributes()}getId(){return this.sourceCore.id}}const u={type:"FeatureCollection",features:[]};class m extends h{constructor(e,t,i){super(e,t,i),this.subtype="internal",this.data=t.data,this.modules.sourceStorage.addSource(this)}getFeatureById(e){return"FeatureCollection"===this.data.type?this.data.features[e.lo]:this.data}destroy(){super.destroy(),this.data=u}setData(e){return(0,n.mG)(this,void 0,void 0,(function*(){(yield this.sourceCore.setData(e))&&(this.data=e,this.layer.onSourceDataChange(),this.modules.identifier.resetCache())}))}}class f extends h{constructor(e,t,i){super(e,t,i),this.subtype="external",this.modules.sourceStorage.addSource(this)}getObjectAttributes(e,t){return this.sourceCore.getObjectAttributes(e,t)}setDataUrl(e){return(0,n.mG)(this,void 0,void 0,(function*(){(yield this.sourceCore.setData(e))&&(this.layer.onSourceDataChange(),this.modules.identifier.resetCache())}))}}},8675:(e,t,i)=>{i.d(t,{T:()=>pe});var n=i(8631),o=i(3251),s=i(7618),r=i(8729),a=i(9110),l=i(6723),c=i(4138),d=i(9329);function h(e,t,i,n){let o=n;const s=i-t>>1;let r,a=i-t;const l=e[t],c=e[t+1],d=e[i],m=e[i+1];for(let n=t+3;n<i;n+=3){const t=u(e[n],e[n+1],l,c,d,m);if(t>o)r=n,o=t;else if(t===o){const e=Math.abs(n-s);e<a&&(r=n,a=e)}}o>n&&(r-t>3&&h(e,t,r,n),e[r+2]=o,i-r>3&&h(e,r,i,n))}function u(e,t,i,n,o,s){let r=o-i,a=s-n;if(0!==r||0!==a){const l=((e-i)*r+(t-n)*a)/(r*r+a*a);l>1?(i=o,n=s):l>0&&(i+=r*l,n+=a*l)}return r=e-i,a=t-n,r*r+a*a}function m(e,t,i,n,o){const s={id:null==e?null:e,index:o,type:t,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)f(s,i);else if("Polygon"===t)f(s,i[0]);else if("MultiLineString"===t)for(const e of i)f(s,e);else if("MultiPolygon"===t)for(const e of i)f(s,e[0]);return s}function f(e,t){for(let i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function p(e,t,i,n){if(!t.geometry)return;const o=t.geometry.coordinates,s=t.geometry.type,r=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=t.id;if(i.promoteId?l=t.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===s)_(o,a);else if("MultiPoint"===s)for(const e of o)_(e,a);else if("LineString"===s)v(o,a,r,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(const i of o)a=[],v(i,a,r,!1),e.push(m(l,"LineString",a,t.properties,n));return}g(o,a,r,!1)}else if("Polygon"===s)g(o,a,r,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(const o of t.geometry.geometries)p(e,{id:l,geometry:o,properties:t.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of o){const t=[];g(e,t,r,!0),a.push(t)}}e.push(m(l,s,a,t.properties,n))}function _(e,t){t.push(y(e[0]),b(e[1]),0)}function v(e,t,i,n){let o,s,r=0;for(let i=0;i<e.length;i++){const a=y(e[i][0]),l=b(e[i][1]);t.push(a,l,0),i>0&&(r+=n?(o*l-a*s)/2:Math.sqrt(Math.pow(a-o,2)+Math.pow(l-s,2))),o=a,s=l}const a=t.length-3;t[2]=1,h(t,0,a,i),t[a+2]=1,t.size=Math.abs(r),t.start=0,t.end=t.size}function g(e,t,i,n){for(let o=0;o<e.length;o++){const s=[];v(e[o],s,i,n),t.push(s)}}function y(e){return e/360+.5}function b(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function w(e,t,i,n,o,s,r,a){if(n/=t,s>=(i/=t)&&r<n)return e;if(r<i||s>=n)return null;const l=[];for(const t of e){const e=t.geometry;let s=t.type;const r=0===o?t.minX:t.minY,c=0===o?t.maxX:t.maxY;if(r>=i&&c<n){l.push(t);continue}if(c<i||r>=n)continue;let d=[];if("Point"===s||"MultiPoint"===s)x(e,d,i,n,o);else if("LineString"===s)I(e,d,i,n,o,!1,a.lineMetrics);else if("MultiLineString"===s)M(e,d,i,n,o,!1);else if("Polygon"===s)M(e,d,i,n,o,!0);else if("MultiPolygon"===s)for(const t of e){const e=[];M(t,e,i,n,o,!0),e.length&&d.push(e)}if(d.length){if(a.lineMetrics&&"LineString"===s){for(const e of d)l.push(m(t.id,s,e,t.tags,t.index));continue}"LineString"!==s&&"MultiLineString"!==s||(1===d.length?(s="LineString",d=d[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===d.length?"Point":"MultiPoint"),l.push(m(t.id,s,d,t.tags,t.index))}}return l.length?l:null}function x(e,t,i,n,o){for(let s=0;s<e.length;s+=3){const r=e[s+o];r>=i&&r<=n&&T(t,e[s],e[s+1],e[s+2])}}function I(e,t,i,n,o,s,r){let a=S(e);const l=0===o?P:L;let c,d,h=e.start;for(let u=0;u<e.length-3;u+=3){const m=e[u],f=e[u+1],p=e[u+2],_=e[u+3],v=e[u+4],g=0===o?m:f,y=0===o?_:v;let b=!1;r&&(c=Math.sqrt(Math.pow(m-_,2)+Math.pow(f-v,2))),g<i?y>i&&(d=l(a,m,f,_,v,i),r&&(a.start=h+c*d)):g>n?y<n&&(d=l(a,m,f,_,v,n),r&&(a.start=h+c*d)):T(a,m,f,p),y<i&&g>=i&&(d=l(a,m,f,_,v,i),b=!0),y>n&&g<=n&&(d=l(a,m,f,_,v,n),b=!0),!s&&b&&(r&&(a.end=h+c*d),t.push(a),a=S(e)),r&&(h+=c)}let u=e.length-3;const m=e[u],f=e[u+1],p=e[u+2],_=0===o?m:f;_>=i&&_<=n&&T(a,m,f,p),u=a.length-3,s&&u>=3&&(a[u]!==a[0]||a[u+1]!==a[1])&&T(a,a[0],a[1],a[2]),a.length&&t.push(a)}function S(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function M(e,t,i,n,o,s){for(const r of e)I(r,t,i,n,o,s,!1)}function T(e,t,i,n){e.push(t,i,n)}function P(e,t,i,n,o,s){const r=(s-t)/(n-t);return T(e,s,i+(o-i)*r,1),r}function L(e,t,i,n,o,s){const r=(s-i)/(o-i);return T(e,t+(n-t)*r,s,1),r}function E(e,t){const i=[];for(let n=0;n<e.length;n++){const o=e[n],s=o.type;let r;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=k(o.geometry,t);else if("MultiLineString"===s||"Polygon"===s){r=[];for(const e of o.geometry)r.push(k(e,t))}else if("MultiPolygon"===s){r=[];for(const e of o.geometry){const i=[];for(const n of e)i.push(k(n,t));r.push(i)}}i.push(m(o.id,s,r,o.tags,o.index))}return i}function k(e,t){const i=[];i.size=e.size,void 0!==e.start&&(i.start=e.start,i.end=e.end);for(let n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function z(e,t){if(e.transformed)return e;const i=1<<e.z,n=e.x,o=e.y;for(const s of e.features){const e=s.geometry,r=s.type;if(s.geometry=[],1===r)for(let r=0;r<e.length;r+=2)s.geometry.push(C(e[r],e[r+1],t,i,n,o));else if(2===r)s.geometry=A(e,t,i,n,o);else for(let r=0;r<e.length;r++)s.geometry.push(A(e[r],t,i,n,o))}return e.transformed=!0,e}function A(e,t,i,n,o){const s=[];for(let r=0;r<e.length;r++){const a=[];for(let s=0;s<e[r].length;s+=2)a.push(C(e[r][s],e[r][s+1],t,i,n,o));s.push(a)}return s}function C(e,t,i,n,o,s){return[Math.round(i*(e*n-o)),Math.round(i*(t*n-s))]}function F(e,t,i,n,o){const s=t===o.maxZoom?0:o.tolerance/((1<<t)*o.extent),r={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:i,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const t of e)R(r,t,s,o);return r}function R(e,t,i,n){const o=t.geometry,s=t.type;let r=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===s||"MultiPoint"===s)for(let t=0;t<o.length;t+=3)r.push(o[t],o[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===s)D(r,o,e,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s){for(let t=0;t<o.length;t++)D(r,o[t],e,i,"Polygon"===s,0===t);"Polygon"===s&&r.length&&(r=[r])}else if("MultiPolygon"===s)for(let t=0;t<o.length;t++){const n=o[t],s=[];for(let t=0;t<n.length;t++)D(s,n[t],e,i,!0,0===t);s.length&&r.push(s)}if(r.length){let i=t.tags||null;if("LineString"===s&&n.lineMetrics){i={};for(const e in t.tags)i[e]=t.tags[e];i.mapbox_clip_start=o.start/o.size,i.mapbox_clip_end=o.end/o.size}const a={geometry:r,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:i};null!==t.id&&(a.id=t.id),n.generateIndex&&(a.index=t.index),e.features.push(a)}}function D(e,t,i,n,o,s){const r=n*n;if(n>0&&t.size<(o?r:n))return void(i.numPoints+=t.length/3);const a=[];for(let e=0;e<t.length;e+=3)(0===n||t[e+2]>r)&&(i.numSimplified++,a.push(t[e],t[e+1])),i.numPoints++;o&&function(e,t){let i=0;for(let t=0,n=e.length,o=n-2;t<n;o=t,t+=2)i+=(e[t]-e[o])*(e[t+1]+e[o+1]);if(i>0===t)for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],o=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=o}}(a,s),e.push(a)}const O=1,B=2,j=3,N={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,generateIndex:!1,debug:0};class U{constructor(e,t){const i=(t=this.options=function(e,t){for(const i in t)e[i]=t[i];return e}(Object.create(N),t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const i=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)p(i,e.features[n],t,n);else"Feature"===e.type?p(i,e,t,0):p(i,{geometry:e},t,0);return i}(e,t);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){const i=t.buffer/t.extent;let n=e;const o=w(e,1,-1-i,i,0,-1,2,t),s=w(e,1,1-i,2+i,0,-1,2,t);return(o||s)&&(n=w(e,1,-i,1+i,0,-1,2,t)||[],o&&(n=E(o,1).concat(n)),s&&(n=n.concat(E(s,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,t,i,n,o,s,r){const a=[e,t,i,n],l=this.options,c=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),t=a.pop(),e=a.pop();const d=1<<t,h=Z(t,i,n);let u=this.tiles[h];if(!u&&(c>1&&console.time("creation"),u=this.tiles[h]=F(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,u.numFeatures,u.numPoints,u.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(u.source=e,null==o){if(t===l.indexMaxZoom||u.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===o)continue;if(null!=o){const e=o-t;if(i!==s>>e||n!==r>>e)continue}}if(u.source=null,0===e.length)continue;c>1&&console.time("clipping");const m=.5*l.buffer/l.extent,f=.5-m,p=.5+m,_=1+m;let v=null,g=null,y=null,b=null,x=w(e,d,i-m,i+p,0,u.minX,u.maxX,l),I=w(e,d,i+f,i+_,0,u.minX,u.maxX,l);e=null,x&&(v=w(x,d,n-m,n+p,1,u.minY,u.maxY,l),g=w(x,d,n+f,n+_,1,u.minY,u.maxY,l),x=null),I&&(y=w(I,d,n-m,n+p,1,u.minY,u.maxY,l),b=w(I,d,n+f,n+_,1,u.minY,u.maxY,l),I=null),c>1&&console.timeEnd("clipping"),a.push(v||[],t+1,2*i,2*n),a.push(g||[],t+1,2*i,2*n+1),a.push(y||[],t+1,2*i+1,2*n),a.push(b||[],t+1,2*i+1,2*n+1)}}getTile(e,t,i){e=+e,t=+t,i=+i;const n=this.options,{extent:o,debug:s}=n;if(e<0||e>24)return null;const r=1<<e,a=Z(e,t=t+r&r-1,i);if(this.tiles[a])return z(this.tiles[a],o);s>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let l,c=e,d=t,h=i;for(;!l&&c>0;)c--,d>>=1,h>>=1,l=this.tiles[Z(c,d,h)];return l&&l.source?(s>1&&(console.log("found parent tile z%d-%d-%d",c,d,h),console.time("drilling down")),this.splitTile(l.source,c,d,h,e,t,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?z(this.tiles[a],o):null):null}}function Z(e,t,i){return 32*((1<<e)*i+t)+e}var H=i(9450),G=i(7084),W=i(9899),V=i(5849);function q(e,t){const i=[];return e.geometry.forEach((n=>{const o=[],s=[],r=[];n.forEach((e=>{r.push(...function(e,t){const i=[];let n=[];for(let o=0;o<e.length;o++){const s=e[o];if(n.push(K(s,t)),!J(s,t))continue;const r=e[o+1];if(!r)break;Q(s,r,t)&&(n.length>1&&i.push(n),n=[])}n.length>1&&i.push(n);return i}(e,t)),o.length&&s.push(o.length),o.push(...e)}));const a=[];for(let e=0;e<o.length;e++)a.push(o[e][0]),a.push(o[e][1]);const l=G(a,s),d=H.Ue();for(let n=0;n<l.length;n+=3){const s=[[],[],[]];for(let e=0;e<3;e++)Y(d,o[l[n+2-e]],t),s[0][e]=d[0],s[1][e]=d[1],s[2][e]=0;r.forEach((e=>{const t=[[],[],[]];e.forEach(((e,i)=>{t[0][i]=e[0],t[1][i]=e[1]})),(0,c.fZ)(s,t)})),i.push({tags:e.tags,id:e.id,index:e.index,type:"polygon",vertices:s})}})),i}function X(e,t){const i=H.Ue();return e.geometry.map((n=>{const o=[[],[]];return n.forEach(((e,n)=>{Y(i,e,t),o[0][n]=i[0],o[1][n]=i[1]})),{tags:e.tags,id:e.id,index:e.index,type:"line",vertices:o}}))}function $(e,t){const i=H.Ue();return e.geometry.map((n=>(Y(i,n,t),{tags:e.tags,id:e.id,index:e.index,type:"point",vertices:[[i[0]],[i[1]]]})))}function Y(e,t,i){const n=K(t,i);e[0]=n[0],e[1]=n[1],e[2]=t[2]}function K(e,t){return[(0,V.uZ)(e[0]/t*W.Bq,0,W.Bq),(0,V.uZ)((t-e[1])/t*W.Bq,0,W.Bq)]}function J(e,t){return e[0]<0||e[0]>t||e[1]<0||e[1]>t}function Q(e,t,i){return e[0]>i&&t[0]>i||e[0]<0&&t[0]<0||e[1]>i&&t[1]>i||e[1]<0&&t[1]<0}const ee=4096,te={maxZoom:d.f7,tolerance:3,extent:ee,buffer:1,debug:0,lineMetrics:!1,promoteId:null,generateId:!1,generateIndex:!0,indexMaxZoom:0,indexMaxPoints:1e5};class ie{constructor(e){this.options=e}fetchTile(e){const[t,i,n]=(0,s._W)(e),o={components:[]},r=this.geoJsonVtInstance.getTile(n,t,i);if(!r)return Promise.resolve(o);for(const e of r.features)switch(e.type){case O:o.components=o.components.concat($(e,ee));break;case B:o.components=o.components.concat(X(e,ee));break;case j:o.components=o.components.concat(q(e,ee));break;default:console.warn("unsupported type ",r)}return Promise.resolve(o)}destroy(){this.geoJsonVT=void 0}get geoJsonVtInstance(){var e,t,i;return this.geoJsonVT||(this.geoJsonVT=(t=this.options.data,i=Object.assign(Object.assign({},te),{maxZoom:null!==(e=this.options.maxZoom)&&void 0!==e?e:te.maxZoom}),new U(t,i))),this.geoJsonVT}}var ne=i(5951);function oe(e,t){switch(e.type){case"Point":t(e.coordinates);break;case"LineString":case"MultiPoint":e.coordinates.forEach(t);break;case"Polygon":case"MultiLineString":e.coordinates.forEach((e=>e.forEach(t)));break;case"MultiPolygon":e.coordinates.forEach((e=>e.forEach((e=>e.forEach(t)))))}}function se(e,t){const i={components:[]};return e.features.forEach(((e,n)=>{i.components.push(...re(e.geometry,t).map((t=>Object.assign(Object.assign({},t),{index:n,id:e.id,tags:e.properties||{}}))))})),i}function re(e,t){switch(e.type){case"GeometryCollection":{let i=[];return e.geometries.forEach((e=>{i=i.concat(re(e,t))})),i}case"Point":case"MultiPoint":return function(e,t){if("Point"===e.type)return[ae(e.coordinates,t)];return e.coordinates.map((e=>ae(e,t)))}(e,t);case"LineString":case"MultiLineString":return function(e,t){if("LineString"===e.type)return[le(e.coordinates,t)];return e.coordinates.map((e=>le(e,t)))}(e,t);case"Polygon":case"MultiPolygon":return function(e,t){if("Polygon"===e.type)return ce(e.coordinates,t);return e.coordinates.reduce(((e,i)=>e.concat(ce(i,t))),[])}(e,t)}}function ae(e,t){const i=[0,0,0];return(0,s.a2)(i,(0,ne.yq)(e),t),{type:"point",vertices:[[i[0]],[i[1]]]}}function le(e,t){const i=[[],[]],n=[0,0,0];return e.forEach(((e,o)=>{(0,s.a2)(n,(0,ne.yq)(e),t),i[0][o]=n[0],i[1][o]=n[1]})),{type:"line",vertices:i}}function ce(e,t){const i=[],n=[],o=[],r=[],a=[];e.forEach((e=>{const i=e.map((e=>((0,s.a2)(a,(0,ne.yq)(e),t),[Math.max(Math.min(a[0],65535),0),Math.max(Math.min(a[1],65535),0)])));r.push(i),n.length&&o.push(n.length),n.push(...i)}));const l=[];for(let e=0;e<n.length;e++)l.push(n[e][0]),l.push(n[e][1]);const d=G(l,o);for(let e=0;e<d.length;e+=3){const t=[[],[],[]];for(let i=0;i<3;i++)t[0][i]=n[d[e+i]][0],t[1][i]=n[d[e+i]][1],t[2][i]=0;r.forEach((e=>{const i=[[],[],[]];e.forEach(((e,t)=>{i[0][t]=e[0],i[1][t]=e[1]})),(0,c.fZ)(t,i)})),i.push({type:"polygon",vertices:t})}return i}var de=i(4712),he=i(7018),ue=i(1525);class me{constructor(e){this.tileLoader=new de.U("json"),this.options=e,this.url=e=>{const[t,i,n]=this.options.flipY?e:(0,s._W)(e);return(0,he.IG)(this.options.url,{x:t.toString(),y:i.toString(),z:n.toString(),subdomain:ue.tiles.subdomains[Math.abs(t+i)%ue.tiles.subdomains.length]})}}fetchTile(e){return this.tileLoader.fetch(e,this.url).then((t=>{if(!t.data)return{components:[]};if(this.options.hillshadeEncoded){const[o,r,a]=(0,s._W)(e);let l=0,c=0;i=t.data,n=e=>{l-=e[0],c-=e[1],e[0]=function(e,t){return e/Math.pow(2,t)*360-180}(o+l/d.Jb,a),e[1]=function(e,t){const i=Math.PI-2*Math.PI*e/Math.pow(2,t);return 180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)))}(r+c/d.Jb,a)},i.features.forEach((e=>{"GeometryCollection"===e.geometry.type?e.geometry.geometries.forEach((e=>oe(e,n))):oe(e.geometry,n)}))}var i,n;return se(t.data,(0,s.Bs)(e))}))}abortTile(e){this.tileLoader.abortRequest((0,s.gx)(e))}destroy(){this.tileLoader.destroy()}}var fe=i(7768);class pe{constructor(e,t,i){this.scope=e,this.options=t,this.id=i,e.sources[i]=this,this.tileData={},this.styleManager=e.styleManager,this.collector=e.collector,this.sourceAttrs=this.options.attributes||{},this.metatile=(0,c.X4)(),this.tileServer="url"in t?new me(t):new ie(t)}fetchTile(e){const t=(0,s.gx)(e);return this.tileData[t]?Promise.resolve(this.tileData[t]):this.tileServer.fetchTile(e).then((e=>(this.tileData[t]=e,e)))}abortTileFetch(e){this.tileServer instanceof me&&this.tileServer.abortTile(e)}generateTile(e,t,i,d,h){const u=(0,s.gx)(t),m=this.tileData[u],f=(0,s.Bs)(t),p=[],_=[],v=this.styleManager.getStyle(i),g=new l.c,y=new l.c(d);if(!v)return Promise.resolve({results:p,transferable:_});m&&m.components.forEach((t=>{const{tileProps:i}=this.metatile,s=[],d=Object.keys(t.tags);(0,r.Qy)(this.metatile,d);for(const e of d)s[i[e]]=t.tags[e];const u=Object.keys(this.sourceAttrs);(0,r.Qy)(this.metatile,u);for(const e of u)s[i[e]]=this.sourceAttrs[e];const m="url"in this.options&&this.options.preventInteractions?NaN:(0,n.Ru)(t.index,this.id);if("number"!=typeof m){const e=y.has(m);s[i.selected]=e?1:0,g.add(m)}const{coords:p}=f,_=p[3],b=(0,a.o1)(h),w=(0,fe.OW)(this.metatile,e.styleState,this.sourceAttrs,i,s,r.wz),x=this.styleManager.getLayers(v.id,i,s).filter((e=>(0,c.Y0)(t.type,e.type))).filter((e=>(0,fe.FR)(e.filter,w)));s[i.id]=m,this.options.identifyAsDefaultSource&&(s[i.id]=(0,n.IL)(s[i.db_id])),"point"!==t.type&&"line"!==t.type||(void 0===s[i.db_label]&&(s[i.db_label]=NaN),void 0===s[i.db_label2]&&(s[i.db_label2]=NaN)),"line"===t.type&&(s[i.componentDistanceStart]=0,s[i.objectLength]=(0,c.Sj)(t),s[i.beginningIsCut]=0,s[i.endingIsCut]=0),(0,o.PA)(this.collector,v,x,_,this.metatile,i,s,r.wz,this.id,this.sourceAttrs,e.styleState,p,b,t.vertices,new l.c)})),this.collector.setGeoIds(new Uint32Array(g.toFlatArray()));const b=this.collector.getAccumulatedData();return p.push({regionId:0,metatileHash:W.L2,collectorOutput:b,styleId:v.id}),_.push(...b.transferable),this.scope.debouncedResetCollector(),this.scope.syncNewRasterSets(),Promise.resolve({results:p,transferable:_})}getObjectAttributes(e,t){const i=this.tileData[t];if(i){const t=i.components.find((t=>t.index===e));if(t)return t.tags}}deleteTile(e){delete this.tileData[(0,s.gx)(e)]}setSourceAttrs(e){this.sourceAttrs=e}destroy(){delete this.scope.sources[this.id],this.tileData={},this.sourceAttrs={},this.tileServer.destroy()}setData(e){if("string"==typeof e){if(this.tileServer instanceof me)return this.tileServer.destroy(),this.options=Object.assign(Object.assign({},this.options),{url:e}),this.tileServer=new me(this.options),this.tileData={},Promise.resolve(!0)}else if(this.tileServer instanceof ie)return this.tileServer.destroy(),this.options=Object.assign(Object.assign({},this.options),{data:e}),this.tileServer=new ie(this.options),this.tileData={},Promise.resolve(!0);return Promise.resolve(!1)}}},5507:(e,t,i)=>{i.d(t,{Q:()=>o});let n=1;function o(){return n++}},9696:(e,t,i)=>{i.d(t,{dx:()=>s,qS:()=>a,lG:()=>c,nt:()=>h});var n=i(7618);const o={db_id:"id",tech_db_beginning_is_cut:"beginningIsCut",tech_db_ending_is_cut:"endingIsCut",tech_db_previous_point_x:"previousPointX",tech_db_previous_point_y:"previousPointY",tech_db_next_point_x:"nextPointX",tech_db_next_point_y:"nextPointY",tech_db_object_length:"objectLength",tech_db_component_distance_start:"componentDistanceStart",tech_db_component_distance_end:"componentDistanceEnd"},s=e=>{var t;return null!==(t=o[e])&&void 0!==t?t:e},r={objectClass:"db_object_class",sublayer:"db_sublayer"};function a(e){var t;return null!==(t=r[e])&&void 0!==t?t:e}const l={Class:"db_class",DisputePosition:"db_dispute_position",ObjectClass:"db_object_class",ParkingType:"db_parking_type",Sublayer:"db_sublayer",Subsublayer:"db_subsublayer"},c=e=>{var t,i,n;e.enumerationValues?e.enumerationValues=Object.keys(e.enumerationValues).reduce(((t,i)=>(t[(e=>{var t;return null!==(t=l[e])&&void 0!==t?t:e})(i)]=e.enumerationValues[i],t)),{}):e.enumerationValues={db_class:null!==(t=e.classes)&&void 0!==t?t:{},db_object_class:null!==(i=e.objectClasses)&&void 0!==i?i:{},db_sublayer:null!==(n=e.sublayers)&&void 0!==n?n:{}}},d={sourceName:"zenith"};class h{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="terrain",this.sourceAttrs=Object.assign({},d)}fetchTile(e,t){const{assetManager:i,map:o,workers:s}=this.modules;return s.parser.fetchTile({coords:e,tileServer:this.options.tileServer,tileSet:this.options.tileSet,tileProtocol:this.options.tileProtocol,subdomains:this.options.subdomains,tileKey:this.options.tileKey,appId:this.options.appId,lang:t.lang,defaultLang:this.options.defaultLang,sessionId:this.options.sessionId}).catch((()=>Promise.resolve())).then((s=>{if(!s)return;const{metadata:r,invalidTileKey:a}=s;return r.forEach((s=>{i.loadMetatile(s.metatileHash,s.regionId),o.emit("tileload",{tileCoords:e,regionId:s.regionId}),(0,n.FP)(s.regionId)&&t.shownRegionIds.add(s.regionId)})),a&&o.emit("invalidtilekey"),r}))}generateTile(e,t,i,o,s,r={}){return this.modules.workers.parser.generateTile(Object.assign({styleId:i,tileInfo:(0,n.Bs)(t),pixelRatio:s,selectedIds:o,styleState:e.styleState,floorsEnabled:e.floorsEnabled,sourceId:this.id},r))}abortTileFetch(e){this.modules.workers.parser.abortTileRequest((0,n.gx)(e))}deleteTile(e){this.modules.workers.parser.deleteTile((0,n.gx)(e))}setAttributes(e){this.sourceAttrs=Object.assign(Object.assign({},e),d)}getAttributes(){return this.sourceAttrs}destroy(){}setFeatureStateMap(e){this.modules.workers.parser.setFeatureStateMapToZenith(e)}}},947:(e,t,i)=>{i.d(t,{T:()=>n});const n=[{id:"__2gis_comm_poi",type:"point",style:{textFont:["Noto_Sans_Semibold",["step",["zoom"],"Noto_Sans",16,"Noto_Sans"]],iconImage:"peak",iconWidth:["interpolate",["linear"],["zoom"],15,22,16.8,30],textColor:"#3A3A3A",visibility:"visible",textFontSize:[["interpolate",["linear"],["zoom"],15.5,11,18,13],["interpolate",["linear"],["zoom"],15.5,10,18,12]],textHaloColor:"rgba(255,255,255,0.5)",textHaloWidth:.9,iconLabelingGroup:i(6554).n3,iconLabelingMargin:{leftRight:6,topBottom:6}},filter:["all",["match",["get","db_sublayer"],["Commercial_poi_default","Commercial_poi_city"],!0,!1],["any",["==",["in",["get","db_building_id"],["global","_activeFloorBuildingIds"]],!1],["in",["get","db_plan_id"],["global","_activeFloorIds"]]]]}]},5314:(e,t,i)=>{i.d(t,{h:()=>c});var n=i(9670);function o(e){return"boolean"!=typeof e&&"attrs"===e.type}function s(e){return"boolean"!=typeof e&&"unextractable"===e.type}function r(e){if(!(0,n.Uu)(e))return[Boolean(e)];let t=[];const i=[];switch(e.type){case"all":const l=e.array.map(r);for(const e of l){const n=[];for(const t of e){if(!1===t)return[!1];o(t)?n.push(t):s(t)&&i.push(t)}n.length>0&&(t=0===t.length?n:a(t,n))}break;case"match":if(!(0,n.Uu)(e.input)||"get"!==e.input.type&&"sourceAttr"!==e.input.type&&"featureState"!==e.input.type)return[{type:"unextractable",exp:e}];const c=e.input.property,d=e.defaultOutput;for(const n of e.cases){const e=r(n.output),l=[];n.values.forEach((e=>{l.push({type:"attrs",attrs:{[c]:e}})}));for(const n of e)if(o(n))for(const e of a([n],l))t.push(e);else if(s(n)){i.push(n);for(const e of l)t.push(e)}else if(!0===n&&!d)for(const e of l)t.push(e)}break;default:return[{type:"unextractable",exp:e}]}return t.concat(i)}function a(e,t){const i=[];for(const n of e)for(const e of t)i.push({type:"attrs",attrs:Object.assign(Object.assign({},n.attrs),e.attrs)});return i}class l{constructor(){this.layers=[],this.keyStat={},this.orderedKeys=[],this.tree=null,this.treeNodesCount=0,this.traverseCount=0,this.traverseIterations=0}addLayers(e){for(const t of e)"custom"!==t.type&&t.filter&&(this.layers.push(t),this.statLayerKeys(t));this.buildTree()}getLayers(e,t){const i=[],n=(o,s)=>{if(this.traverseIterations+=1,!o)return;for(const e of o.leafs)i.push(e);const r=this.orderedKeys[s];if(!r)return;const a=t[e[r]];void 0!==a?(n(o.children[a],s+1),n(o.novalue,s+1)):n(o.novalue,s+1)};return this.traverseCount+=1,n(this.tree,0),i}stat(){const e=this.traverseIterations/this.traverseCount||0;return{tree:this.tree,treeNodes:this.treeNodesCount,layers:this.layers.length,keyStat:this.keyStat,itersPerTraverse:e}}statLayerKeys(e){const t=r(e.filter).filter((e=>o(e)))[0];if(t&&o(t))for(const e in t.attrs)void 0===this.keyStat[e]&&(this.keyStat[e]=0),this.keyStat[e]+=1}getOrderedKeys(){return Object.entries(this.keyStat).sort((([e,t],[i,n])=>n-t)).map((([e,t])=>e))}buildTree(){this.orderedKeys=this.getOrderedKeys();const e=[];for(const t of this.layers){const i=r(t.filter).filter(o);0===i.length&&e.push(t);for(const e of i){const i=new Set(Object.keys(e.attrs));let n=0;const o=e.attrs;let s=this.tree;for(let e=0;e<=this.orderedKeys.length;e++){if(n===i.size){null==s||s.leafs.push(t);break}const r=this.orderedKeys[e],a=this.orderedKeys[e+1]||"";if(s||(s=this.makeTreeNode(r),null===this.tree&&(this.tree=s)),i.has(r)){const e=o[r];s.children[e]||(s.children[e]=this.makeTreeNode(a)),s=s.children[e],n+=1}else s.novalue||(s.novalue=this.makeTreeNode(a)),s=s.novalue}}}e.length>0&&(this.tree||(this.tree=this.makeTreeNode("")),this.tree.leafs=e)}makeTreeNode(e){return this.treeNodesCount+=1,{key:e,children:{},novalue:null,leafs:[]}}}class c{constructor(){this.metaStyles=new Map,this.layerTrees=new Map}proxySyncStyle(e){const t=new l;t.addLayers(e.layers),this.layerTrees.set(e.id,t),this.metaStyles.set(e.id,e)}getStyle(e){return this.metaStyles.get(e)}getLayers(e,t,i){const n=this.layerTrees.get(e);return n?n.getLayers(t,i):[]}}},2815:(e,t,i)=>{i.d(t,{l:()=>f});var n=i(9899),o=i(378),s=i(4004),r=i(2309),a=i(303),l=i(4530),c=i(590);const d=o.Ue(),h=o.Ue(),u={type:l.SP.Entrance,offsetMultiplier:18,cDist:0,oLen:0,px:[],py:[],count:0,localID:0};function m(e,t,i,n){return u.px=e[0],u.py=e[1],u.oLen=i/65536,u.count=t,u.localID=n,u}const f=(0,a.D)({symbol:"arrow",sinks:{stroke:{stride:36,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.segmentEnd=new Uint16Array(t,4),e.views.texExtender=new Uint16Array(t,8),e.views.arrowExtender=new Uint16Array(t,10),e.views.extender=new Int16Array(t,12),e.views.direction=new Int16Array(t,16),e.views.vertexDistance=new Float32Array(t,20),e.views.objectLength=new Float32Array(t,24),e.views.type=new Float32Array(t,28),e.views.localID=new Uint32Array(t,32)},packObjectAttributes:(e,t,i,n,o,s,r,a)=>(0,c.v$)([e,t,i>2?1:0],n,o,s,r,a),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],isLongArrow:e[2],tileData:e.slice(3)})}},generate:(e,t,i,n,o,s,a,c)=>{const d=c[0],h=c[1],u=c[0].length,_=function(e,t,i){let n=0;for(let o=1;o<i;o++){const i=e[o]-e[o-1],s=t[o]-t[o-1];n+=Math.sqrt(i*i+s*s)}return n}(d,h,u),v=e.getBucket(i.type,"stroke",f.sinks.stroke.packObjectAttributes(t,i.innerId,u,i.dataKeys,n,o,s,a),f.sinks.stroke.binder),g=e.idIndexer.getIndex({id:o[n.id],styleId:t,layer:i,sublayer:o[n.db_sublayer]}),y=m(c,u,_,g);(0,r.W)(c[0],c[1],u,l.CJ.Flat,l.kU.ObjectEnding,l.kU.ObjectEnding,0,0,0,0,y,v);let b=0;p(v,l.gD.StartBorder,d[0],h[0],d[1],h[1],0,0,b,_,g);for(let e=0;e<u-1;e++){if(0!==e){const t=d[e]-d[e-1],i=h[e]-h[e-1];b+=Math.sqrt(t*t+i*i)}p(v,l.gD.Arrow,d[e],h[e],d[e+1],h[e+1],-1,0,b,_,g)}}});function p(e,t,i,n,o,s,r,a,l,c,d){!function(e,t,i,n,o,s,r){const{elements:a,indices:l}=e,{buffer:c,offset:d}=l,h=a.offset;c[d]=h+t,c[d+1]=h+i,c[d+2]=h+n,c[d+3]=h+o,c[d+4]=h+s,c[d+5]=h+r,l.offset=d+6}(e,1,2,0,0,2,3),_(e,t,i,n,o,s,r,a,-1,-1,l,c,!0,d),_(e,t,i,n,o,s,r,a,1,-1,l,c,!1,d),_(e,t,i,n,o,s,r,a,1,1,l,c,!1,d),_(e,t,i,n,o,s,r,a,-1,1,l,c,!0,d)}function _(e,t,i,o,r,a,l,c,u,m,f,p,_,v){const g=e.elements,y=g.stride*g.offset>>1,b=y>>1;(0,s.uI)(d,i,o,r,a),(0,s.fN)(h,d),e.views.position[y]=i,e.views.position[y+1]=o,e.views.segmentEnd[y]=r,e.views.segmentEnd[y+1]=a,e.views.texExtender[y]=(0,s.am)(h[0]*m*(_?-1:1)*n.Gt,h[1]*m*(_?-1:1)*n.Gt),e.views.arrowExtender[y]=(0,s.am)(u*n.Gt,m*n.Gt);const w=u+l,x=m+c,I=d[0]*w+h[0]*x,S=d[1]*w+h[1]*x;e.views.extender[y]=Math.round(I*n.Gt*127),e.views.extender[y+1]=Math.round(S*n.Gt*127),e.views.direction[y]=Math.round(127*d[0]),e.views.direction[y+1]=Math.round(127*d[1]),e.views.vertexDistance[b]=f/65536,e.views.objectLength[b]=p/65536,e.views.type[b]=t,e.views.localID[b]=v,e.elements.offset++}},7054:(e,t,i)=>{i.d(t,{p:()=>s});var n=i(303),o=i(590);const s=(0,n.D)({symbol:"circle",sinks:{fill:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.extender=new Int16Array(t,4),e.views.localID=new Uint32Array(t,8)},packObjectAttributes:(e,t,i,n,s,r,a)=>(0,o.v$)([e,t],i,n,s,r,a),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,o,a,l,c){const d=e.getBucket(i.type,"fill",s.sinks.fill.packObjectAttributes(t,i.innerId,i.dataKeys,n,o,a,l),s.sinks.fill.binder),h=e.idIndexer.getIndex({id:o[n.id],styleId:t,layer:i,sublayer:o[n.db_sublayer]}),u=c[0][0],m=c[1][0];!function(e,t,i,n,o,s,r){const{elements:a,indices:l}=e,{buffer:c,offset:d}=l,h=a.offset;c[d]=h+t,c[d+1]=h+i,c[d+2]=h+n,c[d+3]=h+o,c[d+4]=h+s,c[d+5]=h+r,l.offset=d+6}(d,0,2,1,0,3,2),r(d,u,m,-1,-1,h),r(d,u,m,-1,1,h),r(d,u,m,1,1,h),r(d,u,m,1,-1,h)}});function r(e,t,i,n,o,s){const r=e.elements.offset*e.elements.stride>>1,a=r>>1;e.views.position[r]=t,e.views.position[r+1]=i,e.views.extender[r]=n,e.views.extender[r+1]=o,e.views.localID[a]=s,e.elements.offset++}},5180:(e,t,i)=>{i.d(t,{L:()=>c});var n=i(2309),o=i(4530),s=i(303),r=i(590);const a={type:o.SP.Striped,cDist:0,oLen:0,localID:0,offsetMultiplier:14};function l(e,t,i){return a.cDist=e,a.oLen=t,a.localID=i,a}const c=(0,s.D)({symbol:"dashedLine",sinks:{stroke:{stride:28,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.extender=new Int16Array(t,4),e.views.texExtender=new Uint16Array(t,8),e.views.vertexDistance=new Float32Array(t,12),e.views.componentDistance=new Float32Array(t,16),e.views.objectLength=new Float32Array(t,20),e.views.localID=new Uint32Array(t,24)},packObjectAttributes:(e,t,i,n,o,s,a)=>(0,r.v$)([e,t],i,n,o,s,a),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,s,r,a,d,h){const u=e.getBucket(i.type,"stroke",c.sinks.stroke.packObjectAttributes(t,i.innerId,i.dataKeys,s,r,a,d),c.sinks.stroke.binder),m=e.idIndexer.getIndex({id:r[s.id],styleId:t,layer:i,sublayer:r[s.db_sublayer]}),f=l(r[s.componentDistanceStart]/65536,r[s.objectLength]/65536,m),p=!Number.isNaN(r[s.beginningIsCut])&&0!==r[s.beginningIsCut],_=!Number.isNaN(r[s.endingIsCut])&&0!==r[s.endingIsCut];(0,n.W)(h[0],h[1],h[0].length,o.CJ.Flat,p?o.kU.TileCut:o.kU.ObjectEnding,_?o.kU.TileCut:o.kU.ObjectEnding,r[s.previousPointX],r[s.previousPointY],r[s.nextPointX],r[s.nextPointY],f,u)}})},1030:(e,t,i)=>{i.d(t,{_:()=>r});var n=i(303),o=i(2034),s=i(9899);const r=(0,n.D)({symbol:"dem",sinks:{mesh:{stride:4,binder:(e,t)=>{},packObjectAttributes:(e,t)=>[e,t],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(3)})},elevation:{stride:8,binder:(e,t)=>{},packObjectAttributes:(e,t,i)=>[e,t,i],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],textureIndex:e[2],tileData:e.slice(4)})},hillshade:{stride:8,binder:(e,t)=>{},packObjectAttributes:(e,t)=>[e,t],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generateElevation(e,t,i,n,a){const l=new Uint16Array(t.reduce(((e,t)=>{const[i,n,r,a]=t;return e.push(i*s.Bq,n*s.Bq,(0,o.Bb)(r),(0,o.Bb)(a)),e}),[]));return{symbol:r.symbol,sink:"elevation",buffer:l.buffer,generatedObjects:[{attributes:r.sinks.elevation.packObjectAttributes(i,n,a),rangeStart:0,rangeEnd:l.buffer.byteLength}]}},generateHillshade(e,t,i,n){const a=new Uint16Array(t.reduce(((e,t)=>{const[i,n,r,a]=t;return e.push(i*s.Bq,n*s.Bq,(0,o.Bb)(r),(0,o.Bb)(a)),e}),[]));return{symbol:r.symbol,sink:"hillshade",buffer:a.buffer,generatedObjects:[{attributes:r.sinks.hillshade.packObjectAttributes(i,n),rangeStart:0,rangeEnd:a.buffer.byteLength}]}}})},2528:(e,t,i)=>{i.d(t,{B:()=>s});var n=i(303),o=i(7768);const s=(0,n.D)({symbol:"heatmap",sinks:{fill:{stride:8,binder:(e,t)=>{e.views.position=new Float32Array(t)},packObjectAttributes:(e,t,i,n)=>[e,t,i,n],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],textureIndex:e[2],rampTextureIndex:e[3],tileData:e.slice(4)})},framebuffer:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.weight=new Float32Array(t,4),e.views.widen=new Int8Array(t,8)},packObjectAttributes:(e,t)=>[e,t],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,r){const c=n[0],d=n[1],h=Number((0,o.FR)(i.style.weight,r));if(Number.isNaN(h))return void console.error("Can't resolve style.weight to number");const u=e.getBucket(i.type,"framebuffer",s.sinks.framebuffer.packObjectAttributes(t,i.innerId),s.sinks.framebuffer.binder);for(let e=0;e<c.length;e++)l(u,0,1,2,2,1,3),a(u,c[e],d[e],-1,-1,h),a(u,c[e],d[e],1,-1,h),a(u,c[e],d[e],-1,1,h),a(u,c[e],d[e],1,1,h)},generateTexture(e,t,i,n,o){const a=[-1,1,1,-1],l=[-1,-1,1,1],c=e.getBucket(i.type,"fill",s.sinks.fill.packObjectAttributes(t,i.innerId,n,o),s.sinks.fill.binder);let d=c.elements.offset;!function(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}(c.indices,d,0,1,2,0,2,3),r(c,d++,a[0],l[0]),r(c,d++,a[1],l[1]),r(c,d++,a[2],l[2]),r(c,d++,a[3],l[3]),c.elements.offset=d}});function r(e,t,i,n){const o=2*t;e.views.position[o]=i,e.views.position[o+1]=n}function a(e,t,i,n,o,s){const r=e.elements.offset*e.elements.stride,a=r>>1,l=a>>1;e.views.position[a]=t,e.views.position[a+1]=i,e.views.weight[l]=s,e.views.widen[r]=n,e.views.widen[r+1]=o,e.elements.offset++}function l(e,t,i,n,o,s,r){const{elements:a,indices:l}=e,{buffer:c,offset:d}=l,h=a.offset;c[d]=h+t,c[d+1]=h+i,c[d+2]=h+n,c[d+3]=h+o,c[d+4]=h+s,c[d+5]=h+r,l.offset=d+6}},2847:(e,t,i)=>{function n(e,t){return 0===e?0:Math.min(2*e-1,2*(t-e))}i.d(t,{X:()=>n})},3396:(e,t,i)=>{i.d(t,{$Y:()=>r,Uu:()=>a,k8:()=>l});var n=i(1525),o=i(8604);const s=[0,0];function r(e,t,i,r,a,l){let{textLineHeight:d,textLetterSpacing:h}=a.style;l===o.bR.Icon&&(d=a.style.iconTextLineHeight,h=a.style.iconTextLetterSpacing);const{identifyPoiLabelIndex:u}=t,{lines:m,maxWidth:f}=r,p=d*n.fonts.baseSize;let _=function(e,t,i){let n;switch(e){case 0:n=t/2+t*(i-1);break;case 2:n=-t/2;break;default:n=1&i?t*(i>>1):t/2+t*(i-1>>1)}return n}(1,p,m.length);for(let t=0;t<m.length;t++){const o=m[t].width;let r=0;r=-o/2,s[0]=r,s[1]=_;const a=m[t].glyphs;for(let t=0;t<a.length;t++){const o=a[t];void 0!==o.bitmap&&c(e[o.range],i,s,o,u),s[0]+=o.advance+n.fonts.baseSize*h}_-=p}}function a(e,t,i,n,o,s,r){const a=i[1]+n.top,l=i[0]+n.left,c=a-n.height,d=l+n.width,u=Math.sin(o),f=Math.cos(o),p=l*f-a*u,_=l*u+a*f,v=d*f-a*u,g=d*u+a*f,y=l*f-c*u,b=l*u+c*f,w=d*f-c*u,x=d*u+c*f,I=e.elements.offset;h(e,t,p,_,n.texLeft,n.texTop,s,r),h(e,t,v,g,n.texRight,n.texTop,s,r),h(e,t,y,b,n.texLeft,n.texBottom,s,r),h(e,t,w,x,n.texRight,n.texBottom,s,r),m(e.indices,I,1,0,3,2,3,0)}function l(e,t,i){const n=e.elements.offset,o=127*Math.cos(i),s=127*Math.sin(i);u(e,t,o,s,-1,-1),u(e,t,o,s,1,-1),u(e,t,o,s,1,1),u(e,t,o,s,-1,1),m(e.indices,n,0,1,2,2,3,0)}function c(e,t,i,n,o){const s=i[1]+n.top,r=i[0]+n.left,a=s-n.height,l=r+n.width,c=e.elements.offset;d(e,t,r,s,n.texLeft,n.texTop,o),d(e,t,l,s,n.texRight,n.texTop,o),d(e,t,r,a,n.texLeft,n.texBottom,o),d(e,t,l,a,n.texRight,n.texBottom,o),m(e.indices,c,1,0,3,2,3,0)}function d(e,t,i,n,o,s,r){const a=e.elements,l=a.stride*a.offset>>1,c=l>>1;e.views.position[l]=t[0],e.views.position[l+1]=t[1],e.views.position[l+2]=t[2],e.views.cornerOffset[l]=i,e.views.cornerOffset[l+1]=n,e.views.texCoords[l]=o,e.views.texCoords[l+1]=s,e.views.localID[c]=r,a.offset++}function h(e,t,i,n,o,s,r,a){const l=e.elements;let c=l.stride*l.offset>>1;e.views.position[c]=t[0],e.views.position[c+1]=t[1],e.views.position[c+2]=t[2],e.views.texCoords[c]=o,e.views.texCoords[c+1]=s,c>>=1,e.views.cornerOffset[c]=i,e.views.cornerOffset[c+1]=n,e.views.styleZoomLimits[c]=r,e.views.styleZoomLimits[c+1]=a,l.offset++}function u(e,t,i,n,o,s){const r=e.elements,a=r.stride*r.offset/2;e.views.position[a]=t[0],e.views.position[a+1]=t[1],e.views.direction[a]=i,e.views.direction[a+1]=n,e.views.widenDirection[a]=o,e.views.widenDirection[a+1]=s,r.offset++}function m(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}},4530:(e,t,i)=>{var n,o,s,r;i.d(t,{SP:()=>n,gD:()=>o,kU:()=>s,CJ:()=>r}),function(e){e.Striped="Striped",e.Entrance="Entrance"}(n||(n={})),function(e){e[e.Line=0]="Line",e[e.Arrow=1]="Arrow",e[e.StartBorder=2]="StartBorder",e[e.LineEnding=3]="LineEnding"}(o||(o={})),function(e){e[e.TileCut=0]="TileCut",e[e.ObjectEnding=1]="ObjectEnding"}(s||(s={})),function(e){e[e.Flat=0]="Flat",e[e.Circle=1]="Circle"}(r||(r={}))},2309:(e,t,i)=>{i.d(t,{W:()=>y});var n=i(4004),o=i(4530),s=i(9899);const r=[.5,.5],a=[.5,.5],l=[.5,.5],c=[.5,.5],d=[0,0];let h,u,m,f=0,p=0,_=0,v=0;const g={x:0,y:0,xn2:0,yn2:0,xn1:0,yn1:0,noTurn:!0,leftTurn:!1,sharpTurn:!1,reverseTurn:!1,extender:[.5,.5],faExtender:[.5,.5],saExtender:[.5,.5]};function y(e,t,i,s,a,c,d,g,y,w,P,E){let k,z,A,C,F,R,D,O,B,j;if(0!==i)if(m=P,u=E,h=u.indices,p=u.elements.offset,f=0,_=0,v=0,1===i)k=e[0],z=t[0],j=0,L(h,p,0,2,1,1,2,3),T(u,m,0,k,z,1,-1,1,-1,j,!1),T(u,m,0,k,z,-1,-1,-1,-1,j,!1),T(u,m,0,k,z,1,1,1,1,j,!1),T(u,m,0,k,z,-1,1,-1,1,j,!1),f+=4;else{switch(A=e[0],C=t[0],F=e[1],R=t[1],j=0,a){case o.kU.TileCut:(0,n.AE)(r,A,C,d,g),(0,n.AE)(l,F,R,A,C),B=b(F,R,r[0],r[1],l[0],l[1]),B.noTurn?I(A,C,l[0],l[1],j):x(0,A,C,r[0],r[1],l[0],l[1],j);break;case o.kU.ObjectEnding:(0,n.AE)(l,F,R,A,C),s===o.CJ.Flat?I(A,C,l[0],l[1],j):(I(A,C,-l[0],-l[1],j),x(0,A,C,-l[0],-l[1],l[0],l[1],j));break;default:throw new Error("LoftedLine: unknown Ending Type")}const h=i-1;for(let i=1;i<h;i++){A=e[i-1],C=t[i-1],F=e[i],R=t[i],D=e[i+1],O=t[i+1];const o=F-A,s=R-C;j+=Math.sqrt(o*o+s*s)/65536,(0,n.AE)(r,F,R,A,C),(0,n.AE)(l,D,O,F,R),x(i,F,R,r[0],r[1],l[0],l[1],j)}A=e[i-2],C=t[i-2],F=e[h],R=t[h];const u=F-A,m=R-C;switch(j+=Math.sqrt(u*u+m*m)/65536,c){case o.kU.TileCut:(0,n.AE)(r,F,R,A,C),(0,n.AE)(l,y,w,F,R),B=b(F,R,r[0],r[1],l[0],l[1]),B.noTurn?S(h,F,R,l[0],l[1],j):M(h,j,B);break;case o.kU.ObjectEnding:(0,n.AE)(l,F,R,A,C),S(h,F,R,l[0],l[1],j),s===o.CJ.Circle&&x(h,F,R,l[0],l[1],-l[0],-l[1],j);break;default:throw new Error("LoftedLine: unknown Ending Type")}}}function b(e,t,i,o,s,r){const l=function(e,t,i,n,o,s){const r=g;r.x=e,r.y=t,r.xn2=i,r.yn2=n,r.xn1=o,r.yn1=s;const a=i*o+n*s;return r.noTurn=a>.9999,r.leftTurn=i*-s+n*o<0,r.sharpTurn=a<0,r.reverseTurn=a<-.9999,r}(e,t,i,o,s,r);if(l.noTurn||l.reverseTurn)l.extender[0]=0,l.extender[1]=0,l.faExtender[0]=0,l.faExtender[1]=0,l.saExtender[0]=0,l.saExtender[1]=0;else{(0,n.ax)(a,i,o,s,r);const e=a[0],t=a[1];l.extender[0]=e,l.extender[1]=t,l.faExtender[0]=e-2*i,l.faExtender[1]=t-2*o,l.saExtender[0]=e-2*s,l.saExtender[1]=t-2*r}return l}function w(e,t,i,o,s,r,l,c){(0,n.ax)(a,o,s,r,l);o*-l+s*r<0?T(u,m,e,t,i,-a[0],-a[1],-a[0],-a[1],c,!1):T(u,m,e,t,i,a[0],a[1],a[0],a[1],c,!1),f++}function x(e,t,i,o,s,r,a,l){const d=b(t,i,o,s,r,a);M(e,l,d),function(e,t,i){if(i.noTurn)return;const o=i.sharpTurn?2:1;let s,r;i.reverseTurn?(s=v,r=_):i.leftTurn?(s=_,r=f+o):(s=f+o,r=v);const a=f;i.leftTurn,P(h,p,_,v,a);if(i.sharpTurn){const e=f+1;i.leftTurn?L(h,p,a,e,s,s,e,r):L(h,p,a,r,e,e,r,s)}else i.leftTurn,P(h,p,a,r,s);i.sharpTurn?(i.leftTurn?(0,n.AE)(c,i.xn2,i.yn2,i.xn1,i.yn1):(0,n.AE)(c,i.xn1,i.yn1,i.xn2,i.yn2),w(e,i.x,i.y,i.xn2,i.yn2,c[0],c[1],t),w(e,i.x,i.y,c[0],c[1],i.xn1,i.yn1,t)):w(e,i.x,i.y,i.xn2,i.yn2,i.xn1,i.yn1,t);i.reverseTurn||(i.leftTurn?T(u,m,e,i.x,i.y,-i.xn1,-i.yn1,-i.xn1,-i.yn1,t,!1):T(u,m,e,i.x,i.y,i.xn1,i.yn1,i.xn1,i.yn1,t,!1),f++);v=r,_=s}(e,l,d),function(e,t,i){if(i.noTurn||i.reverseTurn)return;const n=f+1,o=f;i.leftTurn?(T(u,m,e,i.x,i.y,-i.xn1,-i.yn1,i.saExtender[0],i.saExtender[1],t,!1),T(u,m,e,i.x,i.y,i.xn1,i.yn1,i.extender[0],i.extender[1],t,!1)):(T(u,m,e,i.x,i.y,-i.xn1,-i.yn1,-i.extender[0],-i.extender[1],t,!1),T(u,m,e,i.x,i.y,i.xn1,i.yn1,-i.saExtender[0],-i.saExtender[1],t,!1));f+=2,i.leftTurn?L(h,p,v,o,_,_,o,n):L(h,p,_,v,n,n,v,o);v=o,_=n}(e,l,d)}function I(e,t,i,n,o){T(u,m,0,e,t,-i,-n,-i,-n,o,!1),T(u,m,0,e,t,i,n,i,n,o,!1),f+=2,_=1,v=0}function S(e,t,i,n,o,s){const r=f+1,a=f;T(u,m,e,t,i,-n,-o,-n,-o,s,!1),T(u,m,e,t,i,n,o,n,o,s,!1),f+=2,L(h,p,v,a,_,_,a,r),_=r,v=a}function M(e,t,i){if(i.noTurn)return;const n=f+1,o=f;if(i.reverseTurn?(T(u,m,e,i.x,i.y,-i.xn2,-i.yn2,-i.xn2,-i.yn2,t,!1),T(u,m,e,i.x,i.y,i.xn2,i.yn2,i.xn2,i.yn2,t,!1)):i.leftTurn?(T(u,m,e,i.x,i.y,-i.xn2,-i.yn2,i.faExtender[0],i.faExtender[1],t,!0),T(u,m,e,i.x,i.y,i.xn2,i.yn2,i.extender[0],i.extender[1],t,!0)):(T(u,m,e,i.x,i.y,-i.xn2,-i.yn2,-i.extender[0],-i.extender[1],t,!0),T(u,m,e,i.x,i.y,i.xn2,i.yn2,-i.faExtender[0],-i.faExtender[1],t,!0)),f+=2,L(h,p,v,o,_,_,o,n),v=o,_=n,!i.reverseTurn){const s=f+1,r=f;i.leftTurn?(T(u,m,e,i.x,i.y,-i.xn2,-i.yn2,-i.xn2,-i.yn2,t,!1),T(u,m,e,i.x,i.y,0,0,0,0,t,!1),L(h,p,n,o,s,s,o,r)):(T(u,m,e,i.x,i.y,0,0,0,0,t,!1),T(u,m,e,i.x,i.y,i.xn2,i.yn2,i.xn2,i.yn2,t,!1),L(h,p,o,r,n,n,r,s)),f+=2,v=r,_=s}}function T(e,t,i,r,a,l,c,h,u,m,f){const p=e.elements.offset*t.offsetMultiplier,_=p>>1;if(e.views.position[p]=r,e.views.position[p+1]=a,e.views.extender[p]=Math.floor(h*s.Gt*127+.5),e.views.extender[p+1]=Math.floor(u*s.Gt*127+.5),t.type===o.SP.Striped)e.views.texExtender[p]=(0,n.am)(l*s.Gt,c*s.Gt),"componentDistance"in e.views&&(e.views.componentDistance[_]=t.cDist);else if(t.type===o.SP.Entrance){const{px:r,py:a,count:h}=t,u=0===i,m=i===h-1,v=u?i:i-1,g=u?i+1:i;(0,n.uI)(d,r[v],a[v],r[g],a[g]),"direction"in e.views&&(e.views.direction[p]=Math.round(127*d[0]),e.views.direction[p+1]=Math.round(127*d[1]),e.views.type[_]=m?o.gD.LineEnding:o.gD.Line),e.views.texExtender[p]=(0,n.am)(l*(f||m?-1:1)*s.Gt,c*(f||m?-1:1)*s.Gt)}e.views.vertexDistance[_]=m,e.views.objectLength[_]=t.oLen,e.views.localID[_]=t.localID,e.elements.offset++}function P(e,t,i,n,o){const s=e.buffer,r=e.offset;s[r]=t+i,s[r+1]=t+n,s[r+2]=t+o,e.offset=r+3}function L(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}},1843:(e,t,i)=>{i.d(t,{n:()=>a});var n=i(9450);const o=n.Ue(),s=n.Ue(),r=n.Ue();function a(e,t,i,a,c,d,h,u){n.t8(o,t,i,a),n.t8(s,c,d,h),n.lu(r,s,o),n.fS(s,o)||(n.Fv(r,r),n.bA(r,r,127)),function(e,t,i,n,o,s,r){const a=e.indices.buffer,l=e.indices.offset,c=e.elements.offset;a[l]=c+t,a[l+1]=c+i,a[l+2]=c+n,a[l+3]=c+o,a[l+4]=c+s,a[l+5]=c+r,e.indices.offset=l+6}(e,0,1,3,3,1,2),l(e,o,r,1,u),l(e,o,r,-1,u),l(e,s,r,-1,u),l(e,s,r,1,u)}function l(e,t,i,n,o){const s=e.elements.offset*e.elements.stride,r=s>>1;e.views.position[r]=t[0],e.views.position[r+1]=t[1],e.views.position[r+2]=t[2],e.views.directionDistance[s]=i[0],e.views.directionDistance[s+1]=i[1],e.views.directionDistance[s+2]=i[2],e.views.directionDistance[s+3]=n,"demPosition"in e.views&&(o=null!=o?o:t,e.views.demPosition[r]=o[0]/8,e.views.demPosition[r+1]=o[1]/8),e.elements.offset++}},7666:(e,t,i)=>{i.d(t,{e:()=>v});var n=i(9899),o=i(378),s=i(5849),r=i(4004);const a=o.Ue(),l=o.Ue(),c=o.Ue(),d=o.Ue(),h=o.Ue(),u=o.Ue(),m=o.Ue(),f=o.Ue();let p=0,_=0;function v(e,t,i,n,o,s,l,c,d){if(!(n<2)){if((0,r.uI)(a,t[0],i[0],t[1],i[1]),p=0,o){const n=void 0!==c?c[0]:0,o=void 0!==d?d[0]:0;y(e,t[0],i[0],-a[0],-a[1],n,o,l)}for(let o=1;o<n;o++)g(e,t,i,o,n,l,c,d);if(s){const o=void 0!==c?c[n-1]:0,s=void 0!==d?d[n-1]:0;y(e,t[n-1],i[n-1],a[0],a[1],o,s,l)}}}function g(e,t,i,v,g,w,x,I){const S=v===g-1;if(o.t8(h,t[v-1],i[v-1]),o.t8(u,t[v],i[v]),void 0!==x&&void 0!==I?(o.t8(c,x[v-1],I[v-1]),o.t8(d,x[v],I[v])):(o.t8(c,0,0),o.t8(d,0,0)),(0,r.fN)(f,a),S)_=0;else{o.t8(m,t[v+1],i[v+1]),(0,r.uI)(l,u[0],u[1],m[0],m[1]);const n=(0,s.uZ)(o.AK(a,l),-1,1);if(n<=0)_=0,y(e,u[0],u[1],a[0],a[1],d[0],d[1],w);else{const e=Math.sqrt((1-n)/(1+n)),t=(0,s.Xx)(o.AK(f,l));_=e*t}}!function(e,t,i,n,o,s,r){const a=e.indices.buffer,l=e.indices.offset,c=e.elements.offset;a[l]=c+t,a[l+1]=c+i,a[l+2]=c+n,a[l+3]=c+o,a[l+4]=c+s,a[l+5]=c+r,e.indices.offset=l+6}(e,0,1,3,3,1,2);const M=f[0]*n.Gt,T=f[1]*n.Gt;b(e,h[0],h[1],(f[0]+a[0]*p)*n.Gt,(f[1]+a[1]*p)*n.Gt,M,T,c[0],c[1],w),b(e,h[0],h[1],(-f[0]-a[0]*p)*n.Gt,(-f[1]-a[1]*p)*n.Gt,-M,-T,c[0],c[1],w),b(e,u[0],u[1],(-f[0]+a[0]*_)*n.Gt,(-f[1]+a[1]*_)*n.Gt,-M,-T,d[0],d[1],w),b(e,u[0],u[1],(f[0]-a[0]*_)*n.Gt,(f[1]-a[1]*_)*n.Gt,M,T,d[0],d[1],w),S||(o.JG(a,l),p=_)}function y(e,t,i,n,o,s,r,a){!function(e,t,i,n){const o=e.indices.buffer,s=e.indices.offset,r=e.elements.offset;o[s]=r+t,o[s+1]=r+i,o[s+2]=r+n,e.indices.offset=s+3}(e,0,1,2);const l=.01*-n,c=.01*-o;b(e,t,i,n+l,o+c,n,o,s,r,a),b(e,t,i,-o+l,n+c,-o,n,s,r,a),b(e,t,i,o+l,-n+c,o,-n,s,r,a)}function b(e,t,i,n,o,s,r,a,l,c){const d=e.elements.offset*e.elements.stride,h=d>>1,u=d>>2;e.views.position[h]=t,e.views.position[h+1]=i,e.views.extender[d]=127*n,e.views.extender[d+1]=127*o,e.views.normal[d]=127*s,e.views.normal[d+1]=127*r,"shift"in e.views&&(e.views.shift[u]=a,e.views.shift[u+1]=l),"localID"in e.views&&(e.views.localID[u]=c),e.elements.offset++}},5668:(e,t,i)=>{i.d(t,{C:()=>a,b:()=>l});var n=i(2847),o=i(4004);const s=[.5,.5],r=[.5,.5];function a(e,t,i,s,a,l){let c=e.elements.offset;const f=(0,n.X)(t-1,t);let p=i[f],_=s[f],g=a?a[f]:0;const y=c;for(let f=0;f<t;f++){const b=(0,n.X)(f,t),w=f===t-1,x=i[b],I=s[b],S=a?a[b]:w?0:1;0!==g&&((0,o.uI)(r,p,_,x,I),v(e,c,S,w?y:c+4),h(e,c,p,_,x,I),l?d(e,c,l[0],l[1],l[0],l[1]):d(e,c,p,_,x,I),u(e,c,(0,o.am)(r[1],-r[0])),m(e,c,(0,o.af)(r)),c+=4),p=x,_=I,g=S}e.elements.offset=c}function l(e,t,i,a,l,d,h){let u=e.elements.offset;const m=(0,n.X)(t-2,t),g=(0,n.X)(t-1,t);let y=i[g],b=a[g],w=l?l[m]:1,x=l?l[g]:0;(0,o.AE)(s,i[m],a[m],y,b);let I=s[0],S=s[1];for(let m=0;m<t;m++){const g=(0,n.X)(m,t),M=m===t-1,T=i[g],P=a[g],L=l?l[g]:M?0:1;(0,o.uI)(r,y,b,T,P);const E=r[1],k=-r[0];0!==w&&(0===x?(s[0]=I,s[1]=S):c(s,I,S,E,k),(0,o.m2)(r,I,S,s[0],s[1]),v(e,u,0,0),f(e,u,y,b,d,null!=h?h:[y,b]),p(e,u,(0,o.af)(s),(0,o.af)(r)),_(e,u),u+=4),y=T,b=P,w=x,x=L,I=E,S=k}e.elements.offset=u}function c(e,t,i,n,o){let s,r,a;t*n+i*o>0?(s=t+n,r=i+o,a=1/Math.sqrt(s*s+r*r),e[0]=s*a,e[1]=r*a):(s=o-i,r=t-n,0!==s&&0!==r?(a=1/Math.sqrt(s*s+r*r),e[0]=s*a,e[1]=r*a):(e[0]=0,e[1]=0))}function d(e,t,i,n,o,s){const r=e.views.demPosition,a=e.elements.stride/r.BYTES_PER_ELEMENT;i/=8,n/=8,o/=8,s/=8,r[t*=a]=i,r[t+1]=n,r[t+=a]=i,r[t+1]=n,r[t+=a]=o,r[t+1]=s,r[t+=a]=o,r[t+1]=s}function h(e,t,i,n,o,s){const{position:r,distance:a}=e.views,l=e.elements.stride/r.BYTES_PER_ELEMENT;r[t*=l]=i,r[t+1]=n,r[t+2]=0,a[t]=0,r[t+=l]=i,r[t+1]=n,r[t+2]=0,a[t]=-32767,r[t+=l]=o,r[t+1]=s,r[t+2]=0,a[t]=-32767,r[t+=l]=o,r[t+1]=s,r[t+2]=0,a[t]=0}function u(e,t,i){const n=e.elements.stride/e.views.normals.BYTES_PER_ELEMENT;t*=n;for(let o=0;o<4;o++)e.views.normals[t]=i,e.views.normals[t+1]=127,t+=n}function m(e,t,i){const n=e.elements.stride/e.views.direction.BYTES_PER_ELEMENT;t*=n;for(let o=0;o<4;o++)e.views.direction[t]=i,e.views.direction[t+1]=0,t+=n}function f(e,t,i,n,o,s){const r=e.elements.stride/e.views.position.BYTES_PER_ELEMENT;t*=r,e.views.position[t]=i,e.views.position[t+1]=n,e.views.position[t+2]=0,e.views.distance[t]=32767,e.views.demPosition[t]=s[0]/8,e.views.demPosition[t+1]=s[1]/8,t+=r,e.views.position[t]=i,e.views.position[t+1]=n,e.views.position[t+2]=0,e.views.distance[t]=-32767,e.views.demPosition[t]=s[0]/8,e.views.demPosition[t+1]=s[1]/8,t+=r,e.views.position[t]=i,e.views.position[t+1]=n,e.views.position[t+2]=o,e.views.distance[t]=-32767,e.views.demPosition[t]=s[0]/8,e.views.demPosition[t+1]=s[1]/8,t+=r,e.views.position[t]=i,e.views.position[t+1]=n,e.views.position[t+2]=o,e.views.distance[t]=32767,e.views.demPosition[t]=s[0]/8,e.views.demPosition[t+1]=s[1]/8}function p(e,t,i,n){const o=e.elements.stride/e.views.normals.BYTES_PER_ELEMENT;t*=o;for(let s=0;s<4;s++)e.views.normals[t]=i,e.views.normals[t+1]=n,t+=o}function _(e,t){const i=e.elements.stride/e.views.direction.BYTES_PER_ELEMENT;t*=i;for(let n=0;n<4;n++)e.views.direction[t]=0,e.views.direction[t+1]=127,t+=i}function v(e,t,i,n){const o=e.indices.buffer;let s=e.indices.offset;o[s++]=t,o[s++]=t+1,o[s++]=t+3,o[s++]=t+3,o[s++]=t+1,o[s++]=t+2,0!==i&&(o[s++]=t+2,o[s++]=n+1,o[s++]=n+0),e.indices.offset=s}},5168:(e,t,i)=>{i.d(t,{y:()=>s});var n=i(4004),o=i(2847);function s(e,t,i,s,h,u,m,f){let p=e.elements.offset;for(let _=0;_<t;_++){const v=(0,o.X)(_,t),g=_===t-1;if(h&&1===h[v]||!h&&!g){const h=i[v],g=s[v],y=(_+1)%t,b=(0,o.X)(y,t),w=i[b],x=s[b];d(e,p),r(e,p,h,g,w,x,u),f?a(e,p,f[0],f[1],f[0],f[1]):a(e,p,h,g,w,x),l(e,p,(0,n.zj)(h,g,w,x)),void 0!==m&&"localID"in e.views&&void 0!==e.views.localID&&c(e.views.localID,p,m,e.elements.stride),p+=4}}e.elements.offset=p}function r(e,t,i,n,o,s,r){const a=e.views.position,l=e.elements.stride/a.BYTES_PER_ELEMENT;a[t*=l]=i,a[t+1]=n,a[t+2]=0,a[t+=l]=i,a[t+1]=n,a[t+2]=r,a[t+=l]=o,a[t+1]=s,a[t+2]=0,a[t+=l]=o,a[t+1]=s,a[t+2]=r}function a(e,t,i,n,o,s){const r=e.views.demPosition,a=e.elements.stride/r.BYTES_PER_ELEMENT;i/=8,n/=8,o/=8,s/=8,r[t*=a]=i,r[t+1]=n,r[t+=a]=i,r[t+1]=n,r[t+=a]=o,r[t+1]=s,r[t+=a]=o,r[t+1]=s}function l(e,t,i){const n=e.elements.stride/e.views.normal.BYTES_PER_ELEMENT;t*=n;for(let o=0;o<4;o++)e.views.normal[t]=i,e.views.normal[t+1]=0,t+=n}function c(e,t,i,n){const o=n/e.BYTES_PER_ELEMENT;e[t*=o]=i,e[t+=o]=i,e[t+=o]=i,e[t+=o]=i}function d(e,t){const i=e.indices.buffer;let n=e.indices.offset;i[n++]=t,i[n++]=t+3,i[n++]=t+1,i[n++]=t,i[n++]=t+2,i[n++]=t+3,e.indices.offset=n}},3251:(e,t,i)=>{i.d(t,{PA:()=>Y,XI:()=>V,kF:()=>q,Pn:()=>J,SV:()=>K,vP:()=>$});var n=i(1993),o=i(303),s=i(7666),r=i(590);const a=(0,o.D)({symbol:"shiftedLine",sinks:{solid:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.extender=new Int8Array(t,4),e.views.normal=new Int8Array(t,6),e.views.shift=new Float32Array(t,8)},packObjectAttributes:(e,t,i,n,o,s,a)=>(0,r.v$)([e,t],i,n,o,s,a),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,o,r,l,c){const d=!Number.isNaN(o[n.beginningIsCut])&&0!==o[n.beginningIsCut],h=!Number.isNaN(o[n.endingIsCut])&&0!==o[n.endingIsCut],u=e.getBucket(i.type,"solid",a.sinks.solid.packObjectAttributes(t,i.innerId,i.dataKeys,n,o,r,l),a.sinks.solid.binder);(0,s.e)(u,c[0],c[1],c[0].length,!d,!h,0,c[2],c[3])}});var l=i(495),c=i(5180),d=i(505),h=i(2815),u=i(7054),m=i(378),f=i(5168),p=i(1843),_=i(5668);const v=m.Ue(),g=m.Ue(),y=m.Ue(),b=m.Ue(),w=(e,t,i,n,o,s,a)=>(0,r.v$)([e,t],i,n,o,s,a),x=e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)}),I=(0,o.D)({symbol:"lineExtrusion",sinks:{fill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.normal=new Uint16Array(t,8),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:w,unpackObjectAttributes:x},topStroke:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.directionDistance=new Int8Array(t,8),e.views.demPosition=new Int16Array(t,12)},packObjectAttributes:w,unpackObjectAttributes:x},sideStroke:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.distance=new Int16Array(t,6),e.views.normals=new Uint16Array(t,8),e.views.direction=new Uint16Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:w,unpackObjectAttributes:x}},generate(e,t,i,n,o,s,r,a){const l=a[0],c=a[1],d=l.length,h=e.getBucket(i.type,"fill",I.sinks.fill.packObjectAttributes(t,i.innerId,i.dataKeys,o,s,r,n),I.sinks.fill.binder),u=e.getBucket(i.type,"topStroke",I.sinks.topStroke.packObjectAttributes(t,i.innerId,i.dataKeys,o,s,r,n),I.sinks.topStroke.binder),w=e.getBucket(i.type,"sideStroke",I.sinks.sideStroke.packObjectAttributes(t,i.innerId,i.dataKeys,o,s,r,n),I.sinks.sideStroke.binder);for(let e=0;e<d-1;e++){const t=l[e],i=c[e],n=l[e+1],o=c[e+1];m.t8(v,t,n),m.t8(g,i,o),m.t8(y,n,t),m.t8(b,o,i),(0,f.y)(h,2,v,g,void 0,1),(0,p.n)(u,t,i,1,n,o,1),(0,_.C)(w,2,v,g,void 0),(0,_.C)(w,2,y,b,void 0),(0,_.b)(w,2,v,g,void 0,1)}m.t8(v,l[d-1],l[0]),m.t8(g,c[d-1],c[0]),(0,_.b)(w,2,v,g,void 0,1)}});var S=i(184),M=i(752),T=i(7618),P=i(5951),L=i(3396),E=i(1525),k=i(5849),z=i(7768),A=i(9899);const C=[0,0,0],F=[0,0],R=(0,o.D)({symbol:"labelLine",sinks:{raster:{stride:28,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.texCoords=new Uint16Array(t,8),e.views.cornerOffset=new Float32Array(t,12),e.views.styleZoomLimits=new Float32Array(t,20)},packObjectAttributes:(e,t,i,n)=>(0,r.LY)([e.styleId,e.layer.innerId,t,i,n],e.tileData),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],range:e[3],fontIndex:e[4],tileData:e.slice(5)})}},processElement(e,t,i,n,o,s,r){var a;const{label:l,anchorPosition:c,anchorSegmentIndex:d,halfLabelWidth:h,layer:u}=i;if("labelLine"!==u.type)return;const{axis:m}=l,{center:f,styleZoom:p}=s,_=(0,z.bs)(p,s.styleState,!1,l.tileData),v=(0,z.Q9)(u.style.textFont,_),g=null!==(a=e.fontNameToIndex[v])&&void 0!==a?a:e.fontNameToIndex[A.Uo],y={};for(const e of l.ranges)y[e]=t.getBucket("labelLine","raster",R.sinks.raster.packObjectAttributes(l,n,e,g),R.sinks.raster.binder);const b=l.textMetrics.lines[0],w=(0,z.vn)(u.style.textFontSize,_)/E.fonts.baseSize,x=b.glyphs,I=function(e,t,i,n){const o=e.interpolate(t-i,e.getSegmentIndex(t-i)),s=e.interpolate(t+i,e.getSegmentIndex(t+i)),r=Math.atan2(s[1]-o[1],s[0]-o[0])-n;return Math.cos(r)<0}(m,c,h,s.rotation);F[0]=-b.width/2,F[1]=0;for(let e=0;e<x.length;e++){const t=x[e],n=(F[0]+t.left+t.width/2)*w*(I?-1:1),o=(0,k.Xx)(n)||1;let s=-1/0,a=1/0;for(let e=d;e>=1&&e<m.vertexCount&&!(a<i.overflowStyleZoom);e+=o,a=s){const l=1===o?e:e-1;s=(0,P.X$)((0,P.to)(n,m.lengths[l]-c),f);const d=m.interpolate(c,e);(0,T.a2)(C,d,r),(0,T.hm)(C)&&void 0!==t.bitmap&&(0,L.Uu)(y[t.range],C,F,t,d[3]+(I?Math.PI:0),Math.max(s,i.overflowStyleZoom),a)}F[0]+=t.advance+E.fonts.baseSize*u.style.textLetterSpacing}},getLabelingInfo(){}});const D=[0,0,0],O=(0,o.D)({symbol:"oneWayLine",sinks:{raster:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.direction=new Uint16Array(t,8),e.views.widenDirection=new Uint16Array(t,12)},packObjectAttributes:(e,t)=>(0,r.LY)([e.styleId,e.layer.innerId,t],e.tileData),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],tileData:e.slice(3)})}},processElement(e,t,i,n,o,s,r){const{label:a,anchorWorld:l}=i;if((0,T.a2)(D,l,r),!(0,T.hm)(D))return;const c=t.getBucket("oneWayLine","raster",O.sinks.raster.packObjectAttributes(a,n),O.sinks.raster.binder);(0,L.k8)(c,D,l[3])},getLabelingInfo(){}});var B=i(8604),j=i(8951),N=i(2528),U=i(1030),Z=i(504),H=i(6743);const G=(e,t,i,n,o,s,a,l,c,d)=>{const{tileProps:h}=a,u={type:H.R2.Line,styleId:t,layerId:i.innerId,sourceId:o,tileCoords:n,id:l[h.id],componentDistanceStart:(0,H.hs)(l[h.componentDistanceStart],0),componentDistanceEnd:(0,H.hs)(l[h.componentDistanceEnd],0),objectLength:(0,H.hs)(l[h.objectLength],0),labelPriority:(0,H.hs)(l[h.db_label_priority],0),vertices:[d[0],d[1]],tileData:(0,r.v$)([],i.dataKeys,h,l,c,s)};e.addLabel(u)},W=(e,t,i,n,o,s,a,l,c,d)=>{const{tileProps:h}=a,u={type:H.R2.OneWayLine,styleId:t,layerId:i.innerId,sourceId:o,tileCoords:n,id:l[h.id],componentDistanceStart:(0,H.hs)(l[h.componentDistanceStart],0),componentDistanceEnd:(0,H.hs)(l[h.componentDistanceEnd],0),objectLength:(0,H.hs)(l[h.objectLength],0),labelPriority:(0,H.hs)(l[h.db_label_priority],0),vertices:[d[0],d[1]],tileData:(0,r.v$)([],i.dataKeys,h,l,c,s)};e.addLabel(u)};function V({collector:e,generator:t,args:i}){do{t(e,...i)}while(e.isOverloaded())}const q={arrow:h.l,line:n.z,polygon:M.a,labelLine:R,lineExtrusion:I,polygonExtrusion:l.p,oneWayLine:O,dashedLine:c.L,shiftedLine:a,circle:u.p,buildingModel:d.X,point:B.uF,stretchableImage:j.z,raster:S.h,heatmap:N.B,dem:U._},X={labelLine:R,oneWayLine:O,point:B.uF};function $(e,t){const i=q[e];return i?i.sinks[t].stride:0}function Y(e,t,i,o,s,r,d,u,m,f,p,_,v,g,y,b){i.forEach((i=>{if((void 0===o||!(i.maxzoom<=o||i.minzoom>=o+1&&o!==E.tiles.maxDetailLevel))&&(!r.hovered||Number.isNaN(d[r.hovered])||1!==d[r.hovered]||"polygon"===i.type||"polygonExtrusion"===i.type||"point"===i.type))do{switch(i.type){case"line":n.z.generate(e,t.id,i,r,d,u,f,g);break;case"dashedLine":c.L.generate(e,t.id,i,r,d,u,f,g);break;case"shiftedLine":a.generate(e,t.id,i,r,d,u,f,g);break;case"polygon":M.a.generate(e,t.id,i,r,d,u,f,g,y);break;case"polygonExtrusion":l.p.generate(e,t.id,i,s,p,f,r,d,u,g,!0,y);break;case"labelLine":G(e,t.id,i,_,m,f,s,d,u,g);break;case"oneWayLine":W(e,t.id,i,_,m,f,s,d,u,g);break;case"point":(0,Z.p)(e,t,i,_,m,f,s,d,u,g,v,b);break;case"lineExtrusion":I.generate(e,t.id,i,f,r,d,u,g);break;case"arrow":h.l.generate(e,t.id,i,r,d,u,f,g);break;case"heatmap":const o=(0,z.OW)(s,p,f,r,d,u);N.B.generate(e,t.id,i,g,o)}}while(e.isOverloaded())}))}function K(e,t,i,n,o,s,r,a){const l=X[t.type];if(l)do{l.processElement(e,i,n,o,s,r,a)}while(i.isOverloaded())}function J(e,t,i,n,o,s,r){const a=X[n.type];a&&a.getLabelingInfo(e,t,i,o,s,r)}},1993:(e,t,i)=>{i.d(t,{z:()=>r});var n=i(303),o=i(7666),s=i(590);const r=(0,n.D)({symbol:"line",sinks:{solid:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.extender=new Int8Array(t,4),e.views.normal=new Int8Array(t,6),e.views.localID=new Uint32Array(t,8)},packObjectAttributes:(e,t,i,n,o,r,a)=>(0,s.v$)([e,t],i,n,o,r,a),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,s,a,l,c){const d=!Number.isNaN(s[n.beginningIsCut])&&0!==s[n.beginningIsCut],h=!Number.isNaN(s[n.endingIsCut])&&0!==s[n.endingIsCut],u=e.idIndexer.getIndex({id:s[n.id],styleId:t,layer:i,sublayer:s[n.db_sublayer]}),m=e.getBucket(i.type,"solid",r.sinks.solid.packObjectAttributes(t,i.innerId,i.dataKeys,n,s,a,l),r.sinks.solid.binder);(0,o.e)(m,c[0],c[1],c[0].length,!d,!h,u)}})},505:(e,t,i)=>{i.d(t,{X:()=>c});var n=i(303),o=i(1843),s=i(8631),r=i(590),a=i(9899);const l=[a.Bq/2,a.Bq/2],c=(0,n.D)({symbol:"buildingModel",sinks:{fill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.texCoords=new Uint16Array(t,8),e.views.localID=new Uint32Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:(e,t,i,n,o,s,a,l,c,d)=>(0,r.v$)([e,t,i,n,s,o],a,l,c,d),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],texture:e[2],primitiveType:e[3],id:Number.isNaN(e[4])?void 0:(0,s.Ak)(e[4]),matrix:e[5],tileData:e.slice(6)})},stroke:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.directionDistance=new Int8Array(t,8),e.views.demPosition=new Int16Array(t,12)},packObjectAttributes:(e,t,i,n,o,s,a,l)=>(0,r.v$)([e,t,n,i],o,s,a,l),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],id:Number.isNaN(e[2])?void 0:(0,s.Ak)(e[2]),matrix:e[3],tileData:e.slice(4)})}},processSubmesh(e,t,i,n,o,s,r,a,l,h,u){const{tileProps:m}=i,f=o[m.id],p=n.idIndexer.getIndex({id:f,styleId:e,layer:t,sublayer:o[m.db_sublayer]}),_=n.getBucket(t.type,"fill",c.sinks.fill.packObjectAttributes(e,t.innerId,h,l,u,f,t.dataKeys,m,o,s),c.sinks.fill.binder);!function(e,t){const i=e.elements.offset;let n=e.indices.offset;for(let o=0;o<t.length;o++)e.indices.buffer[n++]=i+t[o];e.indices.offset=n}(_,a);for(let e=0;e<r.length;e++)d(_,r,e,p)},processOuterEdge(e,t,i,n,s,r,a,d,h){const{tileProps:u}=i,m=s[u.id],f=n.getBucket(t.type,"stroke",c.sinks.stroke.packObjectAttributes(e,t.innerId,h,m,t.dataKeys,u,s,r),c.sinks.stroke.binder);for(let e=0;e<d.length;e+=2){const t=5*d[e],i=5*d[e+1];(0,o.n)(f,a[t],a[t+1],a[t+2],a[i],a[i+1],a[i+2],l)}}});function d(e,t,i,n){const o=e.elements.offset,s=c.sinks.fill.stride,r=5*i,a=o*(s/e.views.position.BYTES_PER_ELEMENT),d=o*(s/e.views.localID.BYTES_PER_ELEMENT);e.views.position[a]=t[r],e.views.position[a+1]=t[r+1],e.views.position[a+2]=t[r+2],e.views.texCoords[a]=t[r+3],e.views.texCoords[a+1]=t[r+4],e.views.demPosition[a]=l[0],e.views.demPosition[a+1]=l[1],e.views.localID[d]=n,e.elements.offset++}},8604:(e,t,i)=>{i.d(t,{bR:()=>T,uF:()=>D,vg:()=>B,qp:()=>O});var n=i(2034),o=i(9899);function s(e,t){const i=e.reduce(((e,t)=>e.concat(t)),[0]).concat(t),n=i.length-1;return{coords:i.slice(i[0]===i[1]?1:0,i[n-1]===i[n]?n:n+1),isOddStretchable:r(e)}}function r(e){var t;return!(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t[0])}function a(e,t,i,n){if(e.coords.length<2)throw new Error("The source coords array must have at least two coordinates");return e.coords.map(((o,s)=>(t+o+n*(0===s?-1:s===e.coords.length-1?1:0))/i))}function l(e,t){const{stretchSize:i,fixSize:n}=c(e),{coords:o,isOddStretchable:s}=e,r=t<n?n:t,a=[o[0]];for(let e=1;e<o.length;e++){const t=o[e-1],l=o[e],c=e%2==(s?1:0),d=a[a.length-1];c?a.push(Math.round((r-n)*(l-t)/i)+d):a.push(d+l-t)}return a}function c({coords:e,isOddStretchable:t}){if(e.length<2)throw new Error("An axis must have at least two coordinates");if(2===e.length)return{stretchSize:e[e.length-1],fixSize:0};let i=0;for(let n=t?0:1;n<e.length-1;n+=2)i+=e[n+1]-e[n];return{stretchSize:i,fixSize:e[e.length-1]-i}}function d(e,t,i=0){const n=e[e.length-1]-e[0],o=e.map((e=>Math.round(e-n/2+i)));return 2===o.length?o[o.length-1]+=2*t:(o[0]-=t,o[o.length-1]+=t),o}function h(e,t,i,n,r,c,h,u,m){const f=function(e,t,i=[],n=[]){return{x:s(i,e),y:s(n,t)}}(i.w,i.h,u,m),p=function(e,t,i,n,o){return[a(e.x,t,n[0],o),a(e.y,i,n[1],o)]}(f,i.x,i.y,t,o.CW),_=function(e,t,i,n,o=0,s=0){return[d(l(e.x,t),n,o),d(l(e.y,i),n,s)]}(f,n,r,o.CW,c,h);e.set(_,p)}function u(e,t,i,o,s,r,a,l,c,d,h){let u=12*e.elements.offset;e.views.position[u]=t,e.views.position[u+1]=i,e.views.position[u+2]=o,e.views.cornerOffset[u]=s,e.views.cornerOffset[u+1]=-r,e.views.texCoords[u]=(0,n.Bb)(a),e.views.texCoords[u+1]=(0,n.Bb)(l),e.views.scales[u]=(0,n.KF)(c),e.views.scales[u+1]=(0,n.wj)(d),u>>=1,e.views.localID[u]=h,e.elements.offset++}function m(e,t,i,n,o,s,r){const{elements:a,indices:l}=e,{buffer:c,offset:d}=l,h=a.offset;c[d]=h+t,c[d+1]=h+i,c[d+2]=h+n,c[d+3]=h+o,c[d+4]=h+s,c[d+5]=h+r,l.offset=d+6}var f=i(3396),p=i(9016),_=i(1525),v=i(7768);function g(e,t,i,n,o,s){if(!e||o&&!s)return[0,0];if(!s)return[e.w/t,e.h/t];const r=w(i,n,s),a=i.style.iconTextPadding;return[a[3]+a[1]+r[0],a[0]+a[2]+r[1]]}function y(e,t,i){return x((0,v.vn)(e.style.textFontSize,t),e.style.textLineHeight,i)}function b(e,t,i){return x((0,v.vn)(e.style.textFontSize2,t),e.style.textLineHeight,i)}function w(e,t,i){return x((0,v.vn)(e.style.iconTextFontSize,t),e.style.iconTextLineHeight,i)}function x(e,t,i){return[e/_.fonts.baseSize*i.maxWidth,e*t*i.lines.length]}function I(e,t,i){var n,o;const s=null!==(n=i[0])&&void 0!==n?n:0,r=null!==(o=i[1])&&void 0!==o?o:0;return[(.5-e.anchorX)*t[0]+s,(.5-e.anchorY)*t[1]+r]}function S(e,t,i,n,o){var s,r,a,l;const c=null!==(s=i[0])&&void 0!==s?s:.5,d=null!==(r=i[1])&&void 0!==r?r:.5,h=null!==(a=o[0])&&void 0!==a?a:0,u=null!==(l=o[1])&&void 0!==l?l:0;return[e[0]/2-c*t[0]-n[3]+h,e[1]/2-d*t[1]-n[0]+u]}function M(e,t,i,n,o){const s=t[0],r=t[1],a=i[0],l=i[1];let c=0,d=0;const h=l/2+r/2,u=l/2-r/2,m=-h,f=-u,p=a/2+s/2,_=a/2-s/2,v=-p,g=-_;switch(e){case"bottomCenter":d=h+o;break;case"rightCenter":c=p+o;break;case"topCenter":d=m-o;break;case"leftCenter":c=v-o;break;case"bottomRight":c=_,d=h+o;break;case"topRight":c=_,d=m-o;break;case"bottomLeft":c=g,d=h+o;break;case"rightBottom":c=p+o,d=f;break;case"rightTop":c=p+o,d=u;break;case"topLeft":c=g,d=m-o;break;case"leftTop":c=v-o,d=u;break;case"leftBottom":c=v-o,d=f}return[c+n[0],d+n[1]]}var T,P=i(303),L=i(7618),E=i(8016),k=i(9670),z=i(5828),A=i(590),C=i(8361);!function(e){e[e.Icon=0]="Icon",e[e.First=1]="First",e[e.Second=2]="Second"}(T||(T={}));const F=new class{constructor(){this.countX=0,this.countY=0,this.textureX=[],this.textureY=[],this.stretchedX=[],this.stretchedY=[]}reset(){this.countX=0,this.countY=0}set(e,t){this.countX=t[0].length,this.countY=t[1].length,this.textureX=t[0],this.textureY=t[1],this.stretchedX=e[0],this.stretchedY=e[1]}isEmpty(){return 0===this.countX||0===this.countY}},R=[0,0,0],D=(0,P.D)({symbol:"point",sinks:{raster:{stride:24,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.cornerOffset=new Int16Array(t,8),e.views.texCoords=new Uint16Array(t,12),e.views.scales=new Int16Array(t,16),e.views.localID=new Uint32Array(t,20)},packObjectAttributes:(e,t,i)=>(0,A.LY)([e.styleId,e.layer.innerId,t,i],e.tileData),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],atlasIndex:e[3],tileData:e.slice(4)})},text:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.cornerOffset=new Int16Array(t,8),e.views.texCoords=new Uint16Array(t,12),e.views.localID=new Uint32Array(t,16)},packObjectAttributes:(e,t,i,n,o,s)=>(0,A.LY)([e.styleId,e.layer.innerId,t,i,n[0],-n[1],o,s],e.tileData),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],range:e[3],offsetX:e[4],offsetY:e[5],labelIndex:e[6],fontIndex:e[7],tileData:e.slice(8)})}},processElement(e,t,i,n,s,r,a){const{layer:l,label:c}=i;if("point"!==l.type)return;const d=(0,v.bs)(r.styleZoom,r.styleState,!0,c.tileData),h=N(d,e,s,c),u=e.icons[(0,v.Q9)(l.style.iconImage,d)],m=(0,C.x)(u),f=g(h,s,l,d,m,c.iconTextMetrics);let p,_=[0,0];if(h&&(c.iconTextMetrics?(p=w(l,d,c.iconTextMetrics),_=S(f,p,l.style.iconTextAnchor,l.style.iconTextPadding,l.style.iconTextOffset)):_=I(h,f,l.style.iconOffset)),(0,L.a2)(R,i.anchorWorld,a),(0,L.hm)(R))switch(i.type){case E.Dl.Icon:if(!h||m&&!c.iconTextMetrics)return;const a=m?u.stretchX:void 0,d=m?u.stretchY:void 0;if(j(t,c,R,n,h,f[0]*s,f[1]*s,_[0]*s,_[1]*s,null==a?void 0:a.map((([e,t])=>[e*s,t*s])),null==d?void 0:d.map((([e,t])=>[e*s,t*s]))),!p)return;return void function(e,t,i,n,s,r,a,l){var c;const{iconTextMetrics:d}=i;if(!d||!l.style.iconTextFont)return;const h=(0,v.bs)(s.styleZoom,s.styleState,!1,i.tileData),u=(0,v.Q9)(l.style.iconTextFont,h),m=null!==(c=e.fontNameToIndex[u])&&void 0!==c?c:e.fontNameToIndex[o.Uo];O(t,i,T.Icon,d,n,r,a,l,m)}(e,t,i.label,R,r,n,function(e,t,i){var n,o,s,r;const a=null!==(n=t[0])&&void 0!==n?n:.5,l=null!==(o=t[1])&&void 0!==o?o:.5,c=null!==(s=i[0])&&void 0!==s?s:0,d=null!==(r=i[1])&&void 0!==r?r:0;return[(.5-a)*e[0]+c,(.5-l)*e[1]+d]}(p,l.style.iconTextAnchor,l.style.iconTextOffset),l);case E.Dl.PoiText:return void function(e,t,i,n,s,r,a,l,c){var d;const{label:h}=i,{textMetrics:u}=h,m=(0,v.bs)(r.styleZoom,r.styleState,!1,h.tileData),f=(0,v.Q9)(c.style.textFont,m);if(!f.length)return;const p=y(c,m,u),_=null!==(d=e.fontNameToIndex[f])&&void 0!==d?d:e.fontNameToIndex[o.Uo],g=i.parent?c.style.textPlacement:"centerCenter",b=(0,v.vn)(c.style.textOffset,m),w=M(g,s,p,l,b);O(t,h,T.First,h.textMetrics,n,a,w,c,_)}(e,t,i,R,f,r,n,_,l);case E.Dl.PoiText2:return void function(e,t,i,n,s,r,a,l,c){var d,h;const{label:u}=i,{textMetrics:m,textMetrics2:f}=u;if(!f||!c.style.textFont2)return;const p=(0,v.bs)(r.styleZoom,r.styleState,!1,u.tileData),_=y(c,p,m),g=b(c,p,f),w=(0,v.vn)(c.style.textOffset,p),x=(0,v.vn)(null!==(d=c.style.textOffset2)&&void 0!==d?d:0,p,0),I=(0,v.Q9)(c.style.textFont2,p),S=null!==(h=e.fontNameToIndex[I])&&void 0!==h?h:e.fontNameToIndex[o.Uo],P=M(c.style.textPlacement,s,[g[0],_[1]],l,w);P[1]+=(_[1]+g[1])/2+x,O(t,u,T.Second,f,n,a,P,c,S)}(e,t,i,R,f,r,n,_,l)}},getLabelingInfo(e,t,i,n,o,s){const{layer:r}=e;if("point"!==r.type)return;e.labelingElements.length=0;const a=(0,v.bs)(n.styleZoom,n.styleState,!0,e.tileData),l=N(a,i,s,e),c=i.icons[(0,v.Q9)(r.style.iconImage,a)],d=(0,C.x)(c),h=g(l,s,r,a,d,e.iconTextMetrics);let u,m=[0,0];if(l&&(!d||e.iconTextMetrics)){e.iconTextMetrics?(u=w(r,a,e.iconTextMetrics),m=S(h,u,r.style.iconTextAnchor,r.style.iconTextPadding,r.style.iconTextOffset)):m=I(l,h,r.style.iconOffset);const s=new p.x(e,E.Dl.Icon,t,n.buildingHeight,o,i);s.boxes.push([-h[0]/2+m[0],-h[1]/2+m[1],h[0]/2+m[0],h[1]/2+m[1]]),e.labelingElements.push(s)}const f=(0,v.Q9)(r.style.textFont,a);e.label.length>0&&f.length&&(function(e,t,i,n,o,s,r,a){const{textMetrics:l}=e;if(!l)return;const c=(0,v.bs)(o.styleZoom,o.styleState,!1,e.tileData),d=(0,v.vn)(a.style.textOffset,c),h=y(a,c,l),u=new p.x(e,E.Dl.PoiText,t,o.buildingHeight,s,i);e.labelingElements.length>0&&(u.parent=e.labelingElements[0]);const m=M(u.parent?a.style.textPlacement:"centerCenter",n,h,r,d);u.boxes.push([m[0]-h[0]/2,m[1]-h[1]/2,m[0]+h[0]/2,m[1]+h[1]/2]),e.labelingElements.push(u)}(e,t,i,h,n,o,m,r),e.label2&&function(e,t,i,n,o,s,r,a){var l;const{textMetrics:c,textMetrics2:d}=e;if(!d)return;const h=(0,v.bs)(o.styleZoom,o.styleState,!1,e.tileData),u=y(a,h,c),m=b(a,h,d),f=(0,v.vn)(a.style.textOffset,h),_=(0,v.vn)(null!==(l=a.style.textOffset2)&&void 0!==l?l:0,h,0),g=new p.x(e,E.Dl.PoiText2,t,o.buildingHeight,s,i);e.labelingElements.length>1?(g.parent=e.labelingElements[0],g.firstLabel=e.labelingElements[1]):e.labelingElements.length>0&&(g.parent=e.labelingElements[0],g.firstLabel=e.labelingElements[0]);const w=M(a.style.textPlacement,n,[m[0],u[1]],r,f);w[1]+=(u[1]+m[1])/2+_,g.boxes.push([w[0]-m[0]/2,w[1]-m[1]/2,w[0]+m[0]/2,w[1]+m[1]/2]),e.labelingElements.push(g)}(e,t,i,h,n,o,m,r))}});function O(e,t,i,n,o,s,r,a,l){const c={};for(const n of t.ranges)c[n]=e.getBucket("point","text",D.sinks.text.packObjectAttributes(t,s,n,r,i,l),D.sinks.text.binder);(0,f.$Y)(c,t,o,n,a,i)}function B(e,t,i,n,o){return j(e,t,i,n,o,o.w,o.h,o.w*(.5-o.anchorX),o.h*(.5-o.anchorY),void 0,void 0)}function j(e,t,i,n,s,r,a,l,c,d,f){if(r<=0||a<=0)return;if("point"!==t.layer.type)return;h(F,_.atlasSize,s,r,a,l,c,d,f),e.atlasPacker.addRastersToLoad(t.styleId,s);const p=e.getBucket("point","raster",D.sinks.raster.packObjectAttributes(t,n,s.atlasIndex),D.sinks.raster.binder);!function(e,t,i,n,s,r,a,l){const{textureX:c,textureY:d,stretchedX:h,stretchedY:f,countX:p,countY:_}=n,v=r!==-1/0?r:o.vL,g=a!==1/0?a:o.Fv;for(let n=0;n<p-1;n++){const o=c[n],r=c[n+1],a=h[n],p=h[n+1];for(let n=0;n<_-1;n++){const c=d[n],h=d[n+1],_=f[n],y=f[n+1];m(s,0,2,1,1,2,3),u(s,e,t,i,a,_,o,c,v,g,l),u(s,e,t,i,p,_,r,c,v,g,l),u(s,e,t,i,a,y,o,h,v,g,l),u(s,e,t,i,p,y,r,h,v,g,l)}}}(i[0],i[1],i[2],F,p,-1/0,1/0,t.identifyIndex)}function N(e,t,i,n){const{rasterSets:o}=t,{layer:s}=n;if("point"!==s.type)return;let r;if(n.pointType===E.a_.Commercial||n.pointType===E.a_.CommercialCity||n.pointType===E.a_.Landmark)r=o.byKey[(0,k.zV)(n.idLo,n.idHi)];else{const t=(0,v.Q9)(s.style.iconImage,e);t.length&&(r=o.byKey[(0,k.fF)(t,s.style.iconAnchor[0],s.style.iconAnchor[1])])}if(r){const t=(0,v.vn)(s.style.iconWidth,e),n=(0,z.Bl)(r.rasters,t*i,!0);if(void 0!==n)return r.rasters[n]}}},752:(e,t,i)=>{i.d(t,{a:()=>u});var n=i(303),o=i(8631),s=i(2847),r=i(1843),a=i(8072),l=i(590);const c=(0,o.Ru)(NaN,NaN);function d(e,t,i,n,o,s,r,a){return(0,l.v$)([e,t,i],n,o,s,r,a)}const h=e=>({styleId:e[0],layerId:e[1],hiddenObjectId:Number.isNaN(e[2])?void 0:(0,o.Ak)(e[2]),tileData:e.slice(3)}),u=(0,n.D)({symbol:"polygon",sinks:{fill:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.localID=new Uint32Array(t,4)},packObjectAttributes:d,unpackObjectAttributes:h},stroke:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.directionDistance=new Int8Array(t,4)},packObjectAttributes:d,unpackObjectAttributes:h}},generate(e,t,i,n,o,l,d,h,p,_){const v=h[0],g=h[1],y=h[2],b=o[n.id],w="number"!=typeof b&&p&&p.has(b)?b:c,x=o[n.hovered]?a.gl:e.idIndexer.getIndex({id:b,styleId:t,layer:i,sublayer:o[n.db_sublayer],floorId:_});!function(e,t,i,n,o){const s=e.indices.buffer;let r=e.indices.offset,a=e.elements.offset;const l=a;m(e,a++,i[0],n[0],o),m(e,a++,i[1],n[1],o);for(let c=2;c<t;c++)f(s,r,l,c),m(e,a++,i[c],n[c],o),r+=3;e.elements.offset=a,e.indices.offset=r}(e.getBucket(i.type,"fill",u.sinks.fill.packObjectAttributes(t,i.innerId,w,i.dataKeys,n,o,l,d),u.sinks.fill.binder),v.length,v,g,x);!function(e,t,i,n,o){for(let a=0;a<t;a++){const l=(0,s.X)(a,t);if(1===o[l]){const o=(0,s.X)((a+1)%t,t);(0,r.n)(e,i[l],n[l],0,i[o],n[o],0)}}}(e.getBucket(i.type,"stroke",u.sinks.stroke.packObjectAttributes(t,i.innerId,w,i.dataKeys,n,o,l,d),u.sinks.stroke.binder),v.length,v,g,y)}});function m(e,t,i,n,o){t*=4,e.views.position[t]=i,e.views.position[t+1]=n,t>>=1,e.views.localID[t]=o}function f(e,t,i,n){n%2==0?(e[t]=i+n-2,e[t+1]=i+n-1,e[t+2]=i+n):(e[t]=i+n-1,e[t+1]=i+n-2,e[t+2]=i+n)}},495:(e,t,i)=>{i.d(t,{p:()=>g});var n=i(2847),o=i(7618),s=i(8631),r=i(303),a=i(5168),l=i(5668),c=i(1843),d=i(8072),h=i(590),u=i(7090),m=i(9899);const f=(0,s.Ru)(NaN,NaN),p=m.Bq/2,_=(e,t,i,n,o,s,r,a)=>(0,h.v$)([e,t,i],n,o,s,r,a),v=e=>({styleId:e[0],layerId:e[1],hiddenObjectId:Number.isNaN(e[2])?void 0:(0,s.Ak)(e[2]),tileData:e.slice(3)}),g=(0,r.D)({symbol:"polygonExtrusion",sinks:{sideFill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.normal=new Uint16Array(t,8),e.views.localID=new Uint32Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:_,unpackObjectAttributes:v},topFill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.normal=new Uint16Array(t,8),e.views.localID=new Uint32Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:_,unpackObjectAttributes:v},sideStroke:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.distance=new Int16Array(t,6),e.views.normals=new Uint16Array(t,8),e.views.direction=new Uint16Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:_,unpackObjectAttributes:v},topStroke:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.directionDistance=new Int8Array(t,8),e.views.demPosition=new Int16Array(t,12)},packObjectAttributes:_,unpackObjectAttributes:v}},generate(e,t,i,s,r,h,p,v,I,S,M,T,P,L){const E=S[0],k=S[1],z=S[2],A=E.length;P||(P=p.db_centroid_x&&p.db_centroid_y?[v[p.db_centroid_x],v[p.db_centroid_y]]:function(e,t,i){let o,s=Math.pow(m.Bq,2);const r=e.length,a=u.Ue();for(let l=0;l<r;l++){o||u.aM(a,[e[l],t[l]]);const c=(0,n.X)(l,r);if(0===i[c]){const i=[e[c],t[c]],a=(0,n.X)((l+1)%r,r),d=[e[a],t[a]];if(x(i)){const e=w(i);e<s&&(o=i,s=e);const t=w(d);t<s&&(o=d,s=t)}else o=[(e[c]+e[a])/2,(t[c]+t[a])/2]}}o||(o=[],u.be(o,a));return o}(E,k,z));const C=v[p.hovered],F=Math.round((0,o.VW)(v[p.db_height])),R=v[p.id],D=C?d.gl:e.idIndexer.getIndex({id:R,styleId:t,layer:i,sublayer:v[p.db_sublayer],floorId:L}),O="number"!=typeof R&&T&&T.has(R)?R:f,B=_(t,i.innerId,O,i.dataKeys,p,v,I,h);if(F>0){const t=e.getBucket("polygonExtrusion","sideFill",B,g.sinks.sideFill.binder);(0,a.y)(t,A,E,k,z,F,D,P);const i=e.getBucket("polygonExtrusion","sideStroke",B,g.sinks.sideStroke.binder);M&&((0,l.C)(i,A,E,k,z,P),(0,l.b)(i,A,E,k,z,F,P))}!function(e,t,i,n,o,s,r){let a=e.elements.offset;const l=a;y(e,a++,i[0],n[0],o,s,r),y(e,a++,i[1],n[1],o,s,r);for(let c=2;c<t;c++)b(e,l,c),y(e,a++,i[c],n[c],o,s,r);e.elements.offset=a}(e.getBucket("polygonExtrusion","topFill",B,g.sinks.topFill.binder),A,E,k,F,D,P);!function(e,t,i,o,s,r,a){for(let l=0;l<t;l++){const d=(0,n.X)(l,t);if(s&&1===s[d]){const s=(0,n.X)((l+1)%t,t);(0,c.n)(e,i[d],o[d],r,i[s],o[s],r,a)}}}(e.getBucket("polygonExtrusion","topStroke",B,g.sinks.topStroke.binder),A,E,k,z,F,P)}});function y(e,t,i,n,o,s,r){const a=e.elements.stride,l=t*(a/e.views.position.BYTES_PER_ELEMENT);e.views.position[l]=i,e.views.position[l+1]=n,e.views.position[l+2]=o,e.views.normal[l]=0,e.views.normal[l+1]=127,e.views.demPosition[l]=r[0]/8,e.views.demPosition[l+1]=r[1]/8;const c=t*(a/e.views.localID.BYTES_PER_ELEMENT);e.views.localID[c]=s}function b(e,t,i){const n=e.indices.buffer;let o=e.indices.offset;i%2==0?(n[o++]=t+i-2,n[o++]=t+i-1,n[o++]=t+i):(n[o++]=t+i-1,n[o++]=t+i-2,n[o++]=t+i),e.indices.offset=o}function w(e){return Math.pow(p-Math.abs(e[0]-p),2)+Math.pow(p-Math.abs(e[1]-p),2)}function x(e){return 0===e[0]||e[0]===m.Bq||0===e[1]||e[1]===m.Bq}},6743:(e,t,i)=>{i.d(t,{R2:()=>n,hs:()=>s,It:()=>r});var n,o=i(7768);function s(e,t){return Number.isNaN(e)?t:e}function r(e,t){if(!e)return"";const i=(0,o.FR)(e,t);return Number.isNaN(i)||!i&&0!==i?"":String(i)}!function(e){e[e.Point=0]="Point",e[e.Line=1]="Line",e[e.OneWayLine=2]="OneWayLine"}(n||(n={}))},504:(e,t,i)=>{i.d(t,{p:()=>p});var n=i(3386),o=i(1525),s=i(5828),r=i(9670),a=i(9110),l=i(7768),c=i(8072),d=i(590),h=i(8016),u=i(6743),m=i(8361),f=i(7618);const p=(e,t,i,p,_,v,g,y,b,w,x,I,S)=>{const{tileProps:M}=g;if(function(e,t,i,c,d,h,u){const{tileProps:f}=c,{rasterSets:p,icons:_}=t,v=(0,a.fL)(h),g=(0,l.EG)(i.style.iconWidth),y=(0,n.Ty)(d[f.db_sublayer]),b=(0,n.Cz)(d[f.db_sublayer]);if(y||b){if(u)return;const i=y?o.commercialPoi.rasterSizes:o.landmarkRasterSizes,n=(0,s.rA)(d[f.id],i,d[f.db_region],f.url_src?d[f.url_src]:void 0);e.atlasPacker.addNewRasterSet(t.id,n),e.atlasPacker.pack(n,g,v)}else(0,l.EG)(i.style.iconImage).forEach((n=>{if(!n.length)return;const{iconAnchor:o}=i.style,s=p.byKey[(0,r.fF)(n,o[0],o[1])];if(!s)return void console.error(`Not found raster set with image ${n}, anchorX: ${o[0]}, anchorY: ${o[1]}`);if(!s.isSvg)return;const a=_[n],l=a&&(0,m.x)(a)?[{w:a.width,h:a.height}]:g.map((e=>({w:e,h:e})));e.atlasPacker.packSvg(s,l,v),u&&s.rasters.forEach((i=>e.atlasPacker.addRastersToLoad(t.id,i)))}))}(e,t,i,g,y,x,I),I)return;let T=h.a_.Common;(0,n.wu)(y[M.db_sublayer])?T=h.a_.CommercialCity:(0,n.Ty)(y[M.db_sublayer])?T=h.a_.Commercial:(0,n.Cz)(y[M.db_sublayer])&&(T=h.a_.Landmark);const P=1===w[0].length?h._r.Point:h._r.Line;let L,E=[];P===h._r.Point?(E=[[w[0][0]],[w[1][0]],3===w.length?[w[2][0]]:[0]],L=[0,0,0],(0,f.Z$)(L,[E[0][0],E[1][0],E[2][0]],(0,f.Bs)(p))):E=[w[0],w[1]];const k=y[M.id];let z=c.gl,A=c.gl;Number.isNaN(k)||(z=e.idIndexer.getIndex({id:k,styleId:t.id,layer:i,sublayer:y[M.db_sublayer],objectClass:y[M.db_object_class],instanceId:0,metatile:g,center:L,floorId:S}),A=e.idIndexer.getIndex({id:k,styleId:t.id,layer:i,sublayer:y[M.db_sublayer],objectClass:y[M.db_object_class],instanceId:1,metatile:g,center:L,floorId:S}));const C={type:u.R2.Point,pointType:T,geometryType:P,styleId:t.id,layerId:i.innerId,sourceId:_,tileCoords:p,id:y[M.id],identifyIndex:z,identifyPoiLabelIndex:A,labelPriority:(0,u.hs)(y[M.db_label_priority],0),label2Priority:(0,u.hs)(y[M.db_label2_priority],0),iconPriority:(0,u.hs)(y[M.db_icon_priority],0),hovered:(0,u.hs)(y[M.hovered],0),componentDistanceStart:(0,u.hs)(y[M.componentDistanceStart],0),componentDistanceEnd:(0,u.hs)(y[M.componentDistanceEnd],0),objectLength:(0,u.hs)(y[M.objectLength],0),vertices:E,demElevation:NaN,tileData:(0,d.v$)([],i.dataKeys,M,y,b,v)};e.addLabel(C)}},184:(e,t,i)=>{i.d(t,{h:()=>s});var n=i(303),o=i(2034);const s=(0,n.D)({symbol:"raster",sinks:{fill:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.txtrCoords=new Uint16Array(t,4)},packObjectAttributes:(e,t,i)=>[e,t,i],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],textureIndex:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,o){const a=t[0],l=t[1],c=e.getBucket(n.type,"fill",s.sinks.fill.packObjectAttributes(i,n.innerId,o),s.sinks.fill.binder);let d=c.elements.offset;!function(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}(c.indices,d,0,1,2,2,1,3),r(c,d++,a[0],l[0],0,1),r(c,d++,a[1],l[1],1,1),r(c,d++,a[2],l[2],0,0),r(c,d++,a[3],l[3],1,0),c.elements.offset=d}});function r(e,t,i,n,s,r){t*=4,e.views.position[t]=i,e.views.position[t+1]=n,e.views.txtrCoords[t]=(0,o.Bb)(s),e.views.txtrCoords[t+1]=(0,o.Bb)(r)}},8951:(e,t,i)=>{i.d(t,{z:()=>m});var n=i(303),o=i(2034),s=i(9899);function r(e,t){const i=e.reduce(((e,t)=>e.concat(t)),[0]).concat(t),n=i.length-1;return{coords:i.slice(i[0]===i[1]?1:0,i[n-1]===i[n]?n:n+1),isOddStretchable:a(e)}}function a(e){var t;return!(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t[0])}function l({coords:e}){if(e.length<2)throw new Error("The source coords array must have at least two coordinates");const t=e[e.length-1]+2*s.Hg;return e.map(((i,n)=>(i+s.Hg*(0===n?0:n===e.length-1?2:1))/t))}function c(e,t){const{stretchSize:i,fixSize:n}=d(e),{coords:o,isOddStretchable:s}=e,r=t<n?n:t,a=[o[0]];for(let e=1;e<o.length;e++){const t=o[e-1],l=o[e],c=e%2==(s?1:0),d=a[a.length-1];c?a.push(Math.round((r-n)*(l-t)/i)+d):a.push(d+l-t)}return a}function d({coords:e,isOddStretchable:t}){if(e.length<2)throw new Error("An axis must have at least two coordinates");if(2===e.length)return{stretchSize:e[e.length-1],fixSize:0};let i=0;for(let n=t?0:1;n<e.length-1;n+=2)i+=e[n+1]-e[n];return{stretchSize:i,fixSize:e[e.length-1]-i}}function h(e,t=0){const i=e[e.length-1]-e[0];return e.map((e=>Math.round(e-i/2+t)))}function u(e){return e.map((e=>e*window.devicePixelRatio))}const m=(0,n.D)({symbol:"stretchableImage",sinks:{fill:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.vrtxOffset=new Int16Array(t,4),e.views.txtrCoords=new Uint16Array(t,8),e.views.localID=new Uint32Array(t,12)},packObjectAttributes:(e,t,i)=>[e,t,i],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],textureIndex:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,o,s,a){const{offset:d,stretchX:_,stretchY:v,sourceSize:g,targetSize:y}=i.style,b=e.idIndexer.getIndex({id:o[n.id],styleId:t,layer:i,sublayer:o[n.db_sublayer]}),w=e.getBucket("stretchableImage","fill",m.sinks.fill.packObjectAttributes(t,i.innerId,s),m.sinks.fill.binder),x=function([e,t],i=[],n=[]){return{x:r(i,e),y:r(n,t)}}(g,_,v),I=function({x:e,y:t}){return[l(e),l(t)]}(x),S=function({x:e,y:t},{targetSize:[i,n],offset:o}){return[u(h(c(e,i),o&&o[0])),u(h(c(t,n),o&&o[1]))]}(x,{targetSize:y,offset:d});!function(e,[t,i],[n,o],s,r){const a=s[0],l=s[1];let c=e.elements.offset;const d=t.length,h=i.length;for(let s=0;s<d-1;s++){const d=t[s],u=t[s+1],m=n[s],_=n[s+1];for(let t=0;t<h-1;t++){const n=i[t],s=i[t+1],h=o[t],v=o[t+1];p(e.indices,c,0,1,2,2,1,3),f(e,c++,a,l,m,h,d,n,r),f(e,c++,a,l,_,h,u,n,r),f(e,c++,a,l,m,v,d,s,r),f(e,c++,a,l,_,v,u,s,r)}}e.elements.offset=c}(w,I,S,a,b)}});function f(e,t,i,n,s,r,a,l,c){t*=8,e.views.position[t]=i,e.views.position[t+1]=n,e.views.vrtxOffset[t]=s,e.views.vrtxOffset[t+1]=-r,e.views.txtrCoords[t]=(0,o.Bb)(a),e.views.txtrCoords[t+1]=(0,o.Bb)(l),t>>=1,e.views.localID[t]=c}function p(e,t,i,n,o,s,r,a){const l=e.buffer,c=e.offset;l[c]=t+i,l[c+1]=t+n,l[c+2]=t+o,l[c+3]=t+s,l[c+4]=t+r,l[c+5]=t+a,e.offset=c+6}},881:(e,t,i)=>{i.d(t,{g:()=>r});var n=i(8729),o=i(9899),s=i(5849);class r{constructor(){this.dictionaries={},this.reverseDictionaries={},this.version="",this.defaultProps={},this.tileProps=n.Dz,this.tilePropsByIndex=(0,s.l4)(n.Dz),this.hash=o.DL}}},1558:(e,t,i)=>{i.d(t,{r:()=>u});var n=i(5120),o=i(4304),s=i(7618);function r(e){const t=e.currentMod;return void 0!==t&&t.ready}function a(e,t){const i=e.currentMod;return void 0!==i&&void 0!==t[i.key]}function l(e,t){const i=t.currentMod;void 0!==i&&(e[i.key]=i)}function c(e,t){const i=t.currentMod;void 0!==i&&delete e[i.key]}function d(e,t,i){for(const n of t){const t=(0,s.aM)(i,n);for(const i of t)c(e,i)}}var h=i(6165);function u(e,t,i){m(e,t,i),f(e),p(e);for(const t in e.displayedMods)e.tileModsCache.get(t);_(e),v(e)}function m(e,t,i){for(const n in e.tiles)(0,h.qC)(e.tiles[n],e.tileModsCache,t,i)}function f(e){switch(e.tilesAppearance){case n.W.ByOne:(0,o.TQ)(e);break;case n.W.WaitingLayer:(0,o.ej)(e.tiles,e.viewportTiles)&&(e.tilesAppearance=n.W.ByOne,(0,o.TQ)(e))}}function p(e){const{tiles:t,viewportTiles:i,zoomDirection:o,zoomStartZoom:c,maxZoomLevel:h,zoomLevel:u,displayedMods:m}=e;switch(o){case n.Y.Stationary:e.displayedMods=function(e,t){const i={};for(const n of t){const t=e[n];r(t)&&l(i,t)}return i}(t,i);break;case n.Y.ZoomingIn:e.displayedMods=function(e,t,i,n,o){const c={},h=[];for(const d of t){const t=e[d];if(r(t))l(c,t);else for(let d=t.detailLevel-1;d>=n;d--){const n=(0,s.xG)(e,t,d,o);if(void 0!==n&&!h.includes(n)&&r(n)&&a(n,i)){l(c,n),h.push(n);break}}}return d(c,h,e),c}(t,i,m,c,h);break;case n.Y.ZoomingOut:e.displayedMods=function(e,t,i,n,o,c){const h={},u=[],m=new Set(t);for(const t in e){const d=e[t];m.has(d.key)?r(d)&&(l(h,d),u.push(d)):d.detailLevel>o||d.detailLevel<n||m.has((0,s.pV)(d,n,c))&&r(d)&&a(d,i)&&(l(h,d),d.detailLevel<o&&u.push(d))}return d(h,u,e),h}(t,i,m,u,c,h)}}function _({tiles:e,displayedMods:t,viewportTiles:i}){for(const n in e){if(i.includes(n))continue;const o=e[n],s=o.currentMod;s&&!t[s.key]&&(0,h.U9)(o)}}function v(e){switch(e.zoomDirection){case n.Y.ZoomingIn:(e.zoomLevel<=e.zoomStartZoom||g(e))&&(e.zoomDirection=n.Y.Stationary,e.zoomStartZoom=e.zoomLevel);break;case n.Y.ZoomingOut:(e.zoomLevel>=e.zoomStartZoom||g(e))&&(e.zoomDirection=n.Y.Stationary,e.zoomStartZoom=e.zoomLevel)}}function g(e){const{tiles:t,viewportTiles:i,displayedMods:n}=e;for(let e=0;e<i.length;e++){const o=t[i[e]],s=(0,h.hW)(o);if(!s)return!1;if(void 0===n[s.key])return!1}return!0}},9430:(e,t,i)=>{i.d(t,{YY:()=>r,bj:()=>a,TZ:()=>l,I2:()=>c,cA:()=>d});var n=i(5120),o=i(4304),s=i(6165);function r(e,t,i,r){var a;i.selectedIds=r,i.tilesAppearance=n.W.WaitingLayer,(0,o.eh)(i);for(const n in i.tiles){const o=i.tiles[n];(0,s.IF)(e,t,o,i.sourceId,null===(a=o.hover)||void 0===a?void 0:a.id,!0)}}function a(e,t,i,n){if(!t.disableHoverStyles){for(const o in i.tiles){const r=i.tiles[o];(0,s.IF)(e,t,r,i.sourceId,n)}e.labeler.disableThrottleUpdateOnce()}}function l(e,t){e.styleState=t,(0,o.eh)(e)}function c(e,t,i){e.tilesAppearance=n.W.GlobalWaiting,e.styleId=t,e.styleRevision=i,(0,o.eh)(e)}function d(e){e.tilesAppearance=n.W.ByOne,(0,o.TQ)(e)}},7184:(e,t,i)=>{i.d(t,{o:()=>l});var n=i(5120),o=i(5849),s=i(7618),r=i(1525),a=i(4304);function l(e,t){c(e,t.styleZoom,t.zoom),d(e,t),h(e),(0,a.eh)(e)}function c(e,t,i){const o=(0,a.uk)(e.type,i,t),s=o-e.zoomLevel;e.zoomDirection===n.Y.Stationary&&(s>0?(e.zoomDirection=n.Y.ZoomingIn,e.zoomStartZoom=e.zoomLevel):s<0&&(e.zoomDirection=n.Y.ZoomingOut,e.zoomStartZoom=e.zoomLevel)),e.zoomLevel=o}function d(e,t){if(e.zoomLevel<e.minZoomLevel)return void(e.viewportTiles=[]);const i=(0,o.uZ)(e.zoomLevel,e.minZoomLevel,e.maxZoomLevel),n=(0,o.uZ)(e.zoomLevel,e.minDetailLevel,e.maxDetailLevel);e.viewportTiles=(0,s.b5)(t,i,e.minZoomLevel,n).map(s.gx)}function h(e){const t=Math.round((Object.keys(e.displayedMods).length+e.viewportTiles.length)*r.tiles.cacheRatio);e.tileModsCacheMaxCount<t&&(e.tileModsCacheMaxCount=t),t>e.tileModsCacheMaxCount/2&&e.tileModsCache.setSize(t)}},4304:(e,t,i)=>{i.d(t,{eh:()=>h,ej:()=>u,w1:()=>m,lH:()=>f,e:()=>p,HM:()=>_,y7:()=>v,uk:()=>g,d1:()=>y,aq:()=>b,TQ:()=>w});var n=i(5849),o=i(6165),s=i(7618),r=i(2182),a=i(5120),l=i(4915),c=i(1525),d=i(166);function h(e){const t=e.viewportTiles;for(const t in e.tiles)(0,o.bt)(e.tiles[t]);for(let i=0;i<t.length;i++){const n=t[i];let r=e.tiles[n];r||(r=e.tiles[n]=(0,o.Tp)(e.type,(0,s.cL)(n),e.sourceId,e.tileLayerId));const a=new d.l(e.selectedIds,e.styleState,r.revision,e.styleId,e.styleRevision);(0,o.a7)(r,a,e.tileModsCache)}}function u(e,t){for(let i=0;i<t.length;i++){const n=e[t[i]],s=(0,o.hW)(n);if(!s||!s.ready)return!1}return!0}function m(e){const t=[];for(const i in e.tiles){const n=e.tiles[i];n.needFetch&&(n.needFetch=!1,t.push(n))}return t}function f(e){const t=[];for(const i in e.tiles){const n=e.tiles[i];n.needAbortFetch&&(n.needAbortFetch=!1,t.push(n))}return t}function p(e){const t=[];for(const i in e.tiles){const n=e.tiles[i];n.needGenerate&&(n.needGenerate=!1,t.push(n))}return t}function _(e){const t=new Set(e.viewportTiles),i=new Set(e.tileModsCache.getData().map((e=>e.tile))),n=[];for(const s in e.tiles){const r=e.tiles[s];!(0,o.LC)(r)||t.has(s)||e.zoomDirection!==a.Y.Stationary||i.has(r)||n.push(r)}return n}function v(e,t,i,n,o,s,c,d,h){const u=d.styleManager.getStyle(h.handyStyleId);return{type:e,sourceId:t,tileLayerId:i,styleId:h.handyStyleId,styleRevision:(null==u?void 0:u.id)||0,styleState:h.styleState,minZoomLevel:n,maxZoomLevel:o,minDetailLevel:s,maxDetailLevel:c,tiles:{},viewportTiles:[],zoomLevel:g(e,h.zoom,h.styleZoom),zoomDirection:a.Y.Stationary,zoomStartZoom:0,tileModsCache:new r.L(0,((e,t)=>{d.labeler.removeLabels(t.labelsKey),(0,l.Bp)(t,h)})),tileModsCacheMaxCount:0,selectedIds:[],displayedMods:{},tilesAppearance:a.W.ByOne,mapState:h,stopLabelAnimation:!1}}function g(e,t,i){return"raster"===e?Math.round(t):Math.floor(i)}function y(e){for(const t in e.tiles)(0,o.QT)(e.tiles[t],e.mapState);e.tiles={},e.viewportTiles=[],e.zoomDirection=a.Y.Stationary,e.tileModsCache.reset(),e.displayedMods={},e.tilesAppearance=a.W.ByOne}function b(e,t,i,o){const r=i.displayedMods,a=(0,n.$X)(r,o);a.forEach((i=>{if(void 0!==i.objects){let n=!0;for(const e in o)if((0,s.HL)(i.tile,o[e].tile)){n=!1;break}i.objects.forEach((i=>{e.addObject(i),n&&i.startTicker(t,c.tileAnimation.type,c.tileAnimation.time,0,1)}))}}));const l=(0,n.$X)(o,r);l.forEach((t=>{var i;void 0!==t.objects&&(t.objects.forEach((t=>e.removeObject(t))),null===(i=t.tile.hover)||void 0===i||i.tileObjects.forEach((t=>e.removeObject(t))))}));const d=a.length>0||l.length>0;return d&&(t.needLabeling=!0,t.needRerender=!0),d}function w(e){e.viewportTiles.forEach((t=>(0,o.bg)(e.tiles[t])))}},6165:(e,t,i)=>{i.d(t,{z3:()=>n,Tp:()=>u,IF:()=>m,_v:()=>p,LC:()=>_,QT:()=>v,U9:()=>g,hW:()=>y,bt:()=>b,a7:()=>w,qC:()=>I,bg:()=>S,b9:()=>M,NQ:()=>T,nR:()=>P});var n,o=i(6723),s=i(4915),r=i(7618),a=i(8631),l=i(1790),c=i(1525),d=i(166),h=i(8016);function u(e,t,i,o){return{type:e,sourceId:i,key:(0,r.gx)(t),labelsKey:`${e}_${i}_${o}`,coords:t,zoomLevel:t[2],detailLevel:t[3],needFetch:!1,revision:0,needAbortFetch:!1,needGenerate:!1,status:n.Initial,oldHoverTileObjects:[]}}function m(e,t,i,n,o,s){const d=[];i.oldHoverTileObjects.forEach((i=>{i.tickerFinished(t)?(e.tileManager.removeObject(i),i.clean(t)):d.push(i)})),i.oldHoverTileObjects=d,void 0!==o?t.performanceCaveatEmitted||(s||!i.hover||(0,a.v7)(i.hover.id,o))&&function(e,t,i,n,o){if(!i.idSet||!i.idSet.has(n)||!function(e,t){const i=Math.min(Math.floor(e.styleZoom),c.tiles.maxDetailLevel),n=t.coords[3];return i===n}(t,i))return void f(e,i,t);(function(e,t,i,n){const o=t.newMod||t.currentMod,s=e.map.state,a={tileInfo:(0,r.Bs)(t.coords),pixelRatio:self.devicePixelRatio,selectedIds:(null==o?void 0:o.params.getSelectedIds())||[],styleId:s.handyStyleId,styleState:s.styleState,floorsEnabled:e.map.state.floorsEnabled,hoverId:i,sourceId:n};return e.workers.parser.generateTile(a)})(e,i,n,o).then((o=>{f(e,i,t);const s={id:n,tileObjects:[],generatedData:[]},r=[];o.results.forEach((n=>{const o=new l.W("hover",n.collectorOutput.data,e.renderer,i.coords),{packedRasters:a,rastersToLoad:d}=n.collectorOutput;void 0!==a&&e.assetManager.prepareRasters(n.styleId,a),e.assetManager.loadRasters(d),s.tileObjects.push(o),e.tileManager.addObject(o),o.startTicker(t,c.houseHover.inAnimationType,c.houseHover.inAnimationTime,0,1),n.collectorOutput.labels.length&&r.push({metatileHash:n.metatileHash,labels:n.collectorOutput.labels,styleId:n.styleId})})),s.generatedData=o.results,e.labeler.addLabels("label_hover",h.AL.Tile,r),e.identifier.debouncedFillCache(),i.hover=s}))}(e,t,i,o,n):f(e,i,t)}function f(e,t,i){t.hover&&(t.hover.tileObjects.forEach((e=>{t.oldHoverTileObjects.push(e),e.startTicker(i,c.houseHover.outAnimationType,c.houseHover.outAnimationTime,1,0)})),t.hover=void 0,e.labeler.removeLabels("label_hover"),e.identifier.debouncedFillCache())}function p(e){if(e.newMod&&e.newMod.needGenerate)return e.newMod.needGenerate=!1,e.newMod}function _(e){return(!e.currentMod||(0,s.jW)(e.currentMod))&&(!e.newMod||(0,s.jW)(e.newMod))}function v(e,t){e.currentMod&&(0,s.Bp)(e.currentMod,t),e.newMod&&(0,s.Bp)(e.newMod,t)}function g(e){e.currentMod=void 0}function y(e){return e.currentMod&&e.currentMod.useful?e.currentMod:e.newMod&&e.newMod.useful?e.newMod:void 0}function b(e){e.currentMod&&(e.currentMod.useful=!1),e.newMod&&(e.newMod.useful=!1)}function w(e,t,i){if(e.idSet&&t.setTileIds(e.idSet),e.currentMod||e.newMod){if(e.currentMod){if(d.l.equal(e.currentMod.params,t))return e.currentMod.useful=!0,void(e.newMod=void 0)}if(e.newMod){d.l.equal(e.newMod.params,t)?e.newMod.useful=!0:x(e,t,i)}else x(e,t,i)}else x(e,t,i)}function x(e,t,i){const n=(0,r.vl)(e.coords,t),o=i.get(n);o?(e.newMod=o,e.newMod.useful=!0):(e.newMod=(0,s.es)(e,n,t),e.idSet&&e.newMod.params.setTileIds(e.idSet))}function I(e,t,i,o){switch(e.status){case n.Initial:e.newMod&&e.newMod.useful&&(e.status=n.Loading,e.needFetch=!0);break;case n.Loading:e.newMod&&e.newMod.useful?e.serverMetadata&&(e.status=n.Loaded):(e.status=n.Initial,e.needAbortFetch=!0);case n.Loaded:}e.currentMod&&(0,s.zL)(e.currentMod,t,i,o),e.newMod&&((0,s.zL)(e.newMod,t,i,o),e.newMod.needGenerate&&(e.needGenerate=!0))}function S(e){e.newMod&&e.newMod.ready&&(e.currentMod=e.newMod,e.newMod=void 0)}function M(e){const t=new o.c;return e.forEach((e=>{t.addFromFlatArray(e.collectorOutput.geoIds)})),t}function T(e){e.status===n.Loading&&(e.needAbortFetch=!0),e.status=n.Initial,e.serverMetadata=void 0,e.revision++}function P(e){e.revision++}!function(e){e[e.Initial=0]="Initial",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded"}(n||(n={}))},9573:(e,t,i)=>{i.d(t,{I:()=>_});var n=i(7618),o=i(7184),s=i(6165),r=i(4915),a=i(7706),l=i(8016),c=i(4304),d=i(1558),h=i(9430),u=i(5120);function m(e){e.tilesAppearance=u.W.WaitingLayer,e.stopLabelAnimation=!0,Object.keys(e.tiles).forEach((t=>{(0,s.NQ)(e.tiles[t])})),(0,c.eh)(e)}var f=i(308);function p(e){e.tilesAppearance=u.W.WaitingLayer,Object.keys(e.tiles).forEach((t=>{(0,s.nR)(e.tiles[t])})),(0,c.eh)(e)}class _{constructor(e,t,i,n,o,s,r){this.modules=o,this.mapState=s,this.prevStyleState=s.styleState,this.sourceCore=r,this.id=(0,f.f)(),this.gridState=(0,c.y7)(r.type,r.id,this.id,e,t,i,n,o,this.mapState)}destroy(){(0,c.d1)(this.gridState)}redraw(){(0,c.d1)(this.gridState),(0,o.o)(this.gridState,this.mapState)}getDisplayedIdentifyData(){var e,t;const i=[];for(const n in this.gridState.displayedMods){const o=this.gridState.displayedMods[n];null===(e=o.generatedData)||void 0===e||e.concat((null===(t=o.tile.hover)||void 0===t?void 0:t.generatedData)||[]).forEach((e=>i.push({ids:e.collectorOutput.identifyIds,metatileHash:e.metatileHash,sourceId:o.tile.sourceId,tileKey:o.tile.key})))}return i}getLabelingData(){const e={sourceId:this.gridState.sourceId,animate:!this.gridState.stopLabelAnimation,labelsKeys:[]};for(const t in this.gridState.displayedMods){const i=this.gridState.displayedMods[t];e.labelsKeys.push(i.labelsKey)}return this.gridState.stopLabelAnimation&&this.viewportTilesReady()&&(this.gridState.stopLabelAnimation=!1),e}getViewportTiles(){const e=[],t=this.gridState.viewportTiles;for(let i=0;i<t.length;i++){const n=this.gridState.tiles[t[i]];n&&e.push(n)}return e}viewportTilesReady(){return(0,c.ej)(this.gridState.tiles,this.gridState.viewportTiles)}displayedTilesAnimationFinished(){for(const e in this.gridState.displayedMods){const t=this.gridState.displayedMods[e];if(t.objects)for(const e of t.objects)if(!e.tickerFinished(this.mapState))return!1}return!0}activateStyleUpdating(){(0,h.I2)(this.gridState,this.mapState.handyStyleId,this.modules.styleManager.getStyleRevision(this.mapState.handyStyleId))}finishStyleUpdating(){(0,h.cA)(this.gridState)}setSelectedIds(){(0,h.YY)(this.modules,this.mapState,this.gridState,this.mapState.selectedIds)}setHoverId(e){(0,h.bj)(this.modules,this.mapState,this.gridState,e)}resetHoverId(){(0,h.bj)(this.modules,this.mapState,this.gridState)}onSourceDataChange(){m(this.gridState)}onFeatureStateMapChange(){p(this.gridState)}getTileCount(){let e=0;for(const t in this.gridState.displayedMods){const i=this.gridState.displayedMods[t].objects;void 0!==i&&(e+=i.length)}return e}isBlank(){for(const e of this.gridState.viewportTiles){const t=this.gridState.tiles[e],{serverMetadata:i}=t;if(void 0===i||0===i.length)continue;const n=(0,s.hW)(t);if(n&&n.ready)return!1}return!0}updateViewport(){(0,o.o)(this.gridState,this.mapState)}update(){const e=Object.assign({},this.gridState.displayedMods);this.mapState.styleState!==this.prevStyleState&&(0,h.TZ)(this.gridState,this.mapState.styleState),(0,d.r)(this.gridState,this.mapState,this.modules);const{demManager:t,labeler:i}=this.modules;!function(e,t,i){for(const n of e.viewportTiles){const o=e.tiles[n],a=(0,s.hW)(o);if(!a)continue;const c=(0,r.Hd)(a);if(0===c.length)continue;const d=t.getLabelsDemKey(c);a.demKey!==d&&(a.demKey=d,i.addTileLabels(a.labelsKey,l.AL.Tile,c))}}(this.gridState,t,i),this.fetch((0,c.w1)(this.gridState)),this.abortFetch((0,c.lH)(this.gridState)),this.generate((0,c.e)(this.gridState)),this.clearTiles((0,c.HM)(this.gridState)),(0,c.aq)(this.modules.tileManager,this.mapState,this.gridState,e)}fetch(e){e.sort(((e,t)=>(0,n.qu)(this.mapState.center,e,t))).forEach((e=>{this.sourceCore.fetchTile(e.coords,this.mapState).then((t=>{e.status===s.z3.Loading&&(e.serverMetadata=t)}))}))}abortFetch(e){e.forEach((e=>this.sourceCore.abortTileFetch(e.coords)))}generate(e){const t=[];e.sort(((e,t)=>(0,n.qu)(this.mapState.center,e,t))).forEach((e=>{const i=(0,s._v)(e);if(!i)return;const n={tileCoords:e.coords,selectedIds:i.params.getSelectedIds(),styleId:i.params.styleId};t.push(n),this.sourceCore.generateTile(this.mapState,n.tileCoords,n.styleId,n.selectedIds,devicePixelRatio).then((t=>{const{results:n}=t;n.forEach((e=>{const{styleId:t,metatileHash:i,regionId:n,collectorOutput:o}=e,{packedRasters:s,rastersToLoad:r,floorHidingMap:l}=o;void 0!==s&&this.modules.assetManager.prepareRasters(t,s),this.modules.assetManager.loadRasters(r),this.modules.floorManager.prepareFloors(n,i,new a.g(l),this.sourceCore.type)})),e.idSet=(0,s.b9)(n),(0,r.aK)(i,n,e.idSet),this.modules.labeler.addTileLabels(i.labelsKey,l.AL.Tile,(0,r.Hd)(i))}))})),"terrain"===this.sourceCore.type&&(t.forEach((e=>{this.sourceCore.generateTile(this.mapState,e.tileCoords,e.styleId,e.selectedIds,devicePixelRatio,{generateOnlySelectedPoi:!0}).then((e=>{const{results:t}=e;t.forEach((e=>{const{collectorOutput:t,styleId:i}=e,{packedRasters:n,rastersToLoad:o}=t;void 0!==n&&this.modules.assetManager.prepareRasters(i,n),this.modules.assetManager.loadRasters(o)}))}))})),t.forEach((e=>{this.sourceCore.generateTile(this.mapState,e.tileCoords,e.styleId,e.selectedIds,devicePixelRatio,{generateOnlyHoveredPoi:!0}).then((e=>{const{results:t}=e;t.forEach((e=>{const{collectorOutput:t,styleId:i}=e,{packedRasters:n,rastersToLoad:o}=t;void 0!==n&&this.modules.assetManager.prepareRasters(i,n),this.modules.assetManager.loadRasters(o)}))}))})))}clearTiles(e){for(const t of e)this.sourceCore.deleteTile(t.coords),delete this.gridState.tiles[t.key]}}},4915:(e,t,i)=>{i.d(t,{es:()=>r,aK:()=>a,Hd:()=>l,Bp:()=>c,jW:()=>d,zL:()=>h});var n,o=i(1790),s=i(1525);function r(e,t,i){return{key:t,labelsKey:`${e.labelsKey}_${t}`,useful:!0,ready:!1,needGenerate:!1,tile:e,status:n.Initial,params:i.clone()}}function a(e,t,i){e.status===n.Generating&&(e.generatedData=t),i&&e.params.setTileIds(i)}function l(e){const t=e.generatedData,i=[];if(!t)return i;for(let e=0;e<t.length;e++){const n=t[e];n.collectorOutput.labels&&i.push({metatileHash:n.metatileHash,labels:n.collectorOutput.labels,styleId:n.styleId})}return i}function c(e,t){e.status=n.Initial,e.generatedData=void 0,void 0!==e.objects&&e.objects.forEach((e=>e.clean(t))),e.objects=void 0,e.ready=!1,e.tile.currentMod===e&&(e.tile.currentMod=void 0)}function d(e){return e.status===n.Initial}function h(e,t,i,r){const{renderer:a}=r;switch(e.status){case n.Initial:e.useful&&(e.status=n.Loading);break;case n.Loading:e.useful?e.tile.serverMetadata&&(e.status=n.Loaded):e.status=n.Initial;break;case n.Loaded:(function(e,t,i){switch(e.tile.type){case"terrain":return Boolean(e.useful&&e.tile.serverMetadata&&function(e,t,i){const{assetManager:n,modelLayer:o}=i;for(let i=0;i<e.length;i++){const{regionId:r,metatileHash:a}=e[i];if(!n.getMetatile(a)||t.styleZoom>s.loadModelsInfoStyleZoom&&!o.isModelsInfoLoaded(r))return!1}return!0}(e.tile.serverMetadata,t,i));case"traffic":return Boolean(e.useful&&e.tile.serverMetadata);case"raster":case"geojson":case"dem":return Boolean(e.useful);default:return!1}})(e,i,r)&&(e.status=n.Generating,e.needGenerate=!0);break;case n.Generating:e.generatedData&&(e.status=n.Generated,e.ready=!0,e.objects=e.generatedData.map((t=>{const{collectorOutput:{data:i}}=t;return new o.W(e.tile.type,i,a,e.tile.coords)})),t.add(e.key,e))}}!function(e){e[e.Initial=0]="Initial",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded",e[e.Generating=3]="Generating",e[e.Generated=4]="Generated"}(n||(n={}))},166:(e,t,i)=>{i.d(t,{l:()=>r});var n=i(8631),o=i(5849),s=i(7618);class r{constructor(e,t,i,n,o){this.selectedIds=e.slice(),this.styleState=Object.assign({},t),this.tileRevision=i,this.styleRevision=o,this.styleId=n}static equal(e,t){return e.tileRevision===t.tileRevision&&e.styleId===t.styleId&&e.styleRevision===t.styleRevision&&(0,n.y5)(e.getSelectedIds(),t.getSelectedIds())&&(0,o.vZ)(e.styleState,t.styleState)}clone(){return new r(this.selectedIds,this.styleState,this.tileRevision,this.styleId,this.styleRevision)}stringify(){const e=this.selectedIds.map((e=>`${e.lo},${e.hi}`)).join("|");return`sId=${this.styleId}_sRev=${this.styleRevision}_tRev=${this.tileRevision}_sel=${e}_sSt=${JSON.stringify(this.styleState)}`}getSelectedIds(){return this.tileIds?(0,s.vX)(this.selectedIds,this.tileIds):this.selectedIds.slice()}setTileIds(e){this.tileIds=e}}},1790:(e,t,i)=>{i.d(t,{W:()=>f,Y:()=>m});var n=i(127),o=i(9450),s=i(7618),r=i(9769),a=i(9958),l=i(3251);function c(e,t,i){const n=new a.Z(i);n.drawType=a.Z.StaticDraw,n.prepare(e.getRenderingContext());const o=[];return t.forEach((t=>{const i=e.getShaderProgram(t.programName);o.push(t.vaoCreator(n,i))})),{buffer:n,vaos:o}}var d=i(9899),h=i(5677);let u=0;class m{constructor(e){this.bounds={min:[],max:[]},this.readiness=1,this.modelMatrix=n.Ue(),this.mvpMatrix=n.Ue(),this.purpose=e,this.buffers=[],this.children=[],this.identifyChildren=[]}updateMvpMatrix(e){n.dC(this.mvpMatrix,e,this.modelMatrix)}clean(...e){for(const e of this.buffers)e.remove();this.buffers=[],this.children=[],this.identifyChildren=[]}}class f extends m{constructor(e,t,i,n=[0,0,0,0],o){super(e),this.tickerName=`tile-fade-${e}-${u++}`,this.dynamicObject=o;const{buffers:s,objects:a,identifyObjects:d}=function(e,t,i){const n=[],o=[],s=[];for(let a=0;a<t.length;a++){const{symbol:d,sink:h,generatedObjects:u,buffer:m}=t[a],f=e.symbolSettingsList[d];if(void 0===f)continue;const p=f[h];if(void 0===p)continue;const{buffer:_,vaos:v}=c(e,p,m);n.push(_);for(let e=0;e<u.length;e++){const{rangeStart:t,rangeEnd:n,attributes:a}=u[e],c=l.kF[d].sinks[h].unpackObjectAttributes(a);for(let e=0;e<p.length;e++){const u=p[e],m=u.uniformSet||"fill",f={type:r.H.Tile,layerSettings:u,stride:(0,l.vP)(d,h),rangeStart:t,rangeEnd:n,attributes:c,attributesHash:JSON.stringify(a)+"_"+m+"_"+i.detailLevel,vao:v[e],tile:i,symbol:d,sink:h};u.identify?s.push(f):o.push(f)}}}return{buffers:n,objects:o,identifyObjects:s}}(i,t,this);this.buffers=s,this.children=a,this.identifyChildren=d,this.setTileCoords(n)}setTileCoords(e){const t=e[2],i=e[3],r=(0,s.aq)(t);this.size=r,this.zoomLevel=t,this.detailLevel=i;const a=(0,s.Oy)(e);this.bounds.min=[a[0],a[1]],this.bounds.max=[a[0]+r,a[1]+r],n.wA(this.modelMatrix,a,o.al(r,r,d._9))}startTicker(e,t,i,n,o){h.BL(this.tickerName,{easing:t},e,n,o,i)}updateTicker(e){h.Vx(this.tickerName,{step:(e,t)=>{this.readiness=t}},e)}tickerFinished(e){return!h.rS(this.tickerName,e)}clean(e){super.clean(e),h.sT(this.tickerName,e)}}},303:(e,t,i)=>{function n(e){return e}i.d(t,{D:()=>n})},8016:(e,t,i)=>{var n,o,s,r,a;i.d(t,{a_:()=>n,_r:()=>o,AL:()=>s,m3:()=>r,Dl:()=>a}),function(e){e[e.Common=0]="Common",e[e.Commercial=1]="Commercial",e[e.CommercialCity=2]="CommercialCity",e[e.Landmark=3]="Landmark"}(n||(n={})),function(e){e[e.Point=0]="Point",e[e.Line=1]="Line"}(o||(o={})),function(e){e[e.Tile=0]="Tile",e[e.Floor=1]="Floor",e[e.DynamicObject=2]="DynamicObject",e[e.PersonalPoi=3]="PersonalPoi"}(s||(s={})),function(e){e[e.Dead=0]="Dead",e[e.Alive=1]="Alive",e[e.Unused=2]="Unused",e[e.CommercialAlive=3]="CommercialAlive",e[e.CommercialDead=4]="CommercialDead"}(r||(r={})),function(e){e[e.Text=0]="Text",e[e.Icon=1]="Icon",e[e.PoiText=2]="PoiText",e[e.PoiText2=3]="PoiText2",e[e.OneWayLine=4]="OneWayLine",e[e.LineText=5]="LineText",e[e.Box=6]="Box"}(a||(a={}))},3990:(e,t,i)=>{var n;i.d(t,{f:()=>n}),function(e){e[e.Static=0]="Static",e[e.Unique=1]="Unique",e[e.Loaded=2]="Loaded"}(n||(n={}))},9769:(e,t,i)=>{var n;i.d(t,{H:()=>n}),function(e){e[e.Tile=0]="Tile",e[e.Custom=1]="Custom"}(n||(n={}))},5120:(e,t,i)=>{var n,o;i.d(t,{Y:()=>n,W:()=>o}),function(e){e[e.Stationary=0]="Stationary",e[e.ZoomingIn=1]="ZoomingIn",e[e.ZoomingOut=2]="ZoomingOut"}(n||(n={})),function(e){e[e.ByOne=0]="ByOne",e[e.WaitingLayer=1]="WaitingLayer",e[e.GlobalWaiting=2]="GlobalWaiting"}(o||(o={}))},3734:(e,t,i)=>{function n(e,t){const i=new XMLHttpRequest;if(i.open("GET",e.url,!0),i.responseType="arraybuffer",e.headers)for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return i.onerror=function(){t({status:0,message:"Network error"},new ArrayBuffer(0))},i.onload=function(){i.status>=200&&i.status<300&&i.response?t(void 0,i.response):t({status:i.status,message:i.statusText},new ArrayBuffer(0))},i.send(),i}function o(e,t){const i=new XMLHttpRequest;if(i.open("GET",e.url,!0),e.headers)for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return i.onerror=function(){t({status:0,message:"Network error"},{})},i.onload=function(){if(0===i.response.byteLength&&200===i.status)return t({status:0,message:"No content"},{});if(i.status>=200&&i.status<300&&i.response&&i.response.length){let n;try{n=JSON.parse(i.response),t(void 0,n)}catch(i){t({status:0,message:`Json parse data error from url ${e.url}`},{})}}else t({status:i.status,message:i.statusText},{})},i.send(),i}i.d(t,{n:()=>n,L:()=>o})},5849:(e,t,i)=>{i.d(t,{uZ:()=>s,Xx:()=>r,Te:()=>a,Id:()=>l,ZY:()=>c,Kv:()=>d,AB:()=>h,kn:()=>u,l4:()=>m,$X:()=>f,sB:()=>p,vO:()=>_,Kh:()=>v,TH:()=>g,vZ:()=>y,VJ:()=>b,t7:()=>w});var n=i(9450),o=i(3220);function s(e,t,i){return e=Math.max(e,t),e=Math.min(e,i)}function r(e){return 0===e||Number.isNaN(e)?e:e>0?1:-1}function a(e,t){return[t[0]/e[0]*2-1,-t[1]/e[1]*2+1]}function l(e){return e*Math.PI/180}function c(e){return e/Math.PI*180}function d(e,t,i){void 0!==i.zoom&&(i.zoom=s(i.zoom,e.minZoom,e.maxZoom));const r=new o.V(e),a=r.unproject(t);r.setState(Object.assign(Object.assign({},e),i));const l=r.unproject(t),c=n.Ue();return n.lu(c,a,l),c}function h(e){return e>>>=0,e-=1,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)+1}function u(e,t){const i=Object.assign({},t);for(const t in e)void 0!==e[t]&&(i[t]=e[t]);return i}function m(e){const t={};for(const i in e){t[e[i]]=i}return t}function f(e,t){const i=[];for(const n in e)t[n]||i.push(e[n]);return i}function p(e,t,i){return s((i-e)/(t-e),0,1)}function _(e){return e%1}function v(e,t,i){return e>=t&&e<=i}function g(e,t){if(e.size!==t.size)return!1;for(const i of Array.from(e))if(!t.has(i))return!1;return!0}function y(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=Array.isArray(e),n=Array.isArray(t);let o,s,r;if(i&&n){if(s=e.length,s!==t.length)return!1;for(o=s;0!=o--;)if(!y(e[o],t[o]))return!1;return!0}if(i!==n)return!1;const a=e instanceof Date,l=t instanceof Date;if(a!==l)return!1;if(a&&l)return e.getTime()===t.getTime();const c=e instanceof RegExp,d=t instanceof RegExp;if(c!==d)return!1;if(c&&d)return e.toString()===t.toString();const h=Object.keys(e);if(s=h.length,s!==Object.keys(t).length)return!1;for(o=s;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,h[o]))return!1;for(o=s;0!=o--;)if(r=h[o],!y(e[r],t[r]))return!1;return!0}return e!=e&&t!=t}function b(e,t){const i=e.indexOf(t);return-1!==i&&(e.splice(i,1),!0)}function w(e,t,i){return e+(t-e)*i}},8674:(e,t,i)=>{i.d(t,{cX:()=>a});i(9958),i(1525);var n=i(9231),o=i(8729),s=i(3251),r=i(1993);function a(e,t){const i=65535,a=[new Uint16Array([0,i,i,0,0]),new Uint16Array([0,0,i,i,0])],l=(0,n.FJ)({});(0,s.XI)({collector:e,generator:r.z.generate,args:[n.jf,t,o.Dz,l,[],{},a]})}},1713:(e,t,i)=>{i.d(t,{dm:()=>w,rq:()=>x,JA:()=>b,Xq:()=>I});var n=i(6208),o=i.n(n),s=i(8943),r=i(9394);class a{constructor(){this.name="",this.range="",this.glyphs={}}}class l{constructor(){this.id=0,this.range=0,this.bitmap=null,this.top=0,this.left=0,this.advance=0,this.x=0,this.y=0,this.width=0,this.height=0,this.texTop=0,this.texLeft=0,this.texRight=0,this.texBottom=0}}class c{constructor(e,t){this.stacks=e.readFields(d,[],t)}}function d(e,t,i){if(1===e){const e=i.readMessage(h,new a);t.push(e)}}function h(e,t,i){switch(e){case 1:t.name=i.readString();break;case 2:t.range=i.readString();break;case 3:{const e=i.readMessage(u,new l);t.glyphs[e.id]=e;break}}}function u(e,t,i){switch(e){case 1:t.id=i.readVarint(),t.range=(0,r.rx)(t.id);break;case 2:t.bitmap=i.readBytes();break;case 3:t.width=i.readVarint()+6;break;case 4:t.height=i.readVarint()+6;break;case 5:t.left=i.readSVarint()-3;break;case 6:t.top=i.readSVarint()+17+3;break;case 7:t.advance=i.readVarint()}}var m=i(2034),f=i(5849),p=i(1525),_=i(660),v=i(7768),g=i(9899);class y{constructor(e,t,i){const n=[];let o=0;for(let i=0;i<e.length;i++){const s=e.charCodeAt(i),r=t&&t[s];r?(n.push(r),o+=r.advance):s!==p.fonts.bomCharCode&&(0,_.Q7)(e[i],s)}this.glyphs=n,this.width=o+p.fonts.baseSize*i*(e.length-1)}}function b(e,t,i){const n={lines:[],maxWidth:0},o=e.split("\n");for(let e=0;e<o.length;e++){const s=new y(o[e],i,t);n.lines.push(s),s.width>n.maxWidth&&(n.maxWidth=s.width)}return n}function w(e,t,i){for(const n of t)if(!i.has(e,n))return!1;return!0}function x(e,t,i){if(void 0===e)return;const n=(0,v.Q9)(e,t);return""!==n?void 0===i.fontNameToIndex[n]?g.Uo:n:void 0}function I(e){const t=new c(new(o())(new Uint8Array(e))).stacks[0].glyphs,{width:i,height:n}=function(e){const t=[],i=new s.Z(512,512,{autoResize:!0}),n=Object.keys(e);for(let i=0;i<n.length;i++){const o=e[Number(n[i])];o.bitmap&&t.push({glyph:o,width:o.width,height:o.height})}i.pack(t,{inPlace:!0}),i.shrink();for(let e=0;e<t.length;e++){const i=t[e].glyph;i.x=t[e].x,i.y=t[e].y}return{width:(0,f.AB)(i.w),height:(0,f.AB)(i.h)}}(t);!function(e,t,i){const n=Object.keys(e);for(let o=0;o<n.length;o++){const s=e[Number(n[o])];s.bitmap&&(s.texTop=(0,m.Bb)(s.y/i),s.texLeft=(0,m.Bb)(s.x/t),s.texBottom=(0,m.Bb)((s.y+s.height)/i),s.texRight=(0,m.Bb)((s.x+s.width)/t))}}(t,i,n);const r=function(e,t,i){const n=new Uint8Array(t*i),o=Object.keys(e);for(let i=0;i<o.length;i++){const s=e[Number(o[i])];if(s.bitmap)for(let e=0;e<s.height;e++){const i=t*(s.y+e)+s.x,o=s.width*e;for(let e=0;e<s.width;e++)n[i+e]=s.bitmap[o+e]}}return n.buffer}(t,i,n);return{glyphData:t,bitmap:r,width:i,height:n}}},5951:(e,t,i)=>{i.d(t,{A5:()=>h,k3:()=>u,TD:()=>m,LX:()=>f,yq:()=>p,PA:()=>_,pc:()=>v,r9:()=>g,nn:()=>y,EO:()=>b,X$:()=>x,Z3:()=>I,Qn:()=>S,a4:()=>M,Xg:()=>T,vn:()=>P,XV:()=>L,Vv:()=>E,h0:()=>k,ik:()=>z,to:()=>A,gr:()=>R,Iy:()=>D,$X:()=>O,v3:()=>B});var n=i(378),o=i(9450),s=i(127),r=i(1525),a=i(9899),l=i(5849),c=i(7090),d=i(3220);const h=2*Math.PI*6378137,u=a.sX/h,m=s.wA([],[-1,-1,0],[2,2,1]),f=s.wA([],[.5,.5,0],[.5,.5,1]);function p(e){const t=a.sX/2,i=Math.sin((0,l.Id)(e[1])),n=e[0]*a.sX/360,s=Math.log((1+i)/(1-i))*a.sX/(4*Math.PI);return o.al((0,l.uZ)(n,-t,t),(0,l.uZ)(s,-t,t),0)}function _(e){const t=[0,0];t[0]=360*e[0]/a.sX;const i=-2*Math.PI/a.sX;return t[1]=90-2*(0,l.ZY)(Math.atan(Math.exp(e[1]*i))),t}function v(e){return Math.max(e,r.camera.minCalculationScreenHeight)}function g(e,t){return v(t[1])*a.sX/(2*a.y4*Math.tan((0,l.Id)(r.camera.fov)/2)*Math.pow(2,e))}function y(e,t){return Math.log(v(t[1])*a.sX/(2*a.y4*Math.tan((0,l.Id)(r.camera.fov)/2)*e))/Math.LN2}function b(e){return a.ax*Math.pow(2,-e)}function w(e){const t=_(e)[1],i=1/(2*Math.cos((0,l.Id)(t)));return Math.log(i)/Math.log(2)}function x(e,t){const i=w(t)*(0,l.sB)(9,10,e);return e+(0,l.uZ)(i,-1,0)}function I(e,t){const i=w(t),n=i*(0,l.sB)(9,10+i,e);return e-(0,l.uZ)(n,-1,0)}function S(e,t){return a.LF*(e/a.$U)/t}function M(e,t){return t*(a.sX/h)*T(e[1])}function T(e){return 1/Math.cos((0,l.Id)(e))}function P(e,t){const i=Math.PI/180,n=e[1]*i,o=t[1]*i,s=Math.sin((t[1]-e[1])*i/2),r=Math.sin((t[0]-e[0])*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return Math.round(6371e3*l)}function L(e){let t=0;if(e.length>1)for(let i=0;i<e.length-1;i++)t+=P(e[i],e[i+1]);return t}const E=c.Ue([-a.sX/2,-a.sX/2],[a.sX/2,a.sX/2]);function k(e,t){return e*Math.pow(2,-t)*a.sX/a.y4}function z(e,t){return e*Math.pow(2,t)*a.y4/a.sX}function A(e,t){return 0===e?-1/0:-Math.log(t*a.y4/(e*a.sX))/Math.LN2}const C=n.Ue(),F=n.Ue();function R(e,t,i){n.$X(C,i,e),n.$X(F,t,e);const o=n.AK(C,F)/n.kE(C);return Math.atan2(o,e[2])}function D(e){const t=e[0],i=e[1];return(0,l.Kh)(t,-180,180)&&(0,l.Kh)(i,-90,90)}function O(e,t,i,n,o,s,r={top:0,right:0,bottom:0,left:0},a={top:0,right:0,bottom:0,left:0},c,h){const u=new d.V({center:p(e),zoom:t,rotation:(0,l.Id)(i),size:n,pitch:(0,l.Id)(o),viewport:r,padding:a}),m=_(u.unproject(s)),f=_(u.unproject([s[0]+c,s[1]+h]));return Math.max(1,P(m,f))}function B(e){const t=2*Math.PI;return(e%=t)<0&&(e+=t),e}},8361:(e,t,i)=>{function n(e){return!!e&&"stretchX"in e&&Array.isArray(e.stretchX)&&"stretchY"in e&&Array.isArray(e.stretchY)&&"width"in e&&"number"==typeof e.width&&"height"in e&&"number"==typeof e.height}i.d(t,{x:()=>n})},660:(e,t,i)=>{i.d(t,{Q7:()=>o,cM:()=>r});var n=i(9394);function o(e,t){r(`No glyph for character ${e} (code = ${t}, range = ${(0,n.rx)(t)})`)}const s=new Set;function r(e){s.has(e)||(console.log(e),s.add(e))}},7090:(e,t,i)=>{i.d(t,{Ue:()=>r,X3:()=>a,aM:()=>l,JG:()=>c,mc:()=>d,be:()=>h,Rk:()=>u,r3:()=>m,kK:()=>f,jV:()=>p,bA:()=>_});var n=i(378),o=i(5849),s=i(5951);function r(e,t){return{min:e||n.al(1/0,1/0),max:t||n.al(-1/0,-1/0)}}function a(e){return r((0,s.yq)(e.southWest),(0,s.yq)(e.northEast))}function l(e,t){n.VV(e.min,e.min,t),n.Fp(e.max,e.max,t)}function c(e,t){e.min[0]=t.min[0],e.max[0]=t.max[0],e.min[1]=t.min[1],e.max[1]=t.max[1]}function d(e){e.min[0]=1/0,e.max[0]=-1/0,e.min[1]=1/0,e.max[1]=-1/0}function h(e,t){return e[0]=t.min[0]+(t.max[0]-t.min[0])/2,e[1]=t.min[1]+(t.max[1]-t.min[1])/2,e}function u(e,t,i){e[0]=(0,o.uZ)(i[0],t.min[0],t.max[0]),e[1]=(0,o.uZ)(i[1],t.min[1],t.max[1])}function m(e,t){return t[0]<=e.max[0]&&t[0]>=e.min[0]&&t[1]<=e.max[1]&&t[1]>=e.min[1]}function f(e,t){const i=e.min[0]<=t.max[0]&&t.min[0]<=e.max[0],n=e.min[1]<=t.max[1]&&t.min[1]<=e.max[1];return i&&n}function p(e,t){return{min:[Math.max(e.min[0],t.min[0]),Math.max(e.min[1],t.min[1])],max:[Math.min(e.max[0],t.max[0]),Math.min(e.max[1],t.max[1])]}}function _(e,t){const i=h([],e),n=(e.max[0]-e.min[0])/2*t,o=(e.max[1]-e.min[1])/2*t;e.min[0]=i[0]-n,e.min[1]=i[1]-o,e.max[0]=i[0]+n,e.max[1]=i[1]+o}},2771:(e,t,i)=>{i.d(t,{hS:()=>r,Oy:()=>a,iE:()=>l,z_:()=>m,Jh:()=>f,Z4:()=>p});var n=i(9450),o=i(378),s=i(7090);function r(e,t){return{a:e[1]-t[1],b:t[0]-e[0],c:e[0]*t[1]-t[0]*e[1]}}function a(e,t){return Math.abs(l(e,t))}function l(e,t){return(t.a*e[0]+t.b*e[1]+t.c)/Math.sqrt(t.a*t.a+t.b*t.b)}function c(e,t,i){const{a:o,b:s,c:a}=r(e,t);return n.al(i,-(o*i+a)/s,0)}function d(e,t,i){const{a:o,b:s,c:a}=r(e,t);return n.al(-(s*i+a)/o,i,0)}const h=s.Ue(),u=s.Ue();function m(e,t,i){const n=t[t.length-1]*i;let s=e[0],r=0;const a=[s];let l,c=1;for(;c<e.length&&!l;){const i=e[c],d=t[c];let h=i;if(d>n){if(!l){const e=(n-r)/(d-r);l=[],o.t7(l,s,i,e)}h=l}a.push(h),s=h,r=t[c],c++}return a}function f(e,t){let i=e[0];s.mc(h),s.aM(h,i);let n=[i];const o=[n];let r=1;for(;r<e.length;){const a=e[r];let l=!1,m=a;if(s.JG(u,h),s.aM(u,m),u.max[0]-u.min[0]>t){m=c(i,m,u.max[0]===m[0]?u.min[0]+t:u.max[0]-t),l=!0}if(l&&(s.JG(u,h),s.aM(u,m)),u.max[1]-u.min[1]>t){m=d(i,m,u.max[1]===m[1]?u.min[1]+t:u.max[1]-t),l=!0}l?(n.push(m),s.mc(h),s.aM(h,m),n=[m],o.push(n),i=m):(n.push(a),s.aM(h,a),i=a,r++)}return o}function p(e,t,i){const n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],a=s*s+r*r,l=0!==a?(n*s+o*r)/a:0;return l<0?t:l>1?i:[t[0]+l*s,t[1]+l*r]}},6451:(e,t,i)=>{i.d(t,{BS:()=>r,By:()=>a,M4:()=>l,mW:()=>c});var n=i(9450),o=i(7090),s=i(2771);function r(e){const t=e[0][0],i=e[0][1],n=e[1][0],o=e[1][1],s=e[2][0],r=e[2][1],a=e[3][0],l=e[3][1];return{min:[Math.min(t,n,s,a),Math.min(i,o,r,l)],max:[Math.max(t,n,s,a),Math.max(i,o,r,l)]}}function a(e){return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]],[e[3][0],e[3][1],e[3][2]]]}function l(e,t){const i=r(e);if(!(0,o.kK)(t,i))return!1;const n=[(0,s.hS)(e[3],e[2]),(0,s.hS)(e[1],e[0]),(0,s.hS)(e[0],e[3]),(0,s.hS)(e[2],e[1])],a=[t.min,t.max,[t.min[0],t.max[1]],[t.max[0],t.min[1]]];for(const e of n){let t=!0;for(let i=0;i<a.length;i++){const n=a[i];if(e.a*n[0]+e.b*n[1]+e.c<0){t=!1;break}}if(t)return!1}return!0}function c(e,t,i){e.forEach((e=>{const o=1+t/n.TE(i,e);n.t7(e,i,e,o)}))}},4004:(e,t,i)=>{i.d(t,{AE:()=>o,zj:()=>s,uI:()=>r,ax:()=>a,am:()=>l,af:()=>c,m2:()=>d,fN:()=>h,se:()=>u,Hl:()=>m,L$:()=>f,hk:()=>p});var n=i(378);function o(e,t,i,n,o){if(t!==n||i!==o){const s=o-i,r=t-n,a=1/Math.sqrt(s*s+r*r);e[0]=s*a,e[1]=r*a}else e[0]=0,e[1]=0}function s(e,t,i,n){let o=0;if(e!==i||t!==n){let s=n-t,r=e-i;const a=1/Math.sqrt(s*s+r*r);s*=a,r*=a,s=127*s+(s<0?-.5:.5)<<24>>>24,r=127*r+(r<0?-.5:.5)<<24>>>16,o=r+s}return o}function r(e,t,i,n,o){if(t!==n||i!==o){const s=n-t,r=o-i,a=1/Math.sqrt(s*s+r*r);e[0]=s*a,e[1]=r*a}else e[0]=0,e[1]=0}function a(e,t,i,n,o){const s=t+n,r=i+o,a=t*s+i*r;if(0!==a){const t=1/a;e[0]=s*t,e[1]=r*t}else e[0]=0,e[1]=0}function l(e,t){return(127*t+(t<0?-.5:.5)<<24>>>16)+(127*e+(e<0?-.5:.5)<<24>>>24)}function c(e){const t=127*e[0]+(e[0]<0?-.5:.5)<<24>>>24;return(127*e[1]+(e[1]<0?-.5:.5)<<24>>>16)+t}function d(e,t,i,n,o){e[0]=t*n+i*o,e[1]=i*n-t*o}function h(e,t){e[0]=-t[1],e[1]=t[0]}function u(e){return 0===e[0]&&0===e[1]}function m(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])}function f(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}function p(e,t){const i=Math.cos(t)*e[0]-Math.sin(t)*e[1],o=Math.sin(t)*e[0]+Math.cos(t)*e[1];n.t8(e,i,o)}},8729:(e,t,i)=>{i.d(t,{SD:()=>s,GG:()=>r,ev:()=>a,KP:()=>l,Qy:()=>c,Dz:()=>h,nF:()=>u,wz:()=>m,i4:()=>f});var n=i(5849),o=i(4716);function s(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i]*Math.pow(256,e.length-1-i);return t}function r(e){const t=new Uint8Array(6);for(let i=0;i<6;i++)t[i]=255&Math.floor(e/Math.pow(256,5-i));return encodeURIComponent(o.c(t))}function a(e){const t=function(e,t){const i={};e.forEach(((e,t)=>{i[e]=t}));let n=e.length;i.selected=n++,i.hovered=n++,i.dpi=n++,i.isRealtime=n++,i.pixelDensityPreset=n++;for(const e in t)void 0===i[e]&&(i[e]=n++);return i}(e.tileProps,e.defaultProps),i={};for(const n in e.defaultProps)i[n]={index:t[n],value:e.defaultProps[n]};return{version:e.version,dictionaries:e.enumerationValues,reverseDictionaries:Object.keys(e.enumerationValues).reduce(((t,i)=>(t[i]=(0,n.l4)(e.enumerationValues[i]),t)),{}),tileProps:t,tilePropsByIndex:(0,n.l4)(t),defaultProps:i}}function l(e,t){const i={};if(t)for(let e=0;e<t.length;e++)i[t[e]]=e;return a({enumerationValues:{db_sublayer:i},version:"",zenithVersion:"",date:"",defaultProps:{},tileProps:e})}function c(e,t){const{tileProps:i}=e;let n=Object.keys(i).length;for(const e of t)void 0===i[e]&&(i[e]=n,n+=1)}let d=0;const h={beginningIsCut:d++,class:d++,componentDistanceEnd:d++,componentDistanceStart:d++,db_icon_priority:d++,db_label_priority:d++,db_label2_priority:d++,dpi:d++,endingIsCut:d++,height:d++,db_hidden_by_plan_building_id:d++,id:d++,isRealtime:d++,db_label:d++,db_label2:d++,nextPointX:d++,nextPointY:d++,db_object_class:d++,objectLength:d++,pixelDensityPreset:d++,previousPointX:d++,previousPointY:d++,db_region:d++,selected:d++,hovered:d++,db_sublayer:d++,traffic_color:d++,traffic_road_class:d++,traffic_road_z_level:d++},u={version:"0.0.0",tileProps:h,tilePropsByIndex:(0,n.l4)(h),defaultProps:{},dictionaries:{},reverseDictionaries:{}},m=[],f={}},590:(e,t,i)=>{function n(e,t,i,n,o,s){for(let r=0,a=t.length;r<a;r++){const a=t[r];let l=0;switch(a.type){case"get":l=n[i[a.key]];break;case"sourceAttr":s&&(l=s[a.key]);break;case"featureState":l=o[i[a.key]]}e.push(l)}return e}function o(e,t){for(let i=0,n=t.length;i<n;i++)e.push(t[i]);return e}function s(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){const n=e[i],o=t[i];if(Array.isArray(n))return!!Array.isArray(o)&&s(n,o);if(!(n===o||"number"==typeof n&&"number"==typeof o&&Number.isNaN(n)&&Number.isNaN(o)))return!1}return!0}i.d(t,{v$:()=>n,LY:()=>o,wy:()=>s})},2034:(e,t,i)=>{function n(e){const t=256*Math.log(e);return t+(t<0?-.5:.5)<<16>>16}function o(e){return 32768*e+.5<<16>>>16}function s(e){return 256*Math.log(e)+.5<<16>>16}i.d(t,{wj:()=>n,Bb:()=>o,KF:()=>s})},4362:(e,t)=>{var i=t.Z={};i.read=function(e,t){return e.readFields(i._readField,{id:"",name:"",address:"",type:0,regionId:0,branchId:"",branchCount:0,buildings:[],hull:[],tileCoords:[],center:[],centroid:[],scaleFactor:0,viewAngle:0,bound:null,floorCount:0,defaultFloor:0,floorNames:[],entities:[],floorGeometries:[],outdoors:[],metaRubrics:[],version:0,hybrids:[]},t)},i._readField=function(e,t,n){1===e?t.id=n.readString():2===e?t.name=n.readString():3===e?t.address=n.readString():4===e?t.type=n.readVarint():5===e?t.regionId=n.readVarint():6===e?t.branchId=n.readString():7===e?t.branchCount=n.readVarint():8===e?t.buildings.push(n.readString()):9===e?n.readPackedSVarint(t.hull):10===e?n.readPackedDouble(t.tileCoords):11===e?n.readPackedSVarint(t.center):12===e?n.readPackedDouble(t.centroid):13===e?t.scaleFactor=n.readDouble():14===e?t.viewAngle=n.readDouble():15===e?t.bound=i.Bound.read(n,n.readVarint()+n.pos):16===e?t.floorCount=n.readVarint():17===e?t.defaultFloor=n.readVarint():18===e?t.floorNames.push(n.readString()):19===e?t.entities.push(i.Entity.read(n,n.readVarint()+n.pos)):20===e?t.floorGeometries.push(i.Floor.read(n,n.readVarint()+n.pos)):21===e?t.outdoors.push(i.OutdoorObject.read(n,n.readVarint()+n.pos)):22===e?t.metaRubrics.push(i.Metarubric.read(n,n.readVarint()+n.pos)):23===e?t.version=n.readVarint():24===e&&t.hybrids.push(n.readString())},i.write=function(e,t){if(e.id&&t.writeStringField(1,e.id),e.name&&t.writeStringField(2,e.name),e.address&&t.writeStringField(3,e.address),e.type&&t.writeVarintField(4,e.type),e.regionId&&t.writeVarintField(5,e.regionId),e.branchId&&t.writeStringField(6,e.branchId),e.branchCount&&t.writeVarintField(7,e.branchCount),e.buildings)for(var n=0;n<e.buildings.length;n++)t.writeStringField(8,e.buildings[n]);if(e.hull&&t.writePackedSVarint(9,e.hull),e.tileCoords&&t.writePackedDouble(10,e.tileCoords),e.center&&t.writePackedSVarint(11,e.center),e.centroid&&t.writePackedDouble(12,e.centroid),e.scaleFactor&&t.writeDoubleField(13,e.scaleFactor),e.viewAngle&&t.writeDoubleField(14,e.viewAngle),e.bound&&t.writeMessage(15,i.Bound.write,e.bound),e.floorCount&&t.writeVarintField(16,e.floorCount),e.defaultFloor&&t.writeVarintField(17,e.defaultFloor),e.floorNames)for(n=0;n<e.floorNames.length;n++)t.writeStringField(18,e.floorNames[n]);if(e.entities)for(n=0;n<e.entities.length;n++)t.writeMessage(19,i.Entity.write,e.entities[n]);if(e.floorGeometries)for(n=0;n<e.floorGeometries.length;n++)t.writeMessage(20,i.Floor.write,e.floorGeometries[n]);if(e.outdoors)for(n=0;n<e.outdoors.length;n++)t.writeMessage(21,i.OutdoorObject.write,e.outdoors[n]);if(e.metaRubrics)for(n=0;n<e.metaRubrics.length;n++)t.writeMessage(22,i.Metarubric.write,e.metaRubrics[n]);if(e.version&&t.writeVarintField(23,e.version),e.hybrids)for(n=0;n<e.hybrids.length;n++)t.writeStringField(24,e.hybrids[n])},i.ComplexType={mall:{value:0,options:{}},other:{value:1,options:{}},office:{value:2,options:{}}},i.Metarubric={},i.Metarubric.read=function(e,t){return e.readFields(i.Metarubric._readField,{id:"",orgCount:0},t)},i.Metarubric._readField=function(e,t,i){1===e?t.id=i.readString():2===e&&(t.orgCount=i.readVarint())},i.Metarubric.write=function(e,t){e.id&&t.writeStringField(1,e.id),e.orgCount&&t.writeVarintField(2,e.orgCount)},i.Bound={},i.Bound.read=function(e,t){return e.readFields(i.Bound._readField,{min:[],max:[]},t)},i.Bound._readField=function(e,t,i){1===e?i.readPackedSVarint(t.min):2===e&&i.readPackedSVarint(t.max)},i.Bound.write=function(e,t){e.min&&t.writePackedSVarint(1,e.min),e.max&&t.writePackedSVarint(2,e.max)},i.Entity={},i.Entity.read=function(e,t){return e.readFields(i.Entity._readField,{id:"",sublayer:"",coordinates:[],iconId:0,areaId:0,firmId:"",floorIndex:0,floorName:"",text:"",layer:"",priority:0,textPriority:0,type:0,text2:"",humanReadableIconId:"",floorId:"",buildingId:""},t)},i.Entity._readField=function(e,t,i){1===e?t.id=i.readString():2===e?t.sublayer=i.readString():3===e?i.readPackedVarint(t.coordinates):4===e?t.iconId=i.readVarint():5===e?t.areaId=i.readVarint():6===e?t.firmId=i.readString():7===e?t.floorIndex=i.readVarint():8===e?t.floorName=i.readString():9===e?t.text=i.readString():10===e?t.layer=i.readString():11===e?t.priority=i.readVarint(!0):12===e?t.textPriority=i.readVarint(!0):13===e?t.type=i.readVarint():14===e?t.text2=i.readString():15===e?t.humanReadableIconId=i.readString():16===e?t.floorId=i.readString():17===e&&(t.buildingId=i.readString())},i.Entity.write=function(e,t){e.id&&t.writeStringField(1,e.id),e.sublayer&&t.writeStringField(2,e.sublayer),e.coordinates&&t.writePackedVarint(3,e.coordinates),e.iconId&&t.writeVarintField(4,e.iconId),e.areaId&&t.writeVarintField(5,e.areaId),e.firmId&&t.writeStringField(6,e.firmId),e.floorIndex&&t.writeVarintField(7,e.floorIndex),e.floorName&&t.writeStringField(8,e.floorName),e.text&&t.writeStringField(9,e.text),e.layer&&t.writeStringField(10,e.layer),e.priority&&t.writeVarintField(11,e.priority),e.textPriority&&t.writeVarintField(12,e.textPriority),e.type&&t.writeVarintField(13,e.type),e.text2&&t.writeStringField(14,e.text2),e.humanReadableIconId&&t.writeStringField(15,e.humanReadableIconId),e.floorId&&t.writeStringField(16,e.floorId),e.buildingId&&t.writeStringField(17,e.buildingId)},i.Floor={},i.Floor.read=function(e,t){return e.readFields(i.Floor._readField,{name:"",rooms:[],ids:[]},t)},i.Floor._readField=function(e,t,n){1===e?t.name=n.readString():2===e?t.rooms.push(i.Room.read(n,n.readVarint()+n.pos)):3===e&&t.ids.push(n.readString())},i.Floor.write=function(e,t){if(e.name&&t.writeStringField(1,e.name),e.rooms)for(var n=0;n<e.rooms.length;n++)t.writeMessage(2,i.Room.write,e.rooms[n]);if(e.ids)for(n=0;n<e.ids.length;n++)t.writeStringField(3,e.ids[n])},i.Room={},i.Room.read=function(e,t){return e.readFields(i.Room._readField,{id:0,type:0,sublayer:"",isIsland:!1,firmIds:[],area:[],wallSide:[],wallTop:[],areaSublayer:"",wallSublayer:"",floorId:"",buildingId:""},t)},i.Room._readField=function(e,t,i){1===e?t.id=i.readVarint():2===e?t.type=i.readVarint():3===e?t.sublayer=i.readString():4===e?t.isIsland=i.readBoolean():5===e?t.firmIds.push(i.readString()):6===e?t.area.push(i.readBytes()):7===e?t.wallSide.push(i.readBytes()):8===e?t.wallTop.push(i.readBytes()):9===e?t.areaSublayer=i.readString():10===e?t.wallSublayer=i.readString():11===e?t.floorId=i.readString():12===e&&(t.buildingId=i.readString())},i.Room.write=function(e,t){if(e.id&&t.writeVarintField(1,e.id),e.type&&t.writeVarintField(2,e.type),e.sublayer&&t.writeStringField(3,e.sublayer),e.isIsland&&t.writeBooleanField(4,e.isIsland),e.firmIds)for(var i=0;i<e.firmIds.length;i++)t.writeStringField(5,e.firmIds[i]);if(e.area)for(i=0;i<e.area.length;i++)t.writeBytesField(6,e.area[i]);if(e.wallSide)for(i=0;i<e.wallSide.length;i++)t.writeBytesField(7,e.wallSide[i]);if(e.wallTop)for(i=0;i<e.wallTop.length;i++)t.writeBytesField(8,e.wallTop[i]);e.areaSublayer&&t.writeStringField(9,e.areaSublayer),e.wallSublayer&&t.writeStringField(10,e.wallSublayer),e.floorId&&t.writeStringField(11,e.floorId),e.buildingId&&t.writeStringField(12,e.buildingId)},i.OutdoorObject={},i.OutdoorObject.read=function(e,t){return e.readFields(i.OutdoorObject._readField,{type:"",vertices:[],width:0},t)},i.OutdoorObject._readField=function(e,t,i){1===e?t.type=i.readString():2===e?t.vertices.push(i.readBytes()):3===e&&(t.width=i.readDouble())},i.OutdoorObject.write=function(e,t){if(e.type&&t.writeStringField(1,e.type),e.vertices)for(var i=0;i<e.vertices.length;i++)t.writeBytesField(2,e.vertices[i]);e.width&&t.writeDoubleField(3,e.width)}},3801:(e,t)=>{var i=t.w={};i.read=function(e,t){return e.readFields(i._readField,{tiles:[]},t)},i._readField=function(e,t,n){1===e&&t.tiles.push(i.Tile.read(n,n.readVarint()+n.pos))},i.write=function(e,t){if(e.tiles)for(var n=0;n<e.tiles.length;n++)t.writeMessage(1,i.Tile.write,e.tiles[n])},i.Tile={},i.Tile.read=function(e,t){return e.readFields(i.Tile._readField,{x:0,y:0,zoom:0},t)},i.Tile._readField=function(e,t,i){1===e?t.x=i.readVarint():2===e?t.y=i.readVarint():3===e&&(t.zoom=i.readVarint())},i.Tile.write=function(e,t){e.x&&t.writeVarintField(1,e.x),e.y&&t.writeVarintField(2,e.y),e.zoom&&t.writeVarintField(3,e.zoom)};var n=t.F={};n.read=function(e,t){return e.readFields(n._readField,{tileGroups:[]},t)},n._readField=function(e,t,i){1===e&&t.tileGroups.push(n.TileGroup.read(i,i.readVarint()+i.pos))},n.write=function(e,t){if(e.tileGroups)for(var i=0;i<e.tileGroups.length;i++)t.writeMessage(1,n.TileGroup.write,e.tileGroups[i])},n.TileGroup={},n.TileGroup.read=function(e,t){return e.readFields(n.TileGroup._readField,{x:0,y:0,zoom:0,tiles:[]},t)},n.TileGroup._readField=function(e,t,i){1===e?t.x=i.readVarint():2===e?t.y=i.readVarint():3===e?t.zoom=i.readVarint():4===e&&t.tiles.push(n.TileGroup.Tile.read(i,i.readVarint()+i.pos))},n.TileGroup.write=function(e,t){if(e.x&&t.writeVarintField(1,e.x),e.y&&t.writeVarintField(2,e.y),e.zoom&&t.writeVarintField(3,e.zoom),e.tiles)for(var i=0;i<e.tiles.length;i++)t.writeMessage(4,n.TileGroup.Tile.write,e.tiles[i])},n.TileGroup.Tile={},n.TileGroup.Tile.read=function(e,t){return e.readFields(n.TileGroup.Tile._readField,{regionId:0,hash:null,data:null},t)},n.TileGroup.Tile._readField=function(e,t,i){1===e?t.regionId=i.readVarint():2===e?t.hash=i.readBytes():3===e&&(t.data=i.readBytes())},n.TileGroup.Tile.write=function(e,t){e.regionId&&t.writeVarintField(1,e.regionId),e.hash&&t.writeBytesField(2,e.hash),e.data&&t.writeBytesField(3,e.data)}},5828:(e,t,i)=>{i.d(t,{rA:()=>l,W8:()=>c,Bl:()=>d});var n=i(3990),o=i(9670);let s=10001;const r={w:0,h:0,anchorX:.5,anchorY:.5,x:0,y:0,atlasIndex:0,isPacked:!1},a={};function l(e,t,i,l){const c=(0,o.zV)(e.lo,e.hi);if(!a[c]){const o=s++;a[c]={type:n.f.Unique,isSvg:!1,index:o,key:c,name:"",fileName:"",id:e,regionId:i,url:l,rasters:t.map(((e,t)=>Object.assign(Object.assign({},r),{rasterSetIndex:o,rasterIndex:t,w:e,h:e})))}}return a[c]}function c(e){const t=s++;return{type:n.f.Loaded,isSvg:!1,index:t,key:`loaded-${t}`,name:"",fileName:"",rasters:e.map(((e,i)=>Object.assign(Object.assign({},e),{rasterIndex:i,rasterSetIndex:t})))}}function d(e,t,i){let n,o=1/0;for(let s=0;s<e.length;s++){const r=e[s];if(i&&!r.isPacked)continue;const a=Math.abs(r.w-t);a<o&&(n=s,o=a)}return n}},3951:(e,t,i)=>{i.d(t,{ng:()=>d,dp:()=>s,iY:()=>o,GY:()=>a,rJ:()=>r,w7:()=>c});var n=i(9102);let o=e=>e,s=null,r=!1;const a=new Promise((e=>{s=()=>{r=!0,e()}})),l=new Set(["ar"]);function c(e,t,i){const o=t.workers.labeling;"always-off"===e||"depends-on-language"===e&&!l.has(i)?o.markRtlPluginLoaded().then((()=>{null!==s&&s()})):fetch(n.k0,{integrity:n.aT}).then((e=>e.text())).then((e=>Promise.all([o.loadRtlPlugin(e),Promise.resolve(d(e))])))}const d=function(e){let t,i=!1;return function(...n){return i||(i=!0,t=e.apply(this,n)),t}}((function(e){new Function(e)(),o=self.mapglRtlPlugin.processRtl,s&&s()}))},9394:(e,t,i)=>{i.d(t,{zT:()=>o,lD:()=>s,rx:()=>r,Go:()=>a});var n=i(1525);function o(e){let t="",i=0;for(;i<e.length;){let n=e[i++];if(n>127){if(n>191&&n<224){if(i>=e.length)return console.error("Incomplete 2-byte sequence"),t;n=(31&n)<<6|63&e[i]}else if(n>223&&n<240){if(i+1>=e.length)return console.error("Incomplete 3-byte sequence"),t;n=(15&n)<<12|(63&e[i])<<6|63&e[++i]}else{if(!(n>239&&n<248))return console.error(`Unknown multibyte start 0x${n.toString(16)} at index ${i-1}`),t;if(i+2>=e.length)return console.error("Incomplete 4-byte sequence"),t;n=(7&n)<<18|(63&e[i])<<12|(63&e[++i])<<6|63&e[++i]}++i}if(n<=65535)t+=String.fromCharCode(n);else{if(!(n<=1114111))return console.error(`Code point 0x${n.toString(16)} exceeds UTF-16 reach`),t;n-=65536,t+=String.fromCharCode(n>>10|55296),t+=String.fromCharCode(1023&n|56320)}}return t}function s(e,t){if(e.length<=t||-1!==e.indexOf("\n"))return e;const i=[];return e.split(" ").forEach((e=>{const n=i.length-1;0===i.length||i[n].length+e.length>=t?i.push(e):i[n]+=" "+e})),i.join("\n")}function r(e){return Math.floor(e/256)}function a(e){const t=new Set;return e.forEach((e=>{if(void 0!==e)for(let i=0;i<e.length;i++){const o=e.charCodeAt(i);o!==n.fonts.bomCharCode&&t.add(r(o))}})),Array.from(t)}},4712:(e,t,i)=>{i.d(t,{U:()=>s});var n=i(7618),o=i(3734);class s{constructor(e){this.dataType=e,this.pendingRequests=new Map}fetch(e,t){return new Promise((i=>{const s=t(e),r=(0,n.gx)(e),a=("json"===this.dataType?o.L:o.n)({url:s},((e,t)=>{if(this.pendingRequests.delete(r),void 0!==e)return 204!==e.status&&console.error(e),void i({});i({data:t})}));this.pendingRequests.set(r,{xhr:a,resolve:i})}))}destroy(){this.pendingRequests.forEach(((e,t)=>{this.abortRequest(t)}))}abortRequest(e){const t=this.pendingRequests.get(e);void 0!==t&&(t.xhr.abort(),t.resolve({rejected:!0}),this.pendingRequests.delete(e))}}},7266:(e,t,i)=>{i.d(t,{c:()=>n});class n{constructor(){this.events={}}on(e,t){let i=this.events[e];return i||(i=this.events[e]=[]),i.push(t),this}once(e,t){const i=n=>{this.off(e,i),t.call(this,n)};return this.on(e,i),this}off(e,t){const i=this.events[e];if(!i)return this;const n=i.indexOf(t);return-1!==n&&i.splice(n,1),this}emit(e,t){const i=this.events[e];if(!i)return this;const n=i.slice();for(let e=0;e<n.length;e++)n[e].call(this,t);return this}}},7706:(e,t,i)=>{i.d(t,{g:()=>o});var n=i(8631);class o{constructor(e={}){this.map=e}set(e,t){let i=this.map[e.lo];void 0===i&&(i=this.map[e.lo]={}),i[e.hi]=t}get(e){if(void 0!==this.map[e.lo])return this.map[e.lo][e.hi]}serialize(){return this.map}forEach(e){for(const t in this.map)for(const i in this.map[t])e(this.map[t][i],(0,n.Ru)(Number(t),Number(i)))}clear(){this.map={}}}},6723:(e,t,i)=>{i.d(t,{c:()=>n});class n{constructor(e=[]){this.map={};for(const t of e)this.add(t)}has(e){const t=this.map[e.hi];return void 0!==(null==t?void 0:t[e.lo])}hasSome(e){return e.some((e=>this.has(e)))}add(e){let t=this.map[e.hi];t||(t=this.map[e.hi]={}),t[e.lo]=!0}addFromFlatArray(e){const t=this.map;for(let i=0;i<e.length/2;i++){const n=e[2*i+1];let o=t[n];o||(o=t[n]={}),o[e[2*i]]=!0}}toFlatArray(){const e=this.map,t=[];for(const i in e){const n=e[i];for(const e in n)t.push(Number(e),Number(i))}return t}}},8631:(e,t,i)=>{i.d(t,{Ru:()=>o,nI:()=>s,v7:()=>r,y5:()=>a,Ak:()=>l,IL:()=>c});const n=1e5;function o(e,t){return{type:64,lo:e,hi:t}}function s(e){return null!==e&&"object"==typeof e&&64===e.type}function r(e,t){return e.lo===t.lo&&e.hi===t.hi}function a(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!r(e[i],t[i]))return!1;return!0}function l(e){return g(e.lo,e.hi)}function c(e){const t=y(e);return o(t[0],t[1])}function d(e){return[e%n,Math.floor(e/n)%n,0,0]}function h(e){let t=0;for(let i=0;i<4;i++){const o=4294967296*e[i]+t;t=Math.floor(o/n),e[i]=o%n}}function u(e,t){const i=4294967296;let o=4,s=0;for(;--o>=0;){const r=s*n+t[o],a=Math.floor(r/i);s=r-a*i,e[o]=a}}function m(e,t){let i=0;for(let o=0;o<4;o++){const s=e[o]+t[o]+i;i=Math.floor(s/n),e[o]=s%n}}function f(e,t){let i=0;for(let o=0;o<4;o++){let s=e[o]-t[o]-i;s<0?(s+=n,i=1):i=0,e[o]=s}}function p(e){let t=!0,i=4,n="";for(;--i>=0;){const o=String(e[i]);t?0!==e[i]&&(n+=o,t=!1):n+="00000".slice(o.length)+o}return n.length||(n="0"),n}function _(e){let t=4,i=0;for(;--t>=0;)i=i*n+e[t];return i}function v(e){e="00000000000000000000".slice(e.length)+e;const t=[0,0,0,0];for(let i=0;i<4;i++){const n=parseInt(e.slice(5*i,5*(i+1)),10);t[3-i]=n}return t}function g(e,t){const i=d(e),n=d(t);return h(n),m(n,i),p(n)}function y(e){const t=v(e),i=d(0);u(i,t);const n=_(i);return h(i),f(t,i),[_(t),n]}},2182:(e,t,i)=>{i.d(t,{L:()=>o});const n=()=>{};class o{constructor(e,t=n){this.queue=[],this.data={},this.size=e,this.onRemove=t}add(e,t){this.data[e]||(this.queue.push(e),this.data[e]=t,this.shrink(this.size))}remove(e){this.data[e]&&(this.queue.splice(this.queue.indexOf(e),1),delete this.data[e])}get(e){const t=this.data[e];return t&&(this.queue.splice(this.queue.indexOf(e),1),this.queue.push(e)),t}reset(){this.shrink(0)}setSize(e){this.size=e,this.shrink(e)}getSize(){return this.size}keys(){return this.queue}getData(){return Object.keys(this.data).map((e=>this.data[e]))}shrink(e){for(;this.queue.length>e;){const e=this.queue.shift(),t=this.data[e];delete this.data[e],this.onRemove(e,t)}}}},8426:(e,t,i)=>{i.d(t,{c:()=>n});class n{constructor(e){this.map=(null==e?void 0:e.map)||{}}set(e,t,i){void 0===this.map[e]&&(this.map[e]={}),this.map[e][t]=i}get(e,t){const i=this.map[e];if(void 0!==i)return i[t]}has(e,t){const i=this.map[e];return void 0!==i&&void 0!==i[t]}}},9110:(e,t,i)=>{i.d(t,{o1:()=>o,fL:()=>s,aU:()=>r});var n=i(9899);function o(e){return n.$U*e}function s(e){return e/n.$U}function r(e){return!!e.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i)}},3386:(e,t,i)=>{i.d(t,{Ty:()=>l,wu:()=>c,h3:()=>d,Cz:()=>h});var n=i(1525);const o=new Set(n.commercialSublayers),s=new Set(n.commercialCitySublayers),r=new Set(n.personalSublayers),a=new Set(n.landmarkPoiSublayers);function l(e){return o.has(e)}function c(e){return s.has(e)}function d(e){return r.has(e)}function h(e){return a.has(e)}},9638:(e,t,i)=>{i.d(t,{Z:()=>n});class n{constructor(e){this.fnRegistry=e,this.onClassCreate=({id:e,name:t,args:i})=>{const n=this.classes.get(t);if(!n)return void console.error(`ClassRegistry#onClassCreate: class ${t} not found`);const o=n.scope?new n.ClassConstructor(n.scope,...i):new n.ClassConstructor(...i);n.hosts.set(e,o)},this.onMethodUse=({id:e,name:t,method:i,args:n})=>{const o=this.classes.get(t);if(!o)return void console.error(`ClassRegistry#onMethodUse: class ${t} not found`);const s=o.hosts.get(e);if(s){if(s[i])return"destroy"===i&&o.hosts.delete(e),s[i](...n);console.error(`ClassRegistry#onMethodUse: method ${i} in instance ${e} in class ${t} not found`)}else console.error(`ClassRegistry#onMethodUse: instance ${e} in class ${t} not found`)},this.classes=new Map,this.idCounter=0,this.fnRegistry.set("createClass",this.onClassCreate),this.fnRegistry.set("classMethodUse",this.onMethodUse)}set(e,t,i){const n=this,o={ClassConstructor:t,hosts:new Map,proxies:new Map,scope:i};return this.classes.set(e,o),{get:i=>{class o{constructor(...t){this.id=n.idCounter++,n.fnRegistry.get(i,"createClass")({id:this.id,args:t,name:e})}}return Object.getOwnPropertyNames(t.prototype).forEach((t=>{"constructor"!==t&&(o.prototype[t]=function(...o){return n.fnRegistry.get(i,"classMethodUse")({id:this.id,name:e,method:t,args:o})})})),o}}}}},5147:(e,t,i)=>{i.d(t,{H:()=>s,D:()=>r});var n=i(8047),o=i(7266);class s extends o.c{constructor(){super(),this.workers=new Map}addWorker(e,t){this.workers.set(e,t),t.addEventListener("message",(t=>{const{to:i,msg:n,transferable:o}=t.data,s={from:e,to:i,msg:n,transferable:o};this.routeMessage(s)}))}send(e,t,i){const o=this.workers.get(e);if(o){const s={to:e,from:n.P.Main,msg:t,transferable:i};void 0!==i?o.postMessage(s,i):o.postMessage(s)}}broadcast(e){this.workers.forEach(((t,i)=>{const o={to:i,from:n.P.Main,msg:e};t.postMessage(o)}))}routeMessage(e){const{from:t,to:i,transferable:o,msg:{type:s}}=e;if(i===n.P.Main)this.emit("message",e);else if(i===n.P.All)t!==n.P.Main&&this.emit(s,e),this.workers.forEach(((i,n)=>{n!==t&&(void 0!==o?i.postMessage(e,o):i.postMessage(e))}));else{const t=this.workers.get(i);t&&(void 0!==o?t.postMessage(e,o):t.postMessage(e))}}}class r extends o.c{constructor(e){super(),this.worker=e,e.addEventListener("message",(e=>{const t=e.data;this.emit("message",t)}))}send(e,t,i){const n={to:e,msg:t,transferable:i};this.worker.postMessage(n,i)}broadcast(e){const t={to:n.P.All,msg:e};this.worker.postMessage(t)}}},9472:(e,t,i)=>{i.d(t,{J:()=>o});var n=i(8047);class o{constructor(e){this.onMessage=e=>{const{from:t,msg:i}=e;switch(i.type){case n.C.FunctionUse:this.onFunctionUse(i,t);break;case n.C.FunctionResult:this.onFunctionResult(i)}},this.connector=e,this.functions=new Map,this.functionIdCounter=0,this.pendingFunctions=new Map,e.on("message",this.onMessage)}set(e,t){this.functions.set(e,t)}get(e,t){return(...i)=>{const o=this.functionIdCounter++,s=new Promise((e=>{this.pendingFunctions.set(o,e)})),r={type:n.C.FunctionUse,data:{id:o,name:t,args:i}};return this.connector.send(e,r),s}}onFunctionUse(e,t){const{data:{name:i,args:n,id:o}}=e,s=this.functions.get(i);if(s){const e=s(...n);e&&e.then?Promise.resolve(e).then((e=>this.sendFunctionResult(t,o,e))):this.sendFunctionResult(t,o,e)}else console.error(`FnRegistry#onFunctionUse: function ${i} not found`)}sendFunctionResult(e,t,i){const o={type:n.C.FunctionResult,data:{id:t,result:i}};i&&i.transferable?this.connector.send(e,o,i.transferable):this.connector.send(e,o)}onFunctionResult(e){const{data:{id:t,result:i}}=e,n=this.pendingFunctions.get(t);n?(n(i),this.pendingFunctions.delete(t)):console.error(`FnRegistry#onFunctionResult: pending function ${t} not found`)}}},8047:(e,t,i)=>{var n,o;i.d(t,{P:()=>n,C:()=>o}),function(e){e[e.Main=0]="Main",e[e.Parser=1]="Parser",e[e.Labeling=2]="Labeling",e[e.All=3]="All"}(n||(n={})),function(e){e[e.FunctionUse=0]="FunctionUse",e[e.FunctionResult=1]="FunctionResult"}(o||(o={}))},5677:(e,t,i)=>{i.d(t,{rS:()=>U,U2:()=>B,BL:()=>j,sT:()=>N,Vx:()=>Z});var n={};i.r(n),i.d(n,{ease:()=>a,easeInBack:()=>A,easeInCirc:()=>T,easeInCubic:()=>h,easeInElastic:()=>E,easeInExpo:()=>I,easeInOutBack:()=>F,easeInOutCirc:()=>L,easeInOutCubic:()=>m,easeInOutElastic:()=>z,easeInOutExpo:()=>M,easeInOutQuad:()=>d,easeInOutQuart:()=>_,easeInOutQuint:()=>y,easeInOutSine:()=>x,easeInQuad:()=>l,easeInQuart:()=>f,easeInQuint:()=>v,easeInSine:()=>b,easeOutBack:()=>C,easeOutBounce:()=>R,easeOutCirc:()=>P,easeOutCubic:()=>u,easeOutElastic:()=>k,easeOutExpo:()=>S,easeOutQuad:()=>c,easeOutQuart:()=>p,easeOutQuint:()=>g,easeOutSine:()=>w,inertia:()=>D,linear:()=>s});var o=i(1525);function s(e,t,i,n,o){return i+n/o*t}const r=i(6636)(.25,.1,.25,1);function a(e,t,i,n,o){return i+n*r(t/o)}function l(e,t,i,n,o){return n*(t/=o)*t+i}function c(e,t,i,n,o){return-n*(t/=o)*(t-2)+i}function d(e,t,i,n,o){return(t/=o/2)<1?n/2*t*t+i:-n/2*(--t*(t-2)-1)+i}function h(e,t,i,n,o){return n*(t/=o)*t*t+i}function u(e,t,i,n,o){return n*((t=t/o-1)*t*t+1)+i}function m(e,t,i,n,o){return(t/=o/2)<1?n/2*t*t*t+i:n/2*((t-=2)*t*t+2)+i}function f(e,t,i,n,o){return n*(t/=o)*t*t*t+i}function p(e,t,i,n,o){return-n*((t=t/o-1)*t*t*t-1)+i}function _(e,t,i,n,o){return(t/=o/2)<1?n/2*t*t*t*t+i:-n/2*((t-=2)*t*t*t-2)+i}function v(e,t,i,n,o){return n*(t/=o)*t*t*t*t+i}function g(e,t,i,n,o){return n*((t=t/o-1)*t*t*t*t+1)+i}function y(e,t,i,n,o){return(t/=o/2)<1?n/2*t*t*t*t*t+i:n/2*((t-=2)*t*t*t*t+2)+i}function b(e,t,i,n,o){return-n*Math.cos(t/o*(Math.PI/2))+n+i}function w(e,t,i,n,o){return n*Math.sin(t/o*(Math.PI/2))+i}function x(e,t,i,n,o){return-n/2*(Math.cos(Math.PI*t/o)-1)+i}function I(e,t,i,n,o){return 0==t?i:n*Math.pow(2,10*(t/o-1))+i}function S(e,t,i,n,o){return t==o?i+n:n*(1-Math.pow(2,-10*t/o))+i}function M(e,t,i,n,o){return 0==t?i:t==o?i+n:(t/=o/2)<1?n/2*Math.pow(2,10*(t-1))+i:n/2*(2-Math.pow(2,-10*--t))+i}function T(e,t,i,n,o){return-n*(Math.sqrt(1-(t/=o)*t)-1)+i}function P(e,t,i,n,o){return n*Math.sqrt(1-(t=t/o-1)*t)+i}function L(e,t,i,n,o){return(t/=o/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+i:n/2*(Math.sqrt(1-(t-=2)*t)+1)+i}function E(e,t,i,n,o){var s=1.70158,r=0,a=n;if(0==t)return i;if(1==(t/=o))return i+n;if(r||(r=.3*o),a<Math.abs(n)){a=n;s=r/4}else s=r/(2*Math.PI)*Math.asin(n/a);return-a*Math.pow(2,10*(t-=1))*Math.sin((t*o-s)*(2*Math.PI)/r)+i}function k(e,t,i,n,o){var s=1.70158,r=0,a=n;if(0==t)return i;if(1==(t/=o))return i+n;if(r||(r=.3*o),a<Math.abs(n)){a=n;s=r/4}else s=r/(2*Math.PI)*Math.asin(n/a);return a*Math.pow(2,-10*t)*Math.sin((t*o-s)*(2*Math.PI)/r)+n+i}function z(e,t,i,n,o){var s=1.70158,r=0,a=n;if(0==t)return i;if(2==(t/=o/2))return i+n;if(r||(r=o*(.3*1.5)),a<Math.abs(n)){a=n;s=r/4}else s=r/(2*Math.PI)*Math.asin(n/a);return t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t*o-s)*(2*Math.PI)/r)*-.5+i:a*Math.pow(2,-10*(t-=1))*Math.sin((t*o-s)*(2*Math.PI)/r)*.5+n+i}function A(e,t,i,n,o,s){return null==s&&(s=1.70158),n*(t/=o)*t*((s+1)*t-s)+i}function C(e,t,i,n,o,s){return null==s&&(s=1.70158),n*((t=t/o-1)*t*((s+1)*t+s)+1)+i}function F(e,t,i,n,o,s){return null==s&&(s=1.70158),(t/=o/2)<1?n/2*(t*t*((1+(s*=1.525))*t-s))+i:n/2*((t-=2)*t*((1+(s*=1.525))*t+s)+2)+i}function R(e,t,i,n,o){return(t/=o)<1/2.75?n*(7.5625*t*t)+i:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+i:n*(7.5625*(t-=2.625/2.75)*t+.984375)+i}function D(e,t,i,n,s){return n*(1-Math.pow(1-t/s,o.inertia.nonLinearity+1))+i}const O={easing:"easeInOutQuad",forceFinalValue:!0,renderAfterUpdate:!0};function B(e,t){return t.tickers[e]}function j(e,t,i,n,o,s,r){let a;t.animationGroup&&(a=Object.keys(i.tickers).filter((e=>i.tickers[e].animationGroup===t.animationGroup))),i.tickers[e]=Object.assign(Object.assign(Object.assign({},O),t),{from:n,to:o,duration:s,attributes:r,startTime:i.time,alreadyStartedGroupTickers:a})}function N(e,t){delete t.tickers[e]}function U(e,t){return!!t.tickers[e]}function Z(e,t,i){const n=i.tickers[e];if(!n)return;if(n.alreadyStartedGroupTickers&&n.alreadyStartedGroupTickers.some((e=>!!i.tickers[e])))return void(n.startTime=i.time);const o=i.time-n.startTime;let s;if(n.from.length){s=[];for(let e=0;e<n.from.length;e++){const t=H(n.easing,n.from[e],n.to[e],n.duration,o);s.push(t)}}else s=H(n.easing,n.from,n.to,n.duration,o);let r=!1;o>=n.duration&&(n.forceFinalValue&&(s=n.to),r=!0),t.step&&t.step(i,s,n.attributes),r&&(N(e,i),t.complete&&t.complete(i)),n.renderAfterUpdate&&(i.needRerender=!0)}function H(e,t,i,o,s){return n[e](null,s,t,i-t,o)}},7618:(e,t,i)=>{i.d(t,{Bs:()=>f,gx:()=>p,vl:()=>_,cL:()=>v,CJ:()=>g,xH:()=>y,VV:()=>b,Sl:()=>w,Ny:()=>x,b5:()=>I,rL:()=>T,HL:()=>P,pV:()=>E,xG:()=>k,aM:()=>z,qu:()=>A,vX:()=>C,FP:()=>F,Z$:()=>R,L7:()=>O,a2:()=>B,aq:()=>j,hm:()=>N,C5:()=>U,VW:()=>Z,Oy:()=>H,IR:()=>G,z6:()=>V,x7:()=>q,_W:()=>X});var n=i(378),o=i(9450),s=i(4716),r=i(6208),a=i.n(r),l=i(8729),c=i(7018),d=i(6451),h=i(3801),u=i(9899),m=i(7090);function f(e){return{coords:e,size:j(e[2]),offset:H(e)}}function p(e){return`${e[0]}_${e[1]}_${e[2]}_${e[3]}`}function _(e,t){return`${p(e)}_${t.stringify()}`}function v(e){const t=e.split("_");return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}function g(e){const t=new(a())(e),i=h.F.read(t),{x:n,y:o,zoom:s,tiles:r}=i.tileGroups[0];return r.map((({regionId:e,hash:t,data:i})=>(i||(console.warn(`Tile ${s}_${n}_${o} from region ${e} is corrupt (has no data)`),i=new Uint8Array(0)),{data:i,regionId:e,metatileHash:(0,l.SD)(t)})))}function y(e){return e.map((e=>({regionId:e.regionId,metatileHash:e.metatileHash})))}function b(e){const t=4*Math.ceil(e.byteLength/4),i=new ArrayBuffer(t);return new Uint8Array(i).set(e),i}function w(e){const[t,i,n]=e;return{min:H([t,i,n,n]),max:H([t+1,i+1,n,n])}}function x(e,t){const i=w(e);return(0,d.M4)(t,i)}function I(e,t,i,n){const o=(0,d.BS)(e.tilesBounds),s=j(t),r=Math.pow(2,t)-1,a=Math.max(Math.floor((o.min[0]+u.ed)/s),0),l=Math.min(Math.floor((o.max[0]+u.ed)/s),r),c=Math.max(Math.floor((o.min[1]+u.ed)/s),0),h=Math.min(Math.floor((o.max[1]+u.ed)/s),r),m=[];for(let i=a;i<=l;i++)for(let o=c;o<=h;o++){const s=[i,o,t,n];x(s,e.tilesBounds)&&m.push(s)}return e.demMode&&function(e,t,i,n,o){const s=e.reduce(((e,t)=>(e.add(p(t)),e)),new Set),r=new Set,a=(0,d.By)(t.tilesBounds);let l=e.slice();for(let c=i;c>=n;c--){let n=0;const h=[];l.forEach((i=>{const o=S(i),a=p(o);r.has(a)||(h.push(o),r.add(a),M(o,(i=>{const o=p(i);s.has(o)||r.has(o)||!x(i,t.demTilesBounds)||(e.push(i),s.add(o),n++)})))}));const m=j(c-1);(0,d.mW)(a,m,t.center);const f=(0,d.BS)(a),_=Math.pow(2,i)-1,v=Math.max(Math.floor((f.min[0]+u.ed)/m),0),g=Math.min(Math.floor((f.max[0]+u.ed)/m),_),y=Math.max(Math.floor((f.min[1]+u.ed)/m),0),b=Math.min(Math.floor((f.max[1]+u.ed)/m),_);for(let e=v;e<=g;e++)for(let t=y;t<=b;t++){const i=[e,t,c-1,o],s=p(i);!r.has(s)&&x(i,a)&&(h.push(i),n++)}if(!n)break;l=h}}(m,e,t,i,n),m}function S(e,t=1){const[i,n,o,s]=e,r=Math.pow(2,t);return[Math.trunc(i/r),Math.trunc(n/r),o-t,s]}function M(e,t){let[i,n,o]=e;const s=e[3];i*=2,n*=2,o++,t([i,n,o,s]),t([i+1,n,o,s]),t([i,n+1,o,s]),t([i+1,n+1,o,s])}function T(e,t,i,n,o,r,l,d,u,m){const f=new(a()),p={tiles:[{x:o[0],y:o[1],zoom:o[2]}]};return h.w.write(p,f),(0,c.Gr)("tiles",{host:e,tileSet:t,tileKey:r,sessionId:m,protocol:i,appId:l,lang:d,defaultLang:u,subdomain:n[Math.abs(o[0]+o[1])%n.length],request:encodeURIComponent(s.c(f.finish()))})}function P(e,t){const i=e.coords,n=t.coords,o=i[2],s=n[2];return o===s?i[0]===n[0]&&i[1]===n[1]:o<s?L(e,t):L(t,e)}function L(e,t){if(t.zoomLevel<e.zoomLevel)return!1;if(t.zoomLevel===e.zoomLevel)return t.coords[0]===e.coords[0]&&t.coords[1]===e.coords[1]&&t.detailLevel>e.detailLevel;const i=Math.pow(2,t.coords[2]-e.coords[2]),n=e.coords[0]*i,o=n+i,s=e.coords[1]*i,r=s+i,a=t.coords[0],l=t.coords[1];return a>=n&&a<o&&l>=s&&l<r}function E(e,t,i){const{coords:n}=e,o=Math.min(t,i),s=Math.pow(2,e.zoomLevel-o);return p([Math.floor(n[0]/s),Math.floor(n[1]/s),o,t])}function k(e,t,i,n){return e[E(t,i,n)]}function z(e,t){const i=[];for(const n in e){const o=e[n];L(t,o)&&i.push(o)}return i}function A(e,t,i){return n.TE(e,W(t.coords))-n.TE(e,W(i.coords))}function C(e,t){return e.filter((e=>t.has(e)))}function F(e){return e>=1&&e<=65535}function R(e,t,i){e[0]=t[0]*i.size/u.Bq+i.offset[0],e[1]=t[1]*i.size/u.Bq+i.offset[1],e[2]=t[2]*u._9/u.Bq}const D=o.Ue();function O(e,t,i,n){D[0]=t[0][i],D[1]=t[1][i],D[2]=t[2][i],R(e,D,n)}function B(e,t,i){e[0]=(t[0]-i.offset[0])*u.Bq/i.size,e[1]=(t[1]-i.offset[1])*u.Bq/i.size,e[2]=t[2]*u.Bq/u._9}function j(e){return Math.pow(2,32-e)}function N(e){return e[0]>=0&&e[0]<=u.Bq&&e[1]>=0&&e[1]<=u.Bq}function U(e,t){return e*u.sX/(u.Bq*Math.pow(2,t))}function Z(e){return e/u._9*u.Bq}function H(e){const t=j(e[2]),i=2147483648;return o.al(e[0]*t-i,e[1]*t-i,0)}function G(e){const t=2147483648;return[e[0]+t,e[1]+t,32,32]}function W(e){const t=j(e[2]),i=2147483648;return o.al((e[0]+.5)*t-i,(e[1]+.5)*t-i,0)}function V(e,t){const i=2147483648,n=j(t);return[(e[0]-n/2+i)/n,(e[1]-n/2+i)/n,t,t]}function q(e,t=1){const i=Math.max(e.max[0]-e.min[0],e.max[1]-e.min[1],1)*t,o=32-Math.log(i)/Math.LN2,s=n.Ue();return(0,m.be)(s,e),V(s,o)}const X=e=>{const[t,i,n,o]=e;return[t,Math.pow(2,n)-1-i,n,o]}},5569:(e,t,i)=>{function n(e,t,i){let n,o,s,r;const a=function(){const l=Date.now()-s;l<t&&l>=0?n=setTimeout(a,t-l):(n=null,i||(r=e(...o),n||(o=null)))};return function(...l){o=l,s=Date.now();const c=i&&!n;return n||(n=setTimeout(a,t)),c&&(r=e(...o),o=null),r}}i.d(t,{D:()=>n})},308:(e,t,i)=>{i.d(t,{f:()=>o});let n=1;function o(){return n++}},7018:(e,t,i)=>{i.d(t,{XK:()=>s,Gr:()=>a,IG:()=>l,Sy:()=>c});var n=i(1525);const o=/\{(\w+)\}/g;function s(e,t){return e.replace(o,((e,i)=>t[i]))}function r(e){const[t,i]=e.split("?");if(!i)return t;const n=i.split("&").map((e=>e.split("="))).filter((([,e])=>"undefined"!==e)).map((e=>e.join("="))).join("&");return n.length?`${t}?${n}`:t}function a(e,t){const i=s(t.host,{subdomain:t.subdomain});return r(s(n.urls[e],Object.assign(Object.assign({},t),{host:i})))}function l(e,t){return r(s(e,t))}function c(e,t){let i=0;for(let e=0;e<t.length;e++)i+=t.charCodeAt(e);return e[i%e.length]}},8072:(e,t,i)=>{i.d(t,{gl:()=>o,TD:()=>c});var n=i(9899);const o=Math.pow(2,32)-1,s=o-1,r={},a=["main","parser","labeling"];let l=0;a.forEach((e=>{const t=l+Math.floor(s/a.length);r[e]={min:l,max:t-1e6},l=t}));class c{constructor(e){this.ids=[],this.phases=[],this.sublayers=[],this.styleIds=[],this.layerIds=[],this.instanceIds=[],this.objectClasses=[],this.floorIds=[],this.center=[],this.strings={},this.minIdentifyIndex=r[e].min,this.maxIdentifyIndex=r[e].max,this.index=this.minIdentifyIndex}getIndex(e){var t,i,s,r,a,l,c,d,h,u;if("number"==typeof e.id)return o;const m=this.index+this.ids.length/2;this.ids.push(e.id.lo,e.id.hi),this.floorIds.push(null!==(i=null===(t=e.floorId)||void 0===t?void 0:t.lo)&&void 0!==i?i:o,null!==(r=null===(s=e.floorId)||void 0===s?void 0:s.hi)&&void 0!==r?r:o),this.phases.push(e.layer.renderIndex),this.sublayers.push(null!==(c=null===(l=null===(a=e.metatile)||void 0===a?void 0:a.dictionaries.db_sublayer)||void 0===l?void 0:l[e.sublayer])&&void 0!==c?c:NaN),this.styleIds.push(e.styleId),this.layerIds.push(e.layer.innerId),this.instanceIds.push(null!==(d=e.instanceId)&&void 0!==d?d:0);const{center:f,objectClass:p}=e;if(f?this.center.push(Math.round(f[0]),Math.round(f[1])):this.center.push(n.Cd,n.Cd),"string"==typeof p){const t=null===(u=null===(h=e.metatile)||void 0===h?void 0:h.dictionaries.db_object_class)||void 0===u?void 0:u[p];t?this.objectClasses.push(t):(this.objectClasses.push(0),this.strings[m]={objectClass:p})}else this.objectClasses.push(o);return m}getPacked(){const e=new Uint32Array(this.ids).buffer,t=new Uint32Array(this.floorIds).buffer,i=new Float32Array(this.phases).buffer,n=new Uint32Array(this.sublayers).buffer,o=new Uint16Array(this.styleIds).buffer,s=new Uint32Array(this.layerIds).buffer,r=new Uint8Array(this.instanceIds).buffer,a=new Uint32Array(this.objectClasses).buffer,l=new Int32Array(this.center).buffer,c=this.index,d=this.index+this.ids.length-1;this.index=this.index+this.ids.length,this.index>this.maxIdentifyIndex&&(this.index=this.minIdentifyIndex);const h=this.strings;return this.ids=[],this.floorIds=[],this.phases=[],this.sublayers=[],this.styleIds=[],this.layerIds=[],this.instanceIds=[],this.objectClasses=[],this.strings={},this.center=[],{idBuffer:e,floorIdBuffer:t,startIndex:c,endIndex:d,phaseBuffer:i,sublayerBuffer:n,styleIdBuffer:o,layerIdBuffer:s,instanceIdBuffer:r,objectClassBuffer:a,centerBuffer:l,strings:h}}}},341:(e,t,i)=>{i.d(t,{P:()=>p});var n=i(3251);const o=.8;class s{constructor(e,t){this.offset=0,this.stride=t,this.buffer=new ArrayBuffer(e),this.view=new Int32Array(this.buffer),this.comittedOffsets=0,this.watermark=e/t*o}extend(){const e=2*this.buffer.byteLength;this.watermark=e/this.stride*o;const t=new ArrayBuffer(e),i=new Int32Array(t);return i.set(this.view),this.buffer=t,this.view=i,t}}class r{constructor(e){this.offset=0,this.buffer=new Int32Array(e),this.comittedOffsets=0,this.watermark=e*o}extend(){const e=2*this.buffer.length;this.watermark=e*o;const t=new Int32Array(e);t.set(this.buffer),this.buffer=t}}class a{constructor(e,t,i,o){const a="buildingModel"!==e?67200:336e3,l=(0,n.vP)(e,t);this.elements=new s(a,l),this.indices=new r(2*a/l),this.views={},this.binder=o,o(this,this.elements.buffer),this.attributes=i}resetOffsets(){this.elements.offset=0,this.elements.comittedOffsets=0,this.indices.offset=0,this.indices.comittedOffsets=0}commit(){this.elements.comittedOffsets=this.elements.offset,this.indices.comittedOffsets=this.indices.offset}rollback(){this.elements.offset=this.elements.comittedOffsets,this.indices.offset=this.indices.comittedOffsets}checkWatermarks(){let e=0;const t=this.elements;t.offset>t.watermark&&(t.offset>=t.buffer.byteLength/t.stride&&(e=1),this.binder(this,t.extend()));const i=this.indices;return i.offset>i.watermark&&(i.offset>=i.buffer.length&&(e=1),i.extend()),e}}var l=i(8072),c=i(8943),d=i(1525),h=i(5828);class u{constructor(){this.packer=new c.Z(d.atlasSize[0],d.atlasSize[1]),this.currentAtlasIndex=0,this.packedRasters=[],this.rastersToLoad=[],this.newRasterSets=new Map}addNewRasterSet(e,t){let i=this.newRasterSets.get(e);i||(i=[],this.newRasterSets.set(e,i)),i.push(t)}pack(e,t,i){e.isSvg?this.packSvg(e,t.map((e=>({w:e,h:e}))),i):this.packPng(e,t,i)}packSvg(e,t,i){const{rasters:n}=e,o=new Set;for(const{w:e,h:t}of n)o.add(`${e}_${t}`);for(const s of t){const t=s.w*i,r=s.h*i;if(o.has(`${t}_${r}`))continue;let a=this.packer.packOne(t+2,r+2);null===a&&(this.packer=new c.Z(d.atlasSize[0],d.atlasSize[1]),this.currentAtlasIndex++,a=this.packer.packOne(t+2,r+2));const l=n.length,h={rasterSetIndex:e.index,rasterIndex:l,w:t,h:r,x:a.x+1,y:a.y+1,anchorX:e.anchorX,anchorY:e.anchorY,atlasIndex:this.currentAtlasIndex,isPacked:!0};n.push(h),this.packedRasters.push(e.index,l,h.x,h.y,h.w,h.h,this.currentAtlasIndex)}}addRastersToLoad(e,t){this.rastersToLoad.push(e,t.rasterSetIndex,t.rasterIndex)}getNewRasterSets(){const e=this.newRasterSets;return this.newRasterSets=new Map,e}getPackedRasters(){if(0===this.packedRasters.length)return;const e=new Uint16Array(this.packedRasters);return this.packedRasters=[],e}getRastersToLoad(){const e=new Float64Array(this.rastersToLoad);return this.rastersToLoad=[],e}packPng(e,t,i){const{rasters:n}=e;for(const o of t){const t=o*i,s=(0,h.Bl)(n,t,!1);if(void 0===s)continue;const r=e.rasters[s];if(r.isPacked)continue;let a=this.packer.packOne(r.w+2,r.h+2);null===a&&(this.packer=new c.Z(d.atlasSize[0],d.atlasSize[1]),this.currentAtlasIndex++,a=this.packer.packOne(r.w+2,r.h+2)),r.x=a.x+1,r.y=a.y+1,r.atlasIndex=this.currentAtlasIndex,r.isPacked=!0,this.packedRasters.push(e.index,s,r.x,r.y,r.w,r.h,this.currentAtlasIndex)}}}var m=i(590),f=i(7706);class p{constructor(e){this.atlasPacker=new u,this.geoIds=new Uint32Array(0),this.floorHidingMap=new f.g,this.addedBuckets=[],this.labels=[],this.idIndexer=new l.TD(e),this.buckets={},this.reset()}reset(){this.buckets={},this.addedBuckets=[],this.geoIds=new Uint32Array(0),this.floorHidingMap.clear(),this.labels=[]}addLabel(e){this.labels.push(e)}getBucket(e,t,i,n){let o=this.buckets[e];void 0===o&&(o={},this.buckets[e]=o);let s=o[t];void 0===s&&(s=o[t]=[]);for(let e=s.length-1;e>=0;e--){const t=s[e];if((0,m.wy)(i,t.attributes))return this.addedBuckets.push(t),t}const r=new a(e,t,i,n);return s.push(r),this.addedBuckets.push(r),r}isOverloaded(){const e=this.addedBuckets;let t=0,i=0;for(;i<e.length;)t+=e[i++].checkWatermarks();const n=t>0;if(n)for(;i--;)e[i].rollback();else for(;i--;)e[i].commit();return e.length=0,n}setGeoIds(e){this.geoIds=e}addFloorHidingMap(e,t){let i=this.floorHidingMap.get(t);void 0===i&&(i=[]),i.push(e.lo,e.hi),this.floorHidingMap.set(t,i)}getAccumulatedData(){const e=this.buckets,t=[],i=[];for(const o in e){const s=o,r=e[s];if(r)for(const e in r){const o=e,a=r[o];if(!a)continue;const l=(0,n.vP)(s,o)/4;let c=0;for(let e=0;e<a.length;e++)c+=a[e].indices.offset;if(0===c)continue;const d=[],h=new Int32Array(c*l);let u=0;for(let e=0;e<a.length;e++){const t=a[e],{elements:i,indices:n,attributes:o}=t,{view:s}=i,{buffer:r}=n;if(0===i.offset)continue;const c=u;for(let e=0;e<n.offset;e++){const t=r[e]*l;for(let e=0;e<l;e++)h[u++]=s[t+e]}d.push({attributes:o,rangeStart:4*c,rangeEnd:4*u}),t.resetOffsets()}t.push({symbol:s,sink:o,buffer:h.buffer,generatedObjects:d}),i.push(h.buffer)}}const o=this.idIndexer.getPacked();i.push(o.idBuffer,o.phaseBuffer,o.floorIdBuffer);const s=this.atlasPacker.getPackedRasters();void 0!==s&&i.push(s.buffer);const r=this.atlasPacker.getRastersToLoad();i.push(r.buffer);const a=new Uint32Array(this.geoIds);i.push(a.buffer);const l=this.floorHidingMap.serialize();this.floorHidingMap.clear();const c=this.labels;return this.labels=[],{data:t,labels:c,geoIds:a,floorHidingMap:l,packedRasters:s,rastersToLoad:r,identifyIds:o,transferable:i}}}},9016:(e,t,i)=>{i.d(t,{x:()=>a});var n=i(8016),o=i(6554),s=i(1245);const r=new Map;class a{constructor(e,t,i,a,l,c){switch(this.anchorWorld=[0,0,0,0],this.groupPriority=0,this.labelingGroup=o.T_,this.marginTopBottom=0,this.marginLeftRight=0,this.elevation=0,this.type=t,this.label=e,this.layer=e.layer,this.elevation=e.elevation,this.id=e.id+"_"+t+"_"+Math.floor(i[0]/1e3)+"_"+Math.floor(i[1]/1e3)+this.getIconLabelPriorityToId(e),s.JG(this.anchorWorld,i),this.anchorWorld[2]*=a,this.anchorScreen=l.project([this.anchorWorld[0],this.anchorWorld[1],this.anchorWorld[2]+this.elevation,0]),this.anchorPosition=0,this.anchorSegmentIndex=0,this.halfLabelWidth=0,this.commPriorityRandomFactor=NaN,this.itemPriority=t===n.Dl.Icon?e.iconPriority:e.labelPriority,this.layer.type){case"labelLine":this.labelingGroup=this.layer.style.labelingGroup,this.groupPriority=this.layer.style.textPriority;break;case"oneWayLine":this.labelingGroup=this.layer.style.labelingGroup,this.groupPriority=this.layer.style.priority;break;case"point":if(e.pointType===n.a_.Commercial||e.pointType===n.a_.CommercialCity)if(r.has(this.label.id))this.commPriorityRandomFactor=r.get(this.label.id);else{const e=Math.random();this.commPriorityRandomFactor=e,r.set(this.label.id,e)}t===n.Dl.PoiText?(this.labelingGroup=this.layer.style.allowOverlap?o.R_:this.layer.style.textLabelingGroup,this.groupPriority=this.layer.style.iconImage?Math.min(this.layer.style.textPriority,this.layer.style.iconPriority):this.layer.style.textPriority,this.marginTopBottom=this.layer.style.textLabelingMargin.topBottom,this.marginLeftRight=this.layer.style.textLabelingMargin.leftRight):t===n.Dl.PoiText2?(this.labelingGroup=this.layer.style.allowOverlap?o.R_:this.layer.style.textLabelingGroup2,this.groupPriority=Math.min(this.layer.style.textPriority,this.layer.style.iconPriority),this.marginTopBottom=this.layer.style.textLabelingMargin.topBottom,this.marginLeftRight=this.layer.style.textLabelingMargin.leftRight):(this.labelingGroup=this.layer.style.allowOverlap?o.R_:this.layer.style.iconLabelingGroup,this.groupPriority=this.layer.style.iconPriority,this.marginTopBottom=this.layer.style.iconLabelingMargin.topBottom,this.marginLeftRight=this.layer.style.iconLabelingMargin.leftRight)}this.labelingGroupTable=c.labelingGroups.table,this.overflowStyleZoom=-1/0,this.boxes=[],this.placementIndex=0}getIconLabelPriorityToId(e){const{layer:t}=e;if("point"===t.type){return"_"+t.style.iconPriority.toFixed(0)+"_"+t.style.textPriority.toFixed(0)}return""}}},2109:(e,t,i)=>{var n=i(1525),o=i(3251),s=i(5569),r=i(2158),a=i(8016);function l(e,t,i){const n=e[t];if(void 0!==n)return n[i]}var c=i(7123);function d(e,t,i){const{minX:n,maxX:o,minY:s,maxY:r}=i;e.push(n,s,o-n,r-s,t)}function h(e,t,i,n){const o=e.anchorScreen,s=e.boxes[t];return{element:e,minX:o[0]+s[0]-i|0,maxX:o[0]+s[2]+i|0,minY:o[1]+s[1]-n|0,maxY:o[1]+s[3]+n|0}}function u(e,t){if(e.parent===t||e.firstLabel===t||t.parent===e||t.firstLabel===e)return!1;const i=e.labelingGroup,n=t.labelingGroup;return function(e,t,i,n){const o=l(e,i,n),s=l(t,i,n);return void 0===o&&void 0===s||(void 0===o?void 0===s||s:void 0===s?void 0===o||o:o||s)}(e.labelingGroupTable,t.labelingGroupTable,i,n)}function m(e,t,i,n,o,s){const r=h(t,i,n,o);if(r.minX>s.maxX||r.maxX<s.minX||r.minY>s.maxY||r.maxY<s.minY)return!0;const a=e.search(r);for(let e=0;e<a.length;e++)if(u(t,a[e].element))return!0;return!1}function f(e,t,i,n,o){if(m(t,e,0,n.leftRight,n.topBottom,i))e.placementIndex=-1,o&&d(o,a.m3.CommercialDead,h(e,0,n.leftRight,n.topBottom));else{e.placementIndex=0;const i=h(e,0,n.leftRight,n.topBottom);t.insert(i),o&&d(o,a.m3.CommercialAlive,i)}}function p(e,t,i,n,o){let s=!0;for(let n=0;n<e.boxes.length;n++)if(m(t,e,n,e.marginLeftRight,e.marginTopBottom,i)){if(s=!1,o)for(let t=0;t<e.boxes.length;t++){const i=h(e,t,e.marginLeftRight,e.marginTopBottom);let s;s=t===n?a.m3.Dead:t<n?a.m3.Alive:a.m3.Unused,d(o,s,i)}break}if(s)for(let i=0;i<e.boxes.length;i++){const n=h(e,i,e.marginLeftRight,e.marginTopBottom);t.insert(n),o&&d(o,a.m3.Alive,n)}e.placementIndex=s?0:-1}function _(e,t,i,n,o){e.placementIndex=-1;for(let n=0;n<e.boxes.length;n++)if(!e.firstLabel||e.firstLabel.placementIndex===n){if(!m(t,e,n,e.marginLeftRight,e.marginTopBottom,i)){const i=h(e,n,e.marginLeftRight,e.marginTopBottom);if(t.insert(i),e.placementIndex=n,o){d(o,a.m3.Alive,i);for(let t=n+1;t<e.boxes.length;t++)d(o,a.m3.Unused,h(e,t,e.marginLeftRight,e.marginTopBottom))}break}o&&d(o,a.m3.Dead,h(e,n,e.marginLeftRight,e.marginTopBottom))}}function v(e,t){return e.sort(((e,i)=>i.groupPriority-e.groupPriority||(t.has(i.id)?1:0)-(t.has(e.id)?1:0)||i.commPriorityRandomFactor-e.commPriorityRandomFactor))}function g(e){return e.type!==a.Dl.Box&&!Number.isNaN(e.commPriorityRandomFactor)}function y(e){return e.type!==a.Dl.Box&&!Number.isNaN(e.commPriorityRandomFactor)&&e.label.pointType===a.a_.CommercialCity}function b(e){return e.type!==a.Dl.Box&&!Number.isNaN(e.commPriorityRandomFactor)&&(e.label.pointType!==a.a_.CommercialCity||-1!==e.placementIndex&&e.label.pointType===a.a_.CommercialCity)}var w=i(341);class x{constructor(e,t,i){this.line=e,this.lengths=[],this.angles=[];let n=t,o=e[0],s=e[1];const r=e.length/3;for(let t=0;t<r;t++){const i=e[3*t]-o,r=e[3*t+1]-s;n+=Math.sqrt(i*i+r*r),this.lengths.push(n),o+=i,s+=r}this.finishLength=this.lengths[this.lengths.length-1],this.startLength=this.lengths[0],this.midLength=i/2,this.vertexCount=r,this.angles.push(0);for(let e=1;e<r;e++){const t=this.line[3*(e-1)],i=this.line[3*e],n=this.line[3*(e-1)+1],o=this.line[3*e+1];this.angles.push(Math.atan2(o-n,i-t))}}interpolate(e,t){const i=t,n=i-1,o=this.lengths[n],s=(e-o)/(this.lengths[i]-o);return[(1-s)*this.line[3*n]+s*this.line[3*i],(1-s)*this.line[3*n+1]+s*this.line[3*i+1],0,this.angles[t]]}getSegmentIndex(e){for(let t=0;t<this.lengths.length;t++)if(e<this.lengths[t])return t;return this.lengths.length}}class I{constructor(){this.labels={}}add(e){const t=e.id,i=e.componentDistanceStart;void 0===this.labels[t]&&(this.labels[t]={});const n=this.labels[t];void 0===n[i]&&(n[i]=[]),n[i].push(e)}merge(){const e=[];for(const t in this.labels){const i=this.labels[t],n=Object.keys(i).sort(((e,t)=>Number(e)-Number(t)));let o=0;for(;o<n.length;){const t=n[o];if(0===i[t].length){o++;continue}const s=[];let r=i[t].pop();for(;void 0!==r;)s.push(r),r=0===r.componentDistanceStart&&0===r.componentDistanceEnd||void 0===i[r.componentDistanceEnd]?void 0:i[r.componentDistanceEnd].pop();if(1===s.length){const t=s[0];t.axis=new x(t.mapPointVertices,t.componentDistanceStartWorld,t.objectLengthWorld),e.push(t)}else s.length>1&&e.push(this.stitch(s))}}return e}stitch(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i].mapPointVertices.length;t-=3*(e.length-1);const i=new Int32Array(t);let n=0;for(let t=0;t<e.length;t++){const o=e[t].mapPointVertices;for(let e=t>0?3:0;e<o.length;e++)i[n++]=o[e]}const o=e[0];return o.axis=new x(i,o.componentDistanceStartWorld,o.objectLengthWorld),e[0]}}var S=i(9016),M=i(378),T=i(9450),P=i(9899);class L{constructor(e,t,i,n,o,s,r,l,c,d,h,u){this.type=a.Dl.Box,this.marginTopBottom=0,this.marginLeftRight=0,this.id=String(e),this.label={layer:{innerId:0},styleId:-100,idLo:e,idHi:0,symbol:"nevermind",phase:NaN},this.groupPriority=null!=u?u:P.Rw,this.itemPriority=null!=h?h:1,this.parent=d,this.placementIndex=0,this.labelingGroup=c,this.labelingGroupTable=l.labelingGroups.table,this.anchorWorld=T.Ue(),T.JG(this.anchorWorld,n),this.anchorWorld[2]*=s,this.anchorScreen=r.project(this.anchorWorld),M.IH(this.anchorScreen,this.anchorScreen,o),this.boxes=[[0,0,t,i]]}}var E=i(5951),k=i(5849),z=i(1713),A=i(7768),C=i(9231),F=i(6554),R=i(3951);const D=(0,k.Id)(n.labeling.axisAngleToleranceDeg),O=n.labeling.axisCheckDistancePx,B=(0,k.Id)(n.labeling.lineLabelsHidePitchDeg);function j(e,t,i,n,o,s,r,l,c,d,h){const u=[],m=[],f=[],p=[],_={},v=function(e,t){const i={personalPoi:new Set,commercialPoi:new Set};for(const n of e){const e=t.get(n);if(void 0!==e)for(const t of e)t.source===a.AL.PersonalPoi?i.personalPoi.add(t.id):t.pointType!==a.a_.Commercial&&t.pointType!==a.a_.CommercialCity||i.commercialPoi.add(t.id)}return i}(e,o),g=new I;for(let s=0;s<e.length;s++){const u=e[s],m=o.get(u);if(void 0!==m)for(let e=0;e<m.length;e++){const o=m[e],s=n.getStyle(o.styleId);if(s){if(!(o.source===a.AL.Tile&&d.has(o.id)||o.source!==a.AL.PersonalPoi&&v.personalPoi.has(o.id)&&o.pointType!==a.a_.Commercial&&o.pointType!==a.a_.CommercialCity||o.source===a.AL.PersonalPoi&&v.commercialPoi.has(o.id)))switch(o.layer.type){case"point":if(N(o,r,l,t.styleState,t.styleZoom,s,h,t.elevation)&&X(o,t.styleZoom))if(o.geometryType===a._r.Line)g.add(o);else{const e=[o.mapPointVertices[0],o.mapPointVertices[1],o.mapPointVertices[2],0];U(p,f,_,o,e,i,t,s,c)}break;case"labelLine":N(o,r,l,t.styleState,t.styleZoom,s,h,t.elevation)&&X(o,t.styleZoom)&&g.add(o);break;case"oneWayLine":X(o,t.styleZoom)&&g.add(o)}}else console.error(`Not found style ${o.styleId} in labeling#collectLabelingElements`)}}const y=g.merge();for(let e=0;e<y.length;e++){const o=y[e],s=n.getStyle(o.styleId);s?"point"===o.layer.type?Z(p,f,_,o,s,i,t,c):H(m,p,o,s,i,t):console.error(`Not found style ${o.styleId} in labeling#collectLabelingElements`)}return s.forEach((({id:e,width:o,height:s,position:r,offset:a,labelingGroup:l,parentPoiId:c})=>{let d;if(c&&(d=_[c],!d))return;const h=n.getStyle(C.jf);if(!h)return void console.error(`Not found style ${C.jf} in labeling#collectLabelingElements`);const m=new L(e,o,s,r,a,t.buildingHeight,i,h,l,d,null==d?void 0:d.itemPriority,null==d?void 0:d.groupPriority);u.push(m)})),{boxElements:u,oneWayTileElements:m,noLabelingElements:f,otherTileElements:p}}function N(e,t,i,n,o,s,r,a){var l;const{layer:c}=e;if("point"!==c.type&&"labelLine"!==c.type)return!1;Number.isNaN(e.demElevation)?e.elevation=0:e.elevation=(e.demElevation-(null!=a?a:0))*E.k3;const d=(0,A.bs)(o,n,!1,e.tileData);if(R.rJ&&!e.rtlProcessed&&(e.label=null!==(l=(0,R.iY)(e.label))&&void 0!==l?l:"",e.label2=(0,R.iY)(e.label2),e.iconLabel=(0,R.iY)(e.iconLabel),e.updateRanges(),r(P.Uo,e.ranges),(0,A.EG)(c.style.textFont).forEach((t=>{t.length&&r(t,e.ranges)})),"point"===c.type&&c.style.textFont2&&(0,A.EG)(c.style.textFont2).forEach((t=>{t.length&&r(t,e.ranges)})),"point"===c.type&&c.style.iconTextFont&&(0,A.EG)(c.style.iconTextFont).forEach((t=>{t.length&&r(t,e.ranges)})),e.rtlProcessed=!0),!e.rtlProcessed)return!1;const{ranges:h}=e,u=(0,z.rq)(c.style.textFont,d,s);let m;if(u&&e.label&&(0,z.dm)(u,h,i)&&(m=(0,z.JA)(e.label,c.style.textLetterSpacing,t[u]),e.textMetrics=m),"labelLine"===c.type)return!u||!!m;const f=(0,z.rq)(c.style.iconTextFont,d,s);f&&e.iconLabel&&(0,z.dm)(f,h,i)&&(e.iconTextMetrics=(0,z.JA)(e.iconLabel,c.style.iconTextLetterSpacing,t[f]));const p=(0,z.rq)(c.style.textFont2,d,s);return u&&e.label&&p&&e.label2&&(0,z.dm)(p,h,i)&&(e.textMetrics2=(0,z.JA)(e.label2,c.style.textLetterSpacing,t[p])),u&&e.label?!(!m||f&&e.iconLabel&&!e.iconTextMetrics||p&&e.label2&&!e.textMetrics2):!f||!e.iconLabel||!!e.iconTextMetrics}function U(e,t,i,n,s,r,l,c,d){var h;(0,o.Pn)(n,s,c,n.layer,l,r,d);for(let o=0;o<n.labelingElements.length;o++){const s=n.labelingElements[o];s.labelingGroup!==F.R_&&(null===(h=s.parent)||void 0===h?void 0:h.labelingGroup)!==F.R_?(e.push(s),s.type===a.Dl.Icon&&(i[s.label.id]=s)):t.push(s)}}function Z(e,t,i,n,o,s,r,a){const{layer:l}=n;if("point"!==l.type)return;const{zoom:c,styleZoom:d}=r,h=Math.floor(d),u=c+(h-d),{startLength:m,midLength:f,finishLength:p}=n.axis,_=(0,A.bs)(h,r.styleState,!1,n.tileData),v=Math.max((0,E.h0)((0,A.vn)(l.style.duplicationSpacing,_),u),1),g=(0,E.h0)(l.style.endingOffsets,c),y=m+g,b=p-g;for(let l=m+(f-m)%v;l<b;l+=v)if(l>y){const c=n.axis,d=l,h=c.getSegmentIndex(d);U(e,t,i,n,c.interpolate(d,h),s,r,o,a)}}function H(e,t,i,o,s,r){const{layer:a}=i;if("labelLine"!==a.type&&"oneWayLine"!==a.type)return;const{zoom:l,styleZoom:c}=r,d=Math.floor(c),h=l+(d-c),{startLength:u,midLength:m,finishLength:f}=i.axis,p=(0,A.bs)(c,r.styleState,!1,i.tileData),_=(0,A.bs)(d,r.styleState,!1,i.tileData);let v,g,y,b;if("labelLine"===a.type){const e=(0,A.vn)(a.style.textFontSize,p)/n.fonts.baseSize,t=(0,A.vn)(a.style.textFontSize,_)/n.fonts.baseSize;v=i.textMetrics.maxWidth*e,g=i.textMetrics.maxWidth*t,y=(0,E.h0)((0,A.vn)(a.style.textDuplicationSpacing,_),h),b=(0,E.h0)(a.style.lineEndingOffsets,l)}else v=(0,A.vn)(a.style.lineLength,p),g=(0,A.vn)(a.style.lineLength,_),y=(0,E.h0)((0,A.vn)(a.style.duplicationSpacing,_),h),b=(0,E.h0)(a.style.endingOffsets,l);const w=(0,E.h0)(g,h),x=(0,E.h0)(v,l)/2,I=y+w,S=u+(m-u)%I,M=u+x+b,T=f-x-b,P="labelLine"!==a.type?e:t;for(let e=S;e<T;e+=I)e>M&&G(P,i,e,x,v,s,r,o)}function G(e,t,i,o,s,r,l,c){const d=t.axis,{zoom:h,styleZoom:u}=l,{startLength:m,finishLength:f}=d,p=d.getSegmentIndex(i),_=d.interpolate(i,p);if((0,E.gr)(r.position,_,l.center)>B||!function(e,t,i,o,s,r){if("oneWayLine"===e.layer.type)return!0;const a=e.axis,l=(0,A.bs)(s,r,!1,e.tileData),c=(0,A.vn)(e.layer.style.textFontSize,l)/n.fonts.baseSize,d=a.getSegmentIndex(t-i),h=a.getSegmentIndex(t+i),u=(0,E.h0)(O*c,o);for(let e=d;e<h;e++){if(e>1&&W(a.angles[e-1],a.angles[e])>D)return!1;const t=a.getSegmentIndex(a.lengths[e]-u);if(0!==t){if(W(a.angles[t],a.angles[a.getSegmentIndex(a.lengths[e]+u)])>D)return!1}}return!0}(t,i,o,h,u,l.styleState))return;const v="oneWayLine"===t.layer.type,g=v?a.Dl.OneWayLine:a.Dl.LineText,y=new S.x(t,g,_,l.buildingHeight,r,c);y.anchorPosition=i,y.anchorSegmentIndex=p,y.halfLabelWidth=o,v||(y.overflowStyleZoom=(0,E.X$)((0,E.to)(s,f-m),_),function(e,t,i,n,o,s){const{axis:r,layer:a}=t;if("labelLine"!==a.type)return;const{zoom:l,styleZoom:c}=o,d=(0,A.bs)(c,o.styleState,!1,t.tileData),h=(0,A.vn)(a.style.textFontSize,d),u=h/2,m=(0,E.h0)(h,l),f=(0,E.h0)(a.style.textLabelingSideMargin,l),p=i-n+m/2-f,_=i+n-m/2+f;let v=r.getSegmentIndex(p);for(let t=p;t<_;t+=m){for(;r.lengths[v]<t;)v++;q(e,r,t,v,s,u)}for(;r.lengths[v]<_;)v++;q(e,r,_,v,s,u)}(y,t,i,o,l,r)),e.push(y)}function W(e,t){const i=Math.abs(e-t);return i>Math.PI?2*Math.PI-i:i}const V=[0,0];function q(e,t,i,n,o,s){o.putProject(V,t.interpolate(i,n)),V[0]=V[0]-e.anchorScreen[0],V[1]=V[1]-e.anchorScreen[1],e.boxes.push([V[0]-s,V[1]-s,V[0]+s,V[1]+s])}function X(e,t){const{source:i,detailLevel:o,layer:{minzoom:s,maxzoom:r}}=e,l=i===a.AL.PersonalPoi,c=l||s>o,d=l||r<o+1||o===n.tiles.maxDetailLevel;return(!c||t>=s)&&(!d||t<r)}var $=i(5147),Y=i(9472),K=i(8426),J=i(8047),Q=i(5314),ee=i(6451),te=i(7090),ie=i(3220);const ne=new Map;!function(e){const t=new $.D(e),i=new Y.J(t),l=new w.P("labeling"),d=new Q.h,h=i.get(J.P.Main,"loadFont"),u=new Map,m=new Map;let x=[],I=new Map;const S=new K.c,M=new K.c,T={},P=(0,s.D)((()=>l.reset()),n.workerResetDebounceTime);function L(e,t){for(const i of t)S.has(e,i)||(h(e,i),S.set(e,i,!0))}function E(e,t,i){if(e.has(i.label.sourceId))return 0;const n=t.get(i.id);return void 0===n||void 0===n.placementIndex||n.type===a.Dl.Icon&&n.layer.innerId!==i.layer.innerId?1:n.placementIndex===i.placementIndex?0:1}i.set("appendLabels",((e,t,i,n,o)=>{const s=(0,r.v)(i,t,d,n,o);u.set(e,s)})),i.set("appendLabelBox",((e,t)=>{m.set(e,t)})),i.set("removeEmptyBoxLabel",(e=>{m.delete(e)})),i.set("removeLabels",(e=>{u.delete(e),m.delete(e)})),i.set("processLabels",((e,t,i,s,h,w,S,k)=>{const z=new Set(w),A=new ie.V(i),C=new Set,F=t;e.forEach((({sourceId:e,animate:t,labelsKeys:i})=>{t||C.add(e),F.push(...i)}));const{boxElements:R,oneWayTileElements:D,otherTileElements:O,noLabelingElements:B}=j(F,i,A,d,u,m,T,M,h,z,L),N=function(e,t,i,o){const s=t.debugLabels?[]:void 0,{size:l,viewport:d}=t,h=l[0],u=l[1],m=(n.labeling.tileMultiplier-1)/2,w=Math.round(h*m),x=Math.round(u*m),I={minX:d.left-w,maxX:d.left+h+w,minY:d.top-x,maxY:d.top+u+x},S=c();v(e.filter(y),i).forEach((e=>{f(e,S,I,o.city,s)})),S.clear(),v(e.filter(b),i).forEach((e=>{f(e,S,I,o.default,s)})),S.clear();const M=e.sort(((e,t)=>{const n=e.label instanceof r._?e.label.hovered:0,o=t.label instanceof r._?t.label.hovered:0;return t.groupPriority-e.groupPriority||(g(t)?1:0)-(g(e)?1:0)||(i.has(t.id)?1:0)-(i.has(e.id)?1:0)||o-n||t.itemPriority-e.itemPriority||t.label.idHi-e.label.idHi||t.label.idLo-e.label.idLo||t.label.layer.innerId-e.label.layer.innerId||t.anchorWorld[0]-e.anchorWorld[0]||t.anchorWorld[1]-e.anchorWorld[1]}));for(let e=0;e<M.length;e++){const t=M[e];if(-1!==t.placementIndex)switch(t.type){case a.Dl.LineText:case a.Dl.Icon:p(t,S,I,0,s);break;case a.Dl.Box:if(!t.parent||t.parent&&-1!==t.parent.placementIndex){p(t,S,I,0,s);break}t.placementIndex=-1;break;case a.Dl.PoiText:case a.Dl.PoiText2:t.parent&&-1===t.parent.placementIndex||t.firstLabel&&-1===t.firstLabel.placementIndex?t.placementIndex=-1:_(t,S,I,0,s)}}return s}([...O,...R],i,k?ne:I,S),U=[...B,...D,...O],Z=new Map;for(let e=0;e<U.length;e++){const t=U[e];-1!==t.placementIndex&&Z.set(t.id,t)}for(let e=0;e<U.length;e++){const t=U[e],{label:{styleId:n,layer:r}}=t;if(-1===t.placementIndex)continue;const a=E(C,I,t),c=d.getStyle(n);c?(0,o.SV)(c,r,l,t,a,h,i,s):console.error(`Not found style ${n} in labeling#processLabels`)}for(let e=0;e<x.length;e++){const t=x[e],{id:n,label:r,layer:c}=t,{styleId:u}=r,m=d.getStyle(u);if(!m){console.error(`Not found style ${u} in labeling#processLabels`);continue}if(C.has(t.label.sourceId))continue;const f=t.placementIndex,p=Z.get(n);-1!==f&&(t.placementIndex!==(null==p?void 0:p.placementIndex)||t.type===a.Dl.Icon&&t.layer.innerId!==(null==p?void 0:p.layer.innerId))&&(i.styleZoom<t.overflowStyleZoom||i.styleZoom<c.minzoom||i.styleZoom>=c.maxzoom||(0,o.SV)(m,c,l,t,-1,h,i,s))}x=U,I=Z;const H=l.getAccumulatedData(),G=[];for(const e of R)-1!==e.placementIndex&&G.push(e.label.idLo);const W=new Set,V=(0,ee.BS)(i.tilesBounds);for(const e of O)-1!==e.placementIndex&&g(e)&&te.r3(V,e.anchorWorld)&&W.add(e.label.id);const q={survivedLabelBoxIds:G,survivedCommPoiIds:Array.from(W),collectorOutput:H,transferable:H.transferable};if(N){const e=new Int32Array(N.length);e.set(N),q.labels=e.buffer}return P(),q})),i.set("appendFont",((e,t)=>{T[e]||(T[e]={});const i=T[e];for(const e in t)i[e]=t[e]})),i.set("markFontAsLoaded",((e,t)=>{M.set(e,t,!0)})),i.set("addNewRasterSets",((e,t)=>{const i=d.getStyle(e);if(!i)return void console.error(`Not found style ${e} in labeling#addNewRasterSets`);const{rasterSets:n}=i;t.forEach((e=>{n.byIndex[e.index]=e,n.byKey[e.key]=e}))})),i.set("updatePackingInfo",((e,t)=>{const i=d.getStyle(e);if(!i)return void console.error(`Not found style ${e} in labeling#updatePackingInfo`);const{rasterSets:n}=i,o=t.length/7;for(let e=0;e<o;e++){const i=t[7*e],o=t[7*e+1],s=t[7*e+6],r=t[7*e+2],a=t[7*e+3],l=t[7*e+4],c=t[7*e+5],d=n.byIndex[i];if(void 0!==d)if(d.isSvg)d.rasters[o]={rasterIndex:o,rasterSetIndex:i,x:r,y:a,w:l,h:c,anchorX:d.anchorX,anchorY:d.anchorY,atlasIndex:s,isPacked:!0};else{const e=d.rasters[o];if(void 0===e){console.error(`Not found raster with index ${o} and raster set index ${i}`);continue}e.x=r,e.y=a,e.atlasIndex=s,e.isPacked=!0}else console.error(`Not found raster set with index ${i}`)}})),i.set("clearPreviousLabels",(()=>{x=[],I.clear()})),i.set("syncStyle",((...e)=>d.proxySyncStyle(...e))),i.set("loadRtlPlugin",R.ng),i.set("markRtlPluginLoaded",(()=>{R.dp&&(0,R.dp)()}))}(self)},2158:(e,t,i)=>{i.d(t,{v:()=>d,_:()=>h});var n=i(9394),o=i(8631),s=i(8016),r=i(7618),a=i(6743),l=i(8072);function c(e){return"labelLine"===e.type||"point"===e.type||"oneWayLine"===e.type}function d(e,t,i,n,o){const s=[];for(const r of e)for(const e of r.labels){const l=i.getStyle(e.styleId);if(!l){console.error(`Not found style ${e.styleId} in unpackPreLabelingResult`);continue}const d=l.layersById[e.layerId];if(!d||!c(d)){console.error(`Not found layer: ${e.layerId} in style ${e.styleId} in unpackPreLabelingResult`);continue}const u=new h(e,d,t,r.metatileHash);switch(e.type){case a.R2.Point:u.setSpecificPointAttributes(e,n,o);break;case a.R2.Line:u.setSpecificLineAttributes(e,n,o);break;case a.R2.OneWayLine:u.setSpecificOneWayAttributes(e)}s.push(u)}return s}class h{constructor(e,t,i,n){this.rtlProcessed=!1,this.labelingElements=[],this.id="",this.idLo=0,this.idHi=0,this.detailLevel=0,this.labelPriority=0,this.label="",this.ranges=[],this.pointType=s.a_.Common,this.iconPriority=0,this.identifyIndex=l.gl,this.identifyPoiLabelIndex=l.gl,this.hovered=0,this.label2Priority=0,this.mapPointVertices=[0,0,0],this.demElevation=0,this.elevation=0,this.componentDistanceStartWorld=0,this.componentDistanceEnd=0,this.componentDistanceStart=0,this.objectLengthWorld=0,this.layer=t,this.styleId=e.styleId,this.source=i,this.sourceId=e.sourceId,this.metatileHash=n,this.geometryType=e.type===a.R2.Point?e.geometryType:s._r.Line,this.tileData=e.tileData,this.labelPriority=e.labelPriority,this.detailLevel=e.tileCoords[2],this.idLo=e.id.lo,this.idHi=e.id.hi,this.id=(0,o.Ak)(e.id)}setSpecificPointAttributes(e,t,i){if("point"!==this.layer.type)throw new Error("Label: layer type is not a point");const o=this.layer.style;this.pointType=e.pointType,this.label2Priority=e.label2Priority,this.iconPriority=e.iconPriority,this.identifyIndex=e.identifyIndex,this.identifyPoiLabelIndex=e.identifyPoiLabelIndex,this.hovered=e.hovered,this.demElevation=e.demElevation;const l={type:"labeling",interpolateExpressionAsStep:!0,tileData:e.tileData,styleState:t,styleZoom:i};this.label=(0,n.lD)((0,a.It)(o.textField,l),o.textMaxLengthPerLine),o.textField2&&(this.label2=(0,n.lD)((0,a.It)(o.textField2,l),o.textMaxLengthPerLine)),"point"===this.layer.type&&o.iconTextField&&(this.iconLabel=(0,n.lD)((0,a.It)(o.iconTextField,l),o.textMaxLengthPerLine));const c=(0,r.Bs)(e.tileCoords);this.mapPointVertices=[];const d=[0,0,0],h=[0,0,0];if(e.geometryType===s._r.Point)(0,r.L7)(this.mapPointVertices,e.vertices,0,c),this.layer.style.allowElevation||(this.mapPointVertices[2]=0);else{for(let t=0;t<e.vertices[0].length;t++)d[0]=e.vertices[0][t],d[1]=e.vertices[1][t],(0,r.Z$)(h,d,c),this.mapPointVertices.push(h[0],h[1],h[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,r.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,r.C5)(e.objectLength,e.tileCoords[2])}}setSpecificLineAttributes(e,t,i){if("labelLine"!==this.layer.type)throw new Error("Label: layer type is not a labelLine");const n={type:"labeling",interpolateExpressionAsStep:!0,tileData:e.tileData,styleState:t,styleZoom:i};this.label=(0,a.It)(this.layer.style.textField,n);const o=(0,r.Bs)(e.tileCoords);this.mapPointVertices=[];const s=[0,0,0],l=[0,0,0];for(let t=0;t<e.vertices[0].length;t++)s[0]=e.vertices[0][t],s[1]=e.vertices[1][t],(0,r.Z$)(l,s,o),this.mapPointVertices.push(l[0],l[1],l[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,r.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,r.C5)(e.objectLength,e.tileCoords[2])}setSpecificOneWayAttributes(e){const t=(0,r.Bs)(e.tileCoords);this.mapPointVertices=[];const i=[0,0,0],n=[0,0,0];for(let o=0;o<e.vertices[0].length;o++)i[0]=e.vertices[0][o],i[1]=e.vertices[1][o],(0,r.Z$)(n,i,t),this.mapPointVertices.push(n[0],n[1],n[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,r.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,r.C5)(e.objectLength,e.tileCoords[2])}updateRanges(){this.ranges=(0,n.Go)([this.label,this.label2,this.iconLabel])}}},3893:(e,t,i)=>{var n=i(6208),o=i.n(n),s=i(5569),r=i(1525),a=i(9899),l=i(7084),c=i(495),d=i(3386),h=i(8631),u=i(6723),m=i(2847),f=i(7768),p=i(752),_=i(504),v=i(9110),g=i(8729);const y=[a.Bq/2,a.Bq/2],b=[[0],[0],[0]],w=[[0],[0],[0]];function x(e,t,i,n,o,s,a,d){const{tileProps:u}=i,m=(0,h.IL)(e.floorId);t[u.db_height]=r.floors.islandHeight,t[u.db_sublayer]=e.areaSublayer,t[u.selected]=d?1:0,t[u.db_region]=a,n.layers.forEach((r=>{if("polygonExtrusion"!==r.type)return;if((0,f.FR)(r.filter,(0,f.ci)(i,o,g.i4,u,t,[])))for(let a=0;a<e.area.length;a++){const d=T(e.area[a]),{x:h,y:f}=M(d),p=l(d);b[0].length=0,b[1].length=0,b[2].length=0;for(let e=0;e<p.length;e+=3){for(let t=0;t<3;t++)b[0][t]=h[p[e+t]],b[1][t]=f[p[e+t]],b[2][t]=1;do{c.p.generate(s,n.id,r,i,o,g.i4,u,t,g.wz,b,!1,void 0,void 0,m)}while(s.isOverloaded())}}}))}function I(e,t,i,n,o,s,r,a){const{tileProps:c}=i,d=(0,h.IL)(e.floorId);t[c.db_sublayer]=e.areaSublayer,t[c.selected]=a?1:0,t[c.db_region]=r,n.layers.forEach((r=>{if("polygon"!==r.type)return;if((0,f.FR)(r.filter,(0,f.ci)(i,o,g.i4,c,t,[])))for(let i=0;i<e.area.length;i++){const o=T(e.area[i]),{x:a,y:h}=M(o),u=l(o);b[0].length=0,b[1].length=0,b[2].length=0;for(let e=0;e<u.length;e+=3){for(let t=0;t<3;t++)b[0][t]=a[u[e+t]],b[1][t]=h[u[e+t]],b[2][t]=0;do{p.a.generate(s,n.id,r,c,t,g.wz,g.i4,b,void 0,d)}while(s.isOverloaded())}}}))}function S(e,t,i,n,o,s,a,l){if(!e.wallSublayer)return;const{tileProps:d}=i,u=(0,h.IL)(e.floorId);t[d.db_height]=r.floors.wallHeight,t[d.db_sublayer]=e.wallSublayer,t[d.selected]=l?1:0,t[d.db_region]=a,n.layers.forEach((r=>{if("polygonExtrusion"!==r.type)return;if((0,f.FR)(r.filter,(0,f.ci)(i,o,g.i4,d,t,g.wz)))for(let a=0;a<e.wallTop.length;a++){const l=T(e.wallTop[a]),{x:h,y:f,count:p}=M(l);b[0].length=0,b[1].length=0,b[2].length=0;for(let e=0;e<p;e++){const t=(0,m.X)(e,p);b[0][t]=h[e],b[1][t]=f[e],b[2][t]=1}do{c.p.generate(s,n.id,r,i,o,g.i4,d,t,g.wz,b,!1,void 0,y,u)}while(s.isOverloaded())}}))}function M(e){const t=[],i=[];for(let n=0;n<e.length/2;n++)t[n]=e[2*n],i[n]=e[2*n+1];return{x:t,y:i,count:t.length}}function T(e){const t=new Uint16Array(e.length/2);for(let i=0;i<e.length/2;i++)t[i]=e[2*i]|e[2*i+1]<<8;return t}var P=i(9450),L=i(127),E=i(505);const k={1:function(e){let t=0;for(let i=0;i<e.length;i++)t=t+e[i]&255,e[i]=t},2:function(e){let t=0;for(let i=0;i<e.length;i++)t=t+e[i]&65535,e[i]=t},4:function(e){let t=0;for(let i=0;i<e.length;i++)t=t+e[i]>>>0,e[i]=t},8:function(e){let t=0,i=0,n=0;for(let o=0;o<e.length;o+=2)n=i+e[o],i=n>>>0,e[o]=i,t=t+e[o+1]+(n>4294967295?1:0)>>>0,e[o+1]=t}};class z{constructor(e){this.offset=0,this.buffer=e,this.u8=new Uint8Array(e),this.u16=new Uint16Array(e),this.u32=new Uint32Array(e),this.s8=new Int8Array(e),this.s16=new Int16Array(e),this.s32=new Int32Array(e),this.f32=new Float32Array(e)}readS8(){return this.s8[this.offset++]}readU16(){const e=this.u16[this.offset>>1];return this.offset+=2,e}readU32(){const e=this.u32[this.offset>>2];return this.offset+=4,e}readF32(){const e=this.f32[this.offset>>2];return this.offset+=4,e}readU8Vector(e=1){const t=this.readU32()*e,i=3&-t,n=this.u8.subarray(this.offset,this.offset+t);return this.offset+=t+i,n}readU16Vector(e=1){const t=this.readU32()*e*2,i=3&-t,n=this.u16.subarray(this.offset>>1,this.offset+t>>1);return this.offset+=t+i,n}}function A(e,t,i,n){const o=t.BYTES_PER_ELEMENT;e.offset+=-e.offset&o-1;const s=new t(e.buffer,e.offset,i);return e.offset+=o*i,n&&k[o](s),s}function C(e,t,i){e.offset+=7&-e.offset;const n=new Uint32Array(e.buffer,e.offset,2*t);return e.offset+=8*t,i&&k[8](n),n}function F(e,t,i){e.offset+=3&-e.offset;const n=new Uint32Array(e.buffer,e.offset,t),o=new Float32Array(e.buffer,e.offset,t);let s;if(e.offset+=4*t,i){let e=0;for(s=0;s<t;s++)e=e+n[s]>>>0,o[s]=e/1e3}else for(s=0;s<t;s++)o[s]=n[s]/1e3;return o}function R(e,t,i){e.offset+=3&-e.offset;const n=new Int32Array(e.buffer,e.offset,t),o=new Float32Array(e.buffer,e.offset,t);let s;if(e.offset+=4*t,i){let e=0;for(s=0;s<t;s++)e=e+n[s]>>>0,o[s]=(0|e)/1e3}else for(s=0;s<t;s++)o[s]=n[s]/1e3;return o}function D(e,t,i){switch(i){case 2:case 10:return A(e,Uint8Array,t);case 3:return A(e,Uint8Array,t,!0);case 4:return A(e,Uint16Array,t);case 5:return A(e,Uint16Array,t,!0);case 6:case 25:return A(e,Uint32Array,t);case 7:return A(e,Uint32Array,t,!0);case 8:case 19:return C(e,t);case 9:case 20:return C(e,t,!0);case 11:return function(e,t){let i=e.offset;const n=e.u8,o=e.buffer,s=[];for(;t--;)s.push(0|n[i++]);const r=[];for(;++t<s.length;){let e=s[t];255===e&&(e=n[i++]|n[i++]<<8|n[i++]<<16|0),r.push(new Uint8Array(o,i,e)),i+=e}return e.offset=i,r}(e,t);case 12:return function(e,t){e.offset+=3&-e.offset;let i=e.offset;const n=e.u32,o=e.buffer,s=[];for(let e=0;e<t;e++)s.push(n[i>>2]),i+=4;const r=[];for(let e=0;e<t;e++){const t=s[e];i+=7&-i,r.push(new Uint8Array(o,i,t)),i+=t}return e.offset=i,r}(e,t);case 13:return A(e,Int8Array,t);case 14:return A(e,Int8Array,t,!0);case 15:return A(e,Int16Array,t);case 16:return A(e,Int16Array,t,!0);case 17:return A(e,Int32Array,t);case 18:return A(e,Int32Array,t,!0);case 21:return F(e,t);case 22:return F(e,t,!0);case 23:return R(e,t);case 24:return R(e,t,!0);default:throw new Error("Unknown stream type "+i)}}function O(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i];return t}function B(e,t,i){return new e.constructor(e.buffer,e.byteOffset+t*e.BYTES_PER_ELEMENT,i)}function j(e,t,i,n,o,s,r,a){const{matrix:l,offset:c,id:d,selected:h}=o,u=new z(n),m=[];if(!e)return{objects:i.getAccumulatedData(),textures:m};if(1296191066!==u.readU32()||1!==u.readU16())return{objects:i.getAccumulatedData(),textures:[]};u.readU16();const p=u.readU32();for(let e=0;e<p;e++)m.push(u.readU8Vector());const{tileProps:_}=s,v=[],y=Object.keys(_).length;for(let e=0;e<y;e++)v[e]=NaN;if(v[_.db_sublayer]="Building_model",v[_.id]=d,v[_.selected]=h?1:0,v[_.db_region]=r,a.featureAttrs.size>0){const e=Array.from(a.featureAttrs);(0,g.Qy)(s,e)}const b=new Array,w="number"!=typeof d&&a.get(d.hi,d.lo);if(w)for(const e in w)a.clearAttrs=!1,b[_[e]]=w[e];else if(!1===a.clearAttrs){a.clearAttrs=!0;for(const e in _)b[_[e]]&&(b[_[e]]=NaN)}i.setGeoIds(new Uint32Array([d.lo,d.hi]));const x=u.offset;return e.layers.forEach((n=>{if("buildingModel"!==n.type)return;(0,f.FR)(n.filter,(0,f.ci)(s,t,g.i4,_,v,b))&&(u.offset=x,function(e,t,i,n,o,s,r,a,l){const c=n.readU32();for(let d=0;d<c;d++){const c=n.readU32(),d=P.al(n.readF32(),n.readF32(),n.readF32()),h=P.al(n.readF32(),n.readF32(),n.readF32()),u=P.lu(P.Ue(),h,d),m=L.Ue();L.Iu(m,o,d),L.bA(m,m,u),m[12]+=s[0],m[13]+=s[1];const f=n.readU16Vector(5),p=n.readU32();for(let o=0;o<p;o++){const o=n.readU32(),s=n.readU16Vector();do{E.X.processSubmesh(e.id,t,r,i,a,l,f,s,o,c,m)}while(i.isOverloaded())}const _=n.readU16Vector();do{E.X.processOuterEdge(e.id,t,r,i,a,l,f,_,m)}while(i.isOverloaded())}}(e,n,i,u,l,c,s,v,b))})),{objects:i.getAccumulatedData(),textures:m}}var N=i(3251),U=i(7618),Z=i(9394);const H=[],G=new Int32Array(256);let W;const V=[],q=[],X=[0,0,0,0,0];let $=0,Y=0,K=0;const J=[];function Q(e,t,i,n,o,s,r,a,l,c,d){const{tileInfo:h,pixelRatio:m,selectedIds:f,floorsEnabled:p,hoverId:_,generateOnlySelectedPoi:y,generateOnlyHoveredPoi:b}=s,{data:w}=r,x=new u.c(f),I=(0,U.VV)(w);if(I.byteLength<8)return o.getAccumulatedData();H.length=0;const S=new z(I);if(1279676242!==S.readU32())return o.getAccumulatedData();if(2!==S.readU16())return console.error("Unsupported tile format version"),o.getAccumulatedData();S.readU16();const{coords:M}=h,T=(0,v.o1)(m);return function(e){const t=e.u8;let i=e.offset,n=e.u32[i>>2];i+=4,$=n,Y=i;for(;n--;)i=2*t[i++]+i,i=t[i++]+i;e.offset=i+(3&-i)}(S),function(e){const t=e.u32[e.offset>>2];e.offset+=4,W=A(e,Uint8Array,t);const i=A(e,Uint32Array,t);for(let n=0;n<t;n++){const t=W[n];H[n]=D(e,i[n],t),G[n]=0}}(S),function(e,t,i,n,o,s,r,a,l,c,d,h,u,m,f,p,_){const v=Array.from(n.featureAttrs),y=new Array;(0,g.Qy)(c,v);const b=$,w=A(s,Int32Array,b),x=O(w),I=A(s,Uint8Array,x,!0),S=A(s,Uint8Array,O(I),!0),M=A(s,Uint8Array,x,!0),T=A(s,Uint8Array,O(M),!0),P=A(s,Uint16Array,x,!0);let L=0,E=0,k=0;for(let v=0;v<b;v++){const g=w[v];if(ne(s,c,d),0===v){const e=H[q[1]];o.setGeoIds(e)}for(let s=0;s<g;s++){const s=I[L];s>0&&(ee(d,s,S,E,c),E+=s);const v=M[L];v>0&&(te(d,v,T,k),k+=v);const g=P[L];g>0&&ie(e,t,i,n,o,g,r,a,l,c,d,y,h,u,m,f,p,_),L++}}oe()}(e,t,i,n,o,S,M,T,x,a,l,c,p,d,_,y,b),o.getAccumulatedData()}function ee(e,t,i,n,o){for(var s;t--;){const t=i[n++],r=q[t],a=V[t],l=W[r];if(8===l||9===l||19===l||20===l)e[a]=(0,h.Ru)(H[r][G[r]],H[r][G[r]+1]),G[r]+=2;else{const t=H[r][G[r]];switch(a){case o.tileProps.db_label:case o.tileProps.db_label2:e[a]=(0,Z.zT)(t);break;default:{const i=o.tilePropsByIndex[a];i&&o.reverseDictionaries[i]?e[a]=null!==(s=o.reverseDictionaries[i][t])&&void 0!==s?s:t:e[a]=t}}G[r]++}}}function te(e,t,i,n){for(;t--;){const t=i[n++];e[V[t]]=NaN}}function ie(e,t,i,n,o,s,a,l,c,u,m,p,_,v,y,b,w,x){const{tileProps:I,defaultProps:S}=u,M=a[3];for(let e=0;e<K;e++){const t=X[e];J[e]=B(H[t],G[t],s),G[t]=G[t]+s}if(void 0!==I.db_sublayer&&!Number.isNaN(m[I.db_sublayer])&&(0,d.Ty)(m[I.db_sublayer]))return;const T=m[I.id];let P="number"!=typeof T&&c.has(T);w&&(P=!0);let L=!!x;if(!L&&void 0!==b){if("number"==typeof T||!(0,h.v7)(b,T))return;L=!0}m[I.selected]=P?1:0,m[I.hovered]=L?1:0;for(const e in S){const t=S[e];Number.isNaN(m[t.index])&&(m[t.index]=t.value)}if("number"!=typeof T&&v&&m[I.db_hidden_by_plan_building_id]&&M>=Math.floor(r.floors.displayStyleZoom)&&(_.add(T),o.addFloorHidingMap(T,m[I.db_hidden_by_plan_building_id])),n.featureAttrs.size>0){const e="number"!=typeof T&&n.get(T.hi,T.lo);if(e)for(const t in e)I[t]&&(n.clearAttrs=!1,p[I[t]]=e[t]);else if(!1===n.clearAttrs){n.clearAttrs=!0;for(const e in I)p[I[e]]&&(p[I[e]]=NaN)}}const E=(0,f.ci)(u,i,g.i4,I,m,p),k=t.getLayers(e.id,I,m).filter((e=>(0,f.FR)(e.filter,E)));(0,N.PA)(o,e,k,M,u,I,m,p,y,g.i4,i,a,l,J,_,w||x)}function ne(e,t,i){const n=Object.keys(t.tileProps).length,o=e.u8;let s,r,a=Y;for(r=1;r<n;r++)i[r]=NaN;for(s=o[a++],r=0;r<s;r++)V[r]=o[a++],q[r]=o[a++];for(s=o[a++],r=0;r<s;r++)X[r]=o[a++];K=s,Y=a,oe()}function oe(){J.length=0}var se=i(341),re=i(3734),ae=i(4362),le=i(3990),ce=i(5147),de=i(9472),he=i(8047);class ue{constructor(){this.cache=new Map,this.pendingRequests=new Map}fetch({coords:e,tileServer:t,tileSet:i,tileProtocol:n,subdomains:o,tileKey:s,appId:r,lang:a,defaultLang:l,sessionId:c}){return new Promise((d=>{const h=(0,U.rL)(t,i,n,o,e,s,r,a,l,c),u=(0,U.gx)(e),m=(0,re.n)({url:h},((e,t)=>{let i=!1;if(this.pendingRequests.delete(u),void 0!==e||0===t.byteLength)return void 0!==e&&(console.error(e),403===e.status&&(i=!0)),this.cache.set(u,[]),void d({metadata:[],invalidTileKey:i});const n=(0,U.CJ)(t),o=(0,U.xH)(n);this.cache.set(u,n),d({metadata:o,invalidTileKey:i})}));this.pendingRequests.set(u,{xhr:m,resolve:d})}))}get(e){return this.cache.get(e)||[]}delete(e){this.cache.delete(e)}abortRequest(e){const t=this.pendingRequests.get(e);void 0!==t&&(t.xhr.abort(),t.resolve(),this.pendingRequests.delete(e))}}var me=i(7090),fe=i(5951);let pe=[];var _e=i(7018);class ve{constructor(){this.cache=new Map,this.pendingRequests=new Map}fetch(e,t,i,n,o){return new Promise((s=>{const r=ge(e,n,o,t,i),a=(0,U.gx)(e),l=(0,re.L)({url:r},((e,t)=>{if(this.pendingRequests.delete(a),void 0!==e)return 204!==e.status&&console.error(e),this.cache.set(a,void 0),void s();const i=t[0];i?this.cache.set(a,i):this.cache.set(a,void 0),s()}));this.pendingRequests.set(a,{xhr:l,resolve:s})}))}get(e){return this.cache.get(e)}delete(e){this.cache.delete(e)}abortRequest(e){const t=this.pendingRequests.get(e);void 0!==t&&(t.xhr.abort(),t.resolve(),this.pendingRequests.delete(e))}}function ge(e,t,i,n,o){const s=Math.pow(2,e[2])-1,a=e[0],l=(16777215&s-e[1])*(1<<24)+(16777215&a);return(0,_e.XK)(r.traffic.url,{protocol:o,host:n,z:String(e[2]),tiles:String(l),regions:t.join(","),time:String(i)})}var ye=i(5314),be=i(881);class we extends be.g{constructor(e){super(),this.obClassEnumIndex=0,this.sublayerEnumIndex=0,this.workerParserSyncMetatile=e.get(he.P.Main,"syncMetatile")}addData(e){this.dictionaries.db_sublayer||(this.dictionaries.db_sublayer={},this.reverseDictionaries.db_sublayer={}),e.sublayers.forEach((e=>{if(void 0===this.dictionaries.db_sublayer[e]){const t=this.sublayerEnumIndex++;this.dictionaries.db_sublayer[e]=t,this.reverseDictionaries.db_sublayer[t]=e}})),this.dictionaries.db_object_class||(this.dictionaries.db_object_class={},this.reverseDictionaries.db_object_class={}),e.objectClasses.forEach((e=>{if(void 0===this.dictionaries.db_object_class[e]){const t=this.obClassEnumIndex++;this.dictionaries.db_object_class[e]=t,this.reverseDictionaries.db_object_class[t]=e}})),this.workerParserSyncMetatile({dictionaries:this.dictionaries,reverseDictionaries:this.reverseDictionaries})}}i(8674),i(9231);var xe=i(9638),Ie=i(8675),Se=i(8426);class Me extends Se.c{constructor(e){super(e),this.featureAttrs=(null==e?void 0:e.featureAttrs)||new Set,this.clearAttrs=!0}set(e,t,i){super.set(e,t,i),Object.keys(i).forEach((e=>this.featureAttrs.add(e)))}}!function(e){const t=new ce.D(e),i=new de.J(t),n=new xe.Z(i),l=new ue,c=new ve,m=new ye.h,p={main:{addNewRasterSets:i.get(he.P.Main,"addNewRasterSets")},labeling:{addNewRasterSets:i.get(he.P.Labeling,"addNewRasterSets")}},y={},b=new u.c,M={},T=new se.P("parser"),L=[];let E=new Me;const k=()=>{const e=T.atlasPacker.getNewRasterSets();e.size&&e.forEach(((e,t)=>{p.main.addNewRasterSets(t,e),p.labeling.addNewRasterSets(t,e)}))},z=(0,s.D)((()=>T.reset()),r.workerResetDebounceTime),A={sources:{},collector:T,styleManager:m,syncNewRasterSets:k,debouncedResetCollector:z};n.set("GeoJsonSource",Ie.T,A);const C=(e,t)=>{y[e]=t};i.set("setMetatile",C);const F=new we(i);C(a.DL,F),i.set("appendHiddenObjectIds",(e=>{e.forEach((e=>b.add(e)))})),i.set("prepareAtlas",(t=>new Promise((i=>{(0,re.n)({url:t},((t,n)=>{if(t||0===n.byteLength)i(void 0);else if(e.createImageBitmap){const e=new Blob([n],{type:"image/png"});createImageBitmap(e).then((e=>{i({isBitmap:!0,data:[e],transferable:[e]})}))}else i({isBitmap:!1,data:[n],transferable:[n]})}))})))),i.set("fetchTile",(e=>l.fetch(e))),i.set("deleteTile",(e=>{l.delete(e)})),i.set("abortTileRequest",(e=>{l.abortRequest(e)})),i.set("setFeatureStateMapToZenith",(e=>{E=new Me,Object.keys(e).forEach((t=>{const i=(0,h.IL)(t);E.set(i.hi,i.lo,e[t])}))})),i.set("generateTile",(e=>{const{tileInfo:t}=e,{coords:i}=t,n=(0,U.gx)(i),o=l.get(n),s=[],r=[];return o.forEach((t=>{const{regionId:i,metatileHash:n}=t,o=m.getStyle(e.styleId);if(!o)return;const a=Q(o,m,e.styleState,E,T,e,t,y[n],L,b,e.sourceId);s.push({regionId:i,metatileHash:n,collectorOutput:a,styleId:o.id}),r.push(...a.transferable)})),z(),k(),{results:s,transferable:r}})),i.set("fetchTrafficTile",(e=>c.fetch(e.coords,e.tileServer,e.tileProtocol,e.regionIds,e.timestamp))),i.set("deleteTrafficTile",(e=>{c.delete(e)})),i.set("abortTrafficTileRequest",(e=>{c.abortRequest(e)}));const R=(0,g.KP)(["db_sublayer","traffic_road_class","traffic_color","traffic_road_z_level"],["Traffic_jams"]);i.set("generateTrafficTile",(({coords:e,pixelRatio:t,styleState:i,styleId:n,sourceId:o})=>{const s=(0,U.gx)(e),r=[],a=[],l=m.getStyle(n);if(!l)return{results:r,transferable:a};const d=c.get(s);if(d){const n=function(e,t,i,n,o,s,r,a){if(!i)return e.getAccumulatedData();const l=r[3],{tileProps:c}=t,d=Object.keys(c).length,h=[],m=(0,v.o1)(o);for(const o of s.tile){const{color:s=0,geo:p,road:_,normals:v,zLevel:y=0}=o;for(let e=0;e<d;e++)h[e]=NaN;h[c.db_sublayer]="Traffic_jams",h[c.traffic_color]=s,h[c.traffic_road_class]=_,h[c.traffic_road_z_level]=y,h[c.beginningIsCut]=0,h[c.endingIsCut]=0;for(let o=0;o<p.length;o++){const s=p[o],d=v[o],_=[[],[],[],[]];for(let e=0;e<s.length;e++)_[0][e]=s[e][0],_[1][e]=s[e][1],_[2][e]=d[e][0],_[3][e]=d[e][1];const y=(0,f.ci)(t,n,g.i4,c,h,g.wz),b=i.layers.filter((e=>(0,f.FR)(e.filter,y)));(0,N.PA)(e,i,b,l,t,c,h,g.wz,a,g.i4,n,r,m,_,new u.c)}}return e.getAccumulatedData()}(T,R,l,i,t,d,e,o);r.push({regionId:1,metatileHash:0,styleId:l.id,collectorOutput:n})}return{results:r,transferable:a}})),i.set("packRasters",(e=>{for(let t=0;t<e.length;t+=3){const i=e[t+2],n={type:le.f.Loaded,isSvg:!1,index:i,key:`loaded-${i}`,name:"",fileName:"",rasters:[{rasterSetIndex:i,rasterIndex:0,w:e[t],h:e[t+1],atlasIndex:0,x:0,y:0,isPacked:!1,anchorX:0,anchorY:0}]};T.atlasPacker.pack(n,[e[t]],1)}const t=T.atlasPacker.getPackedRasters(),i=[];return void 0!==t&&i.push(t.buffer),{packedRasters:t,transferable:i}})),i.set("generateModel",(t=>{const{regionId:i,metatileHash:n,styleId:o,url:s}=t;return new Promise((r=>{(0,re.n)({url:s},((s,a)=>{if(s||0===a.byteLength)return void r({objects:T.getAccumulatedData(),textures:{isBitmap:!1,data:[]}});const l=m.getStyle(o);if(!l)return void r({objects:T.getAccumulatedData(),textures:{isBitmap:!1,data:[]}});const{objects:c,textures:d}=j(l,t.styleState,T,a,t,y[n],i,E);if(e.createImageBitmap){const e=d.map((e=>{const t=new Blob([e],{type:"image/png"});return createImageBitmap(t)}));Promise.all(e).then((e=>{r({objects:c,textures:{isBitmap:!0,data:e},transferable:[...c.transferable,...e]}),z()}))}else r({objects:c,textures:{isBitmap:!1,data:d},transferable:[...c.transferable,a]}),z()}))}))})),i.set("loadFloor",((e,t)=>new Promise((i=>{(0,re.n)({url:`${t}/complexes/${e}?fields=floorGeometries&format=pbf`},((t,n)=>{if(t||0===n.byteLength)return void i({type:"error",errorStatus:t?t.status:0});const s=new(o())(n),r=ae.Z.read(s),a=r.tileCoords;M[e]=Object.assign(Object.assign({},r),{tileCoords:[a[0],a[1],a[2],a[2]]}),F.addData((e=>{const t=new Set,i=new Set,{floorGeometries:n,entities:o}=e;for(let e=0;e<n.length;e++){const{rooms:i}=n[e];for(let e=0;e<i.length;e++){const{sublayer:n,areaSublayer:o,wallSublayer:s}=i[e];t.add(n),s&&t.add(s),t.add(o)}}for(let e=0;e<o.length;e++){const{humanReadableIconId:n,sublayer:s}=o[e];t.add(s),n&&i.add(n)}return{sublayers:t,objectClasses:i}})(M[e]));const l={};r.entities.forEach((e=>{e.firmId&&(l[e.firmId]=e.floorIndex)})),i({type:"success",center:r.center,bound:r.bound,defaultFloor:r.defaultFloor,floors:r.floorGeometries.map((({ids:e,name:t})=>({ids:e,name:t}))),buildings:r.buildings.concat(r.hybrids),firmsToFloorIndexMap:l})}))})))),i.set("generateFloor",((e,t,i,n,o,s,r,a,l)=>{const c={tileCoords:M[e].tileCoords,collectorOutput:T.getAccumulatedData(),styleId:0},p=m.getStyle(s);if(!p)return c;let y;return y=l?T.getAccumulatedData():function(e,t,i,n,o,s,r,a,l,c){var m;const{floorGeometries:p,defaultFloor:y,tileCoords:b,entities:M}=n,{tileProps:T}=o,P=(0,v.o1)(r),L=new u.c,E=new u.c(l),k=[],z=Object.keys(T).length;Number.isNaN(a)&&(a=y);const A=p[a];for(let n=0;n<A.rooms.length;n++){const r=A.rooms[n];for(let e=0;e<z;e++)k[e]=NaN;const a=r.firmIds.length?r.firmIds[0]:r.buildingId,l=(0,h.IL)(a);L.add(l);const c=E.has(l);k[T.id]=l,r.isIsland?x(r,k,o,e,t,i,s,c):(I(r,k,o,e,t,i,s,c),S(r,k,o,e,t,i,s,c))}for(let n=0;n<M.length;n++){const r=M[n],l=r.sublayer;if(r.floorIndex!==a)continue;if((0,d.Ty)(l))continue;for(let e=0;e<z;e++)k[e]=NaN;w[0]=[r.coordinates[0]],w[1]=[r.coordinates[1]];for(let e=0;e<z;e++)k[e]=NaN;k[T.db_sublayer]=l;let u=!1;const p=r.firmId||r.id;if(p){const e=(0,h.IL)(p);u=E.has(e),L.add(e),k[T.id]=e}k[T.selected]=u?1:0,k[T.db_region]=s,(0,d.Ty)(l)||(k[T.db_object_class]=null!==(m=r.humanReadableIconId)&&void 0!==m?m:o.reverseDictionaries.db_object_class[r.iconId]),k[T.db_label]=r.text,k[T.db_label2]=r.text2,k[T.db_icon_priority]=r.priority,k[T.db_label_priority]=r.textPriority;const v=(0,h.IL)(r.floorId);e.layers.forEach((n=>{"point"===n.type&&(0,f.FR)(n.filter,(0,f.ci)(o,t,g.i4,T,k,g.wz))&&(0,_.p)(i,e,n,b,c,g.i4,o,k,g.wz,w,P,void 0,v)}))}return i.setGeoIds(new Uint32Array(L.toFlatArray())),i.getAccumulatedData()}(p,r,T,M[e],F,t,i,n,o,a),z(),k(),{tileCoords:M[e].tileCoords,collectorOutput:y,transferable:y.transferable,styleId:p.id}})),i.set("generatePersonalPoi",((e,t,i,n,o,s,r,a)=>{const l=m.getStyle(s);if(!l)return;const c=function(e,t,i,n,o,s,r,a,l){var c,d,m;const{tileProps:p,dictionaries:_}=n,y=Object.keys(p).length,b=new u.c(r),w=[];if(void 0===(null===(c=_.db_sublayer)||void 0===c?void 0:c.s_personal_poi))return e.getAccumulatedData();for(let e=0;e<y;e++)w[e]=NaN;const x=(0,v.o1)(s),I=me.Ue(),S=[];for(const e of a){const t=(0,fe.yq)(e.point);me.aM(I,t),S.push(t)}const M=(0,U.x7)(I),T=(0,U.Bs)(M);for(let s=0;s<a.length;s++){const r=a[s],c=P.Ue();(0,U.a2)(c,S[s],T);const _=(0,h.IL)(r.id),v=[[c[0]],[c[1]]];for(let e=0;e<y;e++)w[e]=NaN;w[p.id]=(0,h.IL)(r.id),w[p.db_sublayer]="s_personal_poi",w[p.db_object_class]=null!==(d=r.humanReadableClassId)&&void 0!==d?d:null===(m=n.reverseDictionaries.db_object_class)||void 0===m?void 0:m[r.classId],w[p.db_label]=r.name,w[p.db_icon_priority]=1,w[p.db_label_priority]=0,w[p.selected]=b.has(_)?1:0,w[p.db_region]=o;const I=(0,f.ci)(n,i,g.i4,p,w,g.wz);pe=t.layers.filter((e=>(0,f.FR)(e.filter,I)));const L=void 0,E=new u.c;(0,N.PA)(e,t,pe,L,n,p,w,g.wz,l,g.i4,i,M,x,v,E)}return e.getAccumulatedData()}(T,l,r,y[i],t,n,o,e,a);return z(),k(),{collectorOutput:c,transferable:c.transferable,styleId:l.id}})),i.set("syncStyle",((...e)=>m.proxySyncStyle(...e)))}(self)},2205:()=>{setTimeout((()=>{if("__mapglPlugins"in window)for(const e in window.__mapglPlugins)window.mapgl[e]=window.__mapglPlugins[e]}),0)},5965:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="14" viewBox="0 0 20 14" style="margin-top: 4px">\n    <path d="M 18,5 C 18,4 17,1 15,1 H 12 10 C 8,1 7,4 7,5 H 5 v 2 h 1 v 4 c 0,0.6 0,1 1,1 v 2 h 2 v -2 h 7 v 2 h 2 v -2 c 1,0 1,-0.4 1,-1 V 7 h 1 V 5 H 18 z M 10,3 h 2 3 c 2,0 2,1 2,3 H 8 C 8,4 8,3 10,3 z M 9,10 H 8 C 7.4,10 7,9.6 7,9 7,8.4 7.4,8 8,8 h 1 c 0.6,0 1,0.4 1,1 0,0.6 -0.4,1 -1,1 z m 8,0 H 16 C 15.4,10 15,9.6 15,9 15,8.4 15.4,8 16,8 h 1 c 0.6,0 1,0.4 1,1 0,0.6 -0.4,1 -1,1 z M 4,4 H 6 V 3 H 4 C 1,3 1,6 1,7 H 0 v 1 h 1 v 4 H 3 V 11 H 5 V 7 H 2 C 2,6 2,4 4,4 z M 3,9 4,10 H 2 V 9 h 1 z" fill="#616161" fill-rule="evenodd"/>\n    <g fill="#fff">\n        <path d="m 16,8 h 1 c 0.4,0 0.7,0.2 0.8,0.5 C 17.9,8.4 18,8.2 18,8 18,7.4 17.6,7 17,7 h -1 c -0.6,0 -1,0.4 -1,1 0,0.2 0.1,0.4 0.2,0.5 C 15.3,8.2 15.6,8 16,8 z"/>\n        <path d="M 8,8 H 9 C 9.4,8 9.7,8.2 9.8,8.5 9.9,8.4 10,8.2 10,8 10,7.4 9.6,7 9,7 H 8 C 7.4,7 7,7.4 7,8 7,8.2 7.1,8.4 7.2,8.5 7.3,8.2 7.6,8 8,8 z"/>\n        <path d="M 6,3 H 4 C 4,3 4,3 4,3 2,3 2,5 2,6 H 2 C 2.1,5 2.5,4 4,4 H 5 6 V 3 z"/>\n        <path d="M0 7H1V8H0z"/>\n        <path d="M 15,2 H 12 10 C 8,2 8,3 8,5 H 8 C 8,3.7 8.3,3 10,3 h 2 3 c 1.7,0 1.9,0.7 2,2 h 0 C 17,3 17,2 15,2 z"/>\n        <path d="M3 9L4 9 3 8 2 8 2 9 2 9 2 9 3 9z"/>\n        <path d="M 7,11 C 6,11 6,10.6 6,10 v 1 c 0,0.6 0,1 1,1 v -1 z"/>\n        <path d="m 18,11 v 1 c 1,0 1,-0.4 1,-1 v -1 c 0,0.6 0,1 -1,1 z"/>\n        <path d="M19 6H20V7H19z"/>\n        <path d="M3 11L1 11 1 12 3 12 3 11 5 11 5 7 5 7 5 10 3 10z"/>\n        <path d="M16 13H18V14H16z"/>\n        <path d="M5 6H6V7H5z"/>\n        <path d="M9 13L7 13 7 14 9 14 9 12 16 12 16 11 9 11z"/>\n    </g>\n    <g fill="#444">\n        <path d="M 2,6 C 2,6.4 2,6.7 2,7 H 5 V 6 H 2 z"/>\n        <path d="M2 9L2 10 4 10 3 9z"/>\n        <path d="M 4,3 H 6 V 2 H 4 C 1,2 1,5 1,6 H 0 V 7 H 1 C 1,6 1,3 4,3 z"/>\n        <path d="M 18,4 C 18,3 17,0 15,0 H 12 10 C 8,0 7,3 7,4 H 6 5 V 5 H 7 C 7,4 8,1 10,1 h 2 3 c 2,0 3,3 3,4 h 2 V 4 h -2 z"/>\n        <path d="M 8,10 H 9 C 9.6,10 10,9.6 10,9 10,8.8 9.9,8.6 9.8,8.5 9.7,8.8 9.4,9 9,9 H 8 C 7.6,9 7.3,8.8 7.2,8.5 7.1,8.6 7,8.8 7,9 c 0,0.6 0.4,1 1,1 z"/>\n        <path d="M 17,6 C 17,5.6 17,5.3 17,5 H 8 c 0,0.3 0,0.6 0,1 h 9 z"/>\n        <path d="M 17.8,8.5 C 17.7,8.8 17.4,9 17,9 H 16 C 15.6,9 15.3,8.8 15.2,8.5 15.1,8.6 15,8.8 15,9 c 0,0.6 0.4,1 1,1 h 1 c 0.6,0 1,-0.4 1,-1 0,-0.2 -0.1,-0.4 -0.2,-0.5 z"/>\n    </g>\n</svg>\n'},8943:(e,t,i)=>{i.d(t,{Z:()=>n});const n=o;function o(e,t,i){i=i||{},this.w=e||64,this.h=t||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function s(e,t,i){this.x=0,this.y=e,this.w=this.free=t,this.h=i}function r(e,t,i,n,o,s,r){this.id=e,this.x=t,this.y=i,this.w=n,this.h=o,this.maxw=s||n,this.maxh=r||o,this.refcount=0}o.prototype.pack=function(e,t){e=[].concat(e),t=t||{};for(var i,n,o,s,r=[],a=0;a<e.length;a++)if(i=e[a].w||e[a].width,n=e[a].h||e[a].height,o=e[a].id,i&&n){if(!(s=this.packOne(i,n,o)))continue;t.inPlace&&(e[a].x=s.x,e[a].y=s.y,e[a].id=s.id),r.push(s)}return this.shrink(),r},o.prototype.packOne=function(e,t,i){var n,o,r,a,l,c,d,h,u={freebin:-1,shelf:-1,waste:1/0},m=0;if("string"==typeof i||"number"==typeof i){if(n=this.getBin(i))return this.ref(n),n;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(a=0;a<this.freebins.length;a++){if(t===(n=this.freebins[a]).maxh&&e===n.maxw)return this.allocFreebin(a,e,t,i);t>n.maxh||e>n.maxw||t<=n.maxh&&e<=n.maxw&&(r=n.maxw*n.maxh-e*t)<u.waste&&(u.waste=r,u.freebin=a)}for(a=0;a<this.shelves.length;a++)if(m+=(o=this.shelves[a]).h,!(e>o.free)){if(t===o.h)return this.allocShelf(a,e,t,i);t>o.h||t<o.h&&(r=(o.h-t)*e)<u.waste&&(u.freebin=-1,u.waste=r,u.shelf=a)}return-1!==u.freebin?this.allocFreebin(u.freebin,e,t,i):-1!==u.shelf?this.allocShelf(u.shelf,e,t,i):t<=this.h-m&&e<=this.w?(o=new s(m,this.w,t),this.allocShelf(this.shelves.push(o)-1,e,t,i)):this.autoResize?(l=c=this.h,((d=h=this.w)<=l||e>d)&&(h=2*Math.max(e,d)),(l<d||t>l)&&(c=2*Math.max(t,l)),this.resize(h,c),this.packOne(e,t,i)):null},o.prototype.allocFreebin=function(e,t,i,n){var o=this.freebins.splice(e,1)[0];return o.id=n,o.w=t,o.h=i,o.refcount=0,this.bins[n]=o,this.ref(o),o},o.prototype.allocShelf=function(e,t,i,n){var o=this.shelves[e].alloc(t,i,n);return this.bins[n]=o,this.ref(o),o},o.prototype.shrink=function(){if(this.shelves.length>0){for(var e=0,t=0,i=0;i<this.shelves.length;i++){var n=this.shelves[i];t+=n.h,e=Math.max(n.w-n.free,e)}this.resize(e,t)}},o.prototype.getBin=function(e){return this.bins[e]},o.prototype.ref=function(e){if(1==++e.refcount){var t=e.h;this.stats[t]=1+(0|this.stats[t])}return e.refcount},o.prototype.unref=function(e){return 0===e.refcount?0:(0==--e.refcount&&(this.stats[e.h]--,delete this.bins[e.id],this.freebins.push(e)),e.refcount)},o.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},o.prototype.resize=function(e,t){this.w=e,this.h=t;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(e);return!0},s.prototype.alloc=function(e,t,i){if(e>this.free||t>this.h)return null;var n=this.x;return this.x+=e,this.free-=e,new r(i,n,this.y,e,t,e,this.h)},s.prototype.resize=function(e){return this.free+=e-this.w,this.w=e,!0}}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}return i.m=e,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(8525)})()}));