!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,(()=>(()=>{"use strict";var e={5618:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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=s},3103:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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",""]),s.locals={container:"mapgl_lxLX8k02JhUZQLnJt5Mm",text:"mapgl_AsSWrna6OS9VEoYItIZV",link:"mapgl_N4E6A6Wp5fYeXBf2QGWt"};const a=s},3274:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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",""]),s.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=s},4306:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.push([e.id,".mapgl_T5RQQ2NOfnY3_e00os8n {\n    display: block !important;\n}\n\n.mapgl_T5RQQ2NOfnY3_e00os8n .mapgl_BhGb3GmPN9rfS36yYYbH {\n    height: 20px !important;\n    display: block !important;\n}\n",""]),s.locals={container:"mapgl_T5RQQ2NOfnY3_e00os8n",logos:"mapgl_BhGb3GmPN9rfS36yYYbH"};const a=s},1704:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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    all: revert;\n    padding: 0;\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",""]),s.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=s},9687:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.push([e.id,".mapgl_bWi6iAovl9pw7Yj1to88 {\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_zJVcoMVkFBZDkVKnJOh6 {\n    all: revert;\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_MxEDZaF6oAY2cxCJnZJk:hover {\n    opacity: 0.7;\n}\n\n.mapgl_LnE9RZTvVgvsOYaQhqfm {\n    background: #299400;\n    color: #fff;\n}\n\n.mapgl_LnE9RZTvVgvsOYaQhqfm:hover {\n    color: rgba(38, 38, 38, 0.7);\n}\n",""]),s.locals={root:"mapgl_bWi6iAovl9pw7Yj1to88",button:"mapgl_zJVcoMVkFBZDkVKnJOh6",none:"mapgl_MxEDZaF6oAY2cxCJnZJk",easy:"mapgl_LnE9RZTvVgvsOYaQhqfm"};const a=s},6032:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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",""]),s.locals={root:"mapgl_y5CSWkmzFZelEK3XsNPI",label:"mapgl_jEDrEoj7PBYIc0hBFCRq"};const a=s},4928:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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    all: revert;\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",""]),s.locals={root:"mapgl_XiKtyzV1PZ9N9z7NbBH0",button:"mapgl_TCECw1gCo4pPgxN8WlHv",none:"mapgl_aifLu_eH4oBoq5TCFEl1",easy:"mapgl_AZeLf0JO9BdLfzixjszM",medium:"mapgl_g9fon0BTtGdnOX4Ce0gE",hard:"mapgl_GDc542cVDcz8I8tKJtvz"};const a=s},8585:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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    all: revert;\n\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",""]),s.locals={root:"mapgl_RyvsmCnoVe7ui2MClLMS",button:"mapgl_Tdw0Vs7iQuaknNHHD21k",zoomIn:"mapgl_JwF7YmgOItTjpjwxORCk",zoomOut:"mapgl_Tvr6BDuVyr8143cFJ4nJ"};const a=s},438:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(8276),o=i.n(n),r=i(5368),s=i.n(r)()(o());s.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",""]),s.locals={wrap:"mapgl_Zqe1f2Ik8_MdehkwZiwo",container:"mapgl_RBLYLi7mJFgKIKMPLvv_"};const a=s},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 r={},s=[],a=0;a<e.length;a++){var l=e[a],d=n.base?l[0]+n.base:l[0],c=r[d]||0,h="".concat(d," ").concat(c);r[d]=c+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})}s.push(h)}return s}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 r=n(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=i(r[s]);t[a].references--}for(var l=n(e,o),d=0;d<r.length;d++){var c=i(r[d]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}r=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 r=i.sourceMap;r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),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))}}},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},351:(e,t,i)=>{i.d(t,{Ue:()=>o,xO:()=>r});var n=i(3287);function o(){let e=new n.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}function r(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}},127:(e,t,i)=>{i.d(t,{I6:()=>x,Iu:()=>u,Iw:()=>y,JG:()=>s,Jp:()=>h,M5:()=>b,U_:()=>c,Ue:()=>o,Us:()=>g,al:()=>a,bA:()=>m,d9:()=>r,dC:()=>S,jI:()=>_,lM:()=>f,p4:()=>d,uD:()=>p,wA:()=>I,xJ:()=>v,yR:()=>l,zB:()=>w});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 r(e){let t=new n.WT(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}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 a(e,t,i,o,r,s,a,l,d,c,h,u,m,f,p,_){let v=new n.WT(16);return v[0]=e,v[1]=t,v[2]=i,v[3]=o,v[4]=r,v[5]=s,v[6]=a,v[7]=l,v[8]=d,v[9]=c,v[10]=h,v[11]=u,v[12]=m,v[13]=f,v[14]=p,v[15]=_,v}function l(e){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 d(e,t){if(e===t){let i=t[1],n=t[2],o=t[3],r=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=r,e[11]=t[14],e[12]=o,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function c(e,t){let i=t[0],n=t[1],o=t[2],r=t[3],s=t[4],a=t[5],l=t[6],d=t[7],c=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*s,y=i*l-o*s,b=i*d-r*s,w=n*l-o*a,x=n*d-r*a,S=o*d-r*l,I=c*p-h*f,M=c*_-u*f,T=c*v-m*f,E=h*_-u*p,P=h*v-m*p,L=u*v-m*_,A=g*L-y*P+b*E+w*T-x*M+S*I;return A?(A=1/A,e[0]=(a*L-l*P+d*E)*A,e[1]=(o*P-n*L-r*E)*A,e[2]=(p*S-_*x+v*w)*A,e[3]=(u*x-h*S-m*w)*A,e[4]=(l*T-s*L-d*M)*A,e[5]=(i*L-o*T+r*M)*A,e[6]=(_*b-f*S-v*y)*A,e[7]=(c*S-u*b+m*y)*A,e[8]=(s*P-a*T+d*I)*A,e[9]=(n*T-i*P-r*I)*A,e[10]=(f*x-p*b+v*g)*A,e[11]=(h*b-c*x-m*g)*A,e[12]=(a*M-s*E-l*I)*A,e[13]=(i*E-n*M+o*I)*A,e[14]=(p*y-f*w-_*g)*A,e[15]=(c*w-h*y+u*g)*A,e):null}function h(e,t,i){let n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],l=t[5],d=t[6],c=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*r+b*d+w*m+x*v,e[3]=y*s+b*c+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*r+b*d+w*m+x*v,e[7]=y*s+b*c+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*r+b*d+w*m+x*v,e[11]=y*s+b*c+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*r+b*d+w*m+x*v,e[15]=y*s+b*c+w*f+x*g,e}function u(e,t,i){let n,o,r,s,a,l,d,c,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],r=t[2],s=t[3],a=t[4],l=t[5],d=t[6],c=t[7],h=t[8],u=t[9],m=t[10],f=t[11],e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=l,e[6]=d,e[7]=c,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]=r*p+d*_+m*v+t[14],e[15]=s*p+c*_+f*v+t[15]),e}function m(e,t,i){let n=i[0],o=i[1],r=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]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function f(e,t,i){let n=Math.sin(i),o=Math.cos(i),r=t[4],s=t[5],a=t[6],l=t[7],d=t[8],c=t[9],h=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=r*o+d*n,e[5]=s*o+c*n,e[6]=a*o+h*n,e[7]=l*o+u*n,e[8]=d*o-r*n,e[9]=c*o-s*n,e[10]=h*o-a*n,e[11]=u*o-l*n,e}function p(e,t,i){let n=Math.sin(i),o=Math.cos(i),r=t[0],s=t[1],a=t[2],l=t[3],d=t[8],c=t[9],h=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=r*o-d*n,e[1]=s*o-c*n,e[2]=a*o-h*n,e[3]=l*o-u*n,e[8]=r*n+d*o,e[9]=s*n+c*o,e[10]=a*n+h*o,e[11]=l*n+u*o,e}function _(e,t,i){let n=Math.sin(i),o=Math.cos(i),r=t[0],s=t[1],a=t[2],l=t[3],d=t[4],c=t[5],h=t[6],u=t[7];return t!==e&&(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[0]=r*o+d*n,e[1]=s*o+c*n,e[2]=a*o+h*n,e[3]=l*o+u*n,e[4]=d*o-r*n,e[5]=c*o-s*n,e[6]=h*o-a*n,e[7]=u*o-l*n,e}function v(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function g(e,t,i){let o,r,s,a=i[0],l=i[1],d=i[2],c=Math.sqrt(a*a+l*l+d*d);return Math.abs(c)<n.Ib?null:(c=1/c,a*=c,l*=c,d*=c,o=Math.sin(t),r=Math.cos(t),s=1-r,e[0]=a*a*s+r,e[1]=l*a*s+d*o,e[2]=d*a*s-l*o,e[3]=0,e[4]=a*l*s-d*o,e[5]=l*l*s+r,e[6]=d*l*s+a*o,e[7]=0,e[8]=a*d*s+l*o,e[9]=l*d*s-a*o,e[10]=d*d*s+r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function y(e,t,i,n){let o=t[0],r=t[1],s=t[2],a=t[3],l=o+o,d=r+r,c=s+s,h=o*l,u=o*d,m=o*c,f=r*d,p=r*c,_=s*c,v=a*l,g=a*d,y=a*c,b=n[0],w=n[1],x=n[2];return e[0]=(1-(f+_))*b,e[1]=(u+y)*b,e[2]=(m-g)*b,e[3]=0,e[4]=(u-y)*w,e[5]=(1-(h+_))*w,e[6]=(p+v)*w,e[7]=0,e[8]=(m+g)*x,e[9]=(p-v)*x,e[10]=(1-(h+f))*x,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function b(e,t,i,n,o,r,s){let a=1/(t-i),l=1/(n-o),d=1/(r-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*d,e[11]=0,e[12]=(t+i)*a,e[13]=(o+n)*l,e[14]=(s+r)*d,e[15]=1,e}function w(e,t,i,o){let r,s,a,l,d,c,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],S=i[2];return Math.abs(p-w)<n.Ib&&Math.abs(_-x)<n.Ib&&Math.abs(v-S)<n.Ib?mat4.identity(e):(h=p-w,u=_-x,m=v-S,f=1/Math.sqrt(h*h+u*u+m*m),h*=f,u*=f,m*=f,r=y*m-b*u,s=b*h-g*m,a=g*u-y*h,f=Math.sqrt(r*r+s*s+a*a),f?(f=1/f,r*=f,s*=f,a*=f):(r=0,s=0,a=0),l=u*a-m*s,d=m*r-h*a,c=h*s-u*r,f=Math.sqrt(l*l+d*d+c*c),f?(f=1/f,l*=f,d*=f,c*=f):(l=0,d=0,c=0),e[0]=r,e[1]=l,e[2]=h,e[3]=0,e[4]=s,e[5]=d,e[6]=u,e[7]=0,e[8]=a,e[9]=c,e[10]=m,e[11]=0,e[12]=-(r*p+s*_+a*v),e[13]=-(l*p+d*_+c*v),e[14]=-(h*p+u*_+m*v),e[15]=1,e)}function x(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]}const S=h;function I(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,{$X:()=>c,AK:()=>v,Fp:()=>u,Fv:()=>_,I6:()=>y,IH:()=>d,JG:()=>a,TE:()=>f,TK:()=>x,Ue:()=>o,VV:()=>h,al:()=>s,bA:()=>m,d9:()=>r,fS:()=>b,kE:()=>p,lu:()=>w,t7:()=>g,t8:()=>l});var n=i(3287);function o(){let e=new n.WT(2);return e[0]=0,e[1]=0,e}function r(e){let t=new n.WT(2);return t[0]=e[0],t[1]=e[1],t}function s(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 d(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function c(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],r=t[1];return e[0]=o+n*(i[0]-o),e[1]=r+n*(i[1]-r),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],r=t[0],s=t[1];return Math.abs(i-r)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(o-s)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(s))}const w=c,x=f;!function(){let e=o()}()},9450:(e,t,i)=>{i.d(t,{AK:()=>p,Fv:()=>f,I6:()=>w,IH:()=>c,JG:()=>l,TE:()=>u,TK:()=>I,Ue:()=>o,VC:()=>y,Zh:()=>M,al:()=>a,bA:()=>h,d9:()=>r,fF:()=>g,fS:()=>x,jI:()=>b,kC:()=>_,kE:()=>s,lu:()=>S,t7:()=>v,t8:()=>d,tk:()=>m});var n=i(3287);function o(){let e=new n.WT(3);return e[0]=0,e[1]=0,e[2]=0,e}function r(e){var t=new n.WT(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(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 d(e,t,i,n){return e[0]=t,e[1]=i,e[2]=n,e}function c(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){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function f(e,t){let i=t[0],n=t[1],o=t[2],r=i*i+n*n+o*o;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r),e}function p(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function _(e,t,i){let n=t[0],o=t[1],r=t[2],s=i[0],a=i[1],l=i[2];return e[0]=o*l-r*a,e[1]=r*s-n*l,e[2]=n*a-o*s,e}function v(e,t,i,n){let o=t[0],r=t[1],s=t[2];return e[0]=o+n*(i[0]-o),e[1]=r+n*(i[1]-r),e[2]=s+n*(i[2]-s),e}function g(e,t,i){let n=t[0],o=t[1],r=t[2],s=i[3]*n+i[7]*o+i[11]*r+i[15];return s=s||1,e[0]=(i[0]*n+i[4]*o+i[8]*r+i[12])/s,e[1]=(i[1]*n+i[5]*o+i[9]*r+i[13])/s,e[2]=(i[2]*n+i[6]*o+i[10]*r+i[14])/s,e}function y(e,t,i){let n=t[0],o=t[1],r=t[2],s=i[0],a=i[1],l=i[2],d=i[3],c=d*n+a*r-l*o,h=d*o+l*n-s*r,u=d*r+s*o-a*n,m=-s*n-a*o-l*r;return e[0]=c*d+m*-s+h*-l-u*-a,e[1]=h*d+m*-a+u*-s-c*-l,e[2]=u*d+m*-l+c*-a-h*-s,e}function b(e,t,i,n){let o=[],r=[];return o[0]=t[0]-i[0],o[1]=t[1]-i[1],o[2]=t[2]-i[2],r[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),r[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),r[2]=o[2],e[0]=r[0]+i[0],e[1]=r[1]+i[1],e[2]=r[2]+i[2],e}function w(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function x(e,t){let i=e[0],o=e[1],r=e[2],s=t[0],a=t[1],l=t[2];return Math.abs(i-s)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-a)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(a))&&Math.abs(r-l)<=n.Ib*Math.max(1,Math.abs(r),Math.abs(l))}const S=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e},I=u,M=s;!function(){let e=o()}()},1245:(e,t,i)=>{i.d(t,{AK:()=>f,Fv:()=>m,I6:()=>v,IH:()=>d,JG:()=>a,Ue:()=>o,al:()=>s,bA:()=>c,d9:()=>r,fF:()=>_,fS:()=>g,kE:()=>h,t7:()=>p,t8:()=>l,we:()=>u});var n=i(3287);function o(){let e=new n.WT(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function r(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 r=new n.WT(4);return r[0]=e,r[1]=t,r[2]=i,r[3]=o,r}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function l(e,t,i,n,o){return e[0]=t,e[1]=i,e[2]=n,e[3]=o,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[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 h(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 u(e){let t=e[0],i=e[1],n=e[2],o=e[3];return t*t+i*i+n*n+o*o}function m(e,t){let i=t[0],n=t[1],o=t[2],r=t[3],s=i*i+n*n+o*o+r*r;return s>0&&(s=1/Math.sqrt(s),e[0]=i*s,e[1]=n*s,e[2]=o*s,e[3]=r*s),e}function f(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function p(e,t,i,n){let o=t[0],r=t[1],s=t[2],a=t[3];return e[0]=o+n*(i[0]-o),e[1]=r+n*(i[1]-r),e[2]=s+n*(i[2]-s),e[3]=a+n*(i[3]-a),e}function _(e,t,i){let n=t[0],o=t[1],r=t[2],s=t[3];return e[0]=i[0]*n+i[4]*o+i[8]*r+i[12]*s,e[1]=i[1]*n+i[5]*o+i[9]*r+i[13]*s,e[2]=i[2]*n+i[6]*o+i[10]*r+i[14]*s,e[3]=i[3]*n+i[7]*o+i[11]*r+i[15]*s,e}function v(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function g(e,t){let i=e[0],o=e[1],r=e[2],s=e[3],a=t[0],l=t[1],d=t[2],c=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(r-d)<=n.Ib*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-c)<=n.Ib*Math.max(1,Math.abs(s),Math.abs(c))}!function(){let e=o()}()},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,r="";for(i=0;i<o;i+=3)r+=e[n[i]>>2],r+=e[(3&n[i])<<4|n[i+1]>>4],r+=e[(15&n[i+1])<<2|n[i+2]>>6],r+=e[63&n[i+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r},function(e){var t,n,o,r,s,a=.75*e.length,l=e.length,d=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),h=new Uint8Array(c);for(t=0;t<l;t+=4)n=i[e.charCodeAt(t)],o=i[e.charCodeAt(t+1)],r=i[e.charCodeAt(t+2)],s=i[e.charCodeAt(t+3)],h[d++]=n<<2|o>>4,h[d++]=(15&o)<<4|r>>2,h[d++]=(3&r)<<6|63&s;return c}}()},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 r(e){return 3*e}function s(e,t,i){return((n(t,i)*e+o(t,i))*e+r(t))*e}function a(e,t,i){return 3*n(t,i)*e*e+2*o(t,i)*e+r(t)}function l(e){return e}e.exports=function(e,n,o,r){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===r)return l;for(var d=i?new Float32Array(11):new Array(11),c=0;c<11;++c)d[c]=s(c*t,e,o);function h(i){for(var n=0,r=1;10!==r&&d[r]<=i;++r)n+=t;--r;var l=n+(i-d[r])/(d[r+1]-d[r])*t,c=a(l,e,o);return c>=.001?function(e,t,i,n){for(var o=0;o<4;++o){var r=a(t,i,n);if(0===r)return t;t-=(s(t,i,n)-e)/r}return t}(i,l,e,o):0===c?l:function(e,t,i,n,o){var r,a,l=0;do{(r=s(a=t+(i-t)/2,n,o)-e)>0?i=a:t=a}while(Math.abs(r)>1e-7&&++l<10);return a}(i,n,n+t,e,o)}return function(e){return 0===e?0:1===e?1:s(h(e),n,r)}}},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,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);n&&s[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}},8276:e=>{e.exports=function(e){return e[1]}},7084:e=>{function t(e,t,n){n=n||2;var r,s,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 r,s,a,l=[];for(r=0,s=t.length;r<s;r++)(a=i(e,t[r]*o,r<s-1?t[r+1]*o:e.length,o,!1))===a.next&&(a.steiner=!0),l.push(m(a));for(l.sort(d),r=0;r<l.length;r++)n=c(l[r],n);return n}(e,t,v,n)),e.length>80*n){r=a=e[0],s=l=e[1];for(var y=n;y<_;y+=n)(h=e[y])<r&&(r=h),(u=e[y+1])<s&&(s=u),h>a&&(a=h),u>l&&(l=u);f=0!==(f=Math.max(a-r,l-s))?32767/f:0}return o(v,g,n,r,s,f,0),g}function i(e,t,i,n,o){var r,s;if(o===T(e,t,i,n)>0)for(r=t;r<i;r+=n)s=S(r,e[r],e[r+1],s);else for(r=i-n;r>=t;r-=n)s=S(r,e[r],e[r+1],s);return s&&v(s,s.next)&&(I(s),s=s.next),s}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(I(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function o(e,t,i,d,c,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,r,s,a,l,d=1;do{for(i=e,e=null,r=null,s=0;i;){for(s++,n=i,a=0,t=0;t<d&&(a++,n=n.nextZ);t++);for(l=d;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--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=n}r.nextZ=null,d*=2}while(s>1)}(o)}(e,d,c,h);for(var f,p,_=e;e.prev!==e.next;)if(f=e.prev,p=e.next,h?s(e,d,c,h):r(e))t.push(f.i/i|0),t.push(e.i/i|0),t.push(p.i/i|0),I(e),e=p.next,_=p.next;else if((e=p)===_){m?1===m?o(e=a(n(e),t,i),t,i,d,c,h,2):2===m&&l(e,t,i,d,c,h):o(n(e),t,i,d,c,h,1);break}}}function r(e){var t=e.prev,i=e,n=e.next;if(_(t,i,n)>=0)return!1;for(var o=t.x,r=i.x,s=n.x,a=t.y,l=i.y,d=n.y,c=o<r?o<s?o:s:r<s?r:s,h=a<l?a<d?a:d:l<d?l:d,u=o>r?o>s?o:s:r>s?r:s,m=a>l?a>d?a:d:l>d?l:d,p=n.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=h&&p.y<=m&&f(o,a,r,l,s,d,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function s(e,t,i,n){var o=e.prev,r=e,s=e.next;if(_(o,r,s)>=0)return!1;for(var a=o.x,l=r.x,d=s.x,c=o.y,h=r.y,m=s.y,p=a<l?a<d?a:d:l<d?l:d,v=c<h?c<m?c:m:h<m?h:m,g=a>l?a>d?a:d:l>d?l:d,y=c>h?c>m?c:m:h>m?h:m,b=u(p,v,t,i,n),w=u(g,y,t,i,n),x=e.prevZ,S=e.nextZ;x&&x.z>=b&&S&&S.z<=w;){if(x.x>=p&&x.x<=g&&x.y>=v&&x.y<=y&&x!==o&&x!==s&&f(a,c,l,h,d,m,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,S.x>=p&&S.x<=g&&S.y>=v&&S.y<=y&&S!==o&&S!==s&&f(a,c,l,h,d,m,S.x,S.y)&&_(S.prev,S,S.next)>=0)return!1;S=S.nextZ}for(;x&&x.z>=b;){if(x.x>=p&&x.x<=g&&x.y>=v&&x.y<=y&&x!==o&&x!==s&&f(a,c,l,h,d,m,x.x,x.y)&&_(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;S&&S.z<=w;){if(S.x>=p&&S.x<=g&&S.y>=v&&S.y<=y&&S!==o&&S!==s&&f(a,c,l,h,d,m,S.x,S.y)&&_(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function a(e,t,i){var o=e;do{var r=o.prev,s=o.next.next;!v(r,s)&&g(r,o,o.next,s)&&w(r,s)&&w(s,r)&&(t.push(r.i/i|0),t.push(o.i/i|0),t.push(s.i/i|0),I(o),I(o.next),o=e=s),o=o.next}while(o!==e);return n(o)}function l(e,t,i,r,s,a){var l=e;do{for(var d=l.next.next;d!==l.prev;){if(l.i!==d.i&&p(l,d)){var c=x(l,d);return l=n(l,l.next),c=n(c,c.next),o(l,t,i,r,s,a,0),void o(c,t,i,r,s,a,0)}d=d.next}l=l.next}while(l!==e)}function d(e,t){return e.x-t.x}function c(e,t){var i=function(e,t){var i,n=t,o=e.x,r=e.y,s=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=o&&a>s&&(s=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,d=i,c=i.x,u=i.y,m=1/0;n=i;do{o>=n.x&&n.x>=c&&o!==n.x&&f(r<u?o:s,r,c,u,r<u?s:o,r,n.x,n.y)&&(l=Math.abs(r-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!==d);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,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(n-a)>=(i-s)*(t-a)&&(i-s)*(r-a)>=(o-s)*(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,r=(e.y+t.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&o<(i.next.x-i.x)*(r-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)),r=b(_(e,t,n)),s=b(_(i,n,e)),a=b(_(i,n,t));return o!==r&&s!==a||(!(0!==o||!y(e,i,t))||(!(0!==r||!y(e,n,t))||(!(0!==s||!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,r=t.prev;return e.next=t,t.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function S(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 I(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,r=t,s=i-n;r<i;r+=n)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}e.exports=t,e.exports.default=t,t.deviation=function(e,t,i,n){var o=t&&t.length,r=o?t[0]*i:e.length,s=Math.abs(T(e,0,r,i));if(o)for(var a=0,l=t.length;a<l;a++){var d=t[a]*i,c=a<l-1?t[a+1]*i:e.length;s-=Math.abs(T(e,d,c,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===s&&0===h?0:Math.abs((h-s)/s)},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 r=0;r<e[o].length;r++)for(var s=0;s<t;s++)i.vertices.push(e[o][r][s]);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 r,s,a=8*o-n-1,l=(1<<a)-1,d=l>>1,c=-7,h=i?o-1:0,u=i?-1:1,m=e[t+h];for(h+=u,r=m&(1<<-c)-1,m>>=-c,c+=a;c>0;r=256*r+e[t+h],h+=u,c-=8);for(s=r&(1<<-c)-1,r>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=u,c-=8);if(0===r)r=1-d;else{if(r===l)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),r-=d}return(m?-1:1)*s*Math.pow(2,r-n)},t.write=function(e,t,i,n,o,r){var s,a,l,d=8*r-o-1,c=(1<<d)-1,h=c>>1,u=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:r-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,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,o),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[i+m]=255&a,m+=f,a/=256,o-=8);for(s=s<<o|a,d+=o;d>0;e[i+m]=255&s,m+=f,s/=256,d-=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 r=4294967296,s=1/r,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(e){return e.type===o.Bytes?e.readVarint()+e.pos:e.pos+1}function d(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function c(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,r=this.pos;this.type=7&n,e(o,t,this),this.pos===r&&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)*r;return this.pos+=8,e},readSFixed64:function(){var e=b(this.buf,this.pos)+x(this.buf,this.pos+4)*r;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,r=i.buf;if(o=r[i.pos++],n=(112&o)>>4,o<128)return d(e,n,t);if(o=r[i.pos++],n|=(127&o)<<3,o<128)return d(e,n,t);if(o=r[i.pos++],n|=(127&o)<<10,o<128)return d(e,n,t);if(o=r[i.pos++],n|=(127&o)<<17,o<128)return d(e,n,t);if(o=r[i.pos++],n|=(127&o)<<24,o<128)return d(e,n,t);if(o=r[i.pos++],n|=(1&o)<<31,o<128)return d(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 r,s,a,l=e[o],d=null,c=l>239?4:l>223?3:l>191?2:1;if(o+c>i)break;1===c?l<128&&(d=l):2===c?128==(192&(r=e[o+1]))&&(d=(31&l)<<6|63&r)<=127&&(d=null):3===c?(r=e[o+1],s=e[o+2],128==(192&r)&&128==(192&s)&&((d=(15&l)<<12|(63&r)<<6|63&s)<=2047||d>=55296&&d<=57343)&&(d=null)):4===c&&(r=e[o+1],s=e[o+2],a=e[o+3],128==(192&r)&&128==(192&s)&&128==(192&a)&&((d=(15&l)<<18|(63&r)<<12|(63&s)<<6|63&a)<=65535||d>=1114112)&&(d=null)),null===d?(d=65533,c=1):d>65535&&(d-=65536,n+=String.fromCharCode(d>>>10&1023|55296),d=56320|1023&d),n+=String.fromCharCode(d),o+=c}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*s),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*s),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,r=0;r<t.length;r++){if((n=t.charCodeAt(r))>55295&&n<57344){if(!o){n>56319||r+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&&c(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&&c(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,r,s){t(e,i,o||0,r||e.length-1,s||n)}function t(e,n,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=n-o+1,d=Math.log(a),c=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*c*(a-c)/a)*(l-a/2<0?-1:1);t(e,n,Math.max(o,Math.floor(n-l*c/a+h)),Math.min(r,Math.floor(n+(a-l)*c/a+h)),s)}var u=e[n],m=o,f=r;for(i(e,o,n),s(e[r],u)>0&&i(e,o,r);m<f;){for(i(e,m,f),m++,f--;s(e[m],u)<0;)m++;for(;s(e[f],u)>0;)f--}0===s(e[o],u)?i(e,o,f):i(e,++f,r),f<=n&&(o=f+1),n<=f&&(r=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 r(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 s(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 r,s=t;s<i;s++)r=e.children[s],l(o,e.leaf?n(r):r);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 d(e,t){return e.minX-t.minX}function c(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,r){for(var s,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=o||(s=t+Math.ceil((i-t)/o/2)*o,n(e,s,t,i,r),a.push(t,s,s,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,r,s,a,l=[];t;){for(o=0,r=t.children.length;o<r;o++)s=t.children[o],f(e,a=t.leaf?n(s):s)&&(t.leaf?i.push(s):m(e,a)?this._all(s,i):l.push(s));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,r,s,a=[];t;){for(n=0,o=t.children.length;n<o;n++)if(r=t.children[n],f(e,s=t.leaf?i(r):r)){if(t.leaf||m(e,s))return!0;a.push(r)}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,s,a=this.data,l=this.toBBox(e),d=[],c=[];a||d.length;){if(a||(a=d.pop(),n=d[d.length-1],i=c.pop(),s=!0),a.leaf&&-1!==(o=r(e,a.children,t)))return a.children.splice(o,1),d.push(a),this._condense(d),this;s||a.leaf||!m(a,l)?n?(i++,a=n.children[i],s=!1):a=null:(d.push(a),c.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:d,compareMinY:c,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,r=i-t+1,a=this._maxEntries;if(r<=a)return s(o=p(e.slice(t,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(o=p([])).leaf=!1,o.height=n;var l,d,c,h,u=Math.ceil(r/a),m=u*Math.ceil(Math.sqrt(a));for(_(e,t,i,m,this.compareMinX),l=t;l<=i;l+=m)for(_(e,l,c=Math.min(l+m-1,i),u,this.compareMinY),d=l;d<=c;d+=u)h=Math.min(d+u-1,c),o.children.push(this._build(e,d,h,n-1));return s(o,this.toBBox),o},_chooseSubtree:function(e,t,i,n){for(var o,r,s,a,l,d,c,u,m,f;n.push(t),!t.leaf&&n.length-1!==i;){for(c=u=1/0,o=0,r=t.children.length;o<r;o++)l=h(s=t.children[o]),m=e,f=s,(d=(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=d,c=l<c?l:c,a=s):d===u&&l<c&&(c=l,a=s);t=a||t.children[0]}return t},_insert:function(e,t,i){var n=this.toBBox,o=i?e:n(e),r=[],s=this._chooseSubtree(o,this.data,t,r);for(s.children.push(e),l(s,o);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(o,r,t)},_split:function(e,t){var i=e[t],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var r=this._chooseSplitIndex(i,o,n),a=p(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(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,s(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var n,o,r,s,l,d,c,u,m,f,p,_,v,g;for(d=c=1/0,n=t;n<=i-t;n++)o=a(e,0,n,this.toBBox),r=a(e,n,i,this.toBBox),m=o,f=r,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),s=Math.max(0,v-p)*Math.max(0,g-_),l=h(o)+h(r),s<d?(d=s,u=n,c=l<c?l:c):s===d&&l<c&&(c=l,u=n);return u},_chooseSplitAxis:function(e,t,i){var n=e.leaf?this.compareMinX:d,o=e.leaf?this.compareMinY:c;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,r,s=this.toBBox,d=a(e,0,t,s),c=a(e,i-t,i,s),h=u(d)+u(c);for(o=t;o<i-t;o++)r=e.children[o],l(d,e.leaf?s(r):r),h+=u(d);for(o=i-t-1;o>=t;o--)r=e.children[o],l(c,e.leaf?s(r):r),h+=u(c);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():s(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,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(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(s,a)}l((n=n.apply(e,t||[])).next())}))}Object.create;Object.create},6977:(e,t,i)=>{i.r(t),i.d(t,{AnimationOptions:()=>S.AnimationOptions,Circle:()=>im,CircleMarker:()=>om,CircleMarkerOptions:()=>I.CircleMarkerOptions,CircleOptions:()=>I.CircleOptions,Control:()=>nu,ControlOptions:()=>I.ControlOptions,ControlPosition:()=>I.ControlPosition,DefaultEventTargetData:()=>b.DefaultEventTargetData,DefaultSource:()=>ju,DynamicObjectEventTable:()=>b.DynamicObjectEventTable,DynamicObjectPointerEvent:()=>b.DynamicObjectPointerEvent,Easing:()=>S.Easing,EventTarget:()=>b.EventTarget,EventTargetData:()=>b.EventTargetData,FeatureState:()=>I.FeatureState,FeatureStateMap:()=>I.FeatureStateMap,FitBoundsOptions:()=>I.FitBoundsOptions,FloorControl:()=>Pu,FloorLevelChangeEvent:()=>b.FloorLevelChangeEvent,FloorPlanHideEvent:()=>b.FloorPlanHideEvent,FloorPlanShowEvent:()=>b.FloorPlanShowEvent,GeoJsonEventTargetData:()=>b.GeoJsonEventTargetData,GeoJsonSource:()=>fm,GeoJsonSourceOptions:()=>I.GeoJsonSourceOptions,GltfModel:()=>um,GltfModelOptions:()=>I.GltfModelOptions,HtmlMarker:()=>em,HtmlMarkerOptions:()=>I.HtmlMarkerOptions,Label:()=>Ju,LabelImage:()=>I.LabelImage,LabelOptions:()=>I.LabelOptions,LngLatBounds:()=>w.LngLatBounds,LngLatBoundsClass:()=>Su,Map:()=>Wu,MapEvent:()=>b.MapEvent,MapEventTable:()=>b.MapEventTable,MapOptions:()=>I.MapOptions,MapPointerEvent:()=>b.MapPointerEvent,MapSupportOptions:()=>I.MapSupportOptions,Marker:()=>qu,MarkerIconOptions:()=>I.MarkerIconOptions,MarkerLabelOptions:()=>I.MarkerLabelOptions,MarkerOptions:()=>I.MarkerOptions,Padding:()=>I.Padding,PointerEvent:()=>b.PointerEvent,Polygon:()=>lm,PolygonOptions:()=>I.PolygonOptions,Polyline:()=>sm,PolylineOptions:()=>I.PolylineOptions,Raster:()=>cm,RasterOptions:()=>I.RasterOptions,RasterSource:()=>I.RasterSource,RasterTileSource:()=>bm,RasterTileSourceOptions:()=>I.RasterTileSourceOptions,RotationAnimationOptions:()=>S.RotationAnimationOptions,ScaleControl:()=>Bu,SourceAttributes:()=>I.SourceAttributes,StyleIconConfig:()=>x.StyleIconConfig,StyleLoadEvent:()=>b.StyleLoadEvent,StyleOptions:()=>x.StyleOptions,TrafficControl:()=>uu,TrafficScoreEvent:()=>b.TrafficScoreEvent,TrafficVisibilityEvent:()=>b.TrafficVisibilityEvent,ZenithSource:()=>wm,ZoomControl:()=>lu,_J:()=>y,isSupported:()=>Mn,isTerrainSupported:()=>Cn,notSupportedReason:()=>Tn,terrainNotSupportedReason:()=>An});var n={};i.r(n),i.d(n,{getMetersFromPixelsXY:()=>A.$X,getUrl:()=>P.Gr,hashToString:()=>L.GG});var o={};i.r(o),i.d(o,{Q:()=>mc});var r={};i.r(r),i.d(r,{a:()=>gc});var s={};i.r(s),i.d(s,{e:()=>Rc});var a={};i.r(a),i.d(a,{X:()=>Rh});var l={};i.r(l),i.d(l,{S:()=>Nh});var d={};i.r(d),i.d(d,{J:()=>Hh});var c={};i.r(c),i.d(c,{U:()=>qh});var h={};i.r(h),i.d(h,{n:()=>$h});var u={};i.r(u),i.d(u,{P:()=>Jh});var m={};i.r(m),i.d(m,{c:()=>Qh});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:()=>iu});var y={};i.r(y),i.d(y,{Circle:()=>bh,CircleMarker:()=>q,CircleMarkerOptions:()=>_.CircleMarkerOptions,CircleOptions:()=>_.CircleOptions,CommPoiEvent:()=>f.CommPoiEvent,DashedPolyline:()=>vh,DashedPolylineOptions:()=>_.DashedPolylineOptions,DataTileLayer:()=>iu,DataTileLayerOptions:()=>g.DataTileLayerOptions,DefaultSource:()=>hc,DraggablePointerEvent:()=>f.DraggablePointerEvent,DynamicObject:()=>k,DynamicObjectPointerEvent:()=>f.DynamicObjectPointerEvent,Entrance:()=>Zl,EntranceOptions:()=>_.EntranceOptions,FirmsToFloorIndexMap:()=>v.FirmsToFloorIndexMap,FloorComplexHideEvent:()=>f.FloorComplexHideEvent,FloorComplexShowEvent:()=>f.FloorComplexShowEvent,FontName:()=>ja.FontName,GeoJsonSource:()=>Ao.gs,GeoJsonSourceOptions:()=>Ao.GeoJsonSourceOptions,GeoJsonTileSource:()=>Ao.Xm,GeoJsonTileSourceOptions:()=>Ao.GeoJsonTileSourceOptions,GltfModel:()=>gc,GltfModelOptions:()=>r.GltfModelOptions,HTMLMarkerShownEvent:()=>f.HTMLMarkerShownEvent,Heatmap:()=>Rh,HeatmapOptions:()=>a.HeatmapOptions,HeatmapPalette:()=>a.HeatmapPalette,HeatmapPoint:()=>a.HeatmapPoint,HtmlMarker:()=>Nl,HtmlMarkerOptions:()=>_.HtmlMarkerOptions,IconTransformerParams:()=>m.IconTransformerParams,InteractionEvent:()=>f.InteractionEvent,InteractionTarget:()=>f.InteractionTarget,LabelsDebugOptions:()=>o.LabelsDebugOptions,LinePatternType:()=>zo.y,Map:()=>uh,MapClass:()=>uh,MapErrorEvent:()=>p.MapErrorEvent,MapEvent:()=>f.MapEvent,MapOptions:()=>s.MapOptions,MapPointerEvent:()=>f.MapPointerEvent,Marker:()=>Hh,MarkerIconOptions:()=>d.MarkerIconOptions,MarkerLabelOptions:()=>d.MarkerLabelOptions,MarkerOptions:()=>d.MarkerOptions,OnlineMarker:()=>Qh,OnlineMarkerIcon:()=>m.OnlineMarkerIcon,OnlineMarkerOptions:()=>m.OnlineMarkerOptions,Padding:()=>s.Padding,PersonalPoi:()=>s.PersonalPoi,PointLabel:()=>Nh,PointLabelOptions:()=>l.PointLabelOptions,Polygon:()=>yh,PolygonOptions:()=>_.PolygonOptions,Polyline:()=>ph,PolylineOptions:()=>_.PolylineOptions,Raster:()=>$h,RasterOptions:()=>h.RasterOptions,RasterTileSource:()=>Jh,RasterTileSourceOptions:()=>u.RasterTileSourceOptions,Rect:()=>qh,RectOptions:()=>c.RectOptions,RulerChangeEvent:()=>f.RulerChangeEvent,SourceAttrs:()=>s.SourceAttrs,SourceMetatile:()=>ja.SourceMetatile,Stats:()=>s.Stats,TileCoords:()=>s.TileCoords,TileLoadEvent:()=>f.TileLoadEvent,TrafficScoreEvent:()=>f.TrafficScoreEvent,Viewport:()=>s.Viewport,ZenithSource:()=>lc,ZenithSourceOptions:()=>Xa.ZenithSourceOptions,config:()=>T,linePatternFromString:()=>zo.R,mapglUtils:()=>n,utils:()=>E});var b={};i.r(b),i.d(b,{C:()=>_u});var w={};i.r(w),i.d(w,{S:()=>Su});var x={};i.r(x);var S={};i.r(S);var I={};i.r(I);var M=i(7731),T=i(9218),E=i(3741),P=i(2435),L=i(7188),A=i(9073),C=i(3675),z=i(6874);class k extends C.c{constructor(e,t){super(),this.uniqId=(0,z.f)(),this.parentObject=t,this.modules=e.modules,this.mapState=e.state,this.tileObjects=[],this.identifyIds=[]}update(){this.mapState.needReplicasUpdate&&this.tileObjects.forEach((e=>{e.needSync=!0}))}destroy(){const e=this.modules;this.tileObjects.forEach((t=>{t.clean(this.mapState),e.tileManager.removeObject(t)})),this.tileObjects=[],e.layers.removeLayer(this),e.renderer.addRerenderEvent()}getIdentifyData(){return this.identifyIds.map((e=>({dynamicObjectId:this.uniqId,metatileHash:-1,ids:e})))}}var R=i(378),F=i(4265),O=i(1274),D=i(3672),B=i(7609),j=i(7966);function N(e,t){if(void 0===t)return;if(t.sourceId){const i=e.getSourceById(t.sourceId);if(!(null==i?void 0:i.isIdentifiedAsDefault()))return}const i={id:(0,D.Ak)(t.id),symbol:t.symbol};return"point"===t.symbol&&(i.isText=1===t.instanceId),t.sublayer&&(i.isCityCommercial=(0,B.wu)(t.sublayer),i.isPremiumCommercial=(0,B.CE)(t.sublayer),i.isCommercial=(0,B.Ty)(t.sublayer),i.isPersonal=(0,B.h3)(t.sublayer),"point"!==t.symbol||i.isCommercial||(i.sysCode=t.objectClass)),t.center&&(i.center=(0,E.projectMapToGeo)(t.center)),i}function U(e,t,i,n,o){const r=(0,E.projectMapToGeo)(o.camera.unproject(n));if(t&&void 0!==t.dynamicObjectId){const s=e;let a=o.layers.getDynamicObjectLayers().find((e=>e.uniqId===t.dynamicObjectId));if((null==a?void 0:a.parentObject)&&(a=null==a?void 0:a.parentObject),!a)return;const l={lngLat:r,originalEvent:i,point:n,targetData:a};return void a.emit(s,l)}const s=N(o.sourceStorage,t),a=function(e,t){var i;if(void 0===t)return;if(t.sourceId){const n=e.getSourceById(t.sourceId);if(n)switch(n.type){case"geojson":return"internal"===n.subtype?{type:"geojson",id:(0,D.Ak)(t.id),feature:n.getFeatureById(t.id),source:n}:{type:"geojsonTile",getFeatureProperties:()=>void 0===t.tileKey?Promise.resolve():n.getObjectAttributes(t.id,t.tileKey),source:n};case"zenith":{const e=(0,D.Ak)(t.id);return{type:"zenith",id:e,source:n,attributes:n.getObjectAttributes(null!==(i=t.tileKey)&&void 0!==i?i:"",e)}}}}const n={type:"default",id:(0,D.Ak)(t.id)};return t.floorId&&(n.floorId=(0,D.Ak)(t.floorId)),n}(o.sourceStorage,t);if(("mousedown"===e||"click"===e)&&void 0!==t&&"point"===(null==s?void 0:s.symbol)&&void 0!==a){const e=(0,j.HB)(o,t,s)||{};void 0!==e&&(a.poiIcon=e)}const l={lngLat:r,originalEvent:i,point:n,target:s,targetData:a},d=e;o.map.emit(d,l)}class V extends k{constructor(e,t){super(e),this.start=e=>{const{modules:t,container:i}=this;if(0!==e.button)return;const n=(0,O.yK)(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=(0,O.yK)(n,e.clientX,e.clientY),r=R.d9(t);R.IH(r,r,o),R.lu(r,r,i),this.setPosition(this.modules.camera.unproject(r)),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,A.PA)(i),o=this.modules.camera.project(i),r=this.modules.identifier.searchSync(o),s=void 0!==r&&void 0===r.dynamicObjectId?N(this.modules.sourceStorage,r):void 0;this.emit(e,{originalEvent:t,target:s,targetData:this,lngLat:n,point:o})}}var G=i(5597),H=i(6392),Z=i(3249),W=i(4575),X=i(871),K=i(3194);class q extends V{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;const o=(0,A.yq)(this.options.coordinates);this.position={userValue:o,normalizedValue:(0,A.I0)(o)};const{dynamicStyle:r,collector:s,tileManager:a,identifier:l,layers:d,renderer:c,modelsScene:h}=this.modules;if(this.layer=(0,W.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;r.addLayer(this.layer,this.options.zIndex);const u=(0,H.IR)(this.position.normalizedValue),m=(0,Z.FJ)({id:this.interactive?(0,D.Ru)(0,0):NaN}),f=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,m,L.wz);(0,G.Eu)(this.layer,f),(0,G.XI)({collector:s,generator:X.p.generate,args:[r.getStyle().id,this.layer,f,{x:[0],y:[0]}]});const p=s.getAccumulatedData(),_=new F.W("dynamicObject",p.data,c,h,this.mapState,u);a.addObject(_),this.tileObjects.push(_),this.interactive&&this.identifyIds.push(p.identifyIds),d.addLayer(this),s.reset(),this.modules.renderer.addRerenderEvent(),this.interactive&&l.resetCache()}remove(){this.layer&&this.modules.dynamicStyle.removeLayer(this.layer.innerId),this.interactive&&this.modules.identifier.resetCache(),super.destroy()}isOutOfMainReplica(){return!1}setPosition(e){const t=this.tileObjects[0];void 0!==t&&(this.position={userValue:e,normalizedValue:(0,A.I0)(e)},t.setTileCoords((0,H.IR)(this.position.normalizedValue),this.mapState),this.modules.renderer.addRerenderEvent())}getPosition(){return this.position.userValue}isInteractive(){return this.interactive}contains(e){if(!this.layer)return!1;const{layer:t}=this,i=this.modules.camera.project(this.position.normalizedValue),n=(0,K.vn)(t.style.width,(0,K.jJ)(this.mapState.styleZoom,this.mapState.styleState,[]))/2+(0,K.vn)(t.style.strokeWidth,(0,K.jJ)(this.mapState.styleZoom,this.mapState.styleState,[]));return R.TK(i,e)<=n}}var $=i(1913);function Y(e,t,i){const{top:n,right:o,bottom:r,left:s}=e.viewport,{clientWidth:a,clientHeight:l}=t;e.size=[Math.max(1,a-s-o),Math.max(1,l-n-r)],i.updateFrameBuffersSize()}function J(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 Q(e,t){const{top:i,right:n,bottom:o,left:r}=e.padding;e.padding={top:i,right:n,bottom:o,left:r},t.addRerenderEvent(),t.updateFrameBuffersSize()}var ee=i(9450),te=i(8194);const ie="inertia",ne=$.sT.bind(null,ie),oe=(e,t)=>{$.Vx(ie,{step:(e,i,n)=>{const{startPoint:o,startSpeed:r,startTime:s,direction:a}=n,l=ee.d9(a);ee.bA(l,l,i),ee.IH(l,l,o),e.loopWorld?te.se(e.maxBounds,l)||(re(t,e),te.Rk(l,e.maxBounds,l)):te.r3(e.maxBounds,l)||(re(t,e),te.Rk(l,e.maxBounds,l)),e.center=l,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,A.X$)(e.zoom,l):e.zoom=(0,A.Z3)(e.styleZoom,l);const d=((e,t,i)=>e*Math.pow(1-(i-t)/T.inertia.duration,T.inertia.nonLinearity))(r,s,e.time);(0,A.ik)(d,e.zoom)<T.inertia.minSpeed&&re(t,e)}},e)},re=(e,t)=>{$.sT(ie,t),e.classList.remove("mapgl-inertia")},se="center",ae=(e,t,i={})=>{if($.sT(se,e),ne(e),(0,te.Rk)(t,e.maxBounds,t),!1===i.animate||0===i.duration)e.center=t,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,A.X$)(e.zoom,t):e.zoom=(0,A.Z3)(e.styleZoom,t);else{const n=void 0!==i.easing?i.easing:"linear",o=void 0!==i.duration?i.duration:250;$.BL(se,{easing:n},e,e.center,t,o)}},le=$.sT.bind(null,se),de=$.Vx.bind(null,se,{step:(e,t)=>{e.center=t,"zoom"===e.zoomTypePreserving?e.styleZoom=(0,A.X$)(e.zoom,t):e.zoom=(0,A.Z3)(e.styleZoom,t)}}),ce="rotation";function he(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 ue(e,t,i={}){if($.sT(ce,e),!1===i.animate||0===i.duration)e.rotation=he(t,0);else{const n=void 0===i.normalize||i.normalize;$.BL(ce,{easing:i.easing||"linear"},e,e.rotation,n?he(t,e.rotation):t,i.duration||250)}}const me=$.sT.bind(null,ce),fe=$.Vx.bind(null,ce,{step:(e,t)=>e.rotation=he(t,0)});var pe=i(6490);const _e="pitch";function ve(e,t,i={}){$.sT(_e,e);const n=(0,pe.uZ)(t,e.minPitch,e.maxPitch);!1===i.animate||0===i.duration?e.pitch=n:$.BL(_e,{easing:i.easing||"linear"},e,e.pitch,n,i.duration||300)}const ge=$.sT.bind(null,_e),ye=$.Vx.bind(null,_e,{step:(e,t)=>e.pitch=t}),be="zoom",we=(e,t,i={})=>{$.sT(be,e);const n=(0,pe.uZ)(t,e.minZoom,e.maxZoom);if(n!==e.zoom)if(!1===i.animate||0===i.duration)i.zoomPoint&&(ee.IH(e.center,e.center,(0,pe.Kv)(e,i.zoomPoint,{zoom:n})),te.Rk(e.center,e.maxBounds,e.center)),e.zoom=n,e.styleZoom=(0,A.X$)(n,e.center);else{const t=i.useHeightForAnimation?(0,A.r9)(e.zoom,e.size):e.zoom,o=i.useHeightForAnimation?(0,A.r9)(n,e.size):n,r=void 0!==i.easing?i.easing:"easeOutCubic",s=void 0!==i.duration?i.duration:250;$.BL(be,{easing:r},e,t,o,s,{zoomPoint:i.zoomPoint,useHeightForAnimation:!!i.useHeightForAnimation})}},xe=$.sT.bind(null,be),Se=$.Vx.bind(null,be,{step:(e,t,i={})=>{const n=i&&i.useHeightForAnimation?(0,A.nn)(t,e.size):t;i&&i.zoomPoint&&(ee.IH(e.center,e.center,(0,pe.Kv)(e,i.zoomPoint,{zoom:n})),te.Rk(e.center,e.maxBounds,e.center)),e.zoom=n,e.styleZoom=(0,A.X$)(n,e.center)}}),Ie=navigator.msPointerEnabled&&navigator.msMaxTouchPoints&&!window.PointerEvent,Me=window.PointerEvent&&navigator.pointerEnabled&&navigator.maxTouchPoints||Ie||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,Te=ze("webkit"),Ee=ze("chrome")||ze("crios"),Pe="ActiveXObject"in window,Le=!Ee&&ze("safari"),Ae=(ze("gecko")&&!Te&&window.opera,navigator.platform.toUpperCase().indexOf("MAC")>=0),Ce=ze("firefox");function ze(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}function ke(e,t){const i=Object.assign({hitType:"event",eventCategory:"Metrics"},e);window.ga&&window.ga(`${T.analytics.gaName}.send`,i)}function Re(e,t){let i,n=!1;function o(){n=!1,i&&(r(...i),i=!1)}function r(...r){n?i=r:(e(...r),setTimeout(o,t),n=!0)}return r}function Fe(e){xe(e),le(e),me(e),ge(e),ne(e)}class Oe{constructor(e,t){this.onWheelScroll=e=>{e.preventDefault(),void 0===e.deltaMode&&void 0===e.deltaY||(this.state.userHasInteracted=!0,this.screenPoint=(0,O.yK)(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=this.getDelta();Ae?t*=T.zoom.macWheelDeltaToZoomDelta:Number.isInteger(t)?t=(0,pe.Xx)(t)*T.zoom.wheelZoomDelta:t*=T.zoom.notMacTrackpadDeltaToZoomDelta;const i=e.zoom+t,n=(0,pe.uZ)(i,e.minZoom,e.maxZoom);n!==e.zoom&&(Fe(e),we(e,n,{duration:T.zoom.animDuration,animate:!Ae,zoomPoint:e.keepCenterWhileUserZoomRotate?void 0:this.screenPoint}))},this.stop=()=>{this.state.userHasInteracted=!0,xe(this.state)},this.state=e,this.container=t,Ae||(this.startZooming=Re(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.rerenderEvents.push({type:"coreNeedRerender"}))}getDelta(){const e=this.deltaAccumulator/this.eventCount;return this.deltaAccumulator=0,this.eventCount=0,e}}class De{constructor(e){this.defs=e.map((e=>new Be(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 Be{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):"replicas"===this.type&&(this.last={min:0,max:0},this.compare=this.replicas,this.updateFn=this.replicasUpdate)}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]}replicas(e,t){const i=t[0],n=t[t.length-1];return e.min===i&&e.max===n}replicasUpdate(e){this.last.min=e[0],this.last.max=e[e.length-1]}}class je{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=ee.kE(t);if((0,A.ik)(i,e.zoom)<=T.inertia.minSpeed)return;const n=(0,A.h0)(T.inertia.maxSpeed,e.zoom),o=Math.min(i,n),r=this.calcDistanceByStartSpeed(o),s=ee.d9(e.center),a=ee.Ue();ee.Fv(a,t),((e,t,i,n,o)=>{$.BL(ie,{easing:"inertia"},e,0,o,T.inertia.duration,{startPoint:t,startSpeed:i,direction:n,startTime:e.time})})(e,s,o,a,r),this.container.classList.add("mapgl-inertia")},this.stop=()=>{ne(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),Me&&(this.container.addEventListener("touchend",this.onTouchEnd),this.container.addEventListener("touchstart",this.stop)),this.zoomDiffer=new De([{path:"zoom",type:"number"}]),this.styleZoomDiffer=new De([{path:"styleZoom",type:"number"}]),this.centerDiffer=new De([{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(ee.d9(e.center))}getCurrentSpeed(e){if(this.removeOldRecords(e),this.times.length<2)return ee.Ue();const t=ee.d9(this.positions[this.positions.length-1]);return ee.lu(t,t,this.positions[0]),ee.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 Ne{constructor(e){this.emitMouseEvent=e=>{const t=(0,O.yK)(this.container,e.clientX,e.clientY);this.emitEvent(e,t)},this.emitTouchEvent=e=>{const t=(0,O.yK)(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=>{U(i,n,e,t,this.modules)}))}}class Ue{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=(0,O.yK)(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=>{if(e.preventDefault(),this.state.userHasInteracted=!0,e.scale>1?this.gestureZoom=e.scale-1:this.gestureZoom=-1/e.scale+1,this.state.disableRotationByUserInteraction)return;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)},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=ee.Ue(),o=e.keepCenterWhileUserZoomRotate?ee.Ue():(0,pe.Kv)(e,this.screenPoint,{zoom:t,rotation:i});ee.IH(n,e.center,o),Fe(e),ae(e,n,{animate:!1}),we(e,t,{animate:!1}),e.disableRotationByUserInteraction||ue(e,i,{animate:!1}),this.gestureRotation=0,this.gestureZoom=0}}class Ve extends C.c{constructor(e){super(),this.startRenderTime=0,this.catchNextUpdate=!1,this.durations=[],this.badDurations=[],this.countToCheck=75,this.slowFrameTime=100,this.mapState=e,this.originalMapState={center:this.mapState.center.slice(),zoom:this.mapState.zoom,rotation:this.mapState.rotation,pitch:this.mapState.pitch}}update(){const{time:e,needRerender:t,rerenderEvents:i}=this.mapState,n=e-this.startRenderTime;this.catchNextUpdate&&(this.durations.push(n),n>=this.slowFrameTime&&this.badDurations.push(n),this.catchNextUpdate=!1),(t||i.length>0)&&(this.startRenderTime=e,this.catchNextUpdate=!0),this.durations.length>this.countToCheck&&this.check()}getFpsStats(){const e=this.durations.map((e=>1e3/e)),t=this.badDurations.map((e=>1e3/e)),i=(0,pe.$I)(this.originalMapState.center,this.mapState.center)&&this.originalMapState.pitch===this.mapState.pitch&&this.originalMapState.rotation===this.mapState.rotation&&this.originalMapState.zoom===this.mapState.zoom;return{all:{min:e.length>0?Math.min(...e):0,max:e.length>0?Math.max(...e):0,avg:e.length>0?e.reduce(((e,t)=>e+t))/e.length:0,count:e.length},bad:{min:t.length>0?Math.min(...t):0,max:t.length>0?Math.max(...t):0,avg:t.length>0?t.reduce(((e,t)=>e+t))/t.length:0,count:t.length},isStatic:i}}check(){const e=function(e){e.sort(((e,t)=>e-t));const t=e[Math.floor(3*e.length/4)];return Math.round(1e3/t)}(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)}}var Ge=i(9476);class He{constructor(){this.differ=new De([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"rotation",type:"number"},{path:"pitch",type:"number"}]),this.debouncedSet=(0,Ge.D)((e=>{$.BL("stillness",{},e,e.stillness,1,400)}),100,!1),this.stillnessTickerUpdate=$.Vx.bind(null,"stillness",{step:(e,t)=>{e.stillness=t}})}update(e){this.differ.check(e)&&(e.stillness=0,$.sT("stillness",e),this.debouncedSet(e)),this.stillnessTickerUpdate(e)}}class Ze{constructor(e){this.onTouchStart=()=>{this.isTouchStartEmitted=!0},this.onMouseOut=e=>{if(!this.prevGeo)return;const t=(0,O.yK)(this.container,e.clientX,e.clientY);U("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=(0,O.yK)(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,D.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||(U("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"),U("mouseover",i,e,t,this.modules),this.modules.defaultSource.setHoverId(i.id)),U("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 We=(e,t,i,n)=>{$.sT("buildingHeight"+n,e),!1===i.animate||0===i.duration?(t.set(n,i.to),e.needLabeling=!0):$.BL("buildingHeight"+n,{easing:i.easing},e,i.from,i.to,i.duration)};class Xe{constructor(e,t){this.state=e,this.modules=t,this.buildingHeights=new Map,this.minZoomBuildingHeight=1/0}getBuildingHeight(e){return e===-1/0?1: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)=>{$.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!==$.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=$.U2("buildingHeight"+e,i),o=void 0!==n?n.to:t;i.styleZoom>=e&&this.modules.tileManager.viewportTilesReady()&&1!==o?We(i,this.buildingHeights,{animate:!0,easing:T.buildingAnimation.easing,from:t,to:1,duration:T.buildingAnimation.duration*(1-t)},e):i.styleZoom<e&&0!==o&&We(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 Ke=i(8575),qe=i(127);class $e{constructor(e=null,t={}){this._src=null,this._glContext=null,this._texture=null,this._src=e,this.options=Object.assign({},$e.defaultOptions,t)}enable(e,t){return e.activeTexture(e.TEXTURE0+t),this._texture||this.prepare(e),e.bindTexture(e.TEXTURE_2D,this._texture),this}remove(){return this._texture&&this._glContext&&(this._glContext.deleteTexture(this._texture),this._glContext=null,this._texture=null),this}getTexture(){return this._texture}subImage(e,t,i,n){var o;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);const r=this._toGlParam(e,this.options.format),s=this._toGlParam(e,null!==(o=this.options.type)&&void 0!==o?o:$e.UnsignedByte);return null===r||null===s||e.texSubImage2D(e.TEXTURE_2D,0,i,n,r,s,t),this}prepare(e){var t,i,n;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);const o=this._toGlParam(e,this.options.format),r=this._toGlParam(e,null!==(t=this.options.type)&&void 0!==t?t:$e.UnsignedByte),s=this._toGlParam(e,this.options.wrapS),a=this._toGlParam(e,this.options.wrapT),l=this._toGlParam(e,null!==(i=this.options.magFilter)&&void 0!==i?i:$e.LinearFilter),d=this._toGlParam(e,null!==(n=this.options.minFilter)&&void 0!==n?n:$e.LinearMipMapLinearFilter),c=this.options.compareFunc?this._toGlParam(e,this.options.compareFunc):null;if(null!==o&&null!==r){const t=this.hookInternalFormat(o,r,e);ArrayBuffer.isView(this._src)||null===this._src?this.options.size&&e.texImage2D(e.TEXTURE_2D,0,t,this.options.size[0],this.options.size[1],0,o,r,this._src):this._src&&e.texImage2D(e.TEXTURE_2D,0,o,o,r,this._src)}return null!==s&&null!==a&&(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)),null!==l&&null!==d&&(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,l),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,d)),!c||e instanceof WebGLRenderingContext||e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),this.options.generateMipmaps&&this.options.minFilter!==$e.NearestFilter&&this.options.minFilter!==$e.LinearFilter&&e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null),this}_toGlParam(e,t){return t===$e.ClampToEdgeWrapping?e.CLAMP_TO_EDGE:t===$e.Repeat?e.REPEAT:t===$e.MirroredRepeat?e.MIRRORED_REPEAT:t===$e.NearestFilter?e.NEAREST:t===$e.NearestMipMapNearestFilter?e.NEAREST_MIPMAP_NEAREST:t===$e.NearestMipMapLinearFilter?e.NEAREST_MIPMAP_LINEAR:t===$e.LinearFilter?e.LINEAR:t===$e.LinearMipMapNearestFilter?e.LINEAR_MIPMAP_NEAREST:t===$e.LinearMipMapLinearFilter?e.LINEAR_MIPMAP_LINEAR:t===$e.RgbaFormat?e.RGBA:t===$e.AlphaFormat?e.ALPHA:t===$e.RgbFormat?e.RGB:t===$e.DepthComponentFormat?e.DEPTH_COMPONENT:t===$e.UnsignedByte?e.UNSIGNED_BYTE:t===$e.UnsignedShort?e.UNSIGNED_SHORT:t===$e.Float?e.FLOAT:t===$e.UnsignedInt?e.UNSIGNED_INT:e instanceof WebGLRenderingContext?null:t===$e.RedFormat?e.RED:t===$e.CompareRefToTexture?e.COMPARE_REF_TO_TEXTURE:t===$e.CompareNone?e.NONE:t===$e.DepthComponentFormat32?e.DEPTH_COMPONENT32F:null}hookInternalFormat(e,t,i){return i instanceof WebGLRenderingContext?e:e===i.DEPTH_COMPONENT?i.DEPTH_COMPONENT24:t===i.FLOAT&&e===i.RGBA?i.RGBA32F:t===i.FLOAT&&e===i.RED?i.R32F:t!==i.FLOAT&&e===i.RED?i.R8:e}}$e.ClampToEdgeWrapping=1,$e.Repeat=2,$e.MirroredRepeat=3,$e.NearestFilter=4,$e.NearestMipMapNearestFilter=5,$e.NearestMipMapLinearFilter=6,$e.LinearFilter=7,$e.LinearMipMapNearestFilter=8,$e.LinearMipMapLinearFilter=9,$e.DepthComponentFormat=10,$e.DepthComponentFormat32=11,$e.RgbaFormat=14,$e.AlphaFormat=15,$e.RgbFormat=16,$e.UnsignedByte=17,$e.Float=18,$e.UnsignedShort=19,$e.UnsignedInt=20,$e.RedFormat=21,$e.CompareNone=22,$e.CompareRefToTexture=23,$e.defaultOptions={magFilter:$e.LinearFilter,minFilter:$e.LinearMipMapLinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,format:$e.RgbaFormat,generateMipmaps:!0,flipY:!0,premultiplyAlpha:!0,type:$e.UnsignedByte};class Ye{constructor(e={}){this._texture=null,this._glContext=null,this._frameBuffer=null,this._depthAttachment=null,this.options=Object.assign({},Ye.defaultOptions,e),this.options.hasColorOutput&&(this._texture=new $e(null,this.options))}bind(e,t){return this._frameBuffer||this._prepare(e),t?e.bindFramebuffer(t,this._frameBuffer):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}getDepthAttachment(){return this._depthAttachment}_prepare(e){var t,i;if(this._glContext=e,!this._texture&&this.options.hasColorOutput&&(this._texture=new $e(null,this.options)),this._frameBuffer=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._texture&&(this._texture.prepare(e),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._texture.getTexture(),0)),this.options.depthTexture){const n=this._depthAttachment=new $e(null,{magFilter:null!==(t=this.options.magFilter)&&void 0!==t?t:$e.NearestFilter,minFilter:null!==(i=this.options.minFilter)&&void 0!==i?i:$e.NearestFilter,format:$e.DepthComponentFormat,size:this.options.size,premultiplyAlpha:!1,generateMipmaps:!1,type:$e.UnsignedInt,compareFunc:this.options.compareFunc});n.prepare(e),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,n.getTexture(),0)}else{const t=this.options.useHighDepthPrecision?e.DEPTH_STENCIL:this.options.depthInternalFormat,i=this.options.useHighDepthPrecision?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;this._depthAttachment=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this._depthAttachment),e.renderbufferStorage(e.RENDERBUFFER,t,this.options.size[0],this.options.size[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,this._depthAttachment)}this._checkComplete(e),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null)}_unprepare(){this._texture&&(this._texture.remove(),this._texture=null),this._glContext&&this._depthAttachment&&(this._depthAttachment instanceof $e?this._depthAttachment.remove():this._glContext.deleteRenderbuffer(this._depthAttachment),this._depthAttachment=null),this._glContext&&this._frameBuffer&&(this._glContext.deleteFramebuffer(this._frameBuffer),this._frameBuffer=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}`))}}Ye.defaultOptions=Object.assign({},$e.defaultOptions,{size:[0,0],generateMipmaps:!1,depthTexture:!1,hasColorOutput:!0,useHighDepthPrecision:!1,depthInternalFormat:33189});const Je={defines:[],hash:""};class Qe{constructor(e,t,i=Je,n=Je){this.shader=null,this.type="vertex"===e?Qe.Vertex:Qe.Fragment,this.sourceCode=t,this.commonDefinitions=i,this.definitions=n}static createShaderDefinitions(e){return{defines:e,hash:e.map((e=>{var t;return`${e.type}:${null!==(t=e.value)&&void 0!==t?t:""}`})).join("")}}get(e){return this.shader||this.compile(e),this.shader}remove(e){this.shader&&(e.deleteShader(this.shader),this.shader=null)}getCode(){return this.assembleShaderText().slice()}compile(e){const t=this.type===Qe.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: ${String(!i)}. Context is lost: ${String(e.isContextLost())}`);const n=this.assembleShaderText();if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const t=e.getShaderInfoLog(i),o=(n||"").split("\n");throw new Error(t?t.replace(/^ERROR:\s*(\d+):(\d+):\s*(.*?)\n/,(function(e,t,i,n){const r=o[Number(i)-1];return r?`ERROR ${t}:${i}: ${n}\nErroneous line: <<${r}>>\n`:e})):"Unknown shader compilation error")}}assembleShaderText(){const e=this.sourceCode,t=[...this.commonDefinitions.defines,...this.definitions.defines].map((e=>void 0!==e.value?"#define "+e.type+" "+e.value:"#define "+e.type)),i=Array.isArray(e)?e:[e||""];let n=!0;for(const e of i)n&&-1!==e.indexOf("#version")?t.unshift(e):t.push(e),n=!1;return t.join("\n")}}Qe.Vertex=1,Qe.Fragment=2;var et=i(7663);class tt{constructor(e){this.location=null,this.name=e.name,this.type=e.type}getLocation(e,t){return this.location=e.getUniformLocation(t,this.name),this}bind(e,t){switch(this.type){case"1i":e.uniform1i(this.location,t);break;case"1f":e.uniform1f(this.location,t);break;case"2i":e.uniform2i(this.location,t[0],t[1]);break;case"2f":e.uniform2f(this.location,t[0],t[1]);break;case"3i":e.uniform3i(this.location,t[0],t[1],t[2]);break;case"3f":e.uniform3f(this.location,t[0],t[1],t[2]);break;case"4i":e.uniform4i(this.location,t[0],t[1],t[2],t[3]);break;case"4f":e.uniform4f(this.location,t[0],t[1],t[2],t[3]);break;case"1iv":e.uniform1iv(this.location,t);break;case"1fv":e.uniform1fv(this.location,t);break;case"2iv":e.uniform2iv(this.location,t);break;case"2fv":e.uniform2fv(this.location,t);break;case"3iv":e.uniform3iv(this.location,t);break;case"3fv":e.uniform3fv(this.location,t);break;case"4iv":e.uniform4iv(this.location,t);break;case"4fv":e.uniform4fv(this.location,t);break;case"mat2":e.uniformMatrix2fv(this.location,!1,t);break;case"mat3":e.uniformMatrix3fv(this.location,!1,t);break;case"mat4":e.uniformMatrix4fv(this.location,!1,t);break;default:throw new Error(`[2gl] Unsupported uniform type: '${this.type}'`)}return this}}class it{constructor(e,t){this.uniforms={},this.attributes={},this._webglProgram=null,this._linked=!1,this._located=!1,this._error=!1,(e=e||{}).uniforms=e.uniforms||[],e.uniforms.forEach((e=>{this.uniforms[e.name]=new tt(e)})),e.attributes=e.attributes||[],e.attributes.forEach((e=>{this.attributes[e.name]=new et.L(e)})),t=null!=t?t:Je,this._vertexShader=e.buildVertex(t),this._fragmentShader=e.buildFragment(t)}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{if(this._webglProgram=e.createProgram(),!this._webglProgram)throw new Error("Failed to create shader program");const t=this._vertexShader.get(e),i=this._fragmentShader.get(e);t&&e.attachShader(this._webglProgram,t),i&&e.attachShader(this._webglProgram,i);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)||"Couldn't get shader program Info Log");this._linked=!0}catch(e){throw this._error=!0,e}return this}locate(e){if(this._located||this._error||!this._webglProgram)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}}var nt=i(878),ot=i(6273);const rt=(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,r=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]*r,o[1]*r]})},at=(e,t,i)=>{const n=(0,A.EO)(i.zoom);t.bind(e,{u_vec3_projection_scale_style_scale_dpi:[n,n,ot.$U*window.devicePixelRatio]})},lt=(e,t,i)=>{const n=(0,A.EO)(i.styleZoom);t.bind(e,{u_vec3_projection_scale_style_scale_dpi:[n,n,ot.$U*window.devicePixelRatio]})},dt=(e,t,i,n)=>{t.bind(e,{u_float_height_factor:n.buildingHeightAnimator.getDefaultBuildingHeight()})},ct=(e,t)=>{t.bind(e,{u_float_border_width_offset:1/window.devicePixelRatio})},ht=(e,t)=>{t.bind(e,{u_float_z_offset:0})},ut=(e,t)=>{t.bind(e,{u_float_z_offset:-1e-5})},mt=(e,t)=>{t.bind(e,{u_sr2d_texture:0})},ft=(e,t)=>{t.bind(e,{u_vec2_scale_limits:[0,ot.ax]})},pt=(e,t)=>{t.bind(e,{u_vec4_border_color:[0,0,0,0]})},_t=(e,t)=>{t.bind(e,{u_vec4_space_color:[0,0,0,0]})},vt=(e,t,i,n)=>{t.bind(e,{u_cam_pos:n.camera.position})},gt=(e,t,i,n)=>{const o=n.shadowManager.texture;return!o||(o.enable(e,3),t.bind(e,{u_texture_shadow:3,u_shadow_map_params:n.shadowManager.shadowMapParams,u_shadow_bias:n.shadowManager.bias,u_mat4_clip_to_shadow:n.shadowManager.clipToShadowMatrix}),!0)};var yt=i(314);function bt(...e){return(t,i,n,o,r,s)=>{e.forEach((e=>e(t,i,n,o,r,s)))}}const wt=(e,t,i,n,o,r)=>{const s=It(o,n,i);if(!s)return!1;const{lightConfig:a,lightingMode:l}=s,d=(l===yt.OD.none||r?0:1)+(0===a.shadowLightIndex?2:0)+(1===a.shadowLightIndex?4:0);return t.bind(e,{u_int_light_flags:d,u_vec3_light_dir1_direction:a.dir1Direction,u_vec4_light_dir1_color:a.dir1ColorIntensity,u_vec3_light_dir2_direction:a.dir2Direction,u_vec4_light_dir2_color:a.dir2ColorIntensity,u_vec4_ambient_color:a.ambientColorIntensity}),!0},xt=(e,t,i,n,o)=>{const r=(0,K.jJ)(i.styleZoom,i.styleState,[],!1),s=(0,K.vn)(o.style.nearCameraFade,r);return t.bind(e,{u_sdtr_distance:s}),!0},St=(e,t,i,n,o)=>{const r=(0,K.jJ)(i.styleZoom,i.styleState,[],!1),s=o.style.showRatio,a=(0,K.FR)(s,r);return t.bind(e,{u_float_show_ratio:a}),!0};function It(e,t,i){var n;const o=t.styleManager.getStyle(i.handyStyleId);if(!o||!o.light.lightingModesResolved)return null;let r=null!==(n=e.lightingMode)&&void 0!==n?n:o.light.defaultLightMode;"gltfModel"===e.type&&e.style.ignoreGlobalLighting&&(r=yt.OD.none);let s=o.light.lightingModesResolved[r];return s||(s=o.light.lightingModesResolved[o.light.defaultLightMode]),{lightingMode:r,lightConfig:s}}var Mt=i(7619),Tt=i(4713),Et=i(1634);class Pt{constructor(e,t,i=null){this.isDirty=!1,this._vao=null,this._vaoExt=null,this._gl=null,this.attributesAliases={},this._attributes=t,this._shaderProgram=e,this.indicesBuffer=i}static merge(e){const t=e[0],i={},n={};for(const t of e)Object.assign(i,t._attributes),Object.assign(n,t.attributesAliases);const o=new Pt(t._shaderProgram,i,t.indicesBuffer);return o.setAttributesAliases(n),o}copy(){const e=new Pt(this._shaderProgram,this._attributes,this.indicesBuffer);return e.setAttributesAliases(this.attributesAliases),e}bind(e){const t=e.extensions.OES_vertex_array_object,i=e.extensions.ANGLE_instanced_arrays;return this._bind(e.gl,t,i),this}unbind(){return this._glBindVertexArray(null),this}setAttribute(e,t){this._attributes[e]=t,this.remove()}remove(){return this._vao&&(this._glDeleteVertexArray(this._vao),this._vao=null),this}getElementsGLType(e){return this.indicesBuffer?this.indicesBuffer.getGLType(e):null}getBuffer(e){return this._attributes[e]}rewriteData(e,t){this._attributes[e].replaceData(t),this.isDirty=!0}setAttributesAliases(e){Object.assign(this.attributesAliases,e),this.remove()}setAttributes(e,t){const i=this._shaderProgram.attributes,n=this._attributes;for(const o in i){const r=n[this.attributesAliases[o]||o];if(!r)continue;const s=i[o];if(!0!==s.index)for(let t=0;t<s.locationsCount;t++)e.enableVertexAttribArray(s.location+t);r.bind(e,s.location,void 0,t,s.locationsCount)}this.indicesBuffer&&this.indicesBuffer.bind(e)}_bind(e,t,i){this._vao?(this.isDirty&&this.updateDirtyBuffers(e),this._glBindVertexArray(this._vao)):this._prepare(e,t,i)}_prepare(e,t,i){this._gl=e,t&&(this._vaoExt=t),this._vao=this._glCreateVertexArray(),this._glBindVertexArray(this._vao),this.setAttributes(e,i)}_glCreateVertexArray(){const e=this._gl,t=this._vaoExt;return e&&this._isWebGL2(e)?e.createVertexArray():t?t.createVertexArrayOES():null}_glBindVertexArray(e){const t=this._gl,i=this._vaoExt;t&&this._isWebGL2(t)?t.bindVertexArray(e):i?i.bindVertexArrayOES(e):t&&this._shaderProgram.bind(t,void 0,this._attributes)}_glDeleteVertexArray(e){const t=this._gl,i=this._vaoExt;t&&this._isWebGL2(t)?t.deleteVertexArray(e):i&&i.deleteVertexArrayOES(e)}_isWebGL2(e){return"undefined"!=typeof window&&"WebGL2RenderingContext"in window&&e instanceof WebGL2RenderingContext}updateDirtyBuffers(e){const t=this._shaderProgram.attributes,i=this._attributes,n=this.attributesAliases;for(const o in t){const t=i[n[o]||o];(null==t?void 0:t.isDirty)&&t.commitData(e)}this.isDirty=!1}}var Lt=i(6263),At=i(749),Ct=i(4922),zt=i(1678),kt=i(8965),Rt=i(3642),Ft=i(8290),Ot=i(2097),Dt=i(5970),Bt=i(6195),jt=i(8009);const Nt=(e,t)=>new Pt(t,{}),Ut=(e,t)=>{const i=Ot.a.sinks.fill.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0});return new Pt(t,{a_vec2_vertex:n})},Vt=(e,t)=>{const i=Ot.a.sinks.shadow.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0});return new Pt(t,{a_vec2_vertex:n})},Gt=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:8,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:8,offset:4,normalized:!1});return new Pt(t,{a_vec2_vertex:i,a_vec2_texcoord:n})},Ht=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:8,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:8,offset:4,normalized:!0});return new Pt(t,{a_vec2_vertex:i,a_vec4_identifier:n})},Zt=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:12,offset:4,normalized:!1});return new Pt(t,{a_vec2_vertex:i,a_vec4_normals:n})},Wt=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:16,offset:4,normalized:!1}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Float,stride:16,offset:8,normalized:!1});return new Pt(t,{a_vec2_vertex:i,a_vec4_normals:n,a_vec2_shift:o})},Xt=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:12,offset:4,normalized:!1}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:12,offset:8,normalized:!0});return new Pt(t,{a_vec2_vertex:i,a_vec4_normals:n,a_vec4_identifier:o})},Kt=(e,t)=>{const i=jt.z.sinks.patterned.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:8}),s=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:12,normalized:!0});return new Pt(t,{a_vec2_vertex:n,a_vec2_widen:o,a_float_texture:r,a_vec4_identifier:s})},qt=(e,t)=>{const i=28,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:12,normalized:!1}),a=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:16,normalized:!1}),l=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:20,normalized:!1}),d=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:24,normalized:!0});return new Pt(t,{a_vec2_vertex:n,a_vec2_texture_widen:r,a_vec2_widen:o,a_float_vertex_distance:s,a_float_component_distance:a,a_float_object_length:l,a_vec4_identifier:d})},$t=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:28,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:28,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:28,offset:12,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:28,offset:16,normalized:!1}),s=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:28,offset:24,normalized:!0});return new Pt(t,{a_vec4_position:i,a_vec2_check_offset:o,a_vec2_offset:n,a_vec2_texcoord:r,a_vec4_tex_identifier:s})},Yt=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:28,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:28,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:28,offset:20,normalized:!0});return new Pt(t,{a_vec4_position:i,a_vec2_offset:n,a_vec4_identifier:o})},Jt=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:28,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:28,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Float,stride:28,offset:12,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Float,stride:28,offset:20,normalized:!1});return new Pt(t,{a_vec4_position:i,a_vec2_offset:o,a_vec2_texcoord:n,a_vec2_style_zoom_limits:r})},Qt=(e,t)=>{const i=kt.j.sinks.fill.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:3,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:1,dataType:Tt.l.Byte,stride:i,offset:11,normalized:!1}),a=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1}),l=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_float_z:o,a_vec3_normal:r,a_float_gradient:s,a_vec2_dem_position:a,a_float_abs_height:l})},ei=(e,t)=>{const i=kt.j.sinks.inverse.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:8,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_float_z:o,a_vec2_dem_position:r,a_float_abs_height:s})},ti=(e,t)=>{const i=Dt.p.sinks.sideFill.stride,n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1});return new Pt(t,{a_vec4_vertex:n,a_vec2_dem_position:o})},ii=(e,t)=>{const i=Dt.p.sinks.sideFill.stride,n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:8,normalized:!0}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1});return new Pt(t,{a_vec4_vertex:n,a_vec4_identifier:o,a_vec2_dem_position:r})},ni=(e,t)=>{const i=Dt.p.sinks.sideFill.stride,n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1}),r=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:16,normalized:!0});return new Pt(t,{a_vec4_vertex:n,a_vec4_identifier:r,a_vec2_dem_position:o})},oi=(e,t)=>{const i=Dt.p.sinks.sideFill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1});return new Pt(t,{a_vec3_vertex:n,a_vec2_dem_position:o})},ri=(e,t)=>{const i=Bt.Q.sinks.fill.stride,n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:8,normalized:!1});return new Pt(t,{a_vec4_vertex:n,a_vec2_dem_position:o})},si=(e,t)=>{const i=Bt.Q.sinks.fill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:8,normalized:!1});return new Pt(t,{a_vec3_vertex:n,a_vec2_dem_position:o})},ai=(e,t)=>{const i=20,n=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:1,dataType:Tt.l.Short,stride:i,offset:6,normalized:!0}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:i,offset:10,normalized:!1}),a=new Et.K(e,{itemSize:3,dataType:Tt.l.Byte,stride:i,offset:12,normalized:!1}),l=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec4_vertex:n,a_vec2_normal:r,a_vec2_normal_delta:s,a_vec3_direction:a,a_float_distance:o,a_vec2_dem_position:l})},li=(e,t)=>{const i=32,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:8,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1}),s=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:16,normalized:!1}),a=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:20,normalized:!1}),l=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:28,normalized:!0});return new Pt(t,{a_vec3_position:n,a_vec2_offset:o,a_vec2_check_offset:r,a_vec2_texcoord:s,a_vec2_range:a,a_vec4_tex_identifier:l})},di=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:32,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:32,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:32,offset:16,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:32,offset:20,normalized:!1}),s=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:32,offset:24,normalized:!0});return new Pt(t,{a_vec3_position:i,a_vec2_offset:n,a_vec2_texcoord:o,a_vec2_range:r,a_vec4_identifier:s})},ci=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:16,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:16,offset:12,normalized:!0});return new Pt(t,{a_vec4_position:i,a_vec2_offset:n,a_vec4_identifier:o})},hi=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:12,offset:8,normalized:!1}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:12,offset:10,normalized:!1});return new Pt(t,{a_vec2_position:i,a_vec2_direction:n,a_vec2_widen_direction:o})},ui=(e,t)=>{const i=zt.X.sinks.fill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:8,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec3_vertex:n,a_vec2_texcoord:o,a_vec2_dem_position:r})},mi=(e,t)=>{const i=zt.X.sinks.fill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:12,normalized:!0}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec3_vertex:n,a_vec4_identifier:o,a_vec2_dem_position:r})},fi=(e,t)=>{const i=zt.X.sinks.fill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1}),r=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:20,normalized:!0});return new Pt(t,{a_vec3_vertex:n,a_vec4_identifier:r,a_vec2_dem_position:o})},pi=(e,t)=>{const i=zt.X.sinks.fill.stride,n=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec3_vertex:n,a_vec2_dem_position:o})},_i=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:8,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:8,offset:4,normalized:!1});return new Pt(t,{a_vec3_vertex:i,a_vec4_direction_distance:n})},vi=(e,t)=>{const i=new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:16,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:16,offset:4,normalized:!1}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:16,offset:8,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:16,offset:12,normalized:!1}),s=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:16,offset:12,normalized:!1});return new Pt(t,{a_vec3_vertex:i,a_float_z:n,a_vec4_direction_distance:o,a_vec2_dem_position:r,a_float_abs_height:s})},gi=(e,t)=>{const i=36,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:4,normalized:!0}),r=new Et.K(e,{itemSize:4,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:12,normalized:!1}),a=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1}),l=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:20,normalized:!1}),d=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:24,normalized:!1}),c=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:28,normalized:!1}),h=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:i,offset:32,normalized:!0});return new Pt(t,{a_vec2_vertex:n,a_vec2_segment_end:o,a_vec4_texture_widen_arrow_widen:r,a_vec2_widen:s,a_vec2_direction:a,a_float_distance_from_start:l,a_float_object_length:d,a_float_type:c,a_vec4_identifier:h})},yi=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:12,offset:4,normalized:!1});return new Pt(t,{a_vec4_vertex:i,a_vec2_widen:n})},bi=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:12,offset:0,normalized:!0}),n=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:12,offset:4,normalized:!1}),o=new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:12,offset:8,normalized:!0});return new Pt(t,{a_vec4_vertex:i,a_vec2_widen:n,a_vec4_identifier:o})},wi=(e,t)=>{const i=Lt.h.sinks.fill.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:4,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})},xi=(e,t)=>{const i=At.B.sinks.framebuffer.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!1});return new Pt(t,{a_vec2_position:n,a_vec2_widen:r,a_float_weight:o})},Si=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.Float,stride:0,offset:0,normalized:!1});return new Pt(t,{a_vec2_position:i})},Ii=(e,t)=>new Pt(t,{a_vec2_position:e}),Mi=(e,t)=>{const i=Ct._.sinks.elevation.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:4,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})},Ti=(e,t)=>{const i=Ct._.sinks.flatBottom.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:i,offset:8,normalized:!0});return new Pt(t,{a_vec2_vertex:n,a_vec2_centroid:o,a_vec2_extender:r})},Ei=(e,t)=>{const i=Ct._.sinks.hillshade.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:4,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_vec2_texcoord:o})},Pi=e=>{const t=Ft.E.sinks.instances.stride;return{a_vec3_instance_position:new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:t,offset:0,normalized:!0,instanceDivisor:1}),a_mat3_instance_matrix:new Et.K(e,{itemSize:9,dataType:Tt.l.Float,stride:t,offset:8,instanceDivisor:1}),a_vec4_instance_localid:new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:t,offset:44,normalized:!0,instanceDivisor:1})}},Li=e=>{const t=Ft.E.sinks.instances.stride;return{a_vec3_instance_position:new Et.K(e,{itemSize:3,dataType:Tt.l.UnsignedShort,stride:t,offset:0,normalized:!0,instanceDivisor:1}),a_mat3_instance_matrix:new Et.K(e,{itemSize:9,dataType:Tt.l.Float,stride:t,offset:8,instanceDivisor:1}),a_vec4_instance_localid:new Et.K(e,{itemSize:4,dataType:Tt.l.UnsignedByte,stride:t,offset:48,normalized:!0,instanceDivisor:1})}},Ai=(e,t)=>{const i=Rt._.sinks.fill.stride,n=new Et.K(e,{itemSize:2,dataType:Tt.l.UnsignedShort,stride:i,offset:0,normalized:!0}),o=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:4,normalized:!1}),r=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:8,normalized:!1}),s=new Et.K(e,{itemSize:3,dataType:Tt.l.Byte,stride:i,offset:12,normalized:!1}),a=new Et.K(e,{itemSize:1,dataType:Tt.l.Byte,stride:i,offset:15,normalized:!1}),l=new Et.K(e,{itemSize:2,dataType:Tt.l.Short,stride:i,offset:16,normalized:!1}),d=new Et.K(e,{itemSize:1,dataType:Tt.l.Float,stride:i,offset:16,normalized:!1});return new Pt(t,{a_vec2_vertex:n,a_float_z:o,a_vec2_extender:r,a_vec3_normal:s,a_float_gradient:a,a_vec2_dem_position:l,a_float_abs_height:d})},Ci=(e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:0,offset:0,normalized:!1});return new Pt(t,{a_vec2_vertex:i})};var zi=i(132);const ki=32,Ri=1/0;class Fi extends F.Y{constructor(e,t,i,n){var o,r;super("raster"),this.children=[],this.identifyChildren=[];const s=this;this.setTileCoords(e,t.map.state),null===(r=null===(o=t.renderer.symbolSettingsList.dem)||void 0===o?void 0:o[n])||void 0===r||r.forEach((e=>{const o={id:(0,z.f)(),type:nt.H.Tile,symbol:"dem",sink:n,tile:this,attributes:{layerId:zi.he,styleId:t.map.state.handyStyleId,tileData:[]},stride:4,rangeStart:0,rangeEnd:24576,attributesHash:"",layerSettings:e,vao:i[n],canRender:!0};e.identify?s.identifyChildren.push(o):e.depthTest?s.depthTestChildren.push(o):e.shadow?s.shadowChildren.push(o):s.children.push(o)}))}setTileCoords(e,t){const i=e[2],n=e[3],o=(0,H.aq)(i);this.coords=e,this.size=o,this.zoomLevel=i,this.detailLevel=n,this.mvpMatrices.clear(),this.demMatrices.clear(),this.flatMapTexMatrices.clear(),this.syncReplicas(t)}syncReplicas({visibleMapReplicas:e}){const t=Math.pow(2,this.coords[2]),i=this.size/ki;this.bounds.clear(),this.modelMatrices.clear(),e.forEach((e=>{const n=[this.coords[0]+e*t,this.coords[1],this.coords[2],this.coords[3]],o=(0,H.Oy)(n);o[0]-=i,o[1]-=i,this.bounds.set(e,{min:[o[0],o[1]],max:[o[0]+this.size,o[1]+this.size]});const r=qe.Ue();qe.wA(r,o,ee.al(this.size+i,this.size+i,ot._9)),this.modelMatrices.set(e,r)})),this.needSync=!1}}class Oi{constructor(e,t){var i;this.meshTiles=new Map,this.groundTiles=new Map,this.destroyed=!1,this.modules=e.modules,this.maxZoom=null!==(i=null==t?void 0:t.maxZoom)&&void 0!==i?i:Ri;const n=[];for(let e=0;e<ki;e++)for(let t=0;t<ki;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=ot._H/ki;for(let e=0;e<n.length;e++)n[e]*=o;this.buffer=new Tt.l(new Uint16Array(n),{itemSize:2,dataType:Tt.l.UnsignedShort,stride:0,offset:0,normalized:!0}),this.buffer.drawType=Tt.l.StaticDraw,this.vaos={mesh:Ii(this.buffer,this.modules.renderer.getShaderProgram("demMesh")),ground:Ii(this.buffer,this.modules.renderer.getShaderProgram("demGround"))},this.update()}destroy(){this.destroyed||(this.meshTiles=new Map,this.groundTiles=new Map,Object.values(this.vaos).forEach((e=>{e.unbind(),e.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;e.needReplicasUpdate&&(this.meshTiles.forEach((e=>{e.needSync=!0})),this.groundTiles.forEach((e=>{e.needSync=!0})));const t=Math.trunc(e.styleZoom),i=Math.min(t,Math.min(this.maxZoom,t)),n=(0,H.b5)(this.modules.map.state,i,0,i).reduce(((e,t)=>(e.set((0,H.gx)(t),t),e)),new Map);this.meshTiles.forEach(((e,t)=>{n.has(t)||(this.meshTiles.delete(t),this.groundTiles.delete(t))})),n.forEach(((e,t)=>{this.meshTiles.has(t)||(this.meshTiles.set(t,new Fi(e,this.modules,this.vaos,"mesh")),this.groundTiles.set(t,new Fi(e,this.modules,this.vaos,"ground")))}))}updateStyleId(){this.meshTiles.forEach((e=>this.updateTileStyleId(e))),this.groundTiles.forEach((e=>this.updateTileStyleId(e)))}updateTileStyleId(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})),e.depthTestChildren.forEach((e=>{e.attributes.styleId=this.modules.map.state.handyStyleId})),e.shadowChildren.forEach((e=>{e.attributes.styleId=this.modules.map.state.handyStyleId}))}}var Di=i(7123),Bi=i(2398),ji=i(2618),Ni=i(267);const Ui=new ji.TD("main").getPacked(),Vi=64;class Gi{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="dem",this.tree=Di(),this.minElevation=0,this.revision=0,this.tileLoader=new Bi.U("arrayBuffer"),this.attributes={},this.tiles=new Map,this.textureIndices=new Map,this.url=e=>{const[t,i,n]=(0,H._W)(e);return this.options.url(t,i,n)}}abortTileFetch(e){this.tileLoader.abortRequest((0,H.gx)(e))}deleteTile(e){const t=(0,H.gx)(e);if(this.tiles.get(t)){const i=(0,H.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.updateRevision()}this.tiles.delete(t),this.updateMinElevation()}fetchTile(e){const t=(0,H.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&&n.data.byteLength?this.tileDataToFloat32Array(n.data,e):void 0),this.updateRevision()),i)),(()=>Promise.resolve(void 0)))}generateTile(e,t,i,n,o,r){return(0,M.mG)(this,void 0,void 0,(function*(){const e=[],i=[],n=(0,H.gx)(t),o=this.tiles.get(n);if(!o)return Promise.resolve({results:e,transferable:i});let r=this.textureIndices.get(n);if(void 0===r){const e=(0,H.aq)(t[2]),i=(0,H.Sl)(t);this.tree.insert(Object.assign({key:n,minX:i.min[0],minY:i.min[1],maxX:i.max[0],maxY:i.max[1],cellSize:e/Vi},o)),this.updateMinElevation();const s=this.modules.renderer.getRenderingContext(),a=new $e(o.data,{size:[Vi,Vi],format:2===Fa.webglVersion?$e.RedFormat:$e.AlphaFormat,type:$e.Float,flipY:!0,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter}).prepare(s);r=this.modules.imageManager.addPreparedTexture(a),this.textureIndices.set(n,r)}const s=this.modules.map.state.handyStyleId,a=.0078125,l=[[0,0,0+a,0+a],[1,0,1-a,0+a],[0,1,0+a,1-a],[0,1,0+a,1-a],[1,0,1-a,0+a],[1,1,1-a,1-a]],d=Ct._.generateElevation(this.modules.collector,l,s,zi.he,r);return e.push({regionId:0,metatileHash:-1,styleId:s,collectorOutput:{data:[d],labels:[],geoIds:new Uint32Array,floorHidingMap:[],rastersToLoad:new Float64Array,transferable:[],dataModelsUrls:{},identifyIds:Ui,promotedObjectAttributes:{}}}),Promise.resolve({results:e,transferable:i})}))}tileDataToFloat32Array(e,t){const[i,n,o,r]=t,s=new Uint8Array(e),a=new Float32Array(Math.pow(Vi,2));let l=1/0,d=-1/0;for(let e=0;e<Vi;e++){const t=(0,E.projectMapToGeo)((0,H.Oy)([i,n+.015625*e,o,r])),c=(0,A.Xg)(t[1]);for(let t=0;t<Vi;t++){const i=t+e*Vi,n=(s[i]+256*s[Math.pow(Vi,2)+i]-1e4)*c;l=Math.min(n,l),d=Math.max(n,d),a[i]=n}}return{data:a,minZ:l,maxZ:d,bounds:{min:(0,H.Oy)(t),max:(0,H.Oy)([i+1,n+1,o,r])}}}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){if(e.data){const i=(0,pe.uZ)((t[0]-e.minX)/e.cellSize,0,63),n=(0,pe.uZ)((t[1]-e.minY)/e.cellSize,0,63),o=Math.trunc(i),r=Math.trunc(n),s=Math.min(o+1,63),a=Math.min(r+1,63),l=R.t7([],[e.data[Hi(r)*Vi+o],e.data[Hi(a)*Vi+o]],[e.data[Hi(r)*Vi+s],e.data[Hi(a)*Vi+s]],i%1);return(0,pe.t7)(l[0],l[1],n%1)}}(t,e)}getElevationTile(e){const t=(0,A.I0)(e);return this.tree.search({minX:t[0],minY:t[1],maxX:t[0],maxY:t[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,Ni.BS)(e.tilesBounds);if(void 0!==e.elevation){const n=e.elevation*A.C/t+1,o=Math.max(e.pitch/e.maxPitch*30,4);(0,te.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-jn>1?this.minElevation=n.reduce(((e,t)=>{if(t.data){const n=(0,te.jV)(i,t.bounds);R.lu(n.min,n.min,t.bounds.min),R.lu(n.max,n.max,t.bounds.min),R.bA(n.min,n.min,1/t.cellSize),R.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,r=t.data[n];e=void 0===e?r:Math.min(e,r)}}return e}),void 0):this.minElevation=n.reduce(((e,t)=>void 0===e?t.minZ:Math.min(e,t.minZ)),void 0)}getRevision(){return this.revision}updateRevision(){this.revision++}}function Hi(e){return 63-e}var Zi=i(3698),Wi=i(1245),Xi=i(4874),Ki=i(2539);const qi=new Float64Array(16);class $i{constructor(e,t,i){this.detailLevel=0,this.mvpMatrix=new Float64Array(16),this.texMatrix=new Float64Array(16),qe.JG(this.mvpMatrix,e),qe.Jp(this.texMatrix,A.LX,e),this.detailLevel=i,this.viewport=[[0,0,0,1],[1,0,0,1],[1,1,0,1],[0,1,0,1]],qe.U_(qi,this.texMatrix),this.viewport.forEach((e=>{ee.fF(e,e,qi),e[0]-=t[0],e[1]-=t[1],e[2]-=t[2],e[2]>=0&&(e[2]=-1),ee.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 Yi{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,extendedTilesBounds:r,zoom:s,cameraConfig:a}=this.modules.map.state,l=(0,Ki.hS)(r[0],r[1]),d=(0,Ki.Oy)(r[2],l);this.textures=[];const c=(0,pe.Id)(45),h=Math.min(this.modules.map.state.pitch,c),u=new Xi.V({pitch:h,center:e,padding:t,rotation:i,size:n,viewport:o,zoom:s,cameraConfig:a}),m=(0,pe.uZ)(Math.pow(this.modules.map.state.pitch/c,3),0,1),[f,p]=this.modules.camera.position,_=Wi.fF([],[f,p,0,1],u.viewProjectionMatrix),v=Math.min(_[1]/_[3]+1,-.5);let g=Math.max(v,-1);if(qe.wA(qi,[0,-g,0],[1/Un[0],1/Un[1],1]),qe.Jp(qi,qi,u.viewProjectionMatrix),this.textures.push(new $i(qi,u.position,0)),(0,Ki.Oy)(this.textures[0].viewport[2],l)>=d)return!0;if(v<g){const e=Math.max(Math.abs(v-g)/2,1);qe.wA(qi,[0,2/e+1,0],[1/Un[0],Un[1]/e,1]),qe.Jp(qi,qi,u.viewProjectionMatrix),this.textures.push(new $i(qi,u.position,1))}g+=1;const y=Math.pow(n[1]/749,2);[1.4,3.2,12,31].some(((e,t)=>{e=(e-1)*m*y+1,qe.wA(qi,[0,-(g*e+1),0],[1/Un[0],e/Un[1],1]),qe.Jp(qi,qi,u.viewProjectionMatrix),g+=2/e;const i=this.textures.push(new $i(qi,u.position,t));if((0,Ki.Oy)(this.textures[i-1].viewport[2],l)>=d)return!0}))}destroy(){this.textures=[]}}var Ji=i(6201);const Qi=null===window||void 0===window?void 0:window.WebGLRenderingContext,en={depthMask:!0,depthTest:!0,depthFunc:Qi?Qi.LESS:0,cullFace:!0,cullFaceMode:Qi?Qi.BACK:0,blend:!1,blendFunc:{sfactor:Qi?Qi.ONE:0,dfactor:Qi?Qi.ZERO:0},blendEquation:Qi.FUNC_ADD,colorMask:[!0,!0,!0,!0],polygonOffsetFill:!1,polygonOffset:{factor:1,units:2}},tn=e=>Object.assign({},en,e),nn=(e,t,i,n)=>{var o,r,s,a,l,d,c,h,u,m,f,p,_,v,g,y,b,w,x,S,I,M,T,E,P,L,A,C,z,k,R,F,O;const D=i.webglState;if(D.state===t&&D.layerState===(null==n?void 0:n.webglState))return;if(e.depthMask(null!==(r=null===(o=null==n?void 0:n.webglState)||void 0===o?void 0:o.depthMask)&&void 0!==r?r:t.depthMask),(null!==(a=null===(s=null==n?void 0:n.webglState)||void 0===s?void 0:s.depthTest)&&void 0!==a?a:t.depthTest)?(e.enable(e.DEPTH_TEST),e.depthFunc(null!==(d=null===(l=null==n?void 0:n.webglState)||void 0===l?void 0:l.depthFunc)&&void 0!==d?d:t.depthFunc)):e.disable(e.DEPTH_TEST),(null!==(h=null===(c=null==n?void 0:n.webglState)||void 0===c?void 0:c.cullFace)&&void 0!==h?h:t.cullFace)?(e.enable(e.CULL_FACE),e.cullFace(null!==(m=null===(u=null==n?void 0:n.webglState)||void 0===u?void 0:u.cullFaceMode)&&void 0!==m?m:t.cullFaceMode)):e.disable(e.CULL_FACE),null!==(p=null===(f=null==n?void 0:n.webglState)||void 0===f?void 0:f.blend)&&void 0!==p?p:t.blend){e.enable(e.BLEND),e.blendEquation(null!==(v=null===(_=null==n?void 0:n.webglState)||void 0===_?void 0:_.blendEquation)&&void 0!==v?v:t.blendEquation);const i=null!==(y=null===(g=null==n?void 0:n.webglState)||void 0===g?void 0:g.blendFuncSeparate)&&void 0!==y?y:t.blendFuncSeparate;i?e.blendFuncSeparate(i.srcRgb,i.dstRgb,i.srcAlpha,i.dstAlpha):e.blendFunc(null!==(x=null===(w=null===(b=null==n?void 0:n.webglState)||void 0===b?void 0:b.blendFunc)||void 0===w?void 0:w.sfactor)&&void 0!==x?x:t.blendFunc.sfactor,null!==(M=null===(I=null===(S=null==n?void 0:n.webglState)||void 0===S?void 0:S.blendFunc)||void 0===I?void 0:I.dfactor)&&void 0!==M?M:t.blendFunc.dfactor)}else e.disable(e.BLEND);const B=null!==(E=null===(T=null==n?void 0:n.webglState)||void 0===T?void 0:T.colorMask)&&void 0!==E?E:t.colorMask;e.colorMask(B[0],B[1],B[2],B[3]),(null!==(L=null===(P=null==n?void 0:n.webglState)||void 0===P?void 0:P.polygonOffsetFill)&&void 0!==L?L:t.polygonOffsetFill)?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(null!==(z=null===(C=null===(A=null==n?void 0:n.webglState)||void 0===A?void 0:A.polygonOffset)||void 0===C?void 0:C.factor)&&void 0!==z?z:t.polygonOffset.factor,null!==(F=null===(R=null===(k=null==n?void 0:n.webglState)||void 0===k?void 0:k.polygonOffset)||void 0===R?void 0:R.units)&&void 0!==F?F:t.polygonOffset.units)):e.disable(e.POLYGON_OFFSET_FILL),null===(O=t.customStateBinder)||void 0===O||O.call(t,e),D.state=t,D.layerState=null==n?void 0:n.webglState},on=tn({}),rn=(tn({blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),tn({blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA},depthFunc:Qi.GREATER,depthMask:!1,cullFace:!1,polygonOffsetFill:!0,polygonOffset:{factor:1,units:2}})),sn=tn({depthMask:!1,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),an=tn({blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA},cullFace:!1}),ln=tn({depthMask:!1,depthTest:!1,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),dn=tn({depthMask:!1,depthTest:!1,colorMask:[!0,!1,!1,!0]}),cn=tn({depthMask:!1,depthTest:!1}),hn=tn({depthMask:!1}),un=tn({colorMask:[!1,!1,!1,!1]}),mn=tn({depthFunc:Qi.EQUAL,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),fn=tn({depthMask:!1,depthTest:!1,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),pn=tn({depthMask:!1,depthTest:!0,depthFunc:Qi.LEQUAL,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),_n=tn({depthMask:!1,depthTest:!0,depthFunc:Qi.GREATER,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),vn=tn({polygonOffsetFill:!0,polygonOffset:{factor:1,units:2},blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE_MINUS_SRC_ALPHA}}),gn=tn({cullFaceMode:Qi.BACK}),yn=tn({cullFace:!1}),bn=tn({depthMask:!1,depthTest:!1,blend:!0,blendFunc:{sfactor:Qi.ONE,dfactor:Qi.ONE}}),wn=tn({depthTest:!1,cullFace:!1}),xn=tn({depthTest:!1,depthMask:!1,blend:!0,blendFuncSeparate:{srcRgb:Qi.SRC_ALPHA,dstRgb:Qi.ONE_MINUS_SRC_ALPHA,srcAlpha:Qi.ONE,dstAlpha:Qi.ONE_MINUS_SRC_ALPHA}}),Sn=tn({colorMask:[!0,!0,!0,!0],depthMask:!0}),In=tn({colorMask:[!0,!0,!0,!0],depthMask:!1});function Mn(e){return!Tn(e)}function Tn(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===En[t]&&(En[t]=function(e){const t=Pn(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 En[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 En={};function Pn(e){const t=document.createElement("canvas"),i={antialias:!1,stencil:!0,failIfMajorPerformanceCaveat:e};if("WebGLRenderingContext"in window)return t.getContext("webgl",i)||t.getContext("experimental-webgl",i)}let Ln;function An(){return Ln=void 0,Cn(),Ln}function Cn(){const e=new Float32Array([-1,-1,1,-1,-1,1]),t=Pn(!1);if(!t)return Ln="Failed to obtain WebGL context",!1;for(const e of["OES_element_index_uint","OES_standard_derivatives","OES_vertex_array_object","OES_texture_float","OES_texture_float_linear"])if(!t.getExtension(e))return Ln=`Absent ${e} extension`,!1;const i=new Ye({size:[2,2]});i.bind(t);const n=new $e(new Float32Array([1,0,1,0]),{size:[2,2],format:$e.AlphaFormat,type:$e.Float,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter}).prepare(t),o=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);if(!o||!r||t.isContextLost())return Ln="Cannot create shaders",!1;t.shaderSource(o,"attribute vec2 pos;\n    void main () {\n        gl_Position = vec4(pos, 0, 1);\n    }"),t.compileShader(o),t.shaderSource(r,"precision mediump float;\n    uniform sampler2D tex;\n    void main () {\n        gl_FragColor = vec4(texture2D(tex, vec2(0.4, 0.4)).a, 0, 0, 0);\n    }"),t.compileShader(r);const s=t.createProgram();if(!s)return Ln="Cannot compile shader program",!1;t.attachShader(s,o),t.attachShader(s,r),t.linkProgram(s),t.useProgram(s);const a=t.createBuffer();if(!a)return Ln="Cannot create buffer",!1;t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW);const l=t.getAttribLocation(s,"pos");t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),n.enable(t,0);const d=t.getUniformLocation(s,"tex");t.uniform1i(d,0),t.viewport(0,0,2,2),t.drawArrays(t.TRIANGLES,0,3);const c=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,c),i.unbind(t),255!==c[0]}function zn(e){return!(e instanceof WebGLRenderingContext)||!!e.getExtension("WEBGL_depth_texture")}var kn=i(9600);const Rn=(0,z.H)(),Fn=(0,z.H)(),On=(0,z.H)(),Dn=(0,z.H)(),Bn=64,jn=12,Nn=.001,Un=[1.7,1];const Vn=ee.Ue(),Gn=new Float64Array(16);class Hn{constructor(e){this.demTextureMatrix=new Float64Array(16),this.demCorrectedFbVpToDemTex=new Float32Array(16),this.demTexToCorrectedTex=new Float32Array(16),this.correctedTexToDemTex=new Float32Array(16),this.isDemCorrectionEnabled=!1,this.demCorrectedScale=1,this.demFbVpMatrix=new Float64Array(16),this.demCorrectedFbVpMatrix=new Float64Array(16),this.demFramebufferId=yt.ze,this.correctedDemFramebufferId=yt.ze,this.flatFramebufferId=yt.ze,this.identifyFlatFramebufferId=yt.ze,this.hillshadeRampTextureId=NaN,this.hillshadeFramebufferId=yt.ze,this.groundFramebufferId=yt.ze,this.isGroundBufferValid=!1,this.lastStyleId=NaN,this.tilesRevision=0,this.tileSet="relief",this.modules=e,this.enabled=!1,this.sources=[],this.sourcesRevision=[],this.tileLayers=[],this.groundBuffer=new Float32Array,this.differ=new De([])}enable(){if(void 0===this.isTerrainSupported&&(this.isTerrainSupported=Cn()),this.enabled||!this.isTerrainSupported)return;this.differ=new De([{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.correctedDemFramebufferId=this.createCorrectedDemFramebuffer(),this.hillshadeFramebufferId=this.createHillshadeFramebuffer(),this.flatFramebufferId=this.createFlatFramebuffer(),this.identifyFlatFramebufferId=this.createFlatIdentifyFramebuffer(),this.groundFramebufferId=this.createGroundFramebuffer(),this.fullscreenBuffer=new Tt.l(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,r]=t;return e.push(i*ot._H,n*ot._H,(0,Zi.Bb)(o),(0,Zi.Bb)(r)),e}),[]))),this.hillshadeVao=Ei(this.fullscreenBuffer,this.modules.renderer.getShaderProgram("demHillshade"));const e=this.modules.renderer.getShaderProgram("demElevationCopy");this.copyDemVao=Ei(this.fullscreenBuffer,e),this.addDefaultSources(),this.modules.styleManager.setFramebufferId(this.modules.map.state.handyStyleId,zi.he,{elevation:this.demFramebufferId,hillshade:this.hillshadeFramebufferId,flatBottom:this.correctedDemFramebufferId,ground:this.groundFramebufferId}),this.updateRampTextureId(),this.enabled=!0}onTerrainStyleChange(){this.updateRampTextureId()}disable(){var e,t,i,n,o;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.sourcesRevision=[],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(),null===(o=this.fullscreenBuffer)||void 0===o||o.remove(),this.modules.styleManager.removeLayer("demo_raster_layer"),this.modules.styleManager.setFramebufferId(this.modules.map.state.handyStyleId,zi.he,{elevation:yt.ze,hillshade:yt.ze,flatBottom:yt.ze,ground:yt.ze}),this.modules.renderer.removeFramebuffer(this.hillshadeFramebufferId),this.modules.renderer.removeFramebuffer(this.demFramebufferId),this.modules.renderer.removeFramebuffer(this.correctedDemFramebufferId),this.modules.renderer.removeFramebuffer(this.flatFramebufferId),this.modules.renderer.removeFramebuffer(this.groundFramebufferId),this.enabled=!1)}update(){var e,t,i,n;if(!this.enabled)return;const o=this.modules.map.state;this.lastStyleId!==o.handyStyleId&&(this.updateRampTextureId(),null===(e=this.meshSource)||void 0===e||e.updateStyleId(),null===(t=this.hillshadeTile)||void 0===t||t.children.forEach((e=>{e.attributes.styleId=o.handyStyleId})),this.modules.styleManager.setFramebufferId(this.modules.map.state.handyStyleId,zi.he,{elevation:this.demFramebufferId,hillshade:this.hillshadeFramebufferId,flatBottom:this.correctedDemFramebufferId,ground:this.groundFramebufferId}),this.updateClearColor(),this.lastStyleId=o.handyStyleId);const r=this.updateTilesRevision(),s=this.differ.check(this.modules.map.state);(r||s)&&(this.isGroundBufferValid=!1),s&&(this.updateMinElevation(),null===(i=this.flatMapSource)||void 0===i||i.update(),null===(n=this.meshSource)||void 0===n||n.update(),this.updateDemFramebufferMatrix(),this.modules.renderer.addRerenderEvent())}isEnabled(){return this.enabled}getDemFramebufferId(){return this.demFramebufferId}getCorrectedDemFramebufferId(){return this.correctedDemFramebufferId}getFlatFramebufferId(){return this.flatFramebufferId}getIdentifyFlatFramebufferId(){return this.identifyFlatFramebufferId}getHillshadeFramebufferId(){return this.hillshadeFramebufferId}getHillshadeRampTextureId(){return this.hillshadeRampTextureId}getElevation(e){if(this.enabled)for(let t=this.sources.length-1;t>=0;t--){const i=this.sources[t].getElevation(e);if(void 0!==i)return i}}getLabelsDemKey(e){if(!this.enabled||0===e.length)return;let t,i;for(const i of e)if(t=i.labels.find((e=>e.type===Ji.R2.Point)),t)break;if(t){(0,H.L7)(Vn,t.vertices,0,(0,H.Bs)(t.tileCoords));for(let e=this.sources.length-1;e>=0;e--){const t=this.sources[e].getElevationTile(Vn);if(void 0!==t){i=t;break}}return i?i.key:void 0}}enrichWithElevation(e){var t;if(this.enabled)for(const i of e){let e=null;for(const n of i.labels)n.type===Ji.R2.Point&&(e||(e=(0,H.Bs)(n.tileCoords)),(0,H.L7)(Vn,n.vertices,0,e),n.demElevation=null!==(t=this.getElevation(Vn))&&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.meshTiles.values()):[]}getGroundTiles(){return this.meshSource?Array.from(this.meshSource.groundTiles.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+Rn),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+Dn),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+Fn),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0+On),e.bindTexture(e.TEXTURE_2D,null)}setMeshMaxZoom(e){var t;this.meshMaxZoom=e,null===(t=this.meshSource)||void 0===t||t.setMaxZoom(e)}getVerticalScale(){const e=this.modules.map.state,t=this.modules.styleManager.getStyle(e.handyStyleId);if(!t)return 0;const i=t.dem.style,n=(0,K.jJ)(e.styleZoom,e.styleState,[]);return(0,K.vn)(i.verticalScale,n)}getTilesRevision(){return this.tilesRevision}setTileSet(e){this.tileSet=e,this.enabled&&(this.disable(),this.enable())}getGroundPoint(e){if(!this.enabled)return;if(this.updateGround(),!this.isGroundBufferValid)return;const t=this.modules.renderer.getFramebuffer(this.groundFramebufferId);if(!t)return;const i=t.renderTarget.options.size,n=e[0]-this.modules.map.state.viewport.left,o=e[1]-this.modules.map.state.viewport.top;if(n<0||n>i[0]-1||o<0||o>i[1]-1)return;const r=4*((i[1]-o-1)*i[0]+n);if(0===this.groundBuffer[r+3])return;const[s,a]=(0,A.PA)([this.groundBuffer[r],this.groundBuffer[r+1]]);return[s,a,this.groundBuffer[r+2]]}updateRampTextureId(){const e=this.modules.styleManager.getStyle(this.modules.map.state.handyStyleId);if(null==e?void 0:e.dem){const t=function(e,t,i){const n=(0,K.jJ)(e.styleZoom,e.styleState,[]),o=[],r=i-1;for(let e=0;e<i;e++){const i=e/r,s=256*(0,K.UP)(t,i,n);o.push(s)}return new $e(new Uint8Array(o),{size:[i,1],format:$e.AlphaFormat,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping})}(this.modules.map.state,e.dem.style.shadingPalette,256);Number.isNaN(this.hillshadeRampTextureId)?this.hillshadeRampTextureId=this.modules.imageManager.addPreparedTexture(t):this.modules.imageManager.updatePreparedTexture(this.hillshadeRampTextureId,t)}}updateClearColor(){const e=this.modules.styleManager.getStyle(this.modules.map.state.handyStyleId);if(null==e?void 0:e.dem){const t=this.modules.renderer.getFramebuffer(this.flatFramebufferId);t&&(t.clearColor=(0,K.m2)(e.background.color))}}updateGround(){if(this.enabled&&!this.isGroundBufferValid){const e=this.modules.renderer.getFramebuffer(this.groundFramebufferId);if(!e)return;const t=this.modules.renderer.getRenderingContext(),i=e.renderTarget.options.size;this.validateGroundBufferSize(i),e.renderTarget.bind(t),t.readPixels(0,0,i[0],i[1],t.RGBA,t.FLOAT,this.groundBuffer),e.renderTarget.unbind(t),this.isGroundBufferValid=!0}}addDefaultSources(){var e;if(!this.enabled){const t=this.modules.map.state,i=(e,i,n)=>((e,t,i,n,o)=>{const r=(0,P.IG)(e.tileServer,{subdomain:e.subdomains[Math.abs(t+i)%e.subdomains.length]});return`${e.tileProtocol}://${r}/v2/ald?ts=${o}&x=${t}&y=${i}&z=${n}`})(t,e,i,n,this.tileSet);this.addElevationSource({url:i,minZoom:5,maxZoom:8,attributes:{}}),this.addElevationSource({url:i,minZoom:9,maxZoom:jn,attributes:{}}),this.flatMapSource=new Yi(this.modules.map),this.meshSource=new Oi(this.modules.map,{maxZoom:this.meshMaxZoom});const n=this.hillshadeVao,o=null===(e=this.modules.renderer.symbolSettingsList.dem.hillshade)||void 0===e?void 0:e[0];if(n&&o){this.hillshadeTile=new F.W("raster",[],this.modules.renderer,this.modules.modelsScene,this.modules.map.state);const e={id:(0,z.f)(),type:nt.H.Tile,symbol:"dem",sink:"hillshade",tile:this.hillshadeTile,attributes:{layerId:zi.he,styleId:this.modules.map.state.handyStyleId,tileData:[]},stride:Ct._.sinks.hillshade.stride,rangeStart:0,rangeEnd:6*Ct._.sinks.hillshade.stride,attributesHash:"",layerSettings:o,vao:n,canRender:!0};this.hillshadeTile.children.push(e),this.modules.tileManager.addObject(this.hillshadeTile)}}}updateTilesRevision(){let e=!1;return this.sources.forEach(((t,i)=>{const n=t.getRevision();n!==this.sourcesRevision[i]&&(this.sourcesRevision[i]=n,e=!0)})),e&&this.tilesRevision++,e}addElevationSource(e){const t=new Gi((0,kn.Q)(),this.modules,e);this.sources.push(t),this.sourcesRevision.push(t.getRevision());const{minZoom:i,maxZoom:n}=e,o=new Mt.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.cameraConfig,t=this.modules.map.state.size[1]*e.viewportLimitRatio;return Math.min(Math.ceil(Math.hypot(t,t)/ot.y4),Bn)}createGroundFramebuffer(){const e=this.modules.renderer.getRenderingContext(),t=this.modules.map.state.size,i=[0,0,0,0],n=new Ye({size:t,magFilter:$e.NearestFilter,minFilter:$e.NearestFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,flipY:!0,type:$e.Float});return n.bind(e),this.modules.renderer.clearWithColor(i,!0),n.unbind(e),this.modules.renderer.addFramebuffer({clearColor:i,useDem:!0,clearDepth:!0,onResize:()=>{const e=this.modules.renderer.getRenderingContext(),t=this.modules.map.state.size;n.setSize(t),n.bind(e),this.modules.renderer.clearWithColor(i,!0),n.unbind(e)},renderTarget:n,renderIndex:5,onRenderStart:()=>{this.clearTextureBindings()},onRenderEnd:()=>{}})}createDemFramebuffer(){const e=this.modules.renderer.getRenderingContext();let t=this.getDemTextureSize()*Bn;const i=new Ye({size:[t,t],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,flipY:!0,type:$e.Float,format:2===Fa.webglVersion?$e.RedFormat:$e.RgbaFormat});return i.bind(e),this.modules.renderer.clearWithColor([0,0,0,1]),i.unbind(e),this.modules.renderer.addFramebuffer({clearColor:[0,0,0,1],onResize:()=>{const n=this.getDemTextureSize()*Bn;n!==t&&(t=n,i.setSize([t,t]),i.bind(e),this.modules.renderer.clearWithColor([0,0,0,1]),i.unbind(e))},renderTarget:i,getViewProjectionMatrix:()=>this.demFbVpMatrix,renderIndex:0,onRenderStart:()=>{this.clearTextureBindings()},onRenderEnd:()=>{this.isDemCorrectionEnabled=!1}})}createCorrectedDemFramebuffer(){const e=this.modules.renderer,t=e.getRenderingContext(),i=e.webGlExtensions;let n=this.getDemTextureSize()*Bn;const o=new Ye({size:[n,n],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,flipY:!0,type:$e.Float});o.bind(t),this.modules.renderer.clearWithColor([0,0,0,1]),o.unbind(t);const r=this.modules.renderer.lastAppliedGlState;return this.modules.renderer.addFramebuffer({onResize:()=>{const e=this.getDemTextureSize()*Bn;e!==n&&(n=e,o.setSize([n,n]),o.bind(t),this.modules.renderer.clearWithColor([0,0,0,1]),o.unbind(t))},renderTarget:o,getViewProjectionMatrix:()=>this.demCorrectedFbVpMatrix,renderIndex:1,onRenderStart:()=>{var e;const n=null===(e=this.modules.renderer.getFramebuffer(this.demFramebufferId))||void 0===e?void 0:e.renderTarget.getTexture();if(!n||!this.copyDemVao)return;this.clearTextureBindings(),o.bind(t),t.viewport(0,0,o.options.size[0],o.options.size[1]),nn(t,dn,r);n.enable(t,0);const s=this.modules.renderer.getShaderProgram("demElevationCopy");s.enable(t),s.bind(t,{u_mat4_mvp:A.TD,u_sr2d_texture:0,u_mat4_dem_corrected:this.correctedTexToDemTex}),this.copyDemVao.bind({gl:t,extensions:i}),t.drawArrays(t.TRIANGLES,0,6),o.unbind(t),this.isDemCorrectionEnabled=!0},useDem:!0})}createHillshadeFramebuffer(){const e=this.modules.renderer.getRenderingContext();let t=this.getDemTextureSize()*Bn;const i=new Ye({size:[t,t],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,format:$e.RgbFormat,flipY:!0});return this.modules.renderer.addFramebuffer({clearColor:[0,0,0,0],onResize:()=>{const n=this.getDemTextureSize()*Bn;n!==t&&(t=n,i.setSize([t,t]),i.bind(e),i.unbind(e))},renderTarget:i,getViewProjectionMatrix:()=>this.demFbVpMatrix,renderIndex:2,onRenderStart:()=>{this.clearTextureBindings()},useDem:!0})}createFlatFramebuffer(){const e=this.modules.renderer.getRenderingContext(),t=this.modules.renderer.getPixelRatio(),i=this.modules.map.state.size,n=new Ye({size:[Math.trunc(i[0]*Un[0]*t),Math.trunc(i[1]*Un[1]*t)],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping});return this.modules.renderer.addFramebuffer({clearColor:this.modules.renderer.clearColor,onResize:()=>{const i=this.modules.map.state.size;n.setSize([Math.trunc(i[0]*Un[0]*t),Math.trunc(i[1]*Un[1]*t)]),n.bind(e),n.unbind(e)},renderTarget:n,renderIndex:3,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 Ye({size:[Math.trunc(t[0]*Un[0]*T.identify.pixelDensity),Math.trunc(t[1]*Un[1]*T.identify.pixelDensity)],magFilter:$e.NearestFilter,minFilter:$e.NearestFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping});return this.modules.renderer.addFramebuffer({clearColor:ka,onResize:()=>{const t=this.modules.map.state.size;i.setSize([Math.trunc(t[0]*Un[0]*T.identify.pixelDensity),Math.trunc(t[1]*Un[1]*T.identify.pixelDensity)]),i.bind(e),i.unbind(e)},renderTarget:i,renderIndex:4,onRenderStart:()=>{e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,null)}})}updateDemFramebufferMatrix(){const e=this.modules.map.state,t=Math.trunc(e.styleZoom),i=Math.min(t,12),n=(0,H.aq)(i),o=n*this.getDemTextureSize(),r=n/Bn,s=[Math.trunc(e.center[0]/r)*r+r/2,Math.trunc(e.center[1]/r)*r+r/2],a=[s[0]-o/2,s[1]-o/2,0];qe.wA(Gn,a,[o,o,ot._9]),qe.U_(this.demTextureMatrix,Gn),qe.Jp(this.demFbVpMatrix,A.TD,this.demTextureMatrix);const l=Math.min(t,18);this.demCorrectedScale=Math.pow(2,l-i);const d=(0,H.aq)(l)*this.getDemTextureSize(),c=[s[0]-d/2,s[1]-d/2,0];qe.wA(Gn,c,[d,d,ot._9]),qe.U_(Gn,Gn),qe.Jp(this.demCorrectedFbVpMatrix,A.TD,Gn),qe.xJ(Gn,[1/this.demCorrectedScale,1/this.demCorrectedScale,1]),qe.Jp(this.demCorrectedFbVpToDemTex,A.LX,Gn),qe.xJ(Gn,[1/this.demCorrectedScale,1/this.demCorrectedScale,1]),qe.Jp(Gn,Gn,A.TD),qe.Jp(this.correctedTexToDemTex,A.LX,Gn),qe.xJ(Gn,[this.demCorrectedScale,this.demCorrectedScale,1]),qe.Jp(Gn,Gn,A.TD),qe.Jp(this.demTexToCorrectedTex,A.LX,Gn)}validateGroundBufferSize(e){const t=e[0]*e[1]*4;this.groundBuffer.length!==t&&(this.groundBuffer=new Float32Array(t))}}var Zn,Wn=i(173);!function(e){e.TAA="TAA",e.NO_AA="NO_AA"}(Zn||(Zn={}));class Xn extends class{constructor(e,t,i){this.output=e,this.input=t,this.modules=i,this.enabled=!0}}{constructor(e,t,i,n){super(e,t,i),this.name=Kn.TAA,this.jitter=[0,0],this.numMixedFrames=0,this.samples=16;const o=i.renderer.getShaderProgram("antialias");this.jitterSequence=this.generateJitterSequence(this.samples),this.vao=Ci(n,o)}onBeforeRender(e){if(this.jitter[0]=0,this.jitter[1]=0,e.disableAntiAliasing||!this.canRender())return this.enabled=!1,void(this.numMixedFrames=0);if(this.numMixedFrames>=this.samples)return;this.modules.renderer.addRerenderEvent(),this.enabled=!0;const t=window.devicePixelRatio,i=e.size,n=this.jitterSequence[this.numMixedFrames];this.jitter[0]=n[0]/Math.ceil(i[0]*t),this.jitter[1]=n[1]/Math.ceil(i[1]*t)}render(e){var t;this.output.bind(e);const i=this.modules.renderer.webGlExtensions,n=1/(this.numMixedFrames+1);this.vao.bind({gl:e,extensions:i});const o=null===(t=this.input)||void 0===t?void 0:t.getTexture();null==o||o.enable(e,0);const r=this.modules.renderer.getShaderProgram("antialias");r.enable(e),r.bind(e,{u_texture:0,u_float_mix_coef:n}),e.drawArrays(e.TRIANGLE_FAN,0,4),this.numMixedFrames++}onAfterRender(){}resize(e){this.output.setSize(e),this.numMixedFrames=0}isReady(){return this.numMixedFrames>=this.samples}canRender(){return!this.modules.renderer.isNeedRerender()}generateJitterSequence(e){const t=[],i=(0,Wn.R4)(e),n=i.base2,o=i.base3;t.push([0,0]);for(let e=0;e<n.length;++e)t.push([2*n[e]-1,2*o[e]-1]);return t}}var Kn,qn=i(412),$n=i(309);!function(e){e[e.TAA=0]="TAA"}(Kn||(Kn={}));class Yn{constructor(e,t){this.renderGraph=[],this.effectsByType={},this.state=e,this.modules=t,this.renderTargetSize=this.modules.renderer.getViewportSize();const i=t.renderer.webglContextState.MAX_TEXTURE_SIZE;if(Math.max(...this.renderTargetSize)>i)return void(0,$n.cM)(`Disabling post-effects as viewport size ${this.renderTargetSize[0]}x${this.renderTargetSize[1]} exceeds hardware limits of ${i}x${i}`);const n=new Tt.l(new Uint8Array([-1,-1,1,-1,1,1,-1,1])),o=this.createRenderTarget(this.renderTargetSize,{useHighDepthPrecision:!0});if(this.mainFrameBufferWrapper={renderTarget:o,onResize:()=>{},clearColor:(0,K.m2)((0,qn.MV)(e.defaultBackgroundColor)),clearDepth:!0},!e.disableAntiAliasing){const e=new Xn(this.createRenderTarget(this.renderTargetSize),o,t,n);this.effectsByType[Kn.TAA]=e,this.renderGraph.push(e)}}update(){this.renderGraph.forEach((e=>e.onBeforeRender(this.state)))}render(e){const t=this.modules.renderer.lastAppliedGlState;nn(e,xn,t),this.renderGraph.forEach((t=>t.render(e)));const i=this.renderGraph[this.renderGraph.length-1].output;this.copyRenderTargetToCanvas(e,i),this.renderGraph.forEach((e=>e.onAfterRender(this.state)))}invalidateSize(){this.mainFrameBufferWrapper&&(this.renderTargetSize=this.modules.renderer.getViewportSize(),this.mainFrameBufferWrapper.renderTarget.setSize(this.renderTargetSize),this.renderGraph.forEach((e=>e.resize(this.renderTargetSize))))}getEffectByName(e){return this.effectsByType[e]}setClearColor(e){this.mainFrameBufferWrapper&&(this.mainFrameBufferWrapper.clearColor=(0,K.m2)(e))}hasActiveEffects(){if(!this.modules.postEffectsManager.mainFrameBufferWrapper)return!1;for(const e of this.renderGraph)if(e.enabled)return!0;return!1}isReady(){for(const e of this.renderGraph)if(!e.isReady())return!1;return!0}copyRenderTargetToCanvas(e,t){const{viewport:i}=this.state,n=window.devicePixelRatio,o=this.modules.renderer.clearColor;e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(i.left*n,i.bottom*n,this.renderTargetSize[0],this.renderTargetSize[1]),e.clearColor(o[0],o[1],o[2],o[3]),e.clear(e.COLOR_BUFFER_BIT);const r=t.getTexture();null==r||r.enable(e,0);const s=this.modules.renderer.getShaderProgram("copy");s.enable(e),s.bind(e,{u_texture:0}),e.drawArrays(e.TRIANGLE_FAN,0,4)}createRenderTarget(e,t){return new Ye(Object.assign({minFilter:$e.NearestFilter,magFilter:$e.NearestFilter,size:e},t))}}const Jn=[1,1,1,1],Qn=[0,0];function eo(...e){return(t,i,n,o,r,s)=>{e.forEach((e=>e(t,i,n,o,r,s)))}}const to=(e,t,i,n,o)=>{var r,s,a;if(!o)return so(e,t);const l=null===(r=n.renderer.getFramebuffer(n.demManager.getDemFramebufferId()))||void 0===r?void 0:r.renderTarget.getTexture(),d=null===(s=n.renderer.getFramebuffer(n.demManager.getCorrectedDemFramebufferId()))||void 0===s?void 0:s.renderTarget.getTexture(),c=n.imageManager.getTexture(n.demManager.getHillshadeRampTextureId()),h=null==l?void 0:l.options.size,u=n.styleManager.getStyle(i.handyStyleId);if(!(l&&d&&c&&u&&h))return so(e,t);const m=(0,K.jJ)(i.styleZoom,i.styleState,[],!1),f=(0,K.vn)(u.dem.style.shadingIntensity,m),p=A.A5/(Math.pow(2,Math.min(Math.trunc(i.styleZoom),jn))*Bn);l.enable(e,Rn),c.enable(e,On),d.enable(e,Dn);const _=n.demManager.demCorrectedScale;t.bind(e,{u_float_dem_resolution:h[0],u_float_dem_cell_size:p,u_float_dem_shading_intensity:f,u_tex_dem:Rn,u_tex_corrected_dem:Dn,u_tex_hillshade_ramp:On,u_float_corrected_interval:n.demManager.isDemCorrectionEnabled&&1!==_?.5/_:0,u_mat4_dem_corrected:n.demManager.demTexToCorrectedTex,u_float_map_center_elevation:null!==(a=i.elevation)&&void 0!==a?a:0})},io=(e,t,i,n)=>{const{renderer:o}=n,{labelingTextureBuffer:r}=o,s=r.getDepthAttachment();if(!(s instanceof $e))return!1;const a=r.getTexture();if(!a)return!1;a.enable(e,Ca),s.enable(e,za),t.bind(e,{u_color_tex_labeling:Ca,u_depth_tex_labeling:za})},no=(e,t,i)=>{const n=(ot.Jv-.5)/2,{size:o}=i;t.bind(e,{u_vec2_depth_test_half_point_size:[n/o[0],n/o[1]]})},oo=(e,t,i)=>{const{labelingDepthTestDisabled:n}=i;t.bind(e,{u_bool_depth_test_disable:n})},ro=(e,t)=>(t.bind(e,{u_float_dem_shading_intensity:0}),!0),so=(e,t)=>(t.bind(e,{u_float_dem_scale:0}),!0),ao=eo(rt,to),lo=eo(mt,dt),co=eo(rt,at,ft,ct),ho=eo(rt,lt,((e,t,i)=>{t.bind(e,{u_float_rounding_factor:i.stillness})}),dt,mt,to,io,no,oo),uo=eo(rt,lt,dt,to),mo=eo(mt,dt,rt,to,io,no,oo),fo=(e,t,i,n)=>{if(!n.environmentManager.isFogEnabled())return!1;const o=n.styleManager.getStyle(i.handyStyleId);let r=Jn,s=Jn;if(o){const e=(0,K.jJ)(i.styleZoom,i.styleState,[]);r=(0,K.m2)((0,K.zn)(o.environment.style.skyColor,e)),s=(0,K.m2)((0,K.zn)(o.environment.style.fogColor,e))}t.bind(e,{u_sky_color:r,u_fog_color:s,u_fog_distance:n.camera.fogDistance,u_fog_limits:n.environmentManager.fogLimits,u_fog_horizon_blend:n.environmentManager.fogHorizonBlend,u_fog_horizon_level:n.environmentManager.fogHorizonLevel})},po=rt,_o=eo(rt,at,ft,ct),vo=(e,t,i,n,o,r)=>{const s=n.postEffectsManager.getEffectByName(Kn.TAA),a=!r&&(null==s?void 0:s.jitter)?s.jitter:Qn;return t.bind(e,{u_vec2_camera_jitter:a}),!0},go=eo(to,vt,fo,vo,gt),yo=eo(rt,at,ft,ct,vt,fo),bo=eo(vt,fo,to,vo,gt),wo=eo(vt,fo,vo,gt),xo=eo(to,vt,fo,vo),So=eo(rt,to,vt,gt,fo),Io=eo(to,vt,fo,vo,gt),Mo=eo(rt,at,pt,_t),To=eo(rt,at,gt,pt,_t,vt,fo),Eo=eo(rt,vt,fo),Po=eo(vt,fo);eo(fo,vo,gt);var Lo=i(7840),Ao=i(5071),Co=i(7464),zo=i(3024);const ko=new Float32Array(16),Ro=new Float32Array(2),Fo=new Float32Array(2);function Oo(e,t){return t===G.jh.none?1:t===G.jh.fadeIn?e.labelingOpacity:1-e.labelingOpacity}const Do=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.color,Dr(i,o,s));return Wi.JG(a.value,l.value),!0},Bo=(e,t,i,n,o,r,s,a)=>!!n.styleManager.getStyle(o.attributes.styleId)&&(Wi.t8(a.value,0,0,0,12.75),!0),jo=(e,t,i,n,o,r,s,a)=>{var l;let d;switch(o.attributes.side){case kt.z.top:d=null!==(l=r.style.topColor)&&void 0!==l?l:r.style.color;break;case kt.z.side:d=r.style.sideColor;break;case kt.z.bottom:d=r.style.bottomColor}const c=Dr(i,o),h=(0,K.FR)(d,c);return ko[0]=0,(0,qn.gC)(h)?Wi.JG(a.value,h.value):(0,qn.RY)(h)&&gs(h,o.tile.readiness,ko),!0},No=(e,t,i,n,o,r,s,a)=>{const l=(0,K.jJ)(i.styleZoom,i.styleState,o.attributes.tileData,Boolean(o.layerSettings.isOverlappedObject)),d=(0,K.zn)(r.style.color,l);return Wi.JG(a.value,d.value),!0},Uo=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.topColor,Dr(i,o));return Wi.JG(a.value,l.value),!0},Vo=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.sideColor,Dr(i,o));return Wi.JG(a.value,l.value),!0},Go=(e,t,i,n,o,r,s,a)=>{const l=(0,K.qv)(r.style.sideColor,Dr(i,o));return l?(Wi.JG(a.value,l.values[0].value),gs(l,o.tile.readiness,ko)):ko[0]=0,!0},Ho=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.strokeColor,Dr(i,o));return Wi.JG(a.value,l.value),!0},Zo=(e,t,i,n,o,r,s,a)=>{let l;switch(o.attributes.side){case kt.z.top:l=(0,K.zn)(r.style.strokeColor,Dr(i,o));break;case kt.z.side:l=(0,K.zn)(r.style.sideColor,Dr(i,o));break;case kt.z.bottom:l=(0,K.zn)(r.style.bottomColor,Dr(i,o))}return!!l&&(Wi.JG(a.value,l.value),!0)},Wo=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.strokeColor2,Dr(i,o));return Wi.JG(a.value,l.value),!0},Xo=(e,t,i,n,o,r,s,a)=>(void 0===o.attributes.id||(a.value[3]*=n.modelLayer.getOpacity(o.attributes.id,r.minzoom)),!0),Ko=(e,t)=>(t.bind(e,{u_float_opacity:1}),!0),qo=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.textureOpacity,s);return t.bind(e,{u_float_texture_opacity:o.tile.readiness*a}),!0},$o=(e,t,i,n,o,r,s,a)=>{const l=Dr(i,o),d=(0,K.zn)(r.style.sideColor,l).value,c=Wi.fS(a.value,d),h=c?r.style.sideColor:r.style.sideStrokeColor,u=(0,K.qv)(h,Dr(i,o));return u?(Wi.JG(a.value,u.values[0].value),gs(u,o.tile.readiness,ko)):ko[0]=0,c&&(a.value[3]*=i.stillness),!0},Yo=(e,t,i,n,o,r,s,a)=>{const l=Dr(i,o),d=(0,K.zn)(r.style.strokeColor,l).value,c=(0,K.vn)(r.style.strokeWidth,l);return Wi.fS(a.value,d)&&1===a.value[3]&&c<=1&&(a.value[3]*=i.stillness),!0},Jo=(e,t,i,n,o,r,s,a)=>{const l=Dr(i,o),d=(0,K.zn)(r.style.topColor,l).value,c=(0,K.vn)(r.style.strokeWidth,l);return Wi.fS(a.value,d)&&1===a.value[3]&&c<=1&&(a.value[3]*=i.stillness),!0},Qo=(e,t,i,n,o,r,s,a)=>{const l=(0,K.zn)(r.style.sideStrokeColor,Dr(i,o));return Wi.JG(a.value,l.value),!0},er=(e,t,i,n,o,r,s,a)=>{const l=(0,K.m2)(a);return Wi.bA(l,l,o.tile.readiness),0!==a.value[3]&&(t.bind(e,{u_vec4_color:l}),!0)},tr=(e,t)=>(t.bind(e,{u_mat4_gradient:ko}),!0),ir=(e,t,i,n,o,r,s,a)=>{const l=(0,K.m2)(a);return t.bind(e,{u_vec4_color:l}),!0},nr=(e,t,i,n,o,r)=>{const s=(0,K.m2)((0,K.zn)(r.style.strokeColor,Dr(i,o)));return Wi.bA(s,s,o.tile.readiness),t.bind(e,{u_vec4_border_color:s}),!0},or=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.width,Dr(i,o));return 0!==s&&(t.bind(e,{u_float_width:s*window.devicePixelRatio}),!0)},rr=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.strokeWidth,Dr(i,o));return 0!==s&&(t.bind(e,{u_float_width:s*window.devicePixelRatio}),!0)},sr=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.strokeWidth,s);if(0===a)return!1;const l=(0,K.vn)(r.style.width,s)+2*a;return t.bind(e,{u_float_width:l*window.devicePixelRatio}),!0},ar=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.strokeWidth2,s);if(0===a)return!1;const l=(0,K.vn)(r.style.width,s)+2*(0,K.vn)(r.style.strokeWidth,s)+2*a;return t.bind(e,{u_float_width:l*window.devicePixelRatio}),!0},lr=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.width,s)+2*(0,K.vn)(r.style.strokeWidth,s)+2*(0,K.vn)(r.style.strokeWidth2,s);return 0!==a&&(t.bind(e,{u_float_width:a*window.devicePixelRatio}),!0)},dr=(e,t,i,n,o,r)=>{const s=Dr(i,o);return(0,K.vn)(r.style.iconWidth,s)>0},cr=(e,t,i,n,o,r)=>(t.bind(e,{u_float_shift:(0,K.vn)(r.style.shift,Dr(i,o))*window.devicePixelRatio}),!0),hr=(e,t,i,n,o)=>0!==Oo(i,o.attributes.animDirection),ur=(e,t,i,n,o,r)=>{const s=Dr(i,o);return(0,K.vn)(r.style.iconOpacity,s)*Oo(i,o.attributes.animDirection)!=0},mr=(e,t,i,n,o,r)=>{const s=Oo(i,o.attributes.animDirection);if(0===s)return!1;const a=(0,K.jJ)(i.styleZoom,i.styleState,o.attributes.tileData,!1),l=r.style.iconOpacity,d=(0,K.vn)(l,a);a.isBehind=!0;const c=(0,K.vn)(l,a);return t.bind(e,{u_vec2_opacity:[s*d,s*c]}),!0},fr=(e,t,i,n,o)=>{const r=Oo(i,o.attributes.animDirection);return 0!==r&&(t.bind(e,{u_float_opacity:r}),!0)},pr=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.iconRotation,Dr(i,o));return t.bind(e,{u_vec2_rotation:[Math.cos(s),Math.sin(s)]}),!0},_r=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.opacity,Dr(i,o));return t.bind(e,{u_float_opacity:o.tile.readiness*s}),!0},vr=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.opacity,Dr(i,o));return t.bind(e,{u_float_opacity:s}),!0},gr=(e,t,i,n,o)=>{const r=n.assetManager.textures[o.attributes.atlasIndex];return!!r&&(r.enable(e,0),!0)},yr=(e,t,i,n,o)=>{const{range:r,fontIndex:s,styleId:a}=o.attributes,l=n.styleManager.getStyle(a);if(!l)return!1;const d=l.fonts[s],c=n.assetManager.getFontTextureByName(d,r);return void 0!==c&&(c.enable(e,0),!0)},br=(e,t,i,{imageManager:n},o)=>{const r=n.getTexture(o.attributes.textureIndex);return!!r&&(r.enable(e,0),!0)},wr=(e,t,i,{imageManager:n},o)=>{const r=n.getTexture(o.attributes.rampTextureIndex);return void 0!==r&&(r.enable(e,1),t.bind(e,{u_sr2d_ramp_texture:1}),!0)},xr=(e,t,i,n,o,r)=>{const{tile:s}=o,a=(0,K.zn)(r.style.gapColor,Dr(i,o));if(!a)return!0;const l=(0,K.m2)((0,K.zn)(a,Dr(i,o)));return Wi.bA(l,l,s.readiness),t.bind(e,{u_vec4_space_color:l}),!0},Sr=(e,t,i,n,o,r)=>{const{styleZoom:s}=i,a=Dr(i,o),{tile:l}=o,d=(0,K.m2)((0,K.zn)(r.style.color,a));Wi.bA(d,d,l.readiness),a.styleZoom=Math.floor(s);const c=Math.pow(2,(0,pe.vO)(s)),h=(0,K.vn)(r.style.dashLength,a)*c,u=(0,K.vn)(r.style.gapLength,a)*c;return t.bind(e,{u_vec4_dash_color:d,u_vec2_scaler_params:[0,ot.ax],u_float_dash_length:(0,A.Qn)(h,l.size),u_float_dash2_length:(0,A.Qn)(h,l.size),u_float_space_length:(0,A.Qn)(u,l.size)}),!0},Ir=Wi.Ue(),Mr=(e,t,i,n,o,r)=>{const s=Dr(i,o),{tile:a}=o,l=(0,K.vn)(r.style.width,s);if(0===l)return!1;const d=(0,K.m2)((0,K.zn)(r.style.color,s));Wi.bA(d,d,a.readiness);const c=(0,K.FR)(r.style.pattern,s);if(!c||c[0]===zo.y.None)return!1;switch(c[0]){case zo.y.Chess:{const e=c[1];Ir[0]=e,Ir[1]=.5,Ir[2]=.25,Ir[3]=-.25;break}case zo.y.DoubleDash:{const e=c[1];Ir[0]=e,Ir[1]=c[2]/l,Ir[2]=.5*c[3]/e,Ir[3]=.5*c[4]/e,Ir[2]>=.5-Number.EPSILON&&(Ir[2]=.6),Ir[3]>=.5-Number.EPSILON&&(Ir[3]=.6);break}case zo.y.Stripe:{const e=c[1]+c[2];Ir[0]=e,Ir[1]=.55,Ir[2]=.5*c[1]/e,Ir[3]=.5*c[1]/e,Ir[2]>=.5-Number.EPSILON&&(Ir[2]=.6),Ir[3]>=.5-Number.EPSILON&&(Ir[3]=.6);break}case zo.y.Circle:{const e=c[1]+c[2];Ir[0]=e,Ir[1]=.5*c[1]/e;break}case zo.y.Triangles:{const e=c[1]+c[2];Ir[0]=e,Ir[1]=c[1]/e,Ir[2]="right"===String(c[3])?-1:1;break}case zo.y.Chevron:{const e=c[1]+c[2];Ir[0]=e,Ir[1]=c[1]/e,Ir[2]=c[3]/e,Ir[3]=c[4]/l;break}}return t.bind(e,{u_vec4_color:d,u_int_pattern_type:c[0],u_vec4_pattern_params:Ir}),!0},Tr=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.tipWidth,s),l=(0,K.vn)(r.style.tipHeight,s),d=a;return Ro[0]=-d,Ro[1]=-0,R.Fv(Ro,Ro),Fo[0]=a,Fo[1]=l,R.Fv(Fo,Fo),t.bind(e,{u_vec2_wing_normal:Ro,u_vec2_tip_normal:Fo,u_float_tip_height_multiplier:l,u_float_wing_height_multiplier:0,u_float_wing_width_multiplier:d,u_float_size_factor:(0,A.Qn)(ot.gt,o.tile.size)/2}),!0},Er=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.lineLength,s),l=(0,K.vn)(r.style.lineWidth,s);return t.bind(e,{u_float_length:a,u_float_width:l,u_float_border_width:0}),!0},Pr=(e,t,i,n,o,r)=>{const s=Dr(i,o),{tile:a,attributes:l}=o,d=l.isLongArrow,c=o.tile.dynamicObject;let h=0,u=1;c&&(d?u=c.growPosition:h=c.bouncePosition);let m=0;return"appearance"===r.style.animation.type&&(m=(0,K.vn)(r.style.animation.tipMovementAmplitude,s)),t.bind(e,{u_float_width_zpt:(0,K.vn)(r.style.lineWidth,s),u_float_border_width_zpt:(0,K.vn)(r.style.strokeWidth,s),u_float_tip_movement_amplitude:(0,A.Qn)(m,a.size),u_float_vertex_shift:h,u_float_relative_end_position:u}),!0},Lr=(e,t,i,{modelLayer:n},o)=>{const{texture:r,id:s}=o.attributes;if(void 0===s)return!1;const a=n.getTexture(s,r);return void 0!==a&&(a.enable(e,0),!0)},Ar=(e,t)=>{var i,n,o;return(!(null===(n=null===(i=e.meta)||void 0===i?void 0:i.linkedIds)||void 0===n?void 0:n.length)||!t.floorManager.hasDisplayedFloorBuilding(e.meta.linkedIds))&&!t.map.state.hiddenObjects.gltfModel.has((null===(o=e.meta)||void 0===o?void 0:o.buildingId)||"")},Cr=(e,t,i,{assetManager:n},o,r)=>{const s=n.getModel(o.attributes.modelId);if(!s)return!1;const a=o.attributes.colorTexture;if(void 0===a)return!1;const l=s.textures[a];if(!l)return!1;l.enable(e,0);const d={u_sr2d_texture_0:0},c=o.attributes.aoTexture,h=void 0!==c?s.textures[c]:null;h&&(h.enable(e,1),d.u_ao_texture=1);const u=o.attributes.pbrTexture,m=void 0!==u?s.textures[u]:null;return m?(m.enable(e,2),d.u_pbr_texture=2):void 0!==o.attributes.metallic&&(d.u_float_metallic=o.attributes.metallic,d.u_float_roughness=o.attributes.roughness),Number.isNaN(r.style.roughness)||(d.u_float_roughness=r.style.roughness,d.u_float_metallic=r.style.metallic),t.bind(e,d),!0},zr=(e,t,i,{modelsScene:n},o,r,s,a)=>{const l=n.getModelHeightFactor(s);return!!l&&(t.bind(e,{u_float_height_factor:l}),!0)},kr=(e,t,i,{modelsScene:n},o,r,s,a)=>{const l=n.getModelOpacity(s);return 0!==l&&(a.value[3]*=l,!0)},Rr=(e,t,i,n,o,r)=>{if(void 0===o.attributes.id)return!0;const s=n.modelLayer.getOpacity(o.attributes.id,r.minzoom),a=1===n.modelLayer.getBuildingHeight(o.attributes.id)?1:s;return t.bind(e,{u_float_height_factor:a}),!0},Fr=(e,t,i,n,o,r)=>{const s=Dr(i,o),a=(0,K.vn)(r.style.height,s);return t.bind(e,{u_float_height_factor:(0,H.VW)(a)}),!0},Or=(e,t,i,n,o,r)=>{let s=n.buildingHeightAnimator.getBuildingHeight(r.minzoom);n.map.state.demMode&&(s=Nn+.999*s);const a=n.modelsScene.objectIdToKey(o.id);return a&&n.modelLayer.setBuildingHeight(a,s),t.bind(e,{u_float_height_factor:s}),!0};function Dr(e,t,i){return(0,K.jJ)(e.styleZoom,e.styleState,i?i.attributes.tileData:t.attributes.tileData,!1,null==i?void 0:i.tile.dynamicObject)}const Br=(e,t,i,n,o,r)=>Nr(o.tile,i,r),jr=(e,t,i,n)=>Nr(e.tile,i,n),Nr=(e,t,i)=>{const{purpose:n,detailLevel:o}=e,{styleZoom:r}=t;switch(n){case"zenith":case"traffic":case"geojson":const e=o<function(e){switch(e){case"zenith":return T.tiles.maxDetailLevel;case"traffic":return T.traffic.maxDetailLevel;case"geojson":return Ao.rR}}(n)?(0,pe.uZ)(r,o,o+.99999):r;return i.minzoom<=e&&e<i.maxzoom;case"dynamicObject":return i.minzoom<=r&&r<=i.maxzoom;default:return i.minzoom<=r&&r<i.maxzoom}};const Ur=(e,t,i,n,o)=>{const{styleZoom:r}=i,{tile:s}=o;return!("zenith"===s.purpose&&r<=T.tiles.maxUniverseZoom)},Vr=(e,t,i,n,o,r)=>{const{styleZoom:s}=i;return s>=r.minzoom&&s<r.maxzoom},Gr=(e,t,i,n,o,r)=>{const{tile:s}=o,a=(0,K.vn)(r.style.width,Dr(i,o));return 0!==a&&(t.bind(e,{u_float_width:(0,A.Qn)(a,s.size)/2*ot.gt,u_float_width_offset:(0,A.Qn)(ot.gt/window.devicePixelRatio,s.size)/2}),!0)},Hr=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.radius,Dr(i,o));return!(s<=0)&&(t.bind(e,{u_float_radius:s*window.devicePixelRatio}),!0)},Zr=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.intensity,Dr(i,o));return t.bind(e,{u_float_intensity:s}),!0},Wr=(e,t,i,n,o,r)=>{const s=Dr(i,o);let a=(0,K.vn)(r.style.textFontSize,s);if("point"===o.symbol){const e=o.attributes.labelIndex;e===Lo.bR.Second&&r.style.textFontSize2?a=(0,K.vn)(r.style.textFontSize2,s):e===Lo.bR.Icon&&r.style.iconTextFontSize&&(a=(0,K.vn)(r.style.iconTextFontSize,s))}return t.bind(e,{u_float_scale:a*window.devicePixelRatio/T.fonts.baseSize}),!0},Xr=(e,t,i,n,o,r)=>{var s,a,l,d,c,h;const u=Dr(i,o),m=r.style;if("point"===o.symbol){switch(o.attributes.labelIndex){case Lo.bR.Second:return(null!==(a=(0,K.vn)(null!==(s=m.textHaloWidth2)&&void 0!==s?s:null,u))&&void 0!==a?a:0)>0&&!!m.textHaloColor2;case Lo.bR.Icon:return(null!==(d=(0,K.vn)(null!==(l=m.iconTextHaloWidth)&&void 0!==l?l:null,u))&&void 0!==d?d:0)>0&&!!m.iconTextHaloColor;case Lo.bR.First:}}return(null!==(h=(0,K.vn)(null!==(c=m.textHaloWidth)&&void 0!==c?c:null,u))&&void 0!==h?h:0)>0&&!!m.textHaloColor},Kr=(e,t,i,n,o,r)=>$r(e,t,i,o,r.style.textFontSize,r.style.textColor,r.style.textHaloWidth,r.style.textHaloColor,o.layerSettings.uniformSet),qr=(e,t,i,n,o,r)=>{const{layerSettings:s}=o,{uniformSet:a}=s,l=o.attributes.labelIndex,d=r.style;let{textFontSize:c,textHaloWidth:h,textColor:u,textHaloColor:m}=d;switch(l){case Lo.bR.Icon:c=d.iconTextFontSize,h=d.iconTextHaloWidth,u=d.iconTextColor,m=d.iconTextHaloColor;break;case Lo.bR.Second:c=d.textFontSize2,h=d.textHaloWidth2,u=d.textColor2,m=d.textHaloColor2}return Yr(e,t,i,o,c,u,h,m,a)},$r=(e,t,i,n,o,r,s,a,l)=>{const d=(0,K.jJ)(i.styleZoom,i.styleState,n.attributes.tileData,Boolean(n.layerSettings.isOverlappedObject)),c=(0,K.vn)(o,d)/T.fonts.baseSize,h=c*window.devicePixelRatio,u=T.fonts.gamma/h,m="fontHalo"===l?(6-(0,K.vn)(s,d)/c)/8:.75;let f;if("fontHalo"===l){if(!a)return!1;f=(0,K.m2)((0,K.zn)(a,d))}else f=(0,K.m2)((0,K.zn)(r,d));return t.bind(e,{u_float_buffer:m,u_float_gamma:u,u_vec4_color:f}),!0},Yr=(e,t,i,n,o,r,s,a,l)=>{const d=(0,K.jJ)(i.styleZoom,i.styleState,n.attributes.tileData,!1),c=(0,K.vn)(o,d)/T.fonts.baseSize,h=c*window.devicePixelRatio,u=T.fonts.gamma/h,m="fontHalo"===l?(6-(0,K.vn)(s,d)/c)/8:.75;let f,p;if("fontHalo"===l){if(!a)return!1;f=(0,K.m2)((0,K.zn)(a,d)),d.isBehind=!0,p=(0,K.m2)((0,K.zn)(a,d))}else f=(0,K.m2)((0,K.zn)(r,d)),d.isBehind=!0,p=(0,K.m2)((0,K.zn)(r,d));return t.bind(e,{u_float_buffer:m,u_float_gamma:u,u_vec4_color:f,u_vec4_hidden_color:p}),!0},Jr=(e,t,i,n,o)=>{const{attributes:r}=o,{offsetX:s,offsetY:a}=r,l=window.devicePixelRatio;return t.bind(e,{u_vec2_offset:[s*l,a*l]}),!0},Qr=(e,t,i)=>(t.bind(e,{u_float_style_zoom:i.styleZoom}),!0),es=(e,t,i,n,o)=>{const{tile:r}=o,{zoom:s}=i,a=ot.y4*Math.pow(2,s-r.zoomLevel)*window.devicePixelRatio;return t.bind(e,{u_float_tile_to_pixel_ratio:ot.gt/a}),!0},ts=(e,t,i,n,o,r)=>{const{tile:s}=o,{zoom:a,styleZoom:l}=i,d=r.style.lengthUnits===yt.vR.Meters,c=(0,H.iq)((0,H.Bs)(s.coords),[ot.Bq/2,ot.Bq/2]),h=ot.gt/(ot.y4*Math.pow(2,a-s.zoomLevel)*window.devicePixelRatio),u=d?l:Math.floor(l),m=ot.y4*Math.pow(2,u-s.zoomLevel)*window.devicePixelRatio/(ot.gt*c);return t.bind(e,{u_vec2_scales:[m,h]}),!0},is=(e,t,i,{demManager:n,renderer:o,map:r})=>{if(!r.state.demMode)return!1;const s=n.getFlatFramebufferId(),a=o.getFramebuffer(s);if(!a)return!1;const l=a.renderTarget.getTexture();return l&&l.enable(e,0),t.bind(e,{u_flat_tex:0}),!0},ns=(e,t,i,{demManager:n,renderer:o,map:r})=>{if(!r.state.demMode)return!1;const s=n.getIdentifyFlatFramebufferId(),a=o.getFramebuffer(s);if(!a)return!1;const l=a.renderTarget.getTexture();return l&&l.enable(e,0),t.bind(e,{u_flat_tex:0}),!0},os=(e,t,i,{demManager:n,renderer:o,map:r})=>{var s;if(!r.state.demMode)return!1;const a=n.getHillshadeFramebufferId(),l=null===(s=o.getFramebuffer(a))||void 0===s?void 0:s.renderTarget.getTexture();return!!l&&(l.enable(e,Fn),t.bind(e,{u_hillshade_tex:Fn}),!0)},rs=(e,t,i,n)=>{var o;const r=n.demManager.getDemFramebufferId(),s=null===(o=n.renderer.getFramebuffer(r))||void 0===o?void 0:o.renderTarget.getTexture();return!!s&&(s.enable(e,0),t.bind(e,{u_tex_dem:0,u_mat4_dem_corrected:n.demManager.demCorrectedFbVpToDemTex}),!0)},ss=(e,t,i,n,o,r)=>{const s=(0,K.vn)(r.style.elevation,Dr(i,o));return t.bind(e,{u_bool_skip_height_factor:Boolean(s)}),!0},as=(e,t,i,n,o,r)=>{let s=n.buildingHeightAnimator.getBuildingHeight(r.minzoom);return n.map.state.demMode&&(s=Nn+.999*s),t.bind(e,{u_float_height_factor:s}),!0},ls=(e,t,i,n,o)=>(t.bind(e,{u_int_abs_height:!!o.attributes.absHeight}),!0),ds=(e,t)=>(t.bind(e,{u_int_abs_height:!1}),!0),cs=(e,t,i,n)=>(t.bind(e,{u_int_signed_z:1}),!0),hs=(e,t)=>(t.bind(e,{u_int_signed_z:0}),!0),us=(e,t,i,n,o)=>(t.bind(e,{u_float_tile_size:(0,H.aq)(o.tile.zoomLevel)}),!0),ms=(e,t,i,n,o,r,s,a,l)=>(t.bind(e,{u_float_dem_scale:l?i.elevationScale:0}),!0),fs=(e,t,i,n,o)=>{const r=o.layerSettings.identify?n.renderer.getMapMeshIdFramebufferId():n.renderer.getMapMeshFramebufferId(),s=n.renderer.getFramebuffer(r),a=null==s?void 0:s.renderTarget.getTexture(),l=null==s?void 0:s.scale;return!(!a||!l)&&(a.enable(e,0),t.bind(e,{u_sampler_map_tex:0,u_float_tex_scale:l,u_float_tex_shift_scale:1-Math.cos(i.pitch)}),!0)},ps=(e,t,i,n,o)=>(t.bind(e,{u_int_identify:o.layerSettings.identify||o.layerSettings.depthTest?1:0}),!0);function _s(...e){const t=(0,Co.lK)([0,0,0,0]);return(i,n,o,r,s,a,l,d)=>{for(let c=0;c<e.length;c++){if(!e[c](i,n,o,r,s,a,l,t,d))return!1}return!0}}function vs(...e){return(t,i,n,o)=>{for(const r of e)if(!r(t,i,n,o))return!1;return!0}}function gs(e,t,i){if(e.steps.length){i[0]=(0,pe.uZ)(e.values.length,0,3);for(let n=0;n<i[0];n++){const o=e.values[n],r=(0,K.m2)(o);Wi.bA(r,r,t),i[n+1]=e.steps[n];const s=4*(n+1);i[s]=r[0],i[s+1]=r[1],i[s+2]=r[2],i[s+3]=r[3]}}else i[0]=0}var ys=i(7486),bs=i(5549);const ws=new Float32Array(16);let xs;function Ss(...e){return(t,i,n,o,r,s,a,l)=>{for(const d of e){if(!d(t,i,n,o,r,s,a,l))return!1}return!0}}const Is=(e,t,i,n,o)=>(t.bind(e,{u_mat4_mvp:o.tile.renderMvpMatrix}),!0),Ms=(e,t,i,n,o)=>(t.bind(e,{u_mat4_flat_map_mvp:o.tile.renderFlatMapTexMatrix}),!0),Ts=(e,t,i,n,o)=>!!o.tile.renderModelMatrix&&(qe.JG(ws,o.tile.renderModelMatrix),t.bind(e,{u_mat4_model:ws}),!0),Es=(e,t,i,n,o,r,s,a)=>{if(a.terrain3d){const i=null!=r?r:o;if(!i.tile.renderModelMatrix)return!1;t.bind(e,{u_mat4_dem_mvp:i.tile.renderDemMatrix,u_float_vertical_scale:1/i.tile.renderModelMatrix[10]})}return!0};function Ps(e,t){return(0,K.jJ)(e.styleZoom,e.styleState,t.attributes.tileData)}const Ls=(e,t,i,n,o,r,s)=>{var a;xs=void 0;const l=Ps(i,o),d=(0,K.Q9)(s.style.textureImage,l),c=n.styleManager.getStyle(o.attributes.styleId);if(!c)return!0;const h=null===(a=c.rasterSets.byKey[(0,Co.FD)(d)])||void 0===a?void 0:a.rasters;if(!h)return!0;const u=(0,K.FR)(s.style.textureSize,l),[m,f]=Array.isArray(u)?u:[u,u];if(m<=0||f<=0)return!0;const p=(0,ys.Bl)(h,m*window.devicePixelRatio,!0);return void 0===p||(xs=h[p]),!0},As=(e,t,i,{assetManager:n},o,r)=>{if(!xs)return t.bind(e,{u_int_is_textured:0}),!0;const{tile:s}=o,{zoom:a}=i,l=n.textures[xs.atlasIndex];if(!l)return t.bind(e,{u_int_is_textured:0}),!0;l.enable(e,0);const d=ot.y4*Math.pow(2,Math.round(a)-s.zoomLevel)*window.devicePixelRatio,c=s.coords[0]*d%xs.w/xs.w,h=s.coords[1]*d%xs.h/xs.h,u=d/xs.w,m=d/xs.h;return t.bind(e,{u_int_is_textured:1,u_float_texture_params:[c,h,u,m],u_float_sprite_texture_coords:[(xs.x+.5)/T.atlasSize[0],(xs.y+xs.h-1)/T.atlasSize[1],(xs.x+xs.w-1)/T.atlasSize[0],(xs.y+.5)/T.atlasSize[1]]}),!0},Cs=(e,t,i,n,o,r)=>{if(!xs)return t.bind(e,{u_int_is_textured:0}),!0;const{tile:s}=o,{zoom:a}=i,l=n.assetManager.textures[xs.atlasIndex];if(!l)return t.bind(e,{u_int_is_textured:0}),!0;l.enable(e,0);const d=ot.y4*Math.pow(2,Math.round(a)-s.zoomLevel)*window.devicePixelRatio;return t.bind(e,{u_float_texture_vertical_scale:xs.h*s.size/d}),!0},zs=(e,t,i,{styleManager:n,assetManager:o},r,s,a)=>{var l;const d=Ps(i,r),c=(0,K.Q9)(a.style.iconImage,d),h=n.getStyle(r.attributes.styleId);if(!h)return!1;const u=null===(l=h.rasterSets.byKey[(0,Co.FD)(c)])||void 0===l?void 0:l.rasters;if(!u)return!1;const m=(0,K.vn)(a.style.width,d),f=(0,K.vn)(a.style.height,d),p=(0,bs.N5)(m,f),_=m*p;if(_<=0||f*p<=0)return!1;const v=(0,ys.Bl)(u,_*window.devicePixelRatio,!0);if(void 0===v)return!1;const g=u[v],y=o.textures[g.atlasIndex];return!!y&&(y.enable(e,0),t.bind(e,{u_float_sprite_texture_coords:[(g.x+.5)/T.atlasSize[0],(g.y+g.h-1)/T.atlasSize[1],(g.x+g.w-1)/T.atlasSize[0],(g.y+.5)/T.atlasSize[1]]}),!0)},ks=(e,t,i,n,o,r)=>{if(null===r)return!1;const s=r.linked;if(!s)return!1;const a=s[o.id];return!!a&&(t.bind(e,{u_mat4_instance:a.transformMatrix,u_mat4_mvp:r.tile.renderMvpMatrix}),!0)},Rs=(e,t,i,n,o,r)=>{if(null===r)return!1;const s=r.linked;if(!s)return!1;return!!s[o.id]&&(!!r.tile.renderModelMatrix&&(qe.JG(ws,r.tile.renderModelMatrix),t.bind(e,{u_mat4_model:ws}),!0))};class Fs{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 Os="\nvec4 apply_opacity(const vec4 color, const float opacity)\n{\nreturn color * opacity;\n}\n",Ds="uniform highp vec3 u_cam_pos;\n",Bs={affine_step:"\nfloat affine_step(const float edge0, const float edge1, const float x)\n{\n    return clamp((x - edge0) / (edge1 - edge0), 0., 1.);\n}\n",apply_opacity:Os,arrow_functions:"struct ArrowDistanceParameters\n{\n    vec2 wing_normal;\n    vec2 tip_normal;\n    vec2 mirrored_wing_normal;\n    vec2 mirrored_tip_normal;\n    float width;\n    float full_length;\n    float arrow_height;\n};\nArrowDistanceParameters calculate_arrow_distance_parameters(\n    const vec2 wing_normal,\n    const vec2 tip_normal,\n    const float width_zpt,\n    const float length_zpt,\n    const float tip_height_multiplier,\n    const float wing_height_multiplier)\n{\n    vec2 mirrored_wing_normal = vec2(wing_normal.x, -wing_normal.y);\n    vec2 mirrored_tip_normal = vec2(tip_normal.x, -tip_normal.y);\n    float width = 0.5 * width_zpt;\n    float length = 0.5 * length_zpt;\n    float arrow_height = width_zpt * (tip_height_multiplier - wing_height_multiplier);\n    return ArrowDistanceParameters(\n        wing_normal,\n        tip_normal,\n        mirrored_wing_normal,\n        mirrored_tip_normal,\n        width,\n        length,\n        arrow_height);\n}\nstruct ArrowDistances\n{\n    float top_tip_cut;\n    float bottom_tip_cut;\n    float line;\n    float bottom_left_wing;\n    float bottom_right_wing;\n    float top_left_wing;\n    float top_right_wing;\n};\nArrowDistances calculate_arrow_distances(\n    const ArrowDistanceParameters arrow_parameters,\n    const vec2 texcoord,\n    const float offset,\n    const mat2 derivatives)\n{\n    float derivatives_x_multiplier = 1. / max(abs(derivatives[0].x), abs(derivatives[1].x));\n    float dt = ( texcoord.x - arrow_parameters.full_length - offset) * derivatives_x_multiplier;\n    float d0 = (-texcoord.x - arrow_parameters.full_length - offset) * derivatives_x_multiplier;\n    float d1 = (abs(texcoord.y) - arrow_parameters.width - offset) / max(abs(derivatives[0].y), abs(derivatives[1].y));\n    float 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)));\n    float 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)));\n    float 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)));\n    float 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)));\n    return ArrowDistances(dt, d0, d1, d2, d3, d4, d5);\n}\n",bit_mask:"\n#ifdef WEBGL2\n#define UNPACK_BOOL1(packedValue) ((packedValue & 0x1) != 0)\n#define UNPACK_BOOL2(packedValue) ((packedValue & 0x2) != 0)\n#define UNPACK_BOOL3(packedValue) ((packedValue & 0x4) != 0)\n#else\n#define UNPACK_BOOL1(packedValue) (int(mod(float(packedValue), 2.0)) == 1)\n#define UNPACK_BOOL2(packedValue) (int(mod(float(packedValue) / 2.0, 2.0)) == 1)\n#define UNPACK_BOOL3(packedValue) (int(mod(float(packedValue) / 4.0, 2.0)) == 1)\n#endif\n",cam_pos:Ds,circle_functions:"\nconst float g_distance_precision_limit = 1e-4;\nstruct CircleDistance\n{\n    float distance;\n    float width;\n};\nCircleDistance circle_color_distance(\n    const mat2 derivatives,\n    const vec2 circle,\n    const float circle_width)\n{\n    float circle_length = length(circle);\n    float distance = circle_length - circle_width;\n    \n    \n    \n    vec2 circle_dx = derivatives[0];\n    vec2 circle_dy = derivatives[1];\n    \n    float distance_dx = dot(circle, circle_dx);\n    float distance_dy = dot(circle, circle_dy);\n    \n    float derivative_denominator = circle_length;\n    float width = max(abs(distance_dx), abs(distance_dy));\n    return CircleDistance(\n        distance * derivative_denominator,\n        width);\n}\nvec4 distance_to_color(\n    const float fill_distance,\n    const float border_distance,\n    const vec4 fill_color,\n    const vec4 border_color)\n{\n    float fill_factor = affine_step(-1., 0., fill_distance);\n    float border_factor = affine_step(0., 1., border_distance);\n    return\n        mix(mix(fill_color, border_color, fill_factor), vec4(.0), border_factor);\n}\nvec4 distance_to_color(\n    const CircleDistance circle_distance,\n    const vec4 fill_color)\n{\n    \n    \n    float fill_factor = circle_distance.distance < g_distance_precision_limit\n        ? 0.\n        : affine_step(0., circle_distance.width, circle_distance.distance);\n    return mix(fill_color, vec4(0.), fill_factor);\n}\n",enable_standard_derivatives:"#ifdef WEBGL1\n#extension GL_OES_standard_derivatives: enable\n#endif\n",fog:"\n#define LINEAR 0\n#define EXP 1\n#define FOG_EQUATION (LINEAR)\n#define EPSILON (0.0001)\n#ifdef FOG\nuniform vec4 u_fog_color;\nuniform vec2 u_fog_limits;\nuniform float u_fog_horizon_blend;\nuniform float u_fog_horizon_level;\n#endif\n#if defined(FOG) || defined(SKY)\nuniform vec4 u_sky_color;\nvarying vec3 v_fog_pos;\n#endif\n#ifdef FOG\nfloat fog_horizon_blending(vec3 camera_dir, float blend) {\n    blend = EPSILON + blend;\n    float t = max(camera_dir.z / blend, 0.0);\n    \n    return exp(-3.0 * t * t);\n}\nfloat fog_exponential(float t) {\n    const float decay = 6.0;\n    float falloff = 1.0 - min(1.0, exp(-decay * t));\n    \n    falloff *= falloff * falloff;\n    \n    return min(1.0, 1.00747 * falloff);\n}\nfloat fog_depth(float depth) {\n    float start = u_fog_limits.x;\n    float end = u_fog_limits.y;\n    float range = end - start;\n    float fac = (depth - start) / range;\n#if (FOG_EQUATION == LINEAR)\n    \n    fac = clamp(fac, 0.0, 1.0);\n#elif (FOG_EQUATION == EXP)\n    fac = fog_exponential(fac);\n#endif\n    return fac;\n}\nfloat calc_depth_fog() {\n    float depth = length(v_fog_pos);\n    float fac = fog_depth(depth);\n    return fac;\n}\nvec3 calc_fog_color() {\n    float depth = length(v_fog_pos);\n    vec3 dir = v_fog_pos / depth;\n    \n    dir.z -= u_fog_horizon_level;\n    float fog_blend = fog_horizon_blending(dir, u_fog_horizon_blend);\n    if (u_sky_color.a <= 0.01) {\n        return u_fog_color.rgb / u_fog_color.a;\n    } else {\n        \n        return mix(u_sky_color.rgb / u_sky_color.a, u_fog_color.rgb / u_fog_color.a, min(fog_blend + (1.0 - u_sky_color.a), 1.0));\n    }\n}\n#endif \nvec4 apply_fog(vec4 color) {\n#ifdef FOG\n    if (u_fog_color.a <= 0.01) {\n        return color;\n    }\n    float alpha = EPSILON + color.a;\n    float fac = calc_depth_fog();\n    vec3 fog_color = calc_fog_color();\n    color.rgb /= alpha;\n    color.rgb = mix(color.rgb, fog_color, fac * u_fog_color.a);\n    color.rgb *= alpha;\n#endif\n    return color;\n}\nvec4 apply_fog_alpha(vec4 color) {\n#ifdef FOG\n    color *= 1.0 - calc_depth_fog();\n#endif\n    return color;\n}\nvec4 apply_fog_sky(vec4 color) {\n#ifdef FOG\n    float alpha = EPSILON + color.a;\n    float depth = length(v_fog_pos);\n    vec3 dir = v_fog_pos / depth;\n    \n    dir.z -= u_fog_horizon_level;\n    float fac = fog_horizon_blending(dir, u_fog_horizon_blend);\n    color.rgb /= alpha;\n    color.rgb = mix(color.rgb, u_fog_color.rgb, fac * u_fog_color.a);\n    color.rgb *= alpha;\n#endif\n    return color;\n}",fragment_normal:"#define FRAGMENT_NORMAL\nvec3 calc_fragment_normal(vec3 vertex) {\n    vec3 dx = dFdx(vertex);\n    vec3 dy = dFdy(vertex);\n    return normalize(cross(dx, dy));\n}",highp_float:"precision highp float;\n",light:"uniform vec3 u_vec3_light_dir1_direction;\nuniform vec4 u_vec4_light_dir1_color;\nuniform vec3 u_vec3_light_dir2_direction;\nuniform vec4 u_vec4_light_dir2_color;\nuniform vec4 u_vec4_ambient_color;\nuniform int u_int_light_flags; \nfloat dot_extended(vec3 a, vec3 b) {\n    #ifdef RENDER_SHADOWS\n        \n        return max(dot(a, b), 0.0);\n    #else\n        \n        const float ext = 0.70710678118; \n        return (clamp(dot(a, b), -ext, 1.0) + ext) / (1.0 + ext);\n    #endif\n}\nvec4 light_factor(vec3 normal) {\n    bool use_light = UNPACK_BOOL1(u_int_light_flags);\n    if (!use_light) { \n        return vec4(1.);\n    }\n    \n    float light_1_factor = dot_extended(normal, u_vec3_light_dir1_direction);\n    float light_2_factor = dot_extended(normal, u_vec3_light_dir2_direction);\n    if (UNPACK_BOOL2(u_int_light_flags)) {\n        light_1_factor *= compute_shadow_factor();\n    } else if (UNPACK_BOOL3(u_int_light_flags)) {\n        light_2_factor *= compute_shadow_factor();\n    }\n    vec3 direct_light_contrib = u_vec4_light_dir1_color[3] * light_1_factor * u_vec4_light_dir1_color.rgb;\n    vec3 shading_light_contrib = u_vec4_light_dir2_color[3] * light_2_factor * u_vec4_light_dir2_color.rgb;\n    return vec4(u_vec4_ambient_color[3] * u_vec4_ambient_color.rgb + direct_light_contrib + shading_light_contrib, 1.0);\n}\nfloat light_factor_dem(vec3 normal) {\n    bool use_light = UNPACK_BOOL1(u_int_light_flags);\n    if (!use_light) { \n        return 1.;\n    }\n    float light_1_factor = dot(normal, u_vec3_light_dir1_direction);\n    if (UNPACK_BOOL2(u_int_light_flags)) {\n        light_1_factor *= compute_shadow_factor();\n    }\n    return light_1_factor;\n}\nvec4 light_factor(vec3 normal, vec3 pos_world) {\n    \n    if (dot(u_cam_pos - pos_world, normal) < 0.) {\n        normal *= vec3(-1.);\n    }\n    return light_factor(normal);\n}\nvec4 light_factor_surface() {\n    bool use_light = UNPACK_BOOL1(u_int_light_flags);\n    if (!use_light) {\n        return vec4(1.);\n    }\n    vec3 normal = vec3(0., 0., 1.);\n    float light_1_factor = dot(normal, u_vec3_light_dir1_direction);\n    float light_2_factor = dot(normal, u_vec3_light_dir2_direction);\n    if (UNPACK_BOOL2(u_int_light_flags)) {\n        light_1_factor *= compute_shadow_factor();\n    } else if (UNPACK_BOOL3(u_int_light_flags)) {\n        light_2_factor *= compute_shadow_factor();\n    }\n    return vec4(u_vec4_ambient_color[3] * u_vec4_ambient_color.rgb\n        + u_vec4_light_dir1_color[3] * light_1_factor * u_vec4_light_dir1_color.rgb\n        + u_vec4_light_dir2_color[3] * light_2_factor * u_vec4_light_dir2_color.rgb, 1.0);\n}",light_pbr:"\n#define LIGHT_MODEL_PBR 2\n#ifdef LIGHT_MODEL\n#if LIGHT_MODEL == LIGHT_MODEL_PBR\n    const float PI = 3.14159265359;\n    \n    float D(float alpha, vec3 N, vec3 H) {\n        float numerator = alpha * alpha;\n        float NdotH = max(dot(N, H), 0.);\n        float denominator = PI * pow(\n            NdotH * NdotH * (alpha * alpha - 1.) + 1.,\n            2.\n        );\n        return numerator / max(denominator, 0.000001);\n    }\n    \n    float G1(float alpha, vec3 N, vec3 X) {\n        float numerator = max(dot(N, X), 0.);\n        float k = alpha / 2.;\n        float denominator = max(dot(N, X), 0.) * (1. - k) + k;\n        return numerator / max(denominator, 0.000001);\n    }\n    \n    float G(float alpha, vec3 N, vec3 V, vec3 L) {\n        return G1(alpha, N, V) * G1(alpha, N, L);\n    }\n    \n    vec3 F(vec3 F0, vec3 V, vec3 H) {\n        return F0 + (vec3(1.) - F0) * pow(1. - max(dot(V, H), 0.), 5.);\n    }\n    vec3 color_pbr(vec3 fragment_normal, vec3 fragment_pos_world, vec3 albedo, float roughness, float metallic) {\n        float alpha = roughness * roughness;\n        vec3 F0 = vec3(0.04); \n        F0 = mix(F0, vec3(1.), metallic);\n        \n        vec3 emitted_light = u_vec4_ambient_color.rgb * u_vec4_ambient_color[3];\n        vec3 N = fragment_normal;\n        \n        vec3 V = normalize(u_cam_pos - fragment_pos_world);\n        \n        vec3 L = u_vec3_light_dir1_direction;\n        \n        vec3 H = normalize(V + L);\n        float shadow_factor = compute_shadow_factor();\n        vec3 Ks = F(F0, V, H);\n        vec3 Kd = (vec3(1.0) - Ks) * (1. - metallic);\n        vec3 lambert = albedo / PI;\n        vec3 cookTorranceNumerator = D(alpha, N, H) * G(alpha, N, V, L) * Ks;\n        float cookTorranceDenominator = 4.0 * max(dot(V, N), 0.) * max(dot(L, N), 0.);\n        cookTorranceDenominator = max(cookTorranceDenominator, 0.000001);\n        vec3 cookTorrance = cookTorranceNumerator / cookTorranceDenominator;\n        \n        vec3 BRDF = Kd * lambert + cookTorrance;\n        vec3 outgoingLight = BRDF * u_vec4_light_dir1_color.rgb * u_vec4_light_dir1_color[3] * max(dot(L, N), 0.);\n        vec3 ambient = u_vec4_ambient_color.rgb * u_vec4_ambient_color[3] * albedo;\n        return ambient + outgoingLight * shadow_factor;\n    }\n#endif\n#endif",light_phong:"#define LIGHT_MODEL_PHONG 1\n#ifdef LIGHT_MODEL\n#if LIGHT_MODEL == LIGHT_MODEL_PHONG\nconst float g_specular_power_max = 32.0;\nconst float g_specular_power_min = 2.0;\nvec2 pbr_to_gloss(vec3 material_attributes)\n{\n    float weight = material_attributes.x;\n    float roughness = material_attributes.y;\n    float metallic = material_attributes.z;\n    \n    \n    float specular_strength = weight * metallic;\n    float specular_power = roughness * (g_specular_power_min - g_specular_power_max) + g_specular_power_max;\n    return vec2(specular_strength, specular_power);\n}\nvec3 color_phong(vec3 fragment_normal, vec3 fragment_pos_world, vec3 albedo, float roughness, float metallic) {\n    vec2 specular_values = pbr_to_gloss(vec3(1., roughness, metallic));\n    float specular_strength = specular_values.x;\n    float specular_power = specular_values.y;\n    \n    float shadow_factor = compute_shadow_factor();\n    \n    vec3 ambient = u_vec4_ambient_color.rgb * u_vec4_ambient_color[3];\n    \n    float diff = max(dot(fragment_normal, u_vec3_light_dir1_direction), 0.0); \n    vec3 diffuse = u_vec4_light_dir1_color.rgb * u_vec4_light_dir1_color[3] * diff * shadow_factor;\n    \n    \n    \n    vec3 view_dir = normalize(u_cam_pos - fragment_pos_world);\n    \n    vec3 reflect_dir = reflect(-u_vec3_light_dir1_direction, fragment_normal);  \n    float spec = pow(max(dot(view_dir, reflect_dir), 0.0), specular_power);\n    vec3 specular = u_vec4_light_dir1_color.rgb * u_vec4_light_dir1_color[3] * spec * specular_strength;  \n        \n    return albedo * (ambient + diffuse) + specular;\n}\n#endif\n#endif",lowp_float:"precision lowp float;\n",mediump_float:"precision mediump float;\n",pack_depth:"vec4 pack_float_to_vec4(float depth)\n{\n    const vec4 bit_shift = vec4(255.0 * 255.0 * 255.0, 255.0 * 255.0, 255.0, 1.0);\n    const vec4 bit_mask = vec4(0.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0);\n    vec4 res = fract(depth * bit_shift);\n    res -= res.xxyz * bit_mask;\n    return res;\n}\nfloat unpack_float_from_vec4(vec4 color)\n{\n    const vec4 bit_shift = vec4(1.0 / (255.0 * 255.0 * 255.0), 1.0 / (255.0 * 255.0), 1.0 / 255.0, 1.0);\n    return dot(color, bit_shift);\n}",prelude:"#ifdef WEBGL2\n#define varying in\n#define attribute in\n#define texture2D texture\n#define gl_FragColor fragColor\nout vec4 gl_FragColor;\n#endif\n",require_frag_depth:"#ifdef WEBGL1\n#extension GL_EXT_frag_depth : require\n#endif",screendoor_transparency:"\nuniform float u_sdtr_distance;\nvarying vec3 v_clipspace_pos;\nfloat interleaved_gradient_noise()\n{\n    const vec3 m = vec3(0.06711056, 0.00583715, 52.9829189);\n    return fract(m.z * fract(dot(gl_FragCoord.xy, m.xy)));\n}\nvoid apply_screendoor() {\n    if (u_sdtr_distance == 0.) {\n        return;\n    }\n    float factor = smoothstep(0., u_sdtr_distance, v_clipspace_pos.z);\n    float patternValue = interleaved_gradient_noise();  \n    \n    float shaped = factor - patternValue;\n    if (shaped <= 0.) {\n        discard;\n    }\n}",shadow:"#ifdef RENDER_SHADOWS\n# if defined(WEBGL2) && defined(DEPTH_TEXTURE_SHADOW)\nuniform mediump sampler2DShadow u_texture_shadow;\n# else\nuniform sampler2D u_texture_shadow;\n# endif\nuniform mediump vec4 u_shadow_map_params;\nvarying float v_depth_metric;\nvarying vec4 v_pos_from_light;\nfloat get_shadow(vec3 coords) {\n# if defined(WEBGL2) && defined(DEPTH_TEXTURE_SHADOW)\n    \n    return texture2D( u_texture_shadow, coords );\n# else\n# ifdef DEPTH_TEXTURE_SHADOW\n    \n    float shadow_depth = texture2D(u_texture_shadow, coords.xy, 0.).r;\n# else\n    \n    \n    float shadow_depth = unpack_float_from_vec4(texture2D(u_texture_shadow, coords.xy, 0.));\n# endif\n    float depth_diff = v_depth_metric - shadow_depth;\n    if (depth_diff <= 0.) {\n        return 1.0;\n    }\n    return 0.0;\n# endif\n}\nfloat sample_shadow_texture(vec3 shadow_coord) {\n    vec2 shadow_map_size = u_shadow_map_params.xy;\n    float radius = u_shadow_map_params.z;\n    vec2 texelSize = vec2( 1.0 ) / shadow_map_size;\n    float dx0 = - texelSize.x * radius;\n    float dy0 = - texelSize.y * radius;\n    float dx1 = + texelSize.x * radius;\n    float dy1 = + texelSize.y * radius;\n    float dx2 = dx0 / 2.0;\n    float dy2 = dy0 / 2.0;\n    float dx3 = dx1 / 2.0;\n    float dy3 = dy1 / 2.0;\n    \n    \n    return (\n        get_shadow( shadow_coord + vec3( dx0, dy0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( 0.0, dy0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx1, dy0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx2, dy2, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( 0.0, dy2, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx3, dy2, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx0, 0.0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx2, 0.0, 0.0 ) ) +\n        get_shadow( shadow_coord) +\n        get_shadow( shadow_coord + vec3( dx3, 0.0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx1, 0.0, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx2, dy3, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( 0.0, dy3, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx3, dy3, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx0, dy1, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( 0.0, dy1, 0.0 ) ) +\n        get_shadow( shadow_coord + vec3( dx1, dy1, 0.0 ) )\n    ) * ( 1.0 / 17.0 );\n}\nfloat compute_shadow_factor()\n{\n    vec4 light_pos = v_pos_from_light;\n# ifdef FRAGMENT_NORMAL\n    float normal_bias = u_shadow_map_params[3];\n    vec3 norm_from_light = calc_fragment_normal(light_pos.xyz);\n    light_pos.xyz -= normal_bias * norm_from_light;\n# endif\n    vec3 clip_space = light_pos.xyz / light_pos.w;\n    \n    float clip_factor = smoothstep(0.5, 1.0, length(clip_space));\n    if (clip_factor >= 1.0) {\n        return 1.0;\n    }\n# if defined(DEPTH_TEXTURE_SHADOW) && defined(WEBGL2)\n    vec3 lightPovPositionInTexture = 0.5 * light_pos.xyz + 0.5;\n    float shadow_factor = sample_shadow_texture(lightPovPositionInTexture);\n# else\n    vec3 uv = 0.5 * clip_space + vec3(0.5);\n    float shadow_factor = sample_shadow_texture(uv);\n# endif\n    \n    shadow_factor = mix(shadow_factor, 1.0, clip_factor);\n    return shadow_factor;\n}\n#else  \nfloat compute_shadow_factor()\n{\n    return 1.0;\n}\n#endif ",taa:"#ifdef TAA\nuniform float u_float_mix_coef;\nvec4 taa(sampler2D tex, vec2 texcoord) {\n    vec4 texColor = texture2D(tex, texcoord);\n    return vec4(texColor.rgb, texColor.a * u_float_mix_coef);\n}\n#endif"},js={antialias:"#include <mediump_float>\n#include <prelude>\n#include <taa>\nuniform sampler2D u_texture;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n#ifdef TAA\n    vec4 color = taa(u_texture, v_vec2_texcoord);\n#else \n    vec4 color = texture2D(u_texture, v_vec2_texcoord);\n#endif\n    gl_FragColor = color;\n}\n",arrow_line:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <affine_step>\n#include <arrow_functions>\n#include <circle_functions>\n#include <fog>\nuniform 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{\n    return abs(a - b) < 1e-4;\n}\nfloat filter_border(const float start, const float value)\n{\n    return step(start, value) * 2. - 1.;\n}\nfloat arrow_distance(\n    const ArrowDistanceParameters arrow_parameters,\n    const vec2 texcoord,\n    const float offset,\n    const mat2 derivatives,\n    const float line_distance,\n    const float line_distance_no_offset)\n{\n    ArrowDistances ad = calculate_arrow_distances(arrow_parameters, texcoord, offset, derivatives);\n    float derivatives_x_multiplier = 1. / max(abs(derivatives[0].x), abs(derivatives[1].x));\n    \n    \n    float intersection_point = arrow_parameters.full_length - arrow_parameters.arrow_height - arrow_parameters.width * u_vec2_wing_normal.y / u_vec2_wing_normal.x;\n    float tail_arrow_intersection = filter_border(-1., (texcoord.x - intersection_point) * derivatives_x_multiplier);\n    \n    float tail_hide_part = v_vec2_line_type_arrow_tail.y;\n    float tail_hide_mask = (-texcoord.x - tail_hide_part) * derivatives_x_multiplier;\n    float clipped_tail = max(tail_hide_mask, max(line_distance, max(ad.top_left_wing, ad.top_right_wing)));\n    float line_without_offset = filter_border(0., line_distance_no_offset);\n    float 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));\n    return (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(\n    const float fill_distance,\n    const float border_distance)\n{\n    return distance_to_color(fill_distance, border_distance, v_vec4_color, v_vec4_border_color);\n}\nvec4 arrow_color(\n    const vec2 texcoord,\n    const ArrowDistanceParameters arrow_parameters,\n    const float line_fill_distance,\n    const float line_border_distance)\n{\n    mat2 derivatives = mat2(dFdx(texcoord), dFdy(texcoord));\n    \n    float border_clipping = (abs(texcoord.y) - v_vec4_arrow_width_length_border_outer.w) / max(abs(derivatives[0].y), abs(derivatives[1].y));\n    float arrow_border_distance = arrow_distance(\n        arrow_parameters,\n        texcoord,\n        v_vec4_arrow_width_length_border_outer.z,\n        derivatives,\n        line_border_distance,\n        line_fill_distance);\n    float border_factor = max(border_clipping, affine_step(0., 1., arrow_border_distance));\n    return distance_to_arrow_line_color(\n        arrow_distance(arrow_parameters, texcoord, 0., derivatives, line_fill_distance, line_fill_distance),\n        border_factor);\n}\nfloat line_start_distance(\n    const vec2 texcoord,\n    const float offset,\n    const mat2 derivatives,\n    const float line_distance)\n{\n    float tail_hide_part = v_vec2_line_type_arrow_tail.y;\n    float d0 = (-texcoord.x - offset) / max(abs(derivatives[0].x), abs(derivatives[1].x));\n    float dh = (texcoord.x - tail_hide_part) / max(abs(derivatives[0].x), abs(derivatives[1].x));\n    return max(d0, max(line_distance, dh));\n}\nvec4 line_color(const float line_fill_distance, const float line_border_distance)\n{\n    float type = v_vec2_line_type_arrow_tail.x;\n    float fill_distance = line_fill_distance;\n    float border_distance = line_border_distance;\n    if (lookalike(type, g_type_start_border))\n    {\n        vec2 texcoord = v_vec4_texcoord_arrow_line.xy;\n        mat2 derivatives = mat2(dFdx(texcoord), dFdy(texcoord));\n        fill_distance = line_start_distance(texcoord, 0., derivatives, line_fill_distance);\n        border_distance = line_start_distance(texcoord, v_vec4_arrow_width_length_border_outer.z, derivatives, line_border_distance);\n    }\n    return distance_to_arrow_line_color(fill_distance, border_distance);\n}\nvec4 arrow_line_color()\n{\n    if (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    {\n        discard;\n    }\n    ArrowDistanceParameters arrow_parameters = calculate_arrow_distance_parameters(\n        u_vec2_wing_normal,\n        u_vec2_tip_normal,\n        v_vec4_arrow_width_length_border_outer.x,\n        v_vec4_arrow_width_length_border_outer.y,\n        u_float_tip_height_multiplier,\n        u_float_wing_height_multiplier);\n    float line_width = arrow_parameters.width;\n    float line_border = v_vec4_arrow_width_length_border_outer.z;\n    \n    vec2 line_texcoord = v_vec4_texcoord_arrow_line.zw;\n    mat2 line_derivatives = mat2(dFdx(line_texcoord), dFdy(line_texcoord));\n    CircleDistance circle_fill_distance = circle_color_distance(line_derivatives, line_texcoord, line_width);\n    CircleDistance circle_border_distance = circle_color_distance(line_derivatives, line_texcoord, line_width + line_border);\n    float line_fill_distance = affine_step(-1., 0., circle_fill_distance.distance / circle_fill_distance.width) - 1.;\n    float line_border_distance = affine_step(0., circle_border_distance.width, circle_border_distance.distance);\n    return 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{\n    vec4 color = arrow_line_color();\n    gl_FragColor = apply_fog(color);\n}\n",arrow_line_identify:"#include <highp_float>\n#include <prelude>\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{\n    return abs(a - b) < 1e-5;\n}\nvoid main()\n{\n    if (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    {\n        discard;\n    }\n    gl_FragColor = v_vec4_identifier;\n}\n",circle_marker:"#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <affine_step>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform 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    vec4 light = light_factor_surface();\n    vec4 color = u_vec4_color * affine_step(1.0, 1.0 - 4.0 / v_float_width, center_distance) * light;\n    gl_FragColor = apply_fog_alpha(color);\n}\n",color:"#include <lowp_float>\n#include <prelude>\n#include <fog>\nvarying vec4 v_vec4_color;\nvoid main()\n{\n    gl_FragColor = apply_fog(v_vec4_color);\n}\n",color_identify:"#include <lowp_float>\n#include <prelude>\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\n    gl_FragColor = v_vec4_identifier;\n}\n",color_with_z_fade:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <screendoor_transparency>\n#include <fragment_normal>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_rotated_scaled_vertex;\nvoid main()\n{\n    apply_screendoor();\n    vec3 normal = calc_fragment_normal(v_vec4_rotated_scaled_vertex.xyz);\n    vec4 light = light_factor(normal);\n    vec4 color = v_vec4_color * light;\n    gl_FragColor = apply_fog(color);\n}\n",copy:"#include <mediump_float>\n#include <prelude>\n#if defined(IS_DEPTH_TEXTURE) && defined(WEBGL2)\nuniform mediump sampler2DShadow u_texture;\n#else\nuniform sampler2D u_texture;\n#endif\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n#if defined(IS_DEPTH_TEXTURE) && defined(WEBGL2)\n    gl_FragColor = vec4(vec3(texture2D(u_texture, vec3(v_vec2_texcoord, 1.0))), 1.0);\n#else\n    gl_FragColor = texture2D(u_texture, v_vec2_texcoord);\n#endif\n}\n",copy_depth:"#include <require_frag_depth>\n#include <mediump_float>\n#include <prelude>\n#include <apply_opacity>\nuniform sampler2D u_texture;\nuniform sampler2D u_depth;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    float depthR = texture2D(u_depth, v_vec2_texcoord).r;\n    vec4 color = texture2D(u_texture, v_vec2_texcoord);\n    gl_FragColor = color;\n    #ifdef WEBGL1\n    gl_FragDepthEXT = depthR;\n    #else\n    gl_FragDepth = depthR;\n    #endif\n}\n",dem_elevation:"#include <mediump_float>\n#include <prelude>\nuniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\n  #ifdef WEBGL2\n  gl_FragColor = vec4(color.r, 0, 0, 1);\n  #else\n  gl_FragColor = vec4(color.a, 0, 0, 1);\n  #endif\n}\n",dem_elevation_copy:"#include <mediump_float>\n#include <prelude>\nuniform sampler2D u_sr2d_texture;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n  gl_FragColor = texture2D(u_sr2d_texture, v_vec2_texcoord);\n}\n",dem_flat_bottom:"#include <mediump_float>\n#include <prelude>\nvarying vec4 v_vec4_color;\nvoid main()\n{\n    gl_FragColor = v_vec4_color;\n}\n",dem_ground:"#include <mediump_float>\n#include <prelude>\nvarying vec4 v_vec4_coords;\nvoid main()\n{\n    gl_FragColor = v_vec4_coords;\n}\n",dem_mesh:"#include <enable_standard_derivatives>\n#include <mediump_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform sampler2D u_flat_tex;\nuniform sampler2D u_hillshade_tex;\nuniform sampler2D u_tex_hillshade_ramp;\nuniform float u_float_dem_shading_intensity;\nvarying vec4 v_vec4_texcoord;\nvarying vec2 hs_tex_pos;\nvoid main()\n{\n    \n    if (v_vec4_texcoord.z == 0.) {\n        discard;\n    }\n    vec4 vec4_texcoord = v_vec4_texcoord / v_vec4_texcoord.w;\n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n     \n    if (vec4_texcoord.x < 0. || vec4_texcoord.x > 1. || vec4_texcoord.y < 0. || vec4_texcoord.y > 1.) {\n        discard;\n    } else {\n        vec4 flatMapColor = texture2D(u_flat_tex, vec4_texcoord.xy);\n        \n        if (u_float_dem_shading_intensity > 0.) {\n            \n            vec3 normal = texture2D(u_hillshade_tex, hs_tex_pos).rgb * 2. - vec3(1.);\n            \n            float light_raw = light_factor_dem(normal);\n            float dir1_intensity = u_vec4_light_dir1_color[3];\n            float amb_intensity = u_vec4_ambient_color[3];\n            float total_intensity = dir1_intensity + amb_intensity;\n            \n            \n            float amb_intensity_shifted = u_vec4_ambient_color[3];\n            float dir_intensity_shifted = dir1_intensity;\n            \n            float horizonatal_surface_light_dir_dot = light_factor_dem(vec3(0, 0, 1));\n            float horizonatal_surface_light_intensity = amb_intensity + dir1_intensity * horizonatal_surface_light_dir_dot;\n            if (u_float_dem_shading_intensity > 0.5) { \n                amb_intensity_shifted = mix(amb_intensity, 0., (u_float_dem_shading_intensity - 0.5) / 0.5);\n                dir_intensity_shifted = (horizonatal_surface_light_intensity - amb_intensity_shifted) / horizonatal_surface_light_dir_dot;\n            } else if (u_float_dem_shading_intensity < 0.5) { \n                dir_intensity_shifted = mix(0., dir1_intensity, u_float_dem_shading_intensity / 0.5);\n                amb_intensity_shifted = horizonatal_surface_light_intensity - dir_intensity_shifted * horizonatal_surface_light_dir_dot;\n            } \n            \n            float tex_coord = clamp(dir_intensity_shifted * light_raw * 0.5 + 0.5, 0., 0.99);\n            \n            float dir_light_factor = 2. * (texture2D(u_tex_hillshade_ramp, vec2(tex_coord, 0.5)).a - 0.5);\n            vec3 light_color = amb_intensity_shifted * u_vec4_ambient_color.rgb + dir_light_factor * u_vec4_light_dir1_color.rgb;\n            \n            gl_FragColor.rgb = light_color * flatMapColor.rgb;\n            \n            \n            gl_FragColor.a = flatMapColor.a;\n        } else {\n            gl_FragColor = flatMapColor * light_factor_surface();\n        }\n        gl_FragColor = apply_fog(gl_FragColor);\n    }\n}\n",dem_normal:"#include <lowp_float>\n#include <prelude>\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_scale;\nconst float M_PI = 3.1415926535897932384626433832795;\nvarying vec2 v_vec2_texcoord;\nmat3 get_kernel(vec2 pos, float step, float defval) {\n    mat3 kernel;\n    for (int x = 0; x < 3; x++) {\n        vec3 col;\n        for (int y = 0; y < 3; y++) {\n            col[y] = texture2D(u_tex_dem, vec2(pos.x + float(x - 1) * step, pos.y + float(y - 1) * step)).r;\n            if (col[y] == DEM_INVALID_VALUE) {\n                col[y] = defval;\n            }\n        }\n        kernel[x] = col;\n    }\n    return 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    \n    if (dzdx == 0. && dzdy == 0.) {\n        return 0.;\n    }\n    \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}\nvec3 dem_normal(const vec2 tex_pos)\n{\n    \n    float tex_step = 1. / u_float_dem_resolution;\n    \n    if (u_float_dem_scale == 0.) {\n        return vec3(0.);\n    }\n    \n    vec4 e = texture2D(u_tex_dem, tex_pos);\n    if (e.a == 0. || e.r == DEM_INVALID_VALUE) {\n        \n        return vec3(0.);\n    }\n    mat3 kernel = get_kernel(tex_pos.xy, tex_step, e.r);\n    \n    float aspect = calc_aspect(kernel);\n    \n    \n    float slope = calc_slope(kernel, u_float_dem_cell_size);\n    \n    slope = M_PI * 0.5 - slope; \n    aspect = aspect - M_PI * 0.5; \n    float cosSlope = cos(slope);\n    vec3 normal = normalize(vec3(cosSlope * cos(aspect), -1. * cosSlope * sin(aspect), sin(slope)));\n    \n    return normal * 0.5 + vec3(0.5);\n}\nvoid main() {\n    gl_FragColor = vec4(dem_normal(v_vec2_texcoord), 1);\n}\n",gltf_model:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <screendoor_transparency>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\n#include <light_pbr>\n#include <light_phong>\nuniform sampler2D u_sr2d_texture_0;\nuniform vec4 u_vec4_color;\n#ifdef AO_TEXTURE\nuniform sampler2D u_ao_texture;\n#endif\n#ifdef PBR_TEXTURE\nuniform sampler2D u_pbr_texture;\n#endif\n#ifdef LIGHT_MODEL\n#if  (LIGHT_MODEL == LIGHT_MODEL_PBR || LIGHT_MODEL == LIGHT_MODEL_PHONG)\nuniform float u_float_metallic;\nuniform float u_float_roughness;\n#endif\n#endif\nvarying vec2 v_vec2_texcoord_color;\nvarying vec3 v_vec3_normal;\nvarying vec3 v_vec3_fragment_pos_world;\n#ifdef AO_TEXTURE\nvarying vec2 v_vec2_texcoord_ao;\n#endif\n#ifdef PBR_TEXTURE\nvarying vec2 v_vec2_texcoord_pbr;\n#endif\nvoid main()\n{\n    apply_screendoor();\n    vec4 tex_color = texture2D(u_sr2d_texture_0, v_vec2_texcoord_color);\n    #ifdef AO_TEXTURE\n        \n        \n        vec4 ao_tex_color = texture2D(u_ao_texture, v_vec2_texcoord_ao);\n        tex_color *= ao_tex_color;\n    #endif\n    vec3 fragment_normal = normalize(v_vec3_normal);\n    vec4 color = tex_color * u_vec4_color;\n    bool use_light = UNPACK_BOOL1(u_int_light_flags);\n    if (!use_light) {\n        gl_FragColor = apply_fog(color);\n        return;\n    }\n    \n    #ifdef LIGHT_MODEL\n        float metallic = max(u_float_metallic, 0.1);\n        float roughness = max(u_float_roughness, 0.1);\n        #ifndef METALLIC_ROUGHNESS_DEBUG\n            #ifdef PBR_TEXTURE\n                vec4 pbr_tex_color = texture2D(u_pbr_texture, v_vec2_texcoord_pbr);\n                roughness = max(pbr_tex_color.g, 0.1);\n                metallic = max(pbr_tex_color.b, 0.1);\n            #endif\n        #endif\n        #if (LIGHT_MODEL == LIGHT_MODEL_PBR)\n            color.rgb = color_pbr(fragment_normal, v_vec3_fragment_pos_world, color.rgb, roughness, metallic);\n        #elif (LIGHT_MODEL == LIGHT_MODEL_PHONG)\n            color.rgb = color_phong(fragment_normal, v_vec3_fragment_pos_world, color.rgb, roughness, metallic);\n        #endif\n    #endif\n    gl_FragColor = apply_fog(color);\n}",gradient_with_z_fade:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <screendoor_transparency>\n#include <fragment_normal>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nvarying mat4 v_mat4_gradient;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_rotated_scaled_vertex;\nvoid main()\n{\n    apply_screendoor();\n    vec4 color = v_vec4_color;\n    if (v_mat4_gradient[0][0] != 0.) {\n        float height_gradient = v_vec4_rotated_scaled_vertex.w;\n        color = mix(v_mat4_gradient[1], v_mat4_gradient[2], smoothstep(v_mat4_gradient[0][1], v_mat4_gradient[0][2], height_gradient));\n    }\n    vec3 normal = calc_fragment_normal(v_vec4_rotated_scaled_vertex.xyz);\n    color *= light_factor(normal);\n    gl_FragColor = apply_fog(color);\n}",heatmap:"#include <mediump_float>\n#include <prelude>\n#include <fog>\nuniform 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    float fog_alpha = apply_fog_alpha(vec4(1)).r;\n    gl_FragColor = vec4(val, fog_alpha, 1.0, 1.0);\n}\n",heatmap_texture:"#include <mediump_float>\n#include <prelude>\n#include <cam_pos>\nuniform sampler2D u_sr2d_texture;\nuniform sampler2D u_sr2d_ramp_texture;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_position;\nvoid main() {\n    vec2 color_and_alpha = texture2D(u_sr2d_texture, v_vec2_position).rg;\n    vec4 color = texture2D(u_sr2d_ramp_texture, vec2(color_and_alpha.r, 0.5));\n    gl_FragColor = color * u_float_opacity;\n    \n    \n    #ifdef FOG\n        gl_FragColor *= color_and_alpha.g;\n    #endif\n}\n",label:"#include <highp_float>\n#include <prelude>\n#include <apply_opacity>\n#include <fog>\nuniform sampler2D u_sr2d_texture;\nuniform float u_float_buffer;\nuniform float u_float_gamma;\nuniform vec4 u_vec4_color;\nuniform vec4 u_vec4_hidden_color;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_behind_factor;\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    vec4 color = mix(u_vec4_hidden_color, u_vec4_color, v_float_behind_factor);\n    color = apply_fog_alpha(color);\n    gl_FragColor = apply_opacity(color * alpha, u_float_opacity);\n}\n",label_directional:"#include <highp_float>\n#include <prelude>\n#include <apply_opacity>\n#include <fog>\nuniform 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    vec4 color = apply_fog_alpha(u_vec4_color);\n    gl_FragColor = apply_opacity(color * alpha, u_float_opacity);\n}\n",line:"#include <mediump_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nvarying vec4 v_vec4_color;\nvarying mat4 v_mat4_gradient;\nvarying vec3 v_vec3_normal;\nvarying vec2 v_vec2_height_gradient;\nuniform mat4 u_mat4_gradient;\nvoid main()\n{ \n    vec4 color = v_vec4_color;\n    if (u_mat4_gradient[0][0] != 0.) {\n        color = mix(v_mat4_gradient[1], v_mat4_gradient[2], smoothstep(v_mat4_gradient[0][1], v_mat4_gradient[0][2], v_vec2_height_gradient[0]));\n    }\n    color *= (1. - abs(v_vec2_height_gradient[1] * gl_FragCoord.w));\n    gl_FragColor = apply_fog(color * light_factor(v_vec3_normal));\n}\n",main_shadow:"#include <mediump_float>\n#include <prelude>\n#include <pack_depth>\nvarying float v_depth_metric;\nvoid main()\n{\n#ifdef DEPTH_TEXTURE_SHADOW\nreturn;\n#endif\ngl_FragColor = pack_float_to_vec4(v_depth_metric);\n}",map_mesh:"#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <screendoor_transparency>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform sampler2D u_sampler_map_tex;\nuniform vec2 u_float_tex_scale;\nuniform float u_float_tex_shift_scale;\nuniform mediump float u_float_light_intensity;\nuniform int u_int_identify;\nvarying vec4 v_tex_coord;\nvarying vec4 v_vec4_normal_gradient;\nvoid main()\n{\nvec2 coord = v_tex_coord.xy / v_tex_coord.w;\ncoord = coord / u_float_tex_scale;\ncoord.y += u_float_tex_shift_scale / u_float_tex_scale.y;\ncoord = (coord / 2.) + vec2(0.5, 0.5);\nif (coord.x < 0. || coord.x > 1. || coord.y < 0. || coord.y > 1.) {\ngl_FragColor = vec4(0, 0, 0, 0);\n} else {\ngl_FragColor = texture2D(u_sampler_map_tex, coord);\nif (u_int_identify == 0) {\napply_screendoor();   \ngl_FragColor.rgb *= 1. - u_float_light_intensity * smoothstep(0.85, 1., abs(v_vec4_normal_gradient.w));\ngl_FragColor *= light_factor(v_vec4_normal_gradient.xyz);\ngl_FragColor = apply_fog(gl_FragColor);\n}\n}\n}",mesh:"#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <apply_opacity>\n#include <fog>\n#include <screendoor_transparency>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform sampler2D u_sr2d_texture;\nuniform float u_float_texture_opacity;\nuniform vec4 u_float_sprite_texture_coords;\nuniform lowp int u_int_is_textured;\nuniform mediump vec4 u_vec4_color;\nuniform mediump mat4 u_mat4_gradient;\nuniform mediump float u_float_opacity;\nuniform int u_int_identify;\nvarying vec4 v_vec4_color;\nvarying mat4 v_mat4_gradient;\nvarying vec2 v_vec2_tex_coord;\nvarying vec4 v_vec4_normal_gradient;\nvoid main()\n{\n    if (u_int_identify == 1) {\n        \n        \n        \n        gl_FragColor = vec4(1, 1, 1, 1);\n    } else {\n        apply_screendoor();   \n        vec4 light = light_factor(v_vec4_normal_gradient.xyz);\n        if (u_int_is_textured != 0)  {\n            vec2 spritecoord = mix(u_float_sprite_texture_coords.xy, u_float_sprite_texture_coords.zw, fract(v_vec2_tex_coord));\n            vec4 color = texture2D(u_sr2d_texture, spritecoord);\n            gl_FragColor = apply_opacity(vec4(color.rgb, color.a), u_float_texture_opacity);\n        } else if (u_mat4_gradient[0][0] != 0.) {\n    gl_FragColor = mix(v_mat4_gradient[1], v_mat4_gradient[2], smoothstep(v_mat4_gradient[0][1], v_mat4_gradient[0][2], v_vec4_normal_gradient.w));\n        } else {\n            gl_FragColor = v_vec4_color;\n        } \n        gl_FragColor = apply_fog(gl_FragColor * light);\n    }\n    \n}\n",metric_point:"#include <mediump_float>\n#include <prelude>\n#include <cam_pos>\n#include <apply_opacity>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform vec4 u_vec4_color;\nuniform sampler2D u_sr2d_texture;\nuniform vec4 u_float_sprite_texture_coords;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    vec2 spritecoord = mix(u_float_sprite_texture_coords.xy, u_float_sprite_texture_coords.zw, v_vec2_texcoord);\n    vec4 color = texture2D(u_sr2d_texture, spritecoord) * u_vec4_color;\n    gl_FragColor = apply_fog(color * light_factor_surface());\n}\n",one_way_line:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <affine_step>\n#include <apply_opacity>\n#include <arrow_functions>\n#include <fog>\nuniform vec2 u_vec2_wing_normal;\nuniform vec2 u_vec2_tip_normal;\nuniform mediump float u_float_width;\nuniform mediump float u_float_length;\nuniform mediump 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{\n    return 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{\n    mat2 derivatives = mat2(dFdx(v_vec2_texcoord), dFdy(v_vec2_texcoord));\n    ArrowDistanceParameters arrow_parameters = calculate_arrow_distance_parameters(\n        u_vec2_wing_normal,\n        u_vec2_tip_normal,\n        u_float_width * v_float_zpt_to_texcoord_factor,\n        u_float_length * v_float_zpt_to_texcoord_factor,\n        u_float_tip_height_multiplier,\n        u_float_wing_height_multiplier);\n    \n    float border_clipping = (abs(v_vec2_texcoord.y) - v_float_outer_width) / max(abs(derivatives[0].y), abs(derivatives[1].y));\n    float fill_factor = affine_step(-1., 0., one_way_line_distance(calculate_arrow_distances(arrow_parameters, v_vec2_texcoord, 0., derivatives)));\n    float 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",patterned_line:"#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <affine_step>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform int u_int_pattern_type;\nvarying vec4 v_vec4_color;\nvarying vec2 v_vec2_uv;\nvarying float v_float_width;\nvarying vec4 v_vec4_pattern_parameters;\nfloat dot2(in vec2 p) {\n    return dot(p, p);\n}\nfloat sdBox( in vec2 p, in vec2 b )\n{\n    vec2 d = abs(p)-b;\n    return length(max(d,0.0)) + min(max(d.x,d.y),0.0);\n}\nfloat sdCircle( vec2 p, float r )\n{\n    return length(p) - r;\n}\nfloat sdTriangle(in vec2 p, in float width) {\n    return abs(p.x) - (p.y + .5) * width * .5;\n}\nfloat sdChevron(in vec2 p, float width, float skew, float rounding)\n{\n    p.x = abs(p.x);\n    if (p.y + p.x > 1.0) {\n        return sqrt(dot2(p - vec2(0.25, 0.75))) - sqrt(2.0)/4.0;\n    }\n    return sqrt(min(dot2(p - vec2(0.00, 1.00)),\n                    dot2(p - 0.5 * max(p.x + p.y, 0.0)))) * sign(p.x - p.y);\n}\nvoid main()\n{\n    float pattern_length = v_vec4_pattern_parameters.x;\n    float full_width = v_float_width + 1.;\n    \n    float smooth_base = max(15., max(v_float_width, pattern_length));\n    float smooth_scale = (smooth_base + 1.) / smooth_base;\n    float smooth_factor = smooth_scale - 1.;\n    \n    \n    vec2 sdf_pos = vec2(mod(v_vec2_uv.x, 1.) - 0.5, v_vec2_uv.y * smooth_scale);\nfloat sdf = 1.; \n    \n    if (u_int_pattern_type < 4) {\n         \n        float width = v_vec4_pattern_parameters.y;\n        float left  = v_vec4_pattern_parameters.z;\n        float right = v_vec4_pattern_parameters.w;\n        \n        \n        vec2 offset;\n        if (right < 0.) {\n            offset = vec2(.25, .5);\n        } else {\n            offset = vec2(.0, .5);\n        }\n        \n        if (width > EPSILON) {\n            float leftSdf = 1.;\n            if (left > EPSILON) {\n                leftSdf = sdBox(sdf_pos + offset, vec2(left, width));\n            }\n            float rightSdf = 1.;\n            if (abs(right) > EPSILON) {\n                rightSdf = sdBox(sdf_pos - offset, vec2(abs(right), width));\n            }\n            sdf = min(leftSdf, rightSdf);\n        }\n    } else if (u_int_pattern_type == 5) {\n        \n        float radius = v_vec4_pattern_parameters.y;\n        \n        if (radius > EPSILON) {\n            sdf = sdCircle(sdf_pos, radius);\n        }\n    } else if (u_int_pattern_type == 4) {\n        \n        float width = v_vec4_pattern_parameters.y;\n        float orientation = v_vec4_pattern_parameters.z;\n        \n        if (width > EPSILON) {\n            sdf = sdTriangle(sdf_pos * vec2(1., orientation), width);\n        }\n    } else if (u_int_pattern_type == 6) {\n        \n        sdf = sdChevron(sdf_pos.yx, 0., 0., 0.);\n    }\n    \n    sdf = max(sdf, abs(sdf_pos.y) - 0.5);\n    \n    vec4 color = mix(\n        v_vec4_color, \n        vec4(0.), \n        affine_step(-smooth_factor, smooth_factor, sdf)\n    );\n    color *= light_factor_surface();\n    gl_FragColor = apply_fog(color);\n}\n",pointsprite:"#include <mediump_float>\n#include <prelude>\n#include <apply_opacity>\n#include <fog>\nuniform sampler2D u_sr2d_texture;\nuniform vec2 u_vec2_opacity;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_behind_factor;\nvoid main()\n{\n    vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\n    float opacity = mix(u_vec2_opacity[1], u_vec2_opacity[0], v_float_behind_factor);\n    color = apply_fog_alpha(color);\n    gl_FragColor = apply_opacity(color, opacity);\n}\n",pointsprite_identify:"#include <mediump_float>\n#include <prelude>\nuniform 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.3) {\n        discard;\n    } else {\n        gl_FragColor = v_vec4_identifier;\n    }\n}\n",rect:"#include <lowp_float>\n#include <prelude>\n#include <fog>\nuniform vec4 u_vec4_color;\nvoid main()\n{\n    gl_FragColor = u_vec4_color;\n}\n",rect_with_texture:"#include <mediump_float>\n#include <prelude>\n#include <apply_opacity>\n#include <fog>\nuniform sampler2D u_sr2d_texture;\nuniform float u_float_opacity;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord);\n    color = apply_fog_alpha(color);\n    gl_FragColor = apply_opacity(color, u_float_opacity);\n}\n",road:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <affine_step>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform 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    vec4 color = light_factor_surface() * u_vec4_color;\n    color = apply_fog(color);\n    gl_FragColor = color * opacity;\n}\n",road_identify:"#include <enable_standard_derivatives>\n#include <lowp_float>\n#include <prelude>\nvarying 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",simple_line:"#include <lowp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform vec4 u_vec4_color;\nvarying float v_float_distance;\nvarying float v_float_distance_offset;\nvoid main()\n{\n    vec4 light = light_factor_surface();\n    vec4 color = u_vec4_color * clamp(\n        1. + v_float_distance_offset - abs(v_float_distance * gl_FragCoord.w),\n        0.,\n        1.) * light;\n    gl_FragColor = apply_fog(color);\n}\n",sky:"#include <mediump_float>\n#include <prelude>\n#include <fog>\n#define SKY_ALPHA_HORIZON_BLEND (6.0)\n#define DEFAULT_SKY_COLOR (vec4(0.0))\nvec4 add_sky_alpha_blend(vec4 color) {\n#ifdef SKY\n    \n    float depth = length(v_fog_pos);\n    vec3 dir = v_fog_pos / depth;\n    float alpha_dir = dir.z + 0.15; \n    float alpha = clamp(1.0 + SKY_ALPHA_HORIZON_BLEND * alpha_dir, 0.0, 1.0);\n    color *= alpha;\n#endif\n    return color;\n}\nvoid main() {\n#ifdef SKY\n    vec4 color = add_sky_alpha_blend(u_sky_color);\n#else\n    vec4 color = DEFAULT_SKY_COLOR;\n#endif\n    gl_FragColor = apply_fog_sky(color);\n}\n",striped_line:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <affine_step>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\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;\nvec4 distance_func_smooth(in vec4 main_color, in vec4 border_color, in vec2 circle)\n{\n    float circle_length = length(circle);\n    float distance = circle_length - v_float_width;\n    mat2 derivatives = mat2(dFdx(v_vec2_circle), dFdy(v_vec2_circle));\n    \n    \n    \n    vec2 circle_dx = derivatives[0];\n    vec2 circle_dy = derivatives[1];\n    \n    float distance_dx = dot(v_vec2_circle, circle_dx);\n    float distance_dy = dot(v_vec2_circle, circle_dy);\n    \n    float derivative_denominator = circle_length;\n    float width = max(abs(distance_dx), abs(distance_dy));\n    vec4 from_main_to_border = mix(\n        main_color,\n        border_color,\n        affine_step(-width, 0., distance * derivative_denominator));\n    vec4 from_color_to_fade = mix(\n        from_main_to_border,\n        vec4(0.),\n        affine_step(0., +width, distance * derivative_denominator));\n    return from_color_to_fade;\n}\nfloat calculate_segment_color_factor(in float distance_in_parts, in float threshold)\n{\n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    \n    float color_factor = abs(fract(distance_in_parts + 0.5 - 0.5 * threshold) - 0.5);\n    \n    float parts_affine_step_width = fwidth(distance_in_parts);\n    \n    float smoothed_color_factor = affine_step(\n        0.5 * threshold - 0.5 * parts_affine_step_width,\n        0.5 * threshold + 0.5 * parts_affine_step_width,\n        color_factor);\n    return smoothed_color_factor;\n}\nvoid main()\n{\n    vec4 current_segment_color = mix(\n        v_vec4_dash_color,\n        v_vec4_space_color,\n        calculate_segment_color_factor(\n            v_float_distance_in_parts,\n            v_float_part_color_swap_threshold));\n    \n    vec4 final_border_color = (1.0 - v_vec4_border_color.a) * current_segment_color + v_vec4_border_color;\n    vec4 color = distance_func_smooth(current_segment_color, final_border_color, v_vec2_circle);\n    vec4 light = light_factor_surface();\n    gl_FragColor = apply_fog(light * color);\n}\n",textured_color:"#include <mediump_float>\n#include <prelude>\n#include <cam_pos>\n#include <apply_opacity>\n#include <fog>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform sampler2D u_sr2d_texture;\nuniform float u_float_texture_opacity;\nuniform vec4 u_float_texture_params;\nuniform vec4 u_float_sprite_texture_coords;\nuniform int u_int_is_textured;\nvarying vec4 v_vec4_color;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    vec4 light = light_factor_surface();\n    vec4 color;\n    if (u_int_is_textured == 0) {\n        color = v_vec4_color * light;\n    } else {\n        vec2 texcoord = fract(v_vec2_texcoord * u_float_texture_params.zw + u_float_texture_params.xy);\n        vec2 spritecoord = mix(u_float_sprite_texture_coords.xy, u_float_sprite_texture_coords.zw, texcoord);\n        color = texture2D(u_sr2d_texture, spritecoord);\n        vec4 texcolor = apply_opacity(color, u_float_texture_opacity);\n        color = texcolor + v_vec4_color * (1. - texcolor.a) * light;\n    }\n    gl_FragColor = apply_fog(color);\n}\n",zbm_model:"#include <enable_standard_derivatives>\n#include <highp_float>\n#include <prelude>\n#include <cam_pos>\n#include <fog>\n#include <screendoor_transparency>\n#include <fragment_normal>\n#include <bit_mask>\n#include <pack_depth>\n#include <shadow>\n#include <light>\nuniform sampler2D u_sr2d_texture;\nuniform vec4 u_vec4_color;\nvarying vec3 v_vec3_rotated_scaled_vertex;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    apply_screendoor();\n    vec3 normal = calc_fragment_normal(v_vec3_rotated_scaled_vertex);\n    vec4 light = light_factor(normal);\n    vec4 color = texture2D(u_sr2d_texture, v_vec2_texcoord) * u_vec4_color * light;\n    gl_FragColor = apply_fog(color);\n}\n"},Ns={apply_height_factor:"vec4 apply_height_factor(const vec3 vertex, const float height_factor)\n{\n    vec3 result_vertex = vertex;\n    result_vertex.z *= height_factor;\n    return vec4(result_vertex, 1.0);\n}\n",apply_opacity:Os,arrow_functions:"\nvec2 multiply_complex(const vec2 lhs, const vec2 rhs)\n{\n    return vec2(lhs.x * rhs.x - lhs.y * rhs.y, lhs.x * rhs.y + lhs.y * rhs.x);\n}\nstruct ArrowParameters\n{\n    float zpt_to_texcoord_factor;\n    float final_size;\n    float outer_width;\n    vec2 widen_size;\n};\nArrowParameters calculate_arrow_parameters(\n    const float calculation_scale,\n    const float width_zpt,\n    const float border_width_zpt,\n    const float segment_length_zpt,\n    const float wing_width_multiplier,\n    const float size_factor)\n{\n    float quad_width = 2.0 * border_width_zpt + 2.0 * wing_width_multiplier * width_zpt;\n    float quad_height = 2.0 * border_width_zpt + segment_length_zpt;\n    float max_quad_dimension = max(quad_width, quad_height);\n    float zpt_to_texcoord_factor = 2.0 / max_quad_dimension;\n    float final_size = calculation_scale * size_factor * max_quad_dimension;\n    vec2 widen_size = 0.5 * vec2(quad_height, quad_width) * zpt_to_texcoord_factor;\n    float outer_width = (width_zpt * wing_width_multiplier + border_width_zpt) * zpt_to_texcoord_factor;\n    return ArrowParameters(\n        zpt_to_texcoord_factor,\n        final_size,\n        outer_width,\n        widen_size);\n}\nstruct VertexShiftParameters\n{\n    vec4 clip_space_vertex;\n    float limited_factor;\n};\nVertexShiftParameters calculate_vertex_shift_parameters(\n    const mat4 mvp,\n    const vec2 vpt_size,\n    const vec2 vertex,\n    const vec2 widen,\n    const float shift_pixels)\n{\n    vec2 widen_perp = vec2(-widen.y, widen.x);\n    \n    vec4 clip_space_widen = mvp * vec4(widen, 0., 0.);\n    vec4 clip_space_widen_perp = mvp * vec4(widen_perp, 0., 0.);\n    vec2 half_viewport = vpt_size / 2.;\n    \n    vec4 clip_space_vertex = mvp * vec4(vertex, 0.0, 1.0) + clip_space_widen;\n    \n    float limited_factor = calculate_multiplication_factor(\n        half_viewport,\n        clip_space_widen,\n        clip_space_widen_perp,\n        clip_space_vertex,\n        shift_pixels);\n    return VertexShiftParameters(\n        clip_space_vertex + clip_space_widen * limited_factor,\n        limited_factor);\n}\n",calculate_scale:"struct Scale\n{\n    float projection;\n    float style;\n    float style_clamped;\n    float calculation;\n};\nScale calculate_scale(const vec3 projection_scale_style_scale_dpi, const vec2 scale_limits)\n{\n    float style_scale_clamped = clamp(projection_scale_style_scale_dpi.y, scale_limits.x, scale_limits.y);\n    float scale_ratio = projection_scale_style_scale_dpi.x / projection_scale_style_scale_dpi.y;\n    float calculation_scale = style_scale_clamped * scale_ratio;\n    return Scale(\n        projection_scale_style_scale_dpi.x,\n        projection_scale_style_scale_dpi.y,\n        style_scale_clamped,\n        calculation_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{\n    return clamp(\n        (scale - g_min_scale_factor) / (tile_size - g_min_scale_factor),\n        g_min_scale_factor,\n        g_max_scale_factor);\n}\n",cam_pos:Ds,clipspace_pos:"varying vec3 v_clipspace_pos;\nvoid save_clipspace_pos () {\n    v_clipspace_pos = gl_Position.xyz;\n}",dem:"\nuniform sampler2D u_tex_dem;\nuniform sampler2D u_tex_corrected_dem;\nuniform float u_float_corrected_interval;\nuniform mat4 u_mat4_dem_corrected;\nuniform mat4 u_mat4_dem_mvp;\nuniform float u_float_dem_scale;\nuniform float u_float_map_center_elevation;\nuniform float u_float_vertical_scale;\nconst float DEM_INVALID_VALUE = -9999.;\nconst float UNPACK_CENTROID = 8. / 65535.;\nconst float MAP_POINTS_IN_METER = 107.17318796639701;\nfloat dem_height_direct_meters(vec2 tex_pos) {\n    \n    if (u_float_dem_scale == 0.) {\n        return 0.;\n    }\n    vec4 elevation;\n    \n    if (u_float_corrected_interval == 0.) {\n        elevation = texture2D(u_tex_dem, tex_pos);\n    }\n    else {\n        vec2 test_tex_pos = abs(tex_pos - vec2(0.5, 0.5));\n        if (test_tex_pos.x < u_float_corrected_interval && test_tex_pos.y < u_float_corrected_interval) {\n            elevation = texture2D(u_tex_corrected_dem, (u_mat4_dem_corrected * vec4(tex_pos, 0, 1)).xy);\n        } else {\n            elevation = texture2D(u_tex_dem, tex_pos);\n        }\n    }\n    \n    if (elevation.a == 0.) {\n        \n        return DEM_INVALID_VALUE;\n    } else {\n        return elevation.r;\n    }\n}\nfloat meters_to_tile_height(float height) {\n    return (height - u_float_map_center_elevation) * MAP_POINTS_IN_METER * u_float_vertical_scale * u_float_dem_scale;\n}\nfloat dem_height_direct(vec2 tex_pos) {\n    float height = dem_height_direct_meters(tex_pos);\n    if (height == DEM_INVALID_VALUE) {\n        return DEM_INVALID_VALUE;\n    } else {\n        return meters_to_tile_height(height);  \n    }  \n}\n \nfloat dem_height(const vec2 coords) {\n    \n    if (u_float_dem_scale == 0.) {\n        return 0.;\n    }\n    vec4 tex_pos = u_mat4_dem_mvp * vec4(coords, 0.0, 1.0);\n    return dem_height_direct(tex_pos.xy);\n}\nfloat abs_height(float height) {\n    return (height - u_float_map_center_elevation * MAP_POINTS_IN_METER) * u_float_dem_scale * u_float_vertical_scale;\n}\nvec2 unpack_dem_position(const vec2 pos) {\n    return pos * UNPACK_CENTROID;\n}\n",depth_test:"uniform sampler2D u_depth_tex_labeling;\nuniform sampler2D u_color_tex_labeling;\nuniform vec2 u_vec2_depth_test_half_point_size;\nuniform bool u_bool_depth_test_disable;\nfloat color_test(const vec2 pos, const vec4 color)\n{\n    vec2 halfPointSize = u_vec2_depth_test_half_point_size;\n    float result = 0.;\n    \n    if (texture2D(u_color_tex_labeling, (vec2(pos.x - halfPointSize.x, pos.y + halfPointSize.y) + 1.) / 2.) == color) {\n        result++;\n    }\n    if (texture2D(u_color_tex_labeling, (pos + halfPointSize + 1.) / 2.) == color) {\n        result++;\n    }\n    if (texture2D(u_color_tex_labeling, (pos - halfPointSize + 1.) / 2.) == color) {\n        result++;\n    }\n    if (texture2D(u_color_tex_labeling, (vec2(pos.x + halfPointSize.x, pos.y - halfPointSize.y) + 1.) / 2.) == color) {\n        result++;\n    }\n    \n    return step(3., result);\n}\nfloat depth_test(const vec2 pos, const float depth, const vec4 color)\n{\n    if (u_bool_depth_test_disable == true) {\n        return 1.;\n    }\n    float colorCheck = color_test(pos, color);\n    if (colorCheck == 1.) {\n        return 1.;\n    }\n    float d = (depth + 1.) / 2.;\n    float delta = 0.001;\n    float texDepth = texture2D(u_depth_tex_labeling, (pos + 1.) / 2.).r;\n    if (d <= texDepth) {\n        return 1.;\n    }\n    if (d - texDepth > delta) {\n        return 0.;\n    }\n    return 1. - (d - texDepth) / delta;\n}\n",fog:"#ifdef FOG\nuniform float u_fog_distance;\n#endif\n#ifdef SKY\nuniform mat4 u_mat4_view_transposed;\nuniform mat4 u_mat4_proj_inverted;\n#endif\n#if defined(FOG) || defined(SKY)\nvarying vec3 v_fog_pos;\n#endif\nvoid calc_fog_pos(vec3 world_pos) {\n#ifdef FOG\n    v_fog_pos = (world_pos - u_cam_pos) / u_fog_distance;\n#endif\n}\nvoid calc_fog_pos_sky(vec4 pos) {\n#ifdef SKY\n    v_fog_pos = mat3(u_mat4_view_transposed) * (u_mat4_proj_inverted * pos).xyz;\n#endif\n}",jitter:"#ifdef TAA\nuniform vec2 u_vec2_camera_jitter;\nvoid apply_vertex_jitter(inout vec4 clipPos) {\n    clipPos.xy += clipPos.w * u_vec2_camera_jitter;\n}\n#endif",line_width:"float calculate_final_width(\n    const Scale scale,\n    const float width,\n    const float width_offset)\n{\n    \n    float final_width = max(0., scale.calculation * width - scale.projection * width_offset);\n    return final_width;\n}\n",mvp_mat:"uniform mat4 u_mat4_mvp;\n",packed_attributes:"\nvec2 normalize_s08(vec2 value)\n{\n    return value * (1. / 127.);\n}\nvec3 normalize_s08(vec3 value)\n{\n    return value * (1. / 127.);\n}\nfloat normalize_s16(float value)\n{\n    return value * (1. / 32767.);\n}\nvec2 normalize_s16(vec2 value)\n{\n    return value * (1. / 32767.);\n}\nvec3 normalize_s16(vec3 value)\n{\n    return value * (1. / 32767.);\n}\nvec2 unpack_widen(vec2 widen_packed)\n{\n    \n    return normalize_s08(widen_packed) * sqrt(2.);\n}\nvec2 unpack_texcoord(vec2 texcoord)\n{\n    return texcoord * (1. / 32768.);\n}\nvec2 unpack_model_texcoord(vec2 texcoord)\n{\n    const float min_value = -3.0;\n    const float max_value = 5.0;\n    return 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(\n    vec2 half_viewport,\n    \n    vec4 clip_space_widen,\n    vec4 clip_space_widen_perp,\n    \n    vec4 clip_space_vertex,\n    float shift_pixels)\n{\n    float limited_factor = 0.;\n    {\n        \n        vec2 screen_space_widen = (clip_space_widen.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_widen.w) * half_viewport;\n        vec2 screen_space_widen_perp = (clip_space_widen_perp.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_widen_perp.w) * half_viewport;\n        \n        vec2 perp = vec2(screen_space_widen_perp.y, -screen_space_widen_perp.x);\n        \n        float perp_length = length(perp);\n        vec4 v = clip_space_vertex;\n        vec4 n = clip_space_widen;\n        float denominator = dot(perp, screen_space_widen) / shift_pixels - n.w * v.w * perp_length;\n        if (abs(denominator) > g_min_denominator)\n        {\n            float factor = v.w * v.w * perp_length / denominator;\n            limited_factor = sign(factor) * min(g_max_factor, abs(factor));\n        }\n    }\n    return limited_factor;\n}\n",pos_world:"uniform mat4 u_mat4_model;\nvec3 calc_pos_world(vec4 pos) {\n    \n    \n    \n    return (u_mat4_model * pos).xyz;\n}\nvec3 calc_pos_world(vec3 pos) {\n    return calc_pos_world(vec4(pos, 1.0));\n}\nvec3 calc_pos_world(vec2 pos) {\n    return calc_pos_world(vec4(pos, 0.0, 1.0));\n}",precision_constants:"\nconst float g_circle_scale_precision_factor = 1e8;\n",prelude:"#ifdef WEBGL2\n#define varying out\n#define attribute in\n#define texture2D texture\n#endif\n",raster_functions:"\nfloat unpack_scale(float value)\n{\n    return exp(abs(value) / 256.) * sign(value);\n}\nfloat unpack_positive_value(float value)\n{\n    return exp(value / 256.);\n}\nvec2 make_position(const vec2 position, const float w, const vec2 inv_half_size, const float rounding_factor)\n{\n    vec2 non_rounded_position = (position + w) / (w * inv_half_size);\n    vec2 rounded_position = floor(non_rounded_position + 0.5);\n    vec2 rounding_delta = rounded_position - non_rounded_position;\n    vec2 pixel_coord = non_rounded_position + rounding_factor * rounding_delta - 0.5;\n    return (pixel_coord * inv_half_size) * w - w;\n}\nvec2 overlay_transform(const vec2 position, const vec2 inv_half_size)\n{\n    \n    \n    return position * inv_half_size;\n}\nfloat clipw(const float w, const vec2 range, const float scale)\n{\n    return 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{\n    \n    \n    if (scale_range.x < 0.)\n    {\n        float default_scale_denominator = unpack_positive_value(rescale.x);\n        float rescale_coeff = unpack_positive_value(rescale.y);\n        float min_scale = unpack_positive_value(-scale_range.x);\n        float stretch_exponent = floor(0.5 + log2(\n            max(1., 1. + rescale_coeff * (1. / max(min_scale, style_scale) - default_scale_denominator))));\n        return corner.xy * exp2(stretch_exponent);\n    }\n    return corner;\n}\n",round_position:"\nvec4 round_position(const vec4 position, const vec2 half_viewport)\n{\n    if (\n        position.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    {\n        return position;\n    }\n    else\n    {\n        \n        return vec4(\n            sign(position.xy) * floor(abs(position.xy) * half_viewport / position.w + .5)\n                * position.w / half_viewport,\n            position.zw);\n    }\n}\n",shadow:"#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_from_light;\nvarying float v_depth_metric;\nuniform mat4 u_mat4_clip_to_shadow;\nuniform mediump vec4 u_shadow_map_params;\nuniform mediump float u_shadow_bias;\nvoid compute_shadow_vertex(vec4 clip_pos)\n{\n    v_pos_from_light = u_mat4_clip_to_shadow * clip_pos;\n    v_pos_from_light.z -= u_shadow_bias;\n    v_depth_metric = 0.5 * v_pos_from_light.z + 0.5;\n}\nvoid compute_shadow_vertex(vec4 clip_pos, vec3 normal, mat4 mvp_mat)\n{\n    \n    float normal_bias = u_shadow_map_params[3];\n    vec3 norm_from_light = (u_mat4_clip_to_shadow * mvp_mat * vec4(normal, 0.0)).xyz;\n    v_pos_from_light = u_mat4_clip_to_shadow * clip_pos;\n    v_pos_from_light.xyz += normal_bias * normalize(norm_from_light);\n    v_pos_from_light.z -= u_shadow_bias;\n    v_depth_metric = 0.5 * v_pos_from_light.z + 0.5;\n}\n#else \nvoid compute_shadow_vertex(vec4 clip_pos) { }\nvoid compute_shadow_vertex(vec4 clip_pos, vec3 normal, mat4 mvp_mat) { }\n#endif ",striped_line_functions:"struct PolylineDistance\n{\n    \n    float vertex_distance_from_start;\n    \n    float segment_distance_from_start;\n    \n    float total_length;\n};\nstruct StripedLineInParams\n{\n    float dash_length;\n    float space_length;\n    float dash2_length;\n    float line_width;\n};\nstruct StripedLineOutParams\n{\n    \n    float part_color_swap_threshold;\n    float distance_in_parts;\n};\nvoid calculate_line_params(in PolylineDistance polyline_distance, in StripedLineInParams striped_line_params, out StripedLineOutParams line_params)\n{\n    \n    float requested_part_length =\n        striped_line_params.dash_length\n        + striped_line_params.space_length;\n    \n    float space2_length = requested_part_length - striped_line_params.dash2_length;\n    \n    float min_part_length =\n        requested_part_length\n        - 0.5 * min(striped_line_params.space_length, space2_length);\n    \n    float part_count = max(\n        floor(polyline_distance.total_length / requested_part_length + 0.5),\n        1.0);\n    \n    float part_length = polyline_distance.total_length / part_count;\n    \n    float dash_length = (part_length / requested_part_length) * striped_line_params.dash2_length;\n    float part_color_swap_threshold;\n    if (polyline_distance.total_length < min_part_length)\n    {\n        \n        dash_length = part_length;\n        part_color_swap_threshold = 1.0;\n    }\n    else\n    {\n        \n        part_color_swap_threshold = dash_length / part_length;\n    }\n    \n    \n    float segment_start = fract((polyline_distance.segment_distance_from_start + 0.5 * dash_length) / part_length);\n    float vertex_normalized_distance = segment_start + polyline_distance.vertex_distance_from_start / part_length;\n    line_params = StripedLineOutParams(\n        part_color_swap_threshold,\n        vertex_normalized_distance);\n}\n"},Us={arrow_line_entrance:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pixel_offset>\n#include <arrow_functions>\n#include <calculate_scale>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nuniform 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{\n    float vertex_type;\n    float width_zpt;\n    float border_width_zpt;\n    float border_width_offset;\n    float arrow_segment_length_zpt;\n    float wing_width_multiplier;\n    float size_factor;\n    vec2 vertex_position;\n    vec2 vertex_widen;\n    vec2 line_texture_widen;\n    vec2 arrow_texture_widen;\n    vec2 segment_direction;\n    float segment_length;\n    float distance_to_end;\n};\nstruct DistanceShiftParameters\n{\n    float shift;\n    bool invisible;\n};\nvec2 perp(const vec2 vector)\n{\n    return vec2(-vector.y, vector.x);\n}\nvec2 vertex_shift(const Scale scale)\n{\n    return u_float_vertex_shift * u_float_tip_movement_amplitude * normalize_s08(a_vec2_direction) * scale.calculation;\n}\nvec2 arrow_shift(const ArrowLineViewParameters view)\n{\n    \n    \n    \n    return view.segment_direction * view.distance_to_end;\n}\nfloat erase_length_end()\n{\n    return 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{\n    v_vec4_texcoord_arrow_line = vec4(arrow_texcoord, line_texcoord);\n}\nvoid set_arrow_varyings(\n    const float arrow_width,\n    const float arrow_length,\n    const float arrow_border,\n    const float arrow_outer_width,\n    const float arrow_tail_hide_part)\n{\n    v_vec4_arrow_width_length_border_outer = vec4(\n        arrow_width,\n        arrow_length,\n        arrow_border,\n        arrow_outer_width);\n    v_vec2_line_type_arrow_tail = vec2(\n        a_float_type,\n        arrow_tail_hide_part);\n}\nDistanceShiftParameters calculate_entrance_arrow_distances(\n    const ArrowLineViewParameters view,\n    const float signed_distance_shift,\n    const float arrow_final_size,\n    const float entrance_arrow_distance_shift)\n{\n    DistanceShiftParameters line_distance_parameters = DistanceShiftParameters(\n        signed_distance_shift + entrance_arrow_distance_shift,\n        false);\n    if (a_float_type == g_type_arrow)\n    {\n        \n        \n        bool outside_of_current_segment = view.distance_to_end > view.segment_length + entrance_arrow_distance_shift;\n        \n        bool inside_end_hide = a_float_distance_from_start + entrance_arrow_distance_shift > erase_length_end();\n        return DistanceShiftParameters(\n            \n            line_distance_parameters.shift + view.distance_to_end,\n            outside_of_current_segment || inside_end_hide\n        );\n    }\n    else\n    {\n        return line_distance_parameters;\n    }\n}\nvoid set_distance_varyings(\n    const ArrowLineViewParameters view,\n    const float arrow_final_size,\n    const float signed_shift_distance)\n{\n    float entrance_arrow_distance_shift = arrow_final_size * (2. - g_line_overlapping_part);\n    DistanceShiftParameters distance_shift_parameters = calculate_entrance_arrow_distances(\n        view,\n        signed_shift_distance,\n        arrow_final_size,\n        entrance_arrow_distance_shift);\n    v_vec4_distance_vertex_hiding =\n        vec4(\n            a_float_distance_from_start + distance_shift_parameters.shift,\n            0.,\n            erase_length_end(),\n            distance_shift_parameters.invisible\n                ? a_float_object_length\n                : 0.\n        ) / a_float_object_length;\n}\nArrowLineViewParameters decode_arrow_line_view_parameters()\n{\n    float width_zpt = u_float_width_zpt;\n    float border_width_zpt = u_float_border_width_zpt;\n    float arrow_segment_length_zpt = width_zpt * u_float_tip_height_multiplier + border_width_zpt;\n    float vertex_type = a_float_type;\n    \n    vec2 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);\n    float segment_length = length(a_vec2_segment_end - a_vec2_vertex);\n    float distance_to_end = erase_length_end() - a_float_distance_from_start;\n    return ArrowLineViewParameters(\n        vertex_type,\n        width_zpt,\n        border_width_zpt,\n        u_float_border_width_offset,\n        arrow_segment_length_zpt,\n        u_float_wing_width_multiplier,\n        u_float_size_factor,\n        a_vec2_vertex,\n        unpack_widen(a_vec2_widen),\n        unpack_widen(a_vec4_texture_widen_arrow_widen.xy),\n        unpack_widen(a_vec4_texture_widen_arrow_widen.zw),\n        segment_direction,\n        segment_length,\n        distance_to_end);\n}\nvec4 process_arrow_line_vertex(const Scale scale, const mat4 mvp, const vec2 vpt_size)\n{\n    ArrowLineViewParameters view = decode_arrow_line_view_parameters();\n    \n    ArrowParameters arrow_parameters = calculate_arrow_parameters(\n        scale.calculation,\n        view.width_zpt,\n        view.border_width_zpt,\n        view.arrow_segment_length_zpt,\n        view.wing_width_multiplier,\n        view.size_factor);\n    vec2 vertex_widen = view.vertex_widen;\n    vec2 texture_widen_with_sign = view.line_texture_widen;\n    \n    \n    float shift_sign = sign(dot(vertex_widen, texture_widen_with_sign));\n    vec2 line_texture_widen = shift_sign * texture_widen_with_sign;\n    \n    float line_final_size = (view.width_zpt + 2. * view.border_width_zpt) * view.size_factor * scale.calculation;\n    float final_size = (view.vertex_type == g_type_arrow)\n        ? arrow_parameters.final_size\n        : line_final_size;\n    \n    \n    \n    \n    vec2 line_texture_widen_perp = perp(line_texture_widen);\n    float shift_distance = abs(dot(vertex_widen, line_texture_widen_perp)) * final_size;\n    vec2 shift_direction = line_texture_widen_perp * sign(dot(vertex_widen, line_texture_widen_perp));\n    vec2 line_vertex_shift = vertex_widen * final_size - shift_direction * max(0., shift_distance - .5 * view.segment_length);\n    \n    vec2 arrow_vertex_widen = vertex_widen * arrow_parameters.final_size;\n    vec2 scene_vertex_shift = (view.vertex_type == g_type_arrow)\n        ? arrow_vertex_widen\n        : line_vertex_shift;\n    vec2 arrow_position_shift = (view.vertex_type == g_type_arrow)\n        ? arrow_shift(view)\n        : vec2(0.);\n    \n    float shift_pixels = g_shift_pixels * sqrt(2.);\n    VertexShiftParameters line_shift_parameters = calculate_vertex_shift_parameters(\n        mvp,\n        vpt_size,\n        view.vertex_position + (vertex_shift(scale) + arrow_position_shift),\n        scene_vertex_shift,\n        shift_pixels);\n    float arrow_line_texcoord_scale = line_final_size / arrow_parameters.final_size;\n    float line_texcoord_scale = (view.vertex_type != g_type_arrow)\n        ? arrow_line_texcoord_scale\n        : 1.;\n    vec2 line_texcoord = line_texture_widen * (1. + line_shift_parameters.limited_factor) * line_texcoord_scale;\n    \n    float arrow_texcoord_scale = (view.vertex_type == g_type_start_border)\n        ? arrow_line_texcoord_scale\n        : 1.;\n    vec2 arrow_texcoord = view.arrow_texture_widen * (1. + line_shift_parameters.limited_factor) * arrow_texcoord_scale;\n    set_texcoord_varyings(arrow_texcoord, line_texcoord);\n    float arrow_width = view.width_zpt * arrow_parameters.zpt_to_texcoord_factor;\n    float arrow_length = view.arrow_segment_length_zpt * arrow_parameters.zpt_to_texcoord_factor;\n    \n    float texcoord_border_width = view.border_width_zpt * arrow_parameters.zpt_to_texcoord_factor;\n    float border_width_texcoord_offset = view.border_width_offset * arrow_parameters.zpt_to_texcoord_factor;\n    float arrow_border = max(0., texcoord_border_width - scale.style / scale.style_clamped * border_width_texcoord_offset);\n    \n    float tail_shift_direction = (view.vertex_type == g_type_line_ending || view.vertex_type == g_type_start_border) ? 1. : -1.;\n    float tail_hide_shift = dot(arrow_vertex_widen, tail_shift_direction * view.segment_direction);\n    float arrow_tail_hide_part = (view.distance_to_end - tail_hide_shift) * arrow_parameters.zpt_to_texcoord_factor / view.size_factor;\n    set_arrow_varyings(\n        arrow_width,\n        arrow_length,\n        arrow_border,\n        arrow_parameters.outer_width,\n        arrow_tail_hide_part);\n    set_distance_varyings(\n        view,\n        arrow_parameters.final_size,\n        shift_sign * shift_distance);\n    \n    \n    return line_shift_parameters.clip_space_vertex / final_size;\n}\nvoid main()\n{\n    v_vec4_identifier = a_vec4_identifier; \n    Scale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scale_limits);\n    vec4 processed_vertex = process_arrow_line_vertex(scale, u_mat4_mvp, u_vec2_vpt_size);\n    gl_Position = processed_vertex * g_w_factor;\n    v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    v_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\n    \n    vec3 pos_world = calc_pos_world(a_vec2_vertex);\n    calc_fog_pos(pos_world);\n}\n",building_shadow:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <apply_height_factor>\nuniform float u_float_height_factor;\nattribute vec3 a_vec3_vertex;\nattribute vec2 a_vec2_dem_position;\nattribute float a_float_visibility;\nvarying float v_depth_metric;\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    \n    \n    if (height == DEM_INVALID_VALUE || a_float_visibility == 0.0) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    vec4 vertex_hf = apply_height_factor(a_vec3_vertex, u_float_height_factor);\n    vertex_hf.z += height;\n    \n    vertex_hf.z = max(vertex_hf.z, height);\n    gl_Position = u_mat4_mvp * vertex_hf;\n    v_depth_metric = (gl_Position.z + 1.0) / 2.0;\n}",circle_marker:"#include <prelude>\n#include <mvp_mat>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\nattribute 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    vec3 pos_world = calc_pos_world(a_vec4_vertex);\n    calc_fog_pos(pos_world);\n}\n",circle_marker_identify:"#include <prelude>\n#include <mvp_mat>\nattribute 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",color:"#include <prelude>\n#include <mvp_mat>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\n#include <shadow>\nuniform vec4 u_vec4_color;\nuniform float u_float_opacity;\nattribute vec2 a_vec2_vertex;\nattribute float a_float_visibility;\nvarying vec4 v_vec4_color;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    if (a_float_visibility == 0.0) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n    vec3 pos_world = calc_pos_world(a_vec2_vertex);\n    calc_fog_pos(pos_world);\n    \n    \n    \n    \n    \n    \n    v_vec2_texcoord = fract(abs((a_vec2_vertex - 0.25) * 2.));\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    compute_shadow_vertex(gl_Position, vec3(0.0, 0.0, 1.0), u_mat4_mvp);\n}\n",color_identify:"#include <prelude>\n#include <mvp_mat>\n#include <round_position>\nuniform vec2 u_vec2_vpt_size;\nattribute vec2 a_vec2_vertex;\nattribute vec4 a_vec4_identifier;\nattribute float a_float_visibility;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\n    v_vec4_identifier = a_vec4_identifier;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier && a_float_visibility != 0.0)\n    {\n        gl_Position = round_position(u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.), .5 * u_vec2_vpt_size);\n    }\n    else\n    {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n}\n",dem_elevation:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",dem_elevation_copy:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\nuniform mat4 u_mat4_dem_corrected;\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n    v_vec2_texcoord = (u_mat4_dem_corrected * vec4(unpack_texcoord(a_vec2_texcoord), 0, 1)).xy;\n}\n",dem_flat_bottom:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_centroid;\nattribute vec2 a_vec2_extender;\nvarying vec4 v_vec4_color;\nvoid main()\n{\n    vec4 tex_pos = u_mat4_dem_corrected * u_mat4_mvp * vec4(unpack_dem_position(a_vec2_centroid), 0.0, 1.0);\n    v_vec4_color = texture2D(u_tex_dem, tex_pos.xy);\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex + a_vec2_extender * 1./64., 0.0, 1.0);\n}\n",dem_ground:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\nuniform mat4 u_mat4_model;\nattribute vec2 a_vec2_position;\nvarying vec4 v_vec4_coords;\nvoid main()\n{\n    vec4 tex_pos = u_mat4_dem_mvp * vec4(a_vec2_position, 0.0, 1.0);\n    float height = dem_height_direct_meters(tex_pos.xy / tex_pos.w);\n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\n        v_vec4_coords = vec4(0);\n    } else {\n        float tile_height = meters_to_tile_height(height);\n        gl_Position = u_mat4_mvp * vec4(a_vec2_position, tile_height, 1.0);\n        v_vec4_coords = u_mat4_model * vec4(a_vec2_position, 0, 1.0);\n        \n        v_vec4_coords[2] = height;\n    }\n}\n",dem_mesh:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\n#include <jitter>\nuniform mat4 u_mat4_flat_map_mvp;\nattribute vec2 a_vec2_position;\nvarying vec4 v_vec4_texcoord;\nvarying vec2 hs_tex_pos;\nvoid main()\n{\n    vec4 coords = u_mat4_mvp * vec4(a_vec2_position, 0.0, 1.0);\n    vec4 tex_pos = u_mat4_dem_mvp * vec4(a_vec2_position, 0.0, 1.0);\n    float height = dem_height_direct(tex_pos.xy / tex_pos.w);\n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = coords;\n        v_vec4_texcoord = vec4(a_vec2_position, 0, 0);\n    } else {\n        gl_Position = u_mat4_mvp * vec4(a_vec2_position, height, 1.0);\n        vec4 flat_coord = u_mat4_flat_map_mvp * vec4(a_vec2_position, 0.0, 1.0);\n        v_vec4_texcoord = vec4(flat_coord.xy, 1., flat_coord.w);\n        hs_tex_pos = tex_pos.xy;\n    }\n    vec3 pos_world = calc_pos_world(vec4(a_vec2_position, height, 1.0));\n    calc_fog_pos(pos_world);\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n}\n",dem_normal:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = vec4((a_vec2_vertex * 2. - vec2(1, 1)), 0.0, 1.0);\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",diffuse:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <clipspace_pos>\n#include <jitter>\n#include <shadow>\nuniform vec4 u_vec4_color;\nuniform mat4 u_mat4_gradient;\nuniform float u_float_height_factor;\nuniform float u_float_opacity;\nattribute vec4 a_vec4_vertex; \nattribute vec2 a_vec2_dem_position;\nattribute float a_float_visibility;\nvarying vec4 v_vec4_color;\nvarying mat4 v_mat4_gradient;\nvarying vec4 v_vec4_rotated_scaled_vertex;\nconst float g_wall_offset_isometric = .001;\nconst float g_wall_offset_perspective = 8.;\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    \n    \n    if (height == DEM_INVALID_VALUE || a_float_visibility == 0.0) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    vec4 vertex_hf = apply_height_factor(a_vec4_vertex.xyz, u_float_height_factor);\n    vertex_hf.z += height;\n    \n    vertex_hf.z = max(vertex_hf.z, height);\n    vec4 clip_pos = u_mat4_mvp * vertex_hf;\n    gl_Position = clip_pos;\n    \n    \n    \n    if (a_vec4_vertex.w == .0)\n    {\n        \n        if ((u_mat4_mvp[0][3] == 0.) && (u_mat4_mvp[1][3] == 0.) && (u_mat4_mvp[2][3] == 0.))\n        {\n            gl_Position.z += g_wall_offset_isometric;\n        }\n        else\n        {\n            \n            \n            \n            if (height == 0.) {\n                gl_Position.z += g_wall_offset_perspective;\n            } else {\n                gl_Position.z += g_wall_offset_isometric;\n            }\n        }\n    }\n    vec3 pos_world = calc_pos_world(vertex_hf);\n    calc_fog_pos(pos_world);\n    save_clipspace_pos();\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    \n    \n    mat4 rotation_scale_mat = u_mat4_model;\n    rotation_scale_mat[3].xyz = vec3(0);\n    v_vec4_rotated_scaled_vertex.xyz = (rotation_scale_mat * a_vec4_vertex).xyz;\n    v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    if (u_mat4_gradient[0][0] !=0.)\n    {\n        \n        if (a_vec4_vertex.z > 0.0)\n        {\n            v_vec4_rotated_scaled_vertex.w = 1.;\n        } else {\n            v_vec4_rotated_scaled_vertex.w = 0.;\n        }\n        v_mat4_gradient = u_mat4_gradient;\n        for (int i = 1; i <= 2; i++) {\n            v_mat4_gradient[i] = apply_opacity(v_mat4_gradient[i], u_float_opacity);\n        }\n    }\n    \n    compute_shadow_vertex(clip_pos);\n}\n",diffuse_identify:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <round_position>\n#include <apply_height_factor>\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_height_factor;\nattribute vec3 a_vec4_vertex;\nattribute vec4 a_vec4_identifier;\nattribute vec2 a_vec2_dem_position;\nattribute float a_float_visibility;\nvarying vec4 v_vec4_identifier;\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    \n    \n    \n    if (height == DEM_INVALID_VALUE || a_float_visibility == 0.0 || a_vec4_identifier == vec4(1., 1., 1., 1.)) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    v_vec4_identifier = a_vec4_identifier;\n    vec4 vertex_hf = apply_height_factor(a_vec4_vertex.xyz, u_float_height_factor);\n    vertex_hf.z += height;\n    \n    vertex_hf.z = max(vertex_hf.z, height);\n    gl_Position = round_position(\n        u_mat4_mvp * vertex_hf,\n        .5 * u_vec2_vpt_size);\n}\n",gltf_model:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <clipspace_pos>\n#include <jitter>\n#include <shadow>\nuniform mat4 u_mat4_instance;\nuniform float u_float_height_factor;\nuniform float u_float_show_ratio;\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_tangent;\nattribute vec3 a_vec3_instance_position;\nattribute mat3 a_mat3_instance_matrix;\nattribute vec4 a_vec4_instance_localid;\nattribute vec2 texcoord_color;\n#ifdef AO_TEXTURE\nattribute vec2 texcoord_ao;\n#endif\n#ifdef PBR_TEXTURE\nattribute vec2 texcoord_pbr;\n#endif\nvarying vec4 v_vec4_identifier;\nvarying vec2 v_vec2_texcoord_color;\nvarying vec3 v_vec3_normal;\nvarying vec3 v_vec3_fragment_pos_world;\n#ifdef AO_TEXTURE\nvarying vec2 v_vec2_texcoord_ao;\n#endif\n#ifdef PBR_TEXTURE\nvarying vec2 v_vec2_texcoord_pbr;\n#endif\nvoid calc_texcoords() {\n    v_vec2_texcoord_color = texcoord_color;\n    #ifdef AO_TEXTURE\n    v_vec2_texcoord_ao = texcoord_ao;\n    #endif\n    #ifdef PBR_TEXTURE\n    v_vec2_texcoord_pbr = texcoord_pbr;\n    #endif\n}\nfloat interleaved_gradient_noise(vec3 coords)\n{\n    const vec3 m = vec3(0.06711056, 0.00583715, 52.9829189);\n    return fract(m.z * fract(dot(coords.xy, m.xy)));\n}\nvoid main()\n{\n    float height = dem_height(a_vec3_instance_position.xy);\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    if (u_float_show_ratio < 1.0) {\n        vec3 instance_wp = a_mat3_instance_matrix * a_vec3_instance_position;\n        if (interleaved_gradient_noise(instance_wp) > u_float_show_ratio) {\n            gl_Position = vec4(0,0,0,0);\n            return;\n        }\n    }\n    v_vec4_identifier = a_vec4_instance_localid;\n    calc_texcoords();\n    vec4 vh = vec4(a_vec3_instance_position, 1.);\n    vh.z += height;\n    mat4 instance_matrix = mat4(\n        vec4(a_mat3_instance_matrix[0], 0),\n        vec4(a_mat3_instance_matrix[1], 0),\n        vec4(a_mat3_instance_matrix[2], 0),\n        vec4(0, 0, 0, 1)\n    );\n    vec4 vertex = instance_matrix * vec4(a_position, 1);\n    vertex *= u_mat4_instance;\n    vertex.z *= u_float_height_factor;\n    vh.xyz += vertex.xyz;\n    vec3 pos_world = calc_pos_world(vh);\n    calc_fog_pos(pos_world);\n    gl_Position = u_mat4_mvp * vh;\n    \n    v_vec3_normal = (instance_matrix * vec4(a_normal, 1)).xyz;\n    v_vec3_fragment_pos_world = pos_world;\n   \n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    save_clipspace_pos();\n    compute_shadow_vertex(gl_Position, v_vec3_normal, u_mat4_mvp);\n}\n",gltf_shadow:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\nuniform mat4 u_mat4_instance;\nuniform float u_float_height_factor;\nuniform float u_float_show_ratio;\nattribute vec3 a_position;\nattribute vec3 a_vec3_instance_position;\nattribute mat3 a_mat3_instance_matrix;\nvarying float v_depth_metric;\nfloat interleaved_gradient_noise(vec3 coords)\n{\n    const vec3 m = vec3(0.06711056, 0.00583715, 52.9829189);\n    return fract(m.z * fract(dot(coords.xy, m.xy)));\n}\nvoid main()\n{\n    float height = dem_height(a_vec3_instance_position.xy);\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    if (u_float_show_ratio < 1.0) {\n        vec3 instance_wp = a_mat3_instance_matrix * a_vec3_instance_position;\n        if (interleaved_gradient_noise(instance_wp) > u_float_show_ratio) {\n            gl_Position = vec4(0,0,0,0);\n            return;\n        }\n    }\n    vec4 vh = vec4(a_vec3_instance_position, 1.);\n    vh.z += height;\n    mat4 instance_matrix = mat4(\n        vec4(a_mat3_instance_matrix[0], 0),\n        vec4(a_mat3_instance_matrix[1], 0),\n        vec4(a_mat3_instance_matrix[2], 0),\n        vec4(0, 0, 0, 1)\n    );\n    vec4 vertex = instance_matrix * vec4(a_position, 1);\n    vertex *= u_mat4_instance;\n    vertex.z *= u_float_height_factor;\n    vh.xyz += vertex.xyz;\n    gl_Position = u_mat4_mvp * vh;\n    v_depth_metric = (gl_Position.z + 1.0) / 2.0;\n}\n",heatmap:"#include <prelude>\n#include <mvp_mat>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute 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    calc_fog_pos(calc_pos_world(pos));\n    gl_Position = u_mat4_mvp * vec4(pos, 0.0, 1.0);\n}\n",heatmap_texture:"#include <prelude>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute 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}\n",label_directional:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute 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    vec3 pos_world = calc_pos_world(newPosition);\n    calc_fog_pos(pos_world);\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",label_fixed_anchor:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <depth_test>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute vec4 a_vec4_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_check_offset;\nattribute vec4 a_vec4_tex_identifier;\nuniform vec2 u_vec2_offset;\nuniform float u_float_scale;\nuniform float u_float_height_factor;\nuniform bool u_bool_skip_height_factor;\nuniform vec2 u_vec2_vpt_size;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_behind_factor;\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;\n    \n    \n    \n    if (u_bool_skip_height_factor == true) {\n        ndcPosition = vec4(a_vec4_position.xyz, 1.0);\n    } else {\n        ndcPosition = apply_height_factor(a_vec4_position.xyz, u_float_height_factor);\n    }\n    ndcPosition.z += height;\n    vec3 pos_world = calc_pos_world(a_vec4_position.xyz);\n    calc_fog_pos(pos_world);\n    ndcPosition = u_mat4_mvp * ndcPosition;\n    ndcPosition.xyz = ndcPosition.xyz / ndcPosition.w;\n    ndcPosition.w = 1.0;\n    v_float_behind_factor = depth_test(ndcPosition.xy + a_vec2_check_offset / u_vec2_vpt_size, ndcPosition.z, a_vec4_tex_identifier);\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:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\nattribute 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    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",line:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\n#include <shadow>\nuniform vec2 u_vec2_vpt_size;\nuniform vec4 u_vec4_color;\nuniform float u_float_height_factor;\nuniform float u_float_opacity;\nuniform mediump mat4 u_mat4_gradient;\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;\nattribute float a_float_visibility;\nvarying vec4 v_vec4_color;\nvarying mat4 v_mat4_gradient;\nvarying vec3 v_vec3_normal;\nvarying vec2 v_vec2_height_gradient;\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{\n    return vec2(lhs.x * rhs.x - lhs.y * rhs.y, lhs.x * rhs.y + lhs.y * rhs.x);\n}\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    \n    \n    if (height == DEM_INVALID_VALUE || a_float_visibility == 0.0) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    vec2 half_viewport = u_vec2_vpt_size / vec2(2.);\n    \n    if (a_vec4_vertex.z > 0.0)\n    {\n        v_vec2_height_gradient[0] = 1.;\n    } else {\n        v_vec2_height_gradient[0] = 0.;\n    }\n    \n    vec4 clip_space_direction = u_mat4_mvp * vec4(normalize_s08(vec3(a_vec3_direction.xy, a_vec3_direction.z + height)), 0.);\n    vec4 vertex_hf = apply_height_factor(a_vec4_vertex.xyz, u_float_height_factor);\n    vertex_hf.z += height;\n    \n    vertex_hf.z = max(vertex_hf.z, height);\n    vec4 clip_space_vertex = u_mat4_mvp * vertex_hf;\n    vec2 screen_space_direction = (clip_space_direction.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_direction.w) * half_viewport;\n    vec2 screen_space_perp = vec2(-screen_space_direction.y, screen_space_direction.x);\n    float denominator = max(g_min_denominator, length(screen_space_perp));\n    vec2 bevel_normal = normalize_s08(a_vec2_normal);\n    vec2 normal_delta = normalize_s08(a_vec2_normal_delta);\n    vec4 clip_space_bevel_normal = u_mat4_mvp * vec4(bevel_normal, 0., 0.);\n    vec2 screen_space_bevel_normal = (clip_space_bevel_normal.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_bevel_normal.w) * half_viewport;\n    float bevel_denominator = max(g_min_denominator, length(screen_space_bevel_normal));\n    \n    float normal_factor = -dot(screen_space_bevel_normal, screen_space_perp) / denominator / bevel_denominator;\n    vec2 wall_normal = multiply_complex(bevel_normal, vec2(normal_delta.x, sign(normal_factor) * normal_delta.y));\n    gl_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);\n    vec3 pos_world = calc_pos_world(vertex_hf);\n    v_vec4_color = u_vec4_color;\n    v_vec3_normal = vec3(wall_normal, 0.0);\n    if (u_mat4_gradient[0][0] !=0.)\n    {\n        v_mat4_gradient = u_mat4_gradient;\n        for (int i = 1; i <= 2; i++) {\n            v_mat4_gradient[i] = apply_opacity(v_mat4_gradient[i], u_float_opacity);\n        }\n    }\n    v_vec2_height_gradient.y = a_float_distance * gl_Position.w;\n    calc_fog_pos(pos_world);\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    \n    \n    compute_shadow_vertex(clip_space_vertex);\n}\n",map_mesh:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\n#include <clipspace_pos>\n#include <jitter>\nattribute vec2 a_vec2_vertex;\nattribute float a_float_z;\nattribute vec2 a_vec2_extender;\nattribute vec3 a_vec3_normal;\nattribute float a_float_gradient;\nattribute vec2 a_vec2_dem_position;\nattribute float a_float_abs_height;\nuniform float u_float_tile_size;\nuniform float u_float_height_factor;\nuniform int u_int_abs_height;\nvarying vec4 v_tex_coord;\nvarying vec4 v_vec4_normal_gradient;\nvoid main()\n{\n    float height = 0.;\n    if (u_int_abs_height == 0) {\n        height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    } else {\n        height = abs_height(a_float_abs_height);\n    }\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    \n    vec3 vec3_vertex = vec3(a_vec2_vertex, a_float_z / (65535. * 32.));\n    v_tex_coord = u_mat4_mvp * vec4(vec3_vertex.xy, 0, 1.0);\n    v_vec4_normal_gradient.xyz = normalize_s08(a_vec3_normal);\n    v_vec4_normal_gradient.w = a_float_gradient;\n    vec4 pos = vec4(vec3_vertex.xy, vec3_vertex.z * u_float_height_factor + height, 1.0);\n    vec3 world_pos = calc_pos_world(pos);\n    calc_fog_pos(world_pos);\n    gl_Position = u_mat4_mvp * pos;\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    save_clipspace_pos();\n}",mesh:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\n#include <clipspace_pos>\n#include <jitter>\nuniform mediump vec4 u_vec4_color;\nuniform mediump mat4 u_mat4_gradient;\nuniform float u_float_height_factor;\nuniform int u_int_abs_height;\nuniform lowp int u_int_is_textured;\nuniform mediump float u_float_opacity;\nuniform vec4 u_float_texture_params;\nuniform float u_float_texture_vertical_scale;\nattribute vec2 a_vec2_vertex;\nattribute float a_float_z;\nattribute vec3 a_vec3_normal;\nattribute float a_float_gradient;\nattribute vec2 a_vec2_dem_position;\nattribute float a_float_abs_height;\nvarying vec4 v_vec4_color;\nvarying mat4 v_mat4_gradient;\nvarying vec2 v_vec2_tex_coord;\nvarying vec4 v_vec4_normal_gradient;\nvoid main()\n{\n    float height = 0.;\n    if (u_int_abs_height == 0) {\n        height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    } else {\n        height = abs_height(a_float_abs_height);\n    }\n    \n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        v_vec4_color = vec4(0, 0, 0, 0);\n        return;\n    }\n    \n    vec4 vec4_pos = apply_height_factor(vec3(a_vec2_vertex.xy, a_float_z / (65535. * 32.)), u_float_height_factor);\n    vec4_pos.z += height;\n    vec3 pos_world = calc_pos_world(vec4_pos);\n    calc_fog_pos(pos_world);\n    gl_Position = u_mat4_mvp * vec4_pos;\n    vec3 vec3_normal = normalize(a_vec3_normal);\n    v_vec4_normal_gradient.xyz = vec3_normal;\n    v_vec4_normal_gradient.w = a_float_gradient;\n    if (u_int_is_textured != 0) {\n        \n        vec2 vec2_vertex = a_vec2_vertex * 2. - 0.5;\n        \n        \n        vec3 tex_coord = abs(vec3(\n            vec2_vertex * u_float_texture_params.zw + u_float_texture_params.xy, \n            a_float_z / u_float_texture_vertical_scale\n        ));\n        \n        if (vec3_normal.x == 0. && vec3_normal.y == 0.) {\n            v_vec2_tex_coord = tex_coord.xy;\n        } else {\n            float scale = abs(vec3_normal.z);\n            tex_coord.z /= sqrt(1.0 - vec3_normal.z * vec3_normal.z);;\n            \n            if (abs(vec3_normal).y > abs(vec3_normal).x) {\n                v_vec2_tex_coord = tex_coord.xz;\n            } else {\n                v_vec2_tex_coord = tex_coord.yz;\n            }\n        }\n    } \n    \n    else if (u_mat4_gradient[0][0] != 0.)\n    {\n        v_mat4_gradient = u_mat4_gradient;\n        for (int i = 1; i <= 2; i++) {\n            v_mat4_gradient[i] = apply_opacity(v_mat4_gradient[i], u_float_opacity);\n        }\n    } else {\n        v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    }\n    \n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    save_clipspace_pos();\n}\n",metric_point:"#include <prelude>\n#include <mvp_mat>\n#include <apply_opacity>\n#include <packed_attributes>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n    vec3 pos_world = calc_pos_world(a_vec2_vertex);\n    calc_fog_pos(pos_world);\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",one_way_line:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pixel_offset>\n#include <arrow_functions>\n#include <apply_opacity>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\nuniform 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{\n    float style_scale_clamped = clamp(u_vec3_projection_scale_style_scale_dpi.y, u_vec2_scale_limits.x, u_vec2_scale_limits.y);\n    float scale_ratio = u_vec3_projection_scale_style_scale_dpi.x / u_vec3_projection_scale_style_scale_dpi.y;\n    float calculation_scale = style_scale_clamped * scale_ratio;\n    ArrowParameters arrow_parameters = calculate_arrow_parameters(\n        calculation_scale,\n        u_float_width,\n        u_float_border_width,\n        u_float_length,\n        u_float_wing_width_multiplier,\n        u_float_size_factor);\n    v_float_zpt_to_texcoord_factor = arrow_parameters.zpt_to_texcoord_factor;\n    v_float_outer_width = arrow_parameters.outer_width;\n    vec2 direction = normalize_s08(a_vec2_direction);\n    vec2 untransformed_widen = a_vec2_widen_direction * arrow_parameters.widen_size;\n    vec2 widen = multiply_complex(untransformed_widen * arrow_parameters.final_size, direction);\n    \n    float shift_pixels = g_shift_pixels * sqrt(2.) / min(abs(untransformed_widen.x), abs(untransformed_widen.y));\n    VertexShiftParameters shift_parameters = calculate_vertex_shift_parameters(\n        u_mat4_mvp,\n        u_vec2_vpt_size,\n        a_vec2_position,\n        widen,\n        shift_pixels);\n    \n    \n    gl_Position = shift_parameters.clip_space_vertex / arrow_parameters.final_size * g_w_factor;\n    v_vec2_texcoord = untransformed_widen * (1. + shift_parameters.limited_factor);\n    \n    float border_width = u_float_border_width * v_float_zpt_to_texcoord_factor;\n    float border_width_offset = u_float_border_width_offset * v_float_zpt_to_texcoord_factor;\n    v_float_border_width = max(0., border_width - u_vec3_projection_scale_style_scale_dpi.y / style_scale_clamped * border_width_offset);\n    v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    v_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\n    v_float_opacity = u_float_opacity;\n    vec3 pos_world = calc_pos_world(a_vec2_position);\n    calc_fog_pos(pos_world);\n}\n",patterned_line:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pixel_offset>\n#include <calculate_scale>\n#include <line_width>\n#include <apply_opacity>\n#include <precision_constants>\n#include <striped_line_functions>\n#include <pos_world>\n#include <cam_pos>\n#include <shadow>\n#include <fog>\n#include <jitter>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_widen;\nattribute float a_float_texture;\nuniform vec2 u_vec2_scales;\nuniform float u_float_width;\nuniform vec4 u_vec4_color;\nuniform float u_float_opacity;\nuniform vec4 u_vec4_pattern_params;\nvarying vec2 v_vec2_uv;\nvarying float v_float_period;\nvarying float v_float_width;\nvarying vec4 v_vec4_color;\nvarying vec4 v_vec4_pattern_parameters;\nconst float g_w_factor = 1e-6;\nvoid main() {\n    \n    v_float_width = u_float_width;\n    v_vec4_color = apply_opacity(u_vec4_color, u_float_opacity);\n    v_vec2_uv = vec2(abs(a_float_texture), sign(a_float_texture) / 2.);\n    v_vec2_uv.x *= u_vec2_scales.x / u_vec4_pattern_params.x;\n    v_vec4_pattern_parameters = u_vec4_pattern_params;\n    \n    float full_width = u_float_width + 1.;\n    \n    vec2 widen = unpack_widen(a_vec2_widen);\n    vec2 extender = widen * full_width * 0.5;\n    \n    \n    vec2 shift = vec2(0.);\n    vec4 shifted_vertex = vec4(a_vec2_vertex + (shift + extender) * u_vec2_scales.y, 0.0, 1.0);\n    vec3 pos_world = calc_pos_world(shifted_vertex); \n    calc_fog_pos(pos_world);\n    gl_Position = u_mat4_mvp * shifted_vertex;\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    gl_Position *= g_w_factor;\n}\n",point_anchor:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\nattribute 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;\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    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_vec2_offset) / u_vec2_vpt_size * 2.0;\n    gl_Position = ndcPosition;\n    v_vec4_identifier = a_vec4_identifier;\n}\n",pointsprite:"#include <prelude>\n#include <mvp_mat>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <raster_functions>\n#include <depth_test>\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; \nuniform bool u_bool_skip_height_factor;\nuniform vec2 u_vec2_vpt_size;\nattribute vec3 a_vec3_position;\nattribute vec2 a_vec2_offset;\nattribute vec2 a_vec2_check_offset;\nattribute vec2 a_vec2_texcoord;\nattribute vec2 a_vec2_range;\nattribute vec2 a_vec2_rescale;\nattribute vec4 a_vec4_tex_identifier;\nvarying vec2 v_vec2_texcoord;\nvarying float v_float_behind_factor;\nvoid main()\n{\n    float height = dem_height(a_vec3_position.xy);\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    mat2 rotation_matrix = mat2(\n        u_vec2_rotation.x, -u_vec2_rotation.y,\n        u_vec2_rotation.y, u_vec2_rotation.x\n    );\n    vec2 inv_half_size = 2.0 / u_vec2_vpt_size;\n    vec4 anchor;\n    \n    \n    \n    if (u_bool_skip_height_factor == true) {\n        anchor = vec4(a_vec3_position, 1.0);\n    } else {\n        anchor = apply_height_factor(a_vec3_position, u_float_height_factor);\n    }\n    anchor.z += height;\n    vec3 pos_world = calc_pos_world(anchor);\n    calc_fog_pos(pos_world);\n    anchor = u_mat4_mvp * anchor;\n    vec2 offset = rescale(rotation_matrix * a_vec2_offset, a_vec2_rescale, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y);\n    vec2 pos_2d = anchor.xy + overlay_transform(offset, inv_half_size) * anchor.w;\n    vec2 corner = make_position(pos_2d, anchor.w, inv_half_size, u_float_rounding_factor);\n    v_float_behind_factor = depth_test(anchor.xy / anchor.w + a_vec2_check_offset / u_vec2_vpt_size, anchor.z / anchor.w, a_vec4_tex_identifier);\n    gl_Position = vec4(corner, anchor.z, clipw(anchor.w, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y));\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",pointsprite_identify:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <raster_functions>\nuniform 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; \nuniform bool u_bool_skip_height_factor;\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{\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n    {\n        float height = dem_height(a_vec3_position.xy);\n        \n        if (height == DEM_INVALID_VALUE) {\n            gl_Position = vec4(0, 0, 0, 0);\n            return;\n        }\n        mat2 rotation_matrix = mat2(\n            u_vec2_rotation.x, -u_vec2_rotation.y,\n            u_vec2_rotation.y, u_vec2_rotation.x\n        );\n        vec2 inv_half_size = 2.0 / u_vec2_vpt_size;\n        vec4 anchor;\n        \n        \n        \n        if (u_bool_skip_height_factor == true) {\n            anchor = vec4(a_vec3_position, 1.0);\n        } else {\n            anchor = apply_height_factor(a_vec3_position, u_float_height_factor);\n        }\n        anchor.z += height;\n        anchor = u_mat4_mvp * anchor;\n        vec2 offset = rescale(rotation_matrix * a_vec2_offset, a_vec2_rescale, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y);\n        vec2 pos_2d = anchor.xy + overlay_transform(offset, inv_half_size) * anchor.w;\n        vec2 corner = make_position(pos_2d, anchor.w, inv_half_size, 1.0);\n        gl_Position = vec4(corner, anchor.z, clipw(anchor.w, a_vec2_range, u_vec3_projection_scale_style_scale_dpi.y));\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",posteffect:"#include <prelude>\nattribute vec2 a_vec2_vertex;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = vec4(a_vec2_vertex, 0.0, 1.0);\n    v_vec2_texcoord = 0.5 * a_vec2_vertex + 0.5;\n}\n",rect:"#include <prelude>\n#include <mvp_mat>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute vec2 a_vec2_vertex;\nvoid main()\n{\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n}\n",rect_with_texture:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <apply_opacity>\n#include <raster_functions>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute vec2 a_vec2_vertex;\nattribute vec2 a_vec2_texcoord;\nvarying vec2 v_vec2_texcoord;\nvoid main()\n{\n    gl_Position = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0);\n    calc_fog_pos(calc_pos_world(a_vec2_vertex));\n    v_vec2_texcoord = unpack_texcoord(a_vec2_texcoord);\n}\n",road:"#include <prelude>\n#include <mvp_mat>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\n#include <shadow>\nattribute 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    vec4 clip_pos = u_mat4_mvp * shifted_vertex;\n    gl_Position = g_w_factor * clip_pos;\n    v_vec2_normal = normal;\n    v_float_half_width = half_width;\n    vec3 pos_world = calc_pos_world(shifted_vertex);\n    calc_fog_pos(pos_world);\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    compute_shadow_vertex(clip_pos, vec3(0.0, 0.0, 1.0), u_mat4_mvp);\n}\n",road_identify:"#include <prelude>\n#include <mvp_mat>\nattribute 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",simple_line:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\n#include <shadow>\nuniform vec2 u_vec2_vpt_size;\nuniform float u_float_width;\nuniform float u_float_height_factor;\nuniform int u_int_signed_z;\nuniform int u_int_abs_height;\nuniform float u_float_z_offset;\nattribute vec3 a_vec3_vertex;\nattribute float a_float_z;\nattribute vec4 a_vec4_direction_distance;\nattribute vec2 a_vec2_dem_position;\nattribute float a_float_abs_height;\nattribute float a_float_visibility;\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{\n    float height = 0.;\n    if (u_int_abs_height == 0) {\n        height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    } else {\n        height = abs_height(a_float_abs_height);\n    }\n    \n    \n    \n    if (height == DEM_INVALID_VALUE || a_float_visibility == 0.0) {\n        gl_Position = vec4(0, 0, 0, 1);\n        return;\n    }\n    float shift_pixels = 0.5 * max(u_float_width - 1., 0.);\n    float shift_pixels_added = shift_pixels + g_smooth_width;\n    vec3 direction = a_vec4_direction_distance.xyz;\n    float distance = a_vec4_direction_distance.w;\n    vec2 half_viewport = u_vec2_vpt_size / vec2(2.);\n    \n    \n    vec4 clip_space_direction = normalize(u_mat4_mvp * vec4(normalize_s08(direction), 0.));\n    vec3 a_vec3_vertex_copy = vec3(a_vec3_vertex);\n    \n    if (u_int_signed_z == 1) {\n        a_vec3_vertex_copy.z = a_float_z / (65535. * 32.);\n    }\n    \n    vec4 vertex_hf = apply_height_factor(a_vec3_vertex_copy, u_float_height_factor);\n    vertex_hf.z += height;\n    vec4 clip_space_vertex = u_mat4_mvp * vertex_hf;\n    vec2 screen_space_direction =\n        (clip_space_direction.xy * clip_space_vertex.w - clip_space_vertex.xy * clip_space_direction.w) * half_viewport;\n    vec2 screen_space_perp = vec2(-screen_space_direction.y, screen_space_direction.x);\n    float denominator = max(g_min_denominator, length(screen_space_perp));\n    gl_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);\n    gl_Position.z += u_float_z_offset;\n    v_float_distance = shift_pixels_added * distance * gl_Position.w;\n    v_float_distance_offset = shift_pixels;\n    vec3 pos_world = calc_pos_world(vertex_hf.xyz);\n    calc_fog_pos(pos_world);\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    \n    \n    compute_shadow_vertex(clip_space_vertex);\n}\n",sky:"#include <prelude>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\nattribute vec2 a_vec2_vertex;\nvoid main()\n{\n    gl_Position = vec4(a_vec2_vertex, 1.0, 1.0);\n    calc_fog_pos_sky(gl_Position);\n}\n",striped_line:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pixel_offset>\n#include <calculate_scale>\n#include <line_width>\n#include <apply_opacity>\n#include <precision_constants>\n#include <striped_line_functions>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <jitter>\n#include <shadow>\nuniform 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{\n    return PolylineDistance(\n        a_float_vertex_distance,\n        a_float_component_distance,\n        a_float_object_length);\n}\nStripedLineInParams decode_line_params(const Scale scale)\n{\n    float width = calculate_final_width(scale, u_float_width, u_float_width_offset);\n    float dash_length  = scale.calculation * u_float_dash_length;\n    float space_length = scale.calculation * u_float_space_length;\n    float dash2_length = scale.calculation * u_float_dash2_length;\n    return StripedLineInParams(\n        dash_length,\n        space_length,\n        dash2_length,\n        width);\n}\nvoid main()\n{\n    Scale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scaler_params);\n    StripedLineInParams params = decode_line_params(scale);\n    vec2 widen = unpack_widen(a_vec2_widen);\n    vec2 widen_perp = vec2(-widen.y, widen.x);\n    \n    vec4 clip_space_widen = u_mat4_mvp * vec4(widen, 0., 0.);\n    vec4 clip_space_widen_perp = u_mat4_mvp * vec4(widen_perp, 0., 0.);\n    \n    vec4 clip_space_vertex = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0) + clip_space_widen * params.line_width;\n    vec2 half_viewport = 0.5 * u_vec2_vpt_size;\n    \n    float limited_factor = calculate_multiplication_factor(\n        half_viewport,\n        clip_space_widen,\n        clip_space_widen_perp,\n        clip_space_vertex,\n        g_shift_pixels);\n    PolylineDistance distance_decoded = decode_line_distance();\n    StripedLineOutParams output_params;\n    calculate_line_params(distance_decoded, params, output_params);\n    \n    \n    vec2 texture_widen_with_shift_sign = unpack_widen(a_vec2_texture_widen);\n    float shift_sign = sign(dot(widen, texture_widen_with_shift_sign));\n    vec2 texture_widen = shift_sign * texture_widen_with_shift_sign;\n    vec2 texture_widen_perp = vec2(-texture_widen.y, texture_widen.x);\n    float distance_shift = shift_sign * abs(dot(widen, texture_widen_perp)) * params.line_width;\n    float circle_factor = g_circle_scale_precision_factor / scale.calculation;\n    v_vec2_circle = texture_widen * (params.line_width + limited_factor) * circle_factor;\n    v_float_width = params.line_width * circle_factor;\n    v_float_part_color_swap_threshold = output_params.part_color_swap_threshold;\n    v_float_distance_in_parts = output_params.distance_in_parts;\n    v_vec4_dash_color = apply_opacity(u_vec4_dash_color, u_float_opacity);\n    v_vec4_space_color = apply_opacity(u_vec4_space_color, u_float_opacity);\n    v_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\n    gl_Position = clip_space_vertex + clip_space_widen * limited_factor;\n    vec3 pos_world = calc_pos_world(a_vec2_vertex);\n    calc_fog_pos(pos_world);\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    gl_Position *= g_w_factor;\n    compute_shadow_vertex(clip_space_vertex, vec3(0.0, 0.0, 1.0), u_mat4_mvp);\n}\n",striped_line_identify:"#include <prelude>\n#include <mvp_mat>\n#include <packed_attributes>\n#include <pixel_offset>\n#include <calculate_scale>\n#include <line_width>\n#include <apply_opacity>\n#include <precision_constants>\n#include <striped_line_functions>\nuniform 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{\n    return PolylineDistance(\n        a_float_vertex_distance,\n        a_float_component_distance,\n        a_float_object_length);\n}\nStripedLineInParams decode_line_params(const Scale scale)\n{\n    float width = calculate_final_width(scale, u_float_width, u_float_width_offset);\n    float dash_length  = scale.calculation * u_float_dash_length;\n    float space_length = scale.calculation * u_float_space_length;\n    float dash2_length = scale.calculation * u_float_dash2_length;\n    return StripedLineInParams(\n        dash_length,\n        space_length,\n        dash2_length,\n        width);\n}\nvoid main()\n{\n    Scale scale = calculate_scale(u_vec3_projection_scale_style_scale_dpi, u_vec2_scaler_params);\n    StripedLineInParams params = decode_line_params(scale);\n    vec2 widen = unpack_widen(a_vec2_widen);\n    vec2 widen_perp = vec2(-widen.y, widen.x);\n    \n    vec4 clip_space_widen = u_mat4_mvp * vec4(widen, 0., 0.);\n    vec4 clip_space_widen_perp = u_mat4_mvp * vec4(widen_perp, 0., 0.);\n    \n    vec4 clip_space_vertex = u_mat4_mvp * vec4(a_vec2_vertex, 0.0, 1.0) + clip_space_widen * params.line_width;\n    vec2 half_viewport = 0.5 * u_vec2_vpt_size;\n    \n    float limited_factor = calculate_multiplication_factor(\n        half_viewport,\n        clip_space_widen,\n        clip_space_widen_perp,\n        clip_space_vertex,\n        g_shift_pixels);\n    PolylineDistance distance_decoded = decode_line_distance();\n    StripedLineOutParams output_params;\n    calculate_line_params(distance_decoded, params, output_params);\n    \n    \n    vec2 texture_widen_with_shift_sign = unpack_widen(a_vec2_texture_widen);\n    float shift_sign = sign(dot(widen, texture_widen_with_shift_sign));\n    vec2 texture_widen = shift_sign * texture_widen_with_shift_sign;\n    vec2 texture_widen_perp = vec2(-texture_widen.y, texture_widen.x);\n    float distance_shift = shift_sign * abs(dot(widen, texture_widen_perp)) * params.line_width;\n    float circle_factor = g_circle_scale_precision_factor / scale.calculation;\n    v_vec2_circle = texture_widen * (params.line_width + limited_factor) * circle_factor;\n    v_float_width = params.line_width * circle_factor;\n    v_float_part_color_swap_threshold = output_params.part_color_swap_threshold;\n    v_float_distance_in_parts = output_params.distance_in_parts;\n    v_vec4_dash_color = apply_opacity(u_vec4_dash_color, u_float_opacity);\n    v_vec4_space_color = apply_opacity(u_vec4_space_color, u_float_opacity);\n    v_vec4_border_color = apply_opacity(u_vec4_border_color, u_float_opacity);\n    v_vec4_identifier = a_vec4_identifier;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n    {\n        gl_Position = (clip_space_vertex + clip_space_widen * limited_factor) * g_w_factor;\n    }\n    else\n    {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n}\n",zbm_model:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <packed_attributes>\n#include <apply_height_factor>\n#include <pos_world>\n#include <cam_pos>\n#include <fog>\n#include <clipspace_pos>\n#include <jitter>\n#include <shadow>\nuniform 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;\nvarying vec3 v_vec3_rotated_scaled_vertex;\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    v_vec2_texcoord = unpack_model_texcoord(a_vec2_texcoord);\n    vec4 vh = apply_height_factor(a_vec3_vertex, u_float_height_factor);\n    vh.z += height;\n    vec3 pos_world = calc_pos_world(vh);\n    calc_fog_pos(pos_world);\n    gl_Position = u_mat4_mvp * vh;\n    \n    \n    mat4 rotation_scale_mat = u_mat4_model;\n    rotation_scale_mat[3].xyz = vec3(0);\n    v_vec3_rotated_scaled_vertex = (rotation_scale_mat * vec4(a_vec3_vertex, 1)).xyz;\n    save_clipspace_pos();\n#ifdef TAA\n    apply_vertex_jitter(gl_Position);\n#endif\n    \n    compute_shadow_vertex(gl_Position);\n}\n",zbm_model_identify:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <round_position>\nuniform 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{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    v_vec4_identifier = a_vec4_identifier;\n    if (vec4(1., 1., 1., 1.) != a_vec4_identifier)\n    {\n        gl_Position = round_position(u_mat4_mvp * vec4(a_vec3_vertex.xy, a_vec3_vertex.z + height, 1.), .5 * u_vec2_vpt_size);\n    }\n    else\n    {\n        gl_Position = vec4(1., 1., 1., 1.);\n    }\n}\n",zbm_shadow:"#include <prelude>\n#include <mvp_mat>\n#include <dem>\n#include <apply_height_factor>\nuniform float u_float_height_factor;\nattribute vec3 a_vec3_vertex;\nattribute vec2 a_vec2_dem_position;\nvarying float v_depth_metric;\nvoid main()\n{\n    float height = dem_height(unpack_dem_position(a_vec2_dem_position));\n    \n    if (height == DEM_INVALID_VALUE) {\n        gl_Position = vec4(0, 0, 0, 0);\n        return;\n    }\n    vec4 vh = apply_height_factor(a_vec3_vertex, u_float_height_factor);\n    vh.z += height;\n    gl_Position = u_mat4_mvp * vh;\n    v_depth_metric = (gl_Position.z + 1.0) / 2.0;\n}\n"},Vs="LIGHT_MODEL",Gs=/^\s*#include\s+<(.+)>.*$/gim,Hs=(e,t)=>(i,n)=>{const o=n.trim(),r="vertex"===e?Ns[o]:Bs[o];if(!r)throw new Error(`Cannot resolve "include <${o}>" in ${e} shader "${t}"`);return r+"\n"};function Zs(e,t){return[("vertex"===e?Us[t]:js[t]).replace(Gs,Hs(e,t))]}function Ws(e){const t=2===Fa.webglVersion?["#version 300 es"]:[],i=Qe.createShaderDefinitions([{type:`WEBGL${Fa.webglVersion}`,value:""},{type:"VERTEX",value:""}]);return n=>new Qe("vertex",t.concat(Zs("vertex",e)),i,n)}function Xs(e){const t=2===Fa.webglVersion?["#version 300 es"]:[],i=Qe.createShaderDefinitions([{type:`WEBGL${Fa.webglVersion}`,value:""},{type:"FRAGMENT",value:""}]);return n=>new Qe("fragment",t.concat(Zs("fragment",e)),i,n)}const Ks={name:"u_mat4_mvp",type:"mat4"},qs={name:"u_mat4_model",type:"mat4"},$s=[{name:"u_tex_dem",type:"1i"},{name:"u_tex_corrected_dem",type:"1i"},{name:"u_float_corrected_interval",type:"1f"},{name:"u_mat4_dem_corrected",type:"mat4"},{name:"u_tex_hillshade_ramp",type:"1i"},{name:"u_mat4_dem_mvp",type:"mat4"},{name:"u_float_dem_scale",type:"1f"},{name:"u_float_vertical_scale",type:"1f"},{name:"u_float_dem_resolution",type:"1f"},{name:"u_float_dem_cell_size",type:"1f"},{name:"u_float_dem_shading_intensity",type:"1f"},{name:"u_float_map_center_elevation",type:"1f"}],Ys=[{name:"u_int_abs_height",type:"1i"}],Js=[{name:"u_cam_pos",type:"3f"}],Qs=[{name:"u_int_light_flags",type:"1i"},{name:"u_vec4_ambient_color",type:"4fv"},{name:"u_vec3_light_dir1_direction",type:"3fv"},{name:"u_vec4_light_dir1_color",type:"4fv"},{name:"u_vec3_light_dir2_direction",type:"3fv"},{name:"u_vec4_light_dir2_color",type:"4fv"}],ea=[{name:"u_texture_shadow",type:"1i"},{name:"u_mat4_clip_to_shadow",type:"mat4"},{name:"u_shadow_map_params",type:"4f"},{name:"u_shadow_bias",type:"1f"}],ta=[{name:"u_fog_color",type:"4f"},{name:"u_sky_color",type:"4f"},{name:"u_fog_limits",type:"2f"},{name:"u_fog_horizon_blend",type:"1f"},{name:"u_fog_horizon_level",type:"1f"},{name:"u_mat4_model",type:"mat4"},{name:"u_cam_pos",type:"3f"},{name:"u_fog_distance",type:"1f"},{name:"u_mat4_proj_inverted",type:"mat4"},{name:"u_mat4_view_transposed",type:"mat4"}],ia=[{name:"u_vec2_camera_jitter",type:"2f"}];var na=i(1315);const oa=(e,t,i,n)=>{(i=i.filter((e=>e.canRender))).length>0&&Number.isNaN(e.metrics.firstcontent)&&(e.metrics.firstcontent=performance.now()-e.metrics.start),ba(i,n),_a(i,e).forEach((i=>ra(e,t,i,n)))},ra=(e,t,i,n)=>{ga(t.styleManager,i,e).forEach((i=>{ua(t.styleManager,i[0])?sa(e,t,i,n):aa(e,t,i,n)}))},sa=(e,t,i,n)=>{const o=ua(t.styleManager,i[0]);if(!o)return;const r=(i,s)=>{s>=o.orderBy.length?aa(e,t,i,n):wa(o.orderBy[s],i,e).forEach(((e,t)=>r(e,t+1)))};r(i,0)},aa=(e,t,i,n)=>{i.sort(((e,t)=>e.tile.zoomLevel-t.tile.zoomLevel)),va(t.styleManager,i,e).forEach((i=>la(e,t,i,n)))},la=(e,t,i,n)=>{ya(i,e).forEach((i=>da(e,t,i,n)))},da=(e,t,i,n)=>{const o=i[0],r=function(e,t){const i=e.getStyle(t.attributes.styleId);if(!i)return;return i.layersById[t.attributes.layerId]}(t.styleManager,o);if(!r)return;const s=r.selectedIdx;void 0!==s&&i.sort(((e,t)=>{var i,n;return Number(null!==(i=e.attributes.tileData[s])&&void 0!==i?i:0)-Number(null!==(n=t.attributes.tileData[s])&&void 0!==n?n:0)})),o.type===nt.H.Custom?(n.useCustomLayerState(r),t.styleManager.callCustomLayerRender(o.attributes.layerId)):(0,na.OB)(o)?Ia(i,e).forEach((i=>{n.drawSymbol(i,r,e,t)})):xa(i,e).forEach((i=>ca(e,t,i,n,r)))},ca=(e,t,i,n,o)=>{n.useProgram(i[0],o),Sa(i,e).forEach((i=>{ha(e,t,i,n,o)}))},ha=(e,t,i,n,o)=>{n.useState(i[0],o),Ia(i,e).forEach((i=>{n.drawSymbol(i,o,e,t)}))};function ua(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,$n.cM)(`Expecting layer with type 'group' but got '${o.type}'`)}const ma=(e,t)=>Number(e)-Number(t),fa=e=>(t,i)=>{const n={};for(let o=0;o<t.length;o++){const r=t[o],s=e(r,i),a=n[s];void 0===a?n[s]=[r]:a.push(r)}const o=Object.keys(n);o.sort(ma);const r=[];for(let e=0;e<o.length;e++)r.push(n[o[e]]);return r},pa=e=>(t,i)=>{const n=new Map;for(let o=0;o<t.length;o++){const r=t[o],s=e(r,i);n.has(s)?n.get(s).push(r):n.set(s,[r])}return n},_a=fa((e=>{const{styleId:t}=e.attributes;return t===Z.jf?1:-t})),va=(e,t,i)=>fa((t=>((e,t,i)=>{const n=e.getStyle(t);if(!n)return(0,$n.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),ga=(e,t,i)=>fa((t=>((e,t,i)=>{const n=e.getStyle(t);if(!n)return(0,$n.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),ya=fa((e=>e.type===nt.H.Custom||(0,na.OB)(e)?0:e.layerSettings.subRenderIndex||0)),ba=(e,t)=>{const i=new Set;e.forEach((e=>{if(e.type===nt.H.Custom||(0,na.OB)(e))return;const n=e.layerSettings.programName;i.has(e.layerSettings.programName)||(i.add(n),t.setProgramBinder(e))}))},wa=(e,t,i)=>fa(((t,i)=>{const n=(0,K.jJ)(i.styleZoom,i.styleState,t.attributes.tileData);return(0,K.vn)(e,n,0)}))(t,i),xa=pa((e=>e.layerSettings.programName)),Sa=pa((e=>e.layerSettings.webglState)),Ia=pa((e=>e.sink+"_"+e.attributesHash+"_"+e.tile.readiness));const Ma=(e,t,i,n,o,r)=>{const s=t.renderer.getRenderingContext();let a=null;const l=t.renderer.lastAppliedGlState,d={terrain3d:!!o,noEffects:!!r,drawSymbol:(e,t,i,n)=>{const o=e[0];"mapMesh"!==o.symbol||"overpass"!==t.type&&"tunnel"!==t.type?Ta(e,t,i,n,d,a):(d.renderTierTexture(o,t,!1),d.useProgram(o,t),d.useState(o),Ta(e,t,i,n,d,null),o.layerSettings.identify||(d.renderTierTexture(o,t,!0),d.useProgram(o,t),d.useState(o),nn(s,rn,l,t),Ta(e,t,i,n,d,null)))},useProgram:(i,n)=>{const{layerBinder:a,programName:l,programBinder:d}=i.layerSettings,c=t.renderer.getShaderProgram(l,i.shaderDefinitions);c.enable(s),null==d||d(s,c,e,t,o,r),null==a||a(s,c,e,t,n,r)},setProgramBinder:i=>{if(i.layerSettings.programBinder){const n=t.renderer.getShaderProgram(i.layerSettings.programName,i.shaderDefinitions);n.enable(s),i.layerSettings.programBinder(s,n,e,t,o,r)}},useState:(e,t)=>{nn(s,e.layerSettings.webglState,l,t)},useCustomLayerState:e=>{nn(s,wn,l,e)},useInstanceObject:e=>{a=e},renderTierTexture:(o,r,a)=>{const{viewport:l,size:c}=e,h=window.devicePixelRatio,u=!!o.layerSettings.identify,m=u?t.renderer.getMapMeshIdFramebufferId():t.renderer.getMapMeshFramebufferId(),f=t.renderer.getFramebuffer(m);if(!f)return;const p=Ma(e,t,void 0,n,!1,!0);if(s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,null),f.renderTarget.bind(s),s.viewport(0,0,f.renderTarget.options.size[0],f.renderTarget.options.size[1]),a)s.depthMask(!0),s.clearDepth(-1),u?s.clearColor(ka[0],ka[1],ka[2],ka[3]):s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);else if(u)t.renderer.clearWithColor(ka,!0);else{const i=(0,K.jJ)(e.styleZoom,e.styleState,o.attributes.tileData),n=(0,K.zn)(r.style.color,i).value;t.renderer.clearWithColor([n[0]/255,n[1]/255,n[2]/255,n[3]/255],!0)}const _=o.attributes.meshTier,v=null==i?void 0:i[_];if(v){v.tileObjects.forEach((e=>{var i,n;e.updateMvpMatrix(null!==(n=null===(i=f.getViewProjectionMatrix)||void 0===i?void 0:i.call(f))&&void 0!==n?n:t.camera.viewProjectionMatrix,void 0)}));const i=a?v.objects.filter((e=>{var i;if(e.type!==nt.H.Custom&&!(0,na.OB)(e)){if(e.layerSettings.webglState.depthTest&&!e.layerSettings.isOverlappedObject)return!0;const n=t.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);if(n)return!0===(null===(i=n.webglState)||void 0===i?void 0:i.depthTest)}return!1})):v.objects;oa(e,t,i,p),v.tileObjects.forEach((e=>e.updateMvpMatrix(t.camera.viewProjectionMatrix))),ba(v.objects,d)}n?(n.bind(s),s.viewport(0,0,n.options.size[0],n.options.size[1])):(f.renderTarget.unbind(s),s.viewport(l.left*h,l.bottom*h,c[0]*h,c[1]*h))},copy:(n,o,r)=>Ma(e,t,i,n,o,r)};return d},Ta=(e,t,i,n,o,r)=>{const s=n.renderer.getRenderingContext(),a=e[0];let l;if((0,na.OB)(a)){if(!a.layerSettings.objectBinder(a,n,i,t))return}else{const e=a.layerSettings;if(l=n.renderer.getShaderProgram(e.programName,a.shaderDefinitions),!e.objectBinder(s,l,i,n,a,t,r,o.terrain3d))return}a.layerSettings.zoomBinder?Aa(e,i).forEach((e=>{var d,c,h,u;(0,na.OB)(a)?null===(u=(h=a.layerSettings).zoomBinder)||void 0===u||u.call(h,a,n,i,t):l&&(null===(c=(d=a.layerSettings).zoomBinder)||void 0===c||c.call(d,s,l,i,n,e[0],t,r,o.terrain3d)),e.forEach((e=>Ea(e,n,l,i,o,s,t,r)))})):e.forEach((e=>Ea(e,n,l,i,o,s,t,r)))},Ea=(e,t,i,n,o,r,s,a)=>{var l;const d=t.renderer.webGlExtensions,c=d.ANGLE_instanced_arrays;if((0,na.OB)(e)){return r instanceof WebGLRenderingContext&&!c?void(0,$n.cM)("Instancing is not supported. Cannot draw instanced objects."):void function(e,t,i,n){if("dynamicObject"!==e.tile.purpose){const{sourceId:i}=e.attributes,n=t.sourceStorage.getSourceById(i);if(!n)return;if("modelsAppearStrategy"in n&&"byTile"===n.modelsAppearStrategy&&!t.modelsScene.allObjectsHaveCurrentModelId(i,e.tile.coords,e.attributes.styleId))return}const o=t.modelsScene.getCurrentLayerModelId(e);if(void 0===o)return;const r=e.getInstanceTileObjects(o,t);if(!r||!r.length)return;const{styleId:s,layerId:a}=e.attributes,l=r.reduce(((t,i)=>{let n=i.children;return e.layerSettings.identify?n=i.identifyChildren:e.layerSettings.depthTest?n=i.depthTestChildren:e.layerSettings.shadow&&(n=i.shadowChildren),t.push(...n),t}),[]);if(!l.length)return;l.forEach((e=>{e.attributes.styleId=s,e.attributes.layerId=a})),n.useInstanceObject(e),oa(i,t,l,n),n.useInstanceObject(null)}(e,t,n,o)}if(!i)return;let h;a&&(a.linked||(a.linked={}),a.linked[e.id]||(0,na.lL)(a,e,s),h=a.linked[e.id]);const u=a?a.tile:e.tile;for(const m of u.modelMatrices.keys()){if(u.renderModelMatrix=u.modelMatrices.get(m),u.renderMvpMatrix=u.mvpMatrices.get(m),u.renderDemMatrix=u.demMatrices.get(m),u.renderFlatMapTexMatrix=u.flatMapTexMatrices.get(m),a&&h){const t=e.tile.modelMatrices.get(0);if(!u.renderModelMatrix||!t)continue;(0,na.fe)(h.transformMatrix,u.renderModelMatrix,t)}if(!e.layerSettings.tileBinder(r,i,n,t,e,a,s,o))continue;h?h.vao.bind({gl:r,extensions:d}):e.vao.bind({gl:r,extensions:d});const f=e.rangeStart/e.stride,p=(e.rangeEnd-e.rangeStart)/e.stride,_=null!==(l=e.drawMode)&&void 0!==l?l:ot.Fg,v=a?(a.rangeEnd-a.rangeStart)/a.stride:0,g=e.vao.getElementsGLType(r);null!==g?v?Pa(r,_,p,g,f,v,c):r.drawElements(_,p,g,f):v?La(r,_,f,p,v,c):r.drawArrays(_,f,p),!n.collectStats||e.layerSettings.identify||e.layerSettings.depthTest||(n.stats.drawCount++,n.stats.vertexCount+=(a?v:1)*p)}};function Pa(e,t,i,n,o,r,s){if(e instanceof WebGLRenderingContext){if(!s)return;s.drawElementsInstancedANGLE(t,i,n,o,r)}else e.drawElementsInstanced(t,i,n,o,r)}function La(e,t,i,n,o,r){if(e instanceof WebGLRenderingContext){if(!r)return;r.drawArraysInstancedANGLE(t,i,n,o)}else e.drawArraysInstanced(t,i,n,o)}const Aa=fa((e=>e.tile.zoomLevel)),Ca=(0,z.H)(),za=(0,z.H)(),ka=[1,1,1,1],Ra=new Float64Array(16);class Fa extends class{constructor(e){if(this.webGlExtensions={},this._canvasElement=null,this._size=[1,1],"canvas"in(e=e||{})){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.clearColor=e.clearColor||[1,1,1,1],this.webGlExtensions={}}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}addExtension(e){return this.webGlExtensions[e]=this._gl.getExtension(e),this}}{constructor(e,t){const i=t.layout.canvas,n=e.webglVersion,o={antialias:!1,stencil:2!==n,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:e.preserveDrawingBuffer};let r=null;if(n&&2!==n||(r=i.getContext("webgl2",o),Fa.webglVersion=2),null!==r&&1!==n||(r=i.getContext("webgl",o)||i.getContext("experimental-webgl",o),Fa.webglVersion=1),null===r||!(r instanceof WebGLRenderingContext||r instanceof WebGL2RenderingContext))throw new Error("Failed to obtain WebGL context");super({gl:r,clearColor:(0,K.m2)((0,qn.MV)(e.defaultBackgroundColor))}),this.commonShaderDefines=Je,this.lastAppliedGlState={webglState:{state:null}},this.framebuffers=[],this.lastRenderedFramebuffers=[],this.mapMeshMvpMatrix=new Float64Array(16),this.trackContextLost=e=>{e.preventDefault(),this.modules.map.destroy(),ke({eventAction:"WebGlContext",eventLabel:"webglcontextlost"}),ke({eventCategory:"WebGlContext",eventAction:"webglcontextlost",eventLabel:e.statusMessage||""})},this.state=e,this.modules=t,this.webglContextState={MAX_TEXTURE_SIZE:r.getParameter(r.MAX_TEXTURE_SIZE),MAX_VIEWPORT_DIMS:r.getParameter(r.MAX_VIEWPORT_DIMS)},this.identifyBuffer=new Ye({minFilter:$e.NearestFilter,magFilter:$e.NearestFilter}),this.labelingTextureBuffer=new Ye({size:this.getViewportSize(),magFilter:$e.NearestFilter,minFilter:$e.NearestFilter,depthTexture:!0}),this.shaderProgramOptions={diffuse:{buildVertex:Ws("diffuse"),buildFragment:Xs("color_with_z_fade"),uniforms:[Ks,qs,{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},{name:"u_sdtr_distance",type:"1f"},...Js,...Qs,...ea,...$s,...ta,...ia],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_dem_position",location:1},{name:"a_float_visibility",location:2}]},gradientDiffuse:{buildVertex:Ws("diffuse"),buildFragment:Xs("gradient_with_z_fade"),uniforms:[Ks,qs,{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},{name:"u_mat4_gradient",type:"mat4"},{name:"u_sdtr_distance",type:"1f"},...Js,...Qs,...ea,...$s,...ta,...ia],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_dem_position",location:1},{name:"a_float_visibility",location:2}]},labelLine:{buildVertex:Ws("label_directional"),buildFragment:Xs("label_directional"),uniforms:[Ks,qs,{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"},...Js,...ta],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:{buildVertex:Ws("label_fixed_anchor"),buildFragment:Xs("label"),uniforms:[Ks,qs,{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_vec4_hidden_color",type:"4fv"},{name:"u_float_opacity",type:"1f"},{name:"u_vec2_offset",type:"2f"},{name:"u_float_height_factor",type:"1f"},{name:"u_depth_tex_labeling",type:"1i"},{name:"u_color_tex_labeling",type:"1i"},{name:"u_vec2_depth_test_half_point_size",type:"2f"},{name:"u_bool_skip_height_factor",type:"1i"},{name:"u_bool_depth_test_disable",type:"1i"},...Js,...$s,...ta],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_texcoord",location:2},{name:"a_vec2_check_offset",location:3},{name:"a_vec4_tex_identifier",location:4}]},labelPointIdentify:{buildVertex:Ws("label_fixed_anchor_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{name:"u_vec2_vpt_size",type:"2f"},{name:"u_float_scale",type:"1f"},{name:"u_vec2_offset",type:"2f"},...$s],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec4_identifier",location:2}]},line:{buildVertex:Ws("line"),buildFragment:Xs("line"),uniforms:[Ks,qs,{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_opacity",type:"1f"},{name:"u_mat4_gradient",type:"mat4"},...Js,...Qs,...$s,...ta,...ea,...ia],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},{name:"a_float_visibility",location:6}]},pointSprite:{buildVertex:Ws("pointsprite"),buildFragment:Xs("pointsprite"),uniforms:[Ks,qs,{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_vec2_opacity",type:"2f"},{name:"u_vec2_rotation",type:"2fv"},{name:"u_depth_tex_labeling",type:"1i"},{name:"u_color_tex_labeling",type:"1i"},{name:"u_vec2_depth_test_half_point_size",type:"2f"},{name:"u_bool_skip_height_factor",type:"1i"},{name:"u_bool_depth_test_disable",type:"1i"},...Js,...$s,...ta],attributes:[{name:"a_vec3_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec2_check_offset",location:2},{name:"a_vec2_texcoord",location:3},{name:"a_vec2_range",location:4},{name:"a_vec2_rescale",location:5},{name:"a_vec4_tex_identifier",location:6}]},pointSpriteIdentify:{buildVertex:Ws("pointsprite_identify"),buildFragment:Xs("pointsprite_identify"),uniforms:[Ks,{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"},{name:"u_bool_skip_height_factor",type:"1i"},...$s],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}]},pointDepthTest:{buildVertex:Ws("point_anchor"),buildFragment:Xs("color_identify"),uniforms:[Ks,{name:"u_vec2_vpt_size",type:"2f"},{name:"u_vec2_offset",type:"2f"},...$s],attributes:[{name:"a_vec4_position",location:0},{name:"a_vec2_offset",location:1},{name:"a_vec4_identifier",location:2}]},stripedLine:{buildVertex:Ws("striped_line"),buildFragment:Xs("striped_line"),uniforms:[Ks,qs,{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"},...Js,...ta,...ia,...ea,...Qs],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}]},patternedLine:{buildVertex:Ws("patterned_line"),buildFragment:Xs("patterned_line"),uniforms:[Ks,{name:"u_vec2_scales",type:"2fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_width",type:"1f"},{name:"u_float_opacity",type:"1f"},{name:"u_int_pattern_type",type:"1i"},{name:"u_vec4_pattern_params",type:"4fv"},qs,...Js,...ta,...ea,...ia,...Qs],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_widen",location:1},{name:"a_float_texture",location:2},{name:"a_vec4_identifier",location:3}]},stripedLineIdentify:{buildVertex:Ws("striped_line_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{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:{buildVertex:Ws("color"),buildFragment:Xs("textured_color"),uniforms:[Ks,qs,{name:"u_vec4_color",type:"4fv"},{name:"u_float_opacity",type:"1f"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_texture_opacity",type:"1f"},{name:"u_float_texture_params",type:"4fv"},{name:"u_float_sprite_texture_coords",type:"4fv"},{name:"u_int_is_textured",type:"1i"},...Js,...Qs,...ea,...ta,...ia],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_float_visibility",location:1}]},vtxColorIdentify:{buildVertex:Ws("color_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{name:"u_vec2_vpt_size",type:"2fv"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec4_identifier",location:1},{name:"a_float_visibility",location:2}]},metricPoint:{buildVertex:Ws("metric_point"),buildFragment:Xs("metric_point"),uniforms:[Ks,qs,{name:"u_vec4_color",type:"4fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_sprite_texture_coords",type:"4fv"},...Js,...ta,...Qs],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]},zbmModelIdentify:{buildVertex:Ws("zbm_model_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{name:"u_vec2_vpt_size",type:"2fv"},...$s],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec4_identifier",location:1},{name:"a_vec2_dem_position",location:2}]},buildingIdentify:{buildVertex:Ws("diffuse_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_float_height_factor",type:"1f"},...$s],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec4_identifier",location:1},{name:"a_vec2_dem_position",location:2},{name:"a_float_visibility",location:3}]},oneWayLine:{buildVertex:Ws("one_way_line"),buildFragment:Xs("one_way_line"),uniforms:[Ks,qs,{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"},...Js,...Qs,...ta,...ia],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_direction",location:1},{name:"a_vec2_widen_direction",location:2}]},zbmModel:{buildVertex:Ws("zbm_model"),buildFragment:Xs("zbm_model"),uniforms:[Ks,qs,{name:"u_vec4_color",type:"4fv"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_height_factor",type:"1f"},{name:"u_sdtr_distance",type:"1f"},...Js,...$s,...ta,...ia,...Qs,...ea],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec2_texcoord",location:1},{name:"a_vec2_dem_position",location:2}]},zbmShadow:{buildVertex:Ws("zbm_shadow"),buildFragment:Xs("main_shadow"),uniforms:[Ks,{name:"u_float_height_factor",type:"1f"},...$s],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec2_dem_position",location:1}]},gltfModel:{buildVertex:Ws("gltf_model"),buildFragment:Xs("gltf_model"),uniforms:[Ks,qs,{name:"u_mat4_instance",type:"mat4"},{name:"u_vec4_color",type:"4fv"},{name:"u_sr2d_texture_0",type:"1i"},{name:"u_ao_texture",type:"1i"},{name:"u_pbr_texture",type:"1i"},{name:"u_float_identify",type:"1f"},{name:"u_sdtr_distance",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_show_ratio",type:"1f"},{name:"u_float_metallic",type:"1f"},{name:"u_float_roughness",type:"1f"},...Js,...ia,...ta,...$s,...Qs,...ea],attributes:[{name:"position",location:0},{name:"normal",location:1},{name:"tangent",location:2},{name:"a_vec3_instance_position",location:3},{name:"a_mat3_instance_matrix",location:4,locationsCount:3},{name:"a_vec4_instance_localid",location:7},{name:"texcoord_color",location:8},{name:"texcoord_ao",location:9},{name:"texcoord_pbr",location:10}]},gltfModelIdentify:{buildVertex:Ws("gltf_model"),buildFragment:Xs("color_identify"),uniforms:[Ks,qs,{name:"u_mat4_instance",type:"mat4"},{name:"u_vec4_color",type:"4fv"},{name:"u_sr2d_texture_0",type:"1i"},{name:"u_float_identify",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_show_ratio",type:"1f"},...Js,...ta,...$s],attributes:[{name:"position",location:0},{name:"normal",location:1},{name:"tangent",location:2},{name:"a_vec3_instance_position",location:3,locationsCount:3},{name:"a_mat3_instance_matrix",location:4},{name:"a_vec4_instance_localid",location:7}]},gltfModelShadow:{buildVertex:Ws("gltf_shadow"),buildFragment:Xs("main_shadow"),uniforms:[Ks,{name:"u_mat4_instance",type:"mat4"},{name:"u_float_height_factor",type:"1f"},{name:"u_float_show_ratio",type:"1f"},...$s],attributes:[{name:"position",location:0},{name:"a_vec3_instance_position",location:3,locationsCount:3},{name:"a_mat3_instance_matrix",location:4}]},simpleLine:{buildVertex:Ws("simple_line"),buildFragment:Xs("simple_line"),uniforms:[Ks,qs,{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_int_signed_z",type:"1i"},{name:"u_float_z_offset",type:"1f"},...Js,...ia,...Qs,...ta,...ea,...$s,...Ys],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_float_z",location:1},{name:"a_vec4_direction_distance",location:2},{name:"a_vec2_dem_position",location:3},{name:"a_float_abs_height",location:4},{name:"a_float_visibility",location:5}]},road:{buildVertex:Ws("road"),buildFragment:Xs("road"),uniforms:[Ks,qs,{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"},...Js,...Qs,...ta,...ia,...ea],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec4_normals",location:1},{name:"a_vec2_shift",location:2}]},roadIdentify:{buildVertex:Ws("road_identify"),buildFragment:Xs("road_identify"),uniforms:[Ks,{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:{buildVertex:Ws("arrow_line_entrance"),buildFragment:Xs("arrow_line"),uniforms:[Ks,qs,{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"},...Js,...ta],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:{buildVertex:Ws("arrow_line_entrance"),buildFragment:Xs("arrow_line_identify"),uniforms:[Ks,qs,{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:{buildVertex:Ws("circle_marker"),buildFragment:Xs("circle_marker"),uniforms:[Ks,qs,{name:"u_vec2_vpt_size",type:"2fv"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_width",type:"1f"},...Js,...ta,...Qs],attributes:[{name:"a_vec4_vertex",location:0},{name:"a_vec2_widen",location:1}]},rect:{buildVertex:Ws("rect"),buildFragment:Xs("rect"),uniforms:[Ks,{name:"u_vec4_color",type:"4fv"}],attributes:[{name:"a_vec2_vertex",location:0}]},rectWithTexture:{buildVertex:Ws("rect_with_texture"),buildFragment:Xs("rect_with_texture"),uniforms:[Ks,qs,{name:"u_sr2d_texture",type:"1i"},{name:"u_float_opacity",type:"1f"},...ta,...Js],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]},circleMarkerIdentify:{buildVertex:Ws("circle_marker_identify"),buildFragment:Xs("color_identify"),uniforms:[Ks,{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}]},heatmap:{buildVertex:Ws("heatmap"),buildFragment:Xs("heatmap"),uniforms:[Ks,qs,...Js,{name:"u_float_radius",type:"1f"},{name:"u_float_intensity",type:"1f"},{name:"u_float_tile_to_pixel_ratio",type:"1f"},...ta],attributes:[{name:"a_vec2_position",location:0},{name:"a_vec2_widen",location:1},{name:"a_float_weight",location:2}]},heatmapTexture:{buildVertex:Ws("heatmap_texture"),buildFragment:Xs("heatmap_texture"),uniforms:[qs,{name:"u_sr2d_texture",type:"1i"},{name:"u_sr2d_ramp_texture",type:"1i"},{name:"u_float_opacity",type:"1f"},...Js,...ta],attributes:[{name:"a_vec2_position",location:0}]},demMesh:{buildVertex:Ws("dem_mesh"),buildFragment:Xs("dem_mesh"),uniforms:[Ks,qs,{name:"u_mat4_flat_map_mvp",type:"mat4"},{name:"u_flat_tex",type:"1i"},{name:"u_hillshade_tex",type:"1i"},...Js,...$s,...ta,...ia,...Qs],attributes:[{name:"a_vec2_position",location:0}]},demGround:{buildVertex:Ws("dem_ground"),buildFragment:Xs("dem_ground"),uniforms:[Ks,qs,...$s],attributes:[{name:"a_vec2_position",location:0}]},demElevation:{buildVertex:Ws("dem_elevation"),buildFragment:Xs("dem_elevation"),uniforms:[Ks,{name:"u_sr2d_texture",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]},demElevationCopy:{buildVertex:Ws("dem_elevation_copy"),buildFragment:Xs("dem_elevation_copy"),uniforms:[Ks,{name:"u_sr2d_texture",type:"1i"},{name:"u_mat4_dem_corrected",type:"mat4"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]},demHillshade:{buildVertex:Ws("dem_normal"),buildFragment:Xs("dem_normal"),uniforms:[...$s,...Qs,Ks,{name:"u_sr2d_texture",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_texcoord",location:1}]},demFlatBottom:{buildVertex:Ws("dem_flat_bottom"),buildFragment:Xs("dem_flat_bottom"),uniforms:[Ks,...$s],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_vec2_centroid",location:1},{name:"a_vec2_extender",location:2}]},mesh:{buildVertex:Ws("mesh"),buildFragment:Xs("mesh"),uniforms:[Ks,qs,...Js,...$s,...Ys,...Qs,...ta,...ia,{name:"u_float_opacity",type:"1f"},{name:"u_vec4_color",type:"4fv"},{name:"u_float_height_factor",type:"1f"},{name:"u_sdtr_distance",type:"1f"},{name:"u_mat4_gradient",type:"mat4"},{name:"u_int_identify",type:"1i"},{name:"u_sr2d_texture",type:"1i"},{name:"u_float_texture_opacity",type:"1f"},{name:"u_float_texture_params",type:"4fv"},{name:"u_float_sprite_texture_coords",type:"4fv"},{name:"u_int_is_textured",type:"1i"},{name:"u_float_texture_vertical_scale",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_float_z",location:1},{name:"a_vec3_normal",location:2},{name:"a_float_gradient",location:3},{name:"a_vec2_dem_position",location:4},{name:"a_float_abs_height",location:5}]},mapMesh:{buildVertex:Ws("map_mesh"),buildFragment:Xs("map_mesh"),uniforms:[Ks,qs,...Js,...$s,...Qs,...Ys,...ta,...ia,{name:"u_float_tile_size",type:"1f"},{name:"u_sampler_map_tex",type:"1i"},{name:"u_float_tex_scale",type:"2f"},{name:"u_float_tex_shift_scale",type:"1f"},{name:"u_float_height_factor",type:"1f"},{name:"u_sdtr_distance",type:"1f"},{name:"u_int_identify",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0},{name:"a_float_z",location:1},{name:"a_vec2_extender",location:2},{name:"a_vec3_normal",location:3},{name:"a_float_gradient",location:4},{name:"a_vec2_dem_position",location:5},{name:"a_float_abs_height",location:6}]},sky:{buildVertex:Ws("sky"),buildFragment:Xs("sky"),uniforms:[qs,...Js,...ta,{name:"u_sky_color",type:"4f"}],attributes:[{name:"a_vec2_vertex",location:0}]},antialias:{buildVertex:Ws("posteffect"),buildFragment:Xs("antialias"),uniforms:[{name:"u_texture",type:"1i"},{name:"u_float_mix_coef",type:"1f"}],attributes:[{name:"a_vec2_vertex",location:0}]},copy:{buildVertex:Ws("posteffect"),buildFragment:Xs("copy"),uniforms:[{name:"u_texture",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0}]},copyDepth:{buildVertex:Ws("posteffect"),buildFragment:Xs("copy_depth"),uniforms:[{name:"u_texture",type:"1i"},{name:"u_depth",type:"1i"}],attributes:[{name:"a_vec2_vertex",location:0}]},buildingShadow:{buildVertex:Ws("building_shadow"),buildFragment:Xs("main_shadow"),uniforms:[...$s,Ks,{name:"u_float_height_factor",type:"1f"}],attributes:[{name:"a_vec3_vertex",location:0},{name:"a_vec2_dem_position",location:1},{name:"a_float_visibility",location:2}]}},this.shaderPrograms={},t.map.once("idle",(()=>function(e,t){if(window.requestIdleCallback){const i=e.getRenderingContext();for(const n in t){const t=n;window.requestIdleCallback((()=>{if(i.isContextLost())return;const n=e.getShaderProgram(t);n.link(i),setTimeout((()=>{window.requestIdleCallback((()=>{i.isContextLost()||n.locate(i)}))}),2e3)}))}}}(this,this.shaderProgramOptions))),this.symbolSettingsList={line:{solid:[{programName:"road",vaoCreator:Zt,webglState:ln,needsVisibilityBuffer:!1,programBinder:eo(vt,fo,vo,gt),objectBinder:_s(cr,Br,Do,er,or),layerBinder:wt,zoomBinder:es,tileBinder:Ss(Ts,Is)},{identify:!0,programName:"roadIdentify",vaoCreator:Xt,webglState:hn,needsVisibilityBuffer:!1,objectBinder:_s(Br,or),zoomBinder:es,tileBinder:Is}],patterned:[{programName:"patternedLine",vaoCreator:Kt,webglState:ln,needsVisibilityBuffer:!1,programBinder:eo(vt,fo,vo),layerBinder:wt,objectBinder:_s(Br,Mr,or,Ko),zoomBinder:ts,tileBinder:Ss(Ts,Is)}]},polygon:{fill:[{programName:"vtxColor",vaoCreator:Ut,webglState:ln,needsVisibilityBuffer:!0,programBinder:wo,layerBinder:bt(mt,wt),objectBinder:_s(Br,Do,er,Ko,qo),tileBinder:Ss(Ls,As,Is,Ts)},{identify:!0,programName:"vtxColorIdentify",vaoCreator:Ht,webglState:cn,needsVisibilityBuffer:!0,programBinder:st,objectBinder:_s(Br),tileBinder:Is}],stroke:[{programName:"simpleLine",vaoCreator:_i,webglState:ln,needsVisibilityBuffer:!0,programBinder:go,layerBinder:bt(st,ht,wt),objectBinder:_s(Ur,Br,Ho,Yo,er,rr,hs),tileBinder:Ss(Ts,Is),subRenderIndex:1}],shadow:[{programName:"vtxColor",vaoCreator:Vt,webglState:ln,needsVisibilityBuffer:!0,programBinder:eo(vt,fo,vo),layerBinder:mt,objectBinder:_s(Br,Bo,er,Ko),tileBinder:Ss(Ls,As,Is,Ts)}]},metricPoint:{fill:[{programName:"metricPoint",vaoCreator:Gt,webglState:ln,needsVisibilityBuffer:!1,programBinder:eo(vt,fo),layerBinder:bt(wt,mt),objectBinder:_s(Br,Do,er),tileBinder:Ss(zs,Is,Ts)}]},mesh:{fill:[{programName:"mesh",vaoCreator:Qt,webglState:vn,needsVisibilityBuffer:!1,programBinder:xo,layerBinder:bt(wt,xt),objectBinder:_s(Br,jo,ir,tr,Ko,as,ms,ls,ps,qo),tileBinder:Ss(Ls,As,Cs,Ts,Is,Es),subRenderIndex:1},{identify:!0,programName:"mesh",vaoCreator:Qt,webglState:on,needsVisibilityBuffer:!1,programBinder:xo,objectBinder:_s(Br,as,ms,ls,ps),tileBinder:Ss(Is,Es),subRenderIndex:1},{depthTest:!0,programName:"mesh",vaoCreator:Qt,webglState:on,needsVisibilityBuffer:!0,programBinder:xo,objectBinder:_s(Br,as,ms,ls,ps),tileBinder:Ss(Is,Es),subRenderIndex:1}],inverse:[{programName:"mesh",vaoCreator:ei,webglState:un,needsVisibilityBuffer:!1,programBinder:eo(xo,vt,fo,vo),objectBinder:_s(as,ms,ps),tileBinder:Ss(Is,Es),subRenderIndex:-1},{identify:!0,programName:"mesh",vaoCreator:ei,webglState:un,needsVisibilityBuffer:!1,programBinder:xo,objectBinder:_s(as,ms,ps),tileBinder:Ss(Is,Es),subRenderIndex:-1}],stroke:[{programName:"simpleLine",vaoCreator:vi,webglState:sn,needsVisibilityBuffer:!0,programBinder:go,layerBinder:bt(rt,ht,wt),objectBinder:_s(Br,Zo,Yo,er,rr,as,cs,ms,ls),tileBinder:Ss(Ts,Is,Es),subRenderIndex:2}]},polygonExtrusion:{sideFill:[{programName:"diffuse",vaoCreator:ti,webglState:un,needsVisibilityBuffer:!0,programBinder:Io,tileBinder:Ss(Ts,Is,Es),layerBinder:bt(wt,xt),objectBinder:_s(Br,Vo,er,Or,Ko,ms)},{programName:"gradientDiffuse",vaoCreator:ti,webglState:mn,needsVisibilityBuffer:!0,programBinder:Io,layerBinder:bt(wt,xt),objectBinder:_s(Br,Vo,Go,er,tr,Or,Ko,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:1},{identify:!0,programName:"buildingIdentify",vaoCreator:ii,webglState:on,needsVisibilityBuffer:!0,programBinder:ao,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)},{depthTest:!0,programName:"buildingIdentify",vaoCreator:ni,webglState:on,needsVisibilityBuffer:!0,programBinder:ao,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)},{programName:"buildingShadow",shadow:!0,vaoCreator:oi,webglState:gn,needsVisibilityBuffer:!0,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)}],topFill:[{programName:"diffuse",vaoCreator:ti,webglState:un,needsVisibilityBuffer:!0,programBinder:Io,layerBinder:wt,objectBinder:_s(Br,Uo,er,Or,Ko,ms),tileBinder:Ss(Ts,Is,Es)},{programName:"diffuse",vaoCreator:ti,webglState:mn,needsVisibilityBuffer:!0,programBinder:Io,layerBinder:bt(wt,xt),objectBinder:_s(Br,Uo,er,Or,Ko,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:1},{identify:!0,programName:"buildingIdentify",vaoCreator:ii,webglState:on,needsVisibilityBuffer:!0,programBinder:ao,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)},{depthTest:!0,programName:"buildingIdentify",vaoCreator:ni,webglState:on,needsVisibilityBuffer:!0,programBinder:ao,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)},{programName:"buildingShadow",shadow:!0,vaoCreator:oi,webglState:gn,needsVisibilityBuffer:!0,objectBinder:_s(Br,Or,ms),tileBinder:Ss(Is,Es)}],sideStroke:[{programName:"line",vaoCreator:ai,webglState:sn,needsVisibilityBuffer:!0,programBinder:So,layerBinder:wt,objectBinder:_s(Br,Qo,$o,er,tr,Or,Ko,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:3}],topStroke:[{programName:"simpleLine",vaoCreator:vi,webglState:sn,needsVisibilityBuffer:!0,programBinder:go,layerBinder:bt(wt,rt,ut),objectBinder:_s(Br,Ho,Jo,er,rr,Or,hs,ms,ds),tileBinder:Ss(Ts,Is,Es),subRenderIndex:4}]},labelLine:{raster:[{programName:"labelLine",vaoCreator:Jt,webglState:pn,needsVisibilityBuffer:!1,programBinder:eo(lo,vt,fo),objectBinder:_s(Vr,Xr,fr,yr,Wr,Kr,Qr),tileBinder:Ss(Is,Ts),zoomBinder:es,uniformSet:"fontHalo"},{programName:"labelLine",vaoCreator:Jt,webglState:_n,needsVisibilityBuffer:!1,programBinder:eo(lo,vt,fo),objectBinder:_s(Vr,Xr,fr,yr,Wr,Kr,Qr),tileBinder:Ss(Is,Ts),zoomBinder:es,uniformSet:"fontHalo",isOverlappedObject:!0},{programName:"labelLine",vaoCreator:Jt,webglState:pn,needsVisibilityBuffer:!1,programBinder:eo(lo,vt,fo),objectBinder:_s(Vr,fr,yr,Wr,Kr,Qr),zoomBinder:es,tileBinder:Ss(Is,Ts),uniformSet:"fontFill",subRenderIndex:1},{programName:"labelLine",vaoCreator:Jt,webglState:_n,needsVisibilityBuffer:!1,programBinder:eo(lo,vt,fo),objectBinder:_s(Vr,fr,yr,Wr,Kr,Qr),zoomBinder:es,tileBinder:Ss(Is,Ts),uniformSet:"fontFill",subRenderIndex:1,isOverlappedObject:!0}]},dashedLine:{stroke:[{programName:"stripedLine",vaoCreator:qt,webglState:ln,needsVisibilityBuffer:!1,programBinder:To,layerBinder:wt,objectBinder:_s(Br,Sr,Gr,xr,Ko),tileBinder:Ss(Ts,Is)},{identify:!0,programName:"stripedLineIdentify",vaoCreator:qt,webglState:hn,needsVisibilityBuffer:!1,programBinder:Mo,objectBinder:_s(Br,Sr,Gr,Ko,xr),tileBinder:Is}]},oneWayLine:{raster:[{programName:"oneWayLine",vaoCreator:hi,webglState:pn,needsVisibilityBuffer:!1,programBinder:co,layerBinder:wt,objectBinder:_s(Vr,fr,No,er,Tr,Er),tileBinder:Is},{programName:"oneWayLine",vaoCreator:hi,webglState:_n,programBinder:co,needsVisibilityBuffer:!1,layerBinder:wt,objectBinder:_s(Vr,fr,No,er,Tr,Er),tileBinder:Is,isOverlappedObject:!0}]},point:{raster:[{programName:"pointSprite",vaoCreator:li,webglState:fn,needsVisibilityBuffer:!1,programBinder:eo(ho,vt,fo),layerBinder:mt,objectBinder:_s(Vr,dr,mr,gr,pr,ss,ms),tileBinder:Ss(Is,Ts,Es)},{identify:!0,programName:"pointSpriteIdentify",vaoCreator:di,webglState:cn,needsVisibilityBuffer:!1,programBinder:uo,objectBinder:_s(Vr,dr,ur,gr,pr,ss,ms),tileBinder:Ss(Is,Es)}],text:[{programName:"labelPoint",vaoCreator:$t,webglState:fn,needsVisibilityBuffer:!1,programBinder:eo(mo,vt,fo),objectBinder:_s(Vr,Xr,fr,yr,Wr,qr,Jr,ss,ms),tileBinder:Ss(Is,Ts,Es),uniformSet:"fontHalo",subRenderIndex:1},{programName:"labelPoint",vaoCreator:$t,webglState:fn,needsVisibilityBuffer:!1,programBinder:eo(mo,vt,fo),objectBinder:_s(Vr,fr,yr,Wr,qr,Jr,ss,ms),tileBinder:Ss(Is,Ts,Es),uniformSet:"fontFill",subRenderIndex:2},{identify:!0,programName:"labelPointIdentify",vaoCreator:Yt,webglState:cn,needsVisibilityBuffer:!1,programBinder:eo(rt,to),objectBinder:_s(Vr,hr,Wr,Jr,ms),tileBinder:Ss(Is,Es),subRenderIndex:1}],labelingTexture:[{depthTest:!0,programName:"pointDepthTest",vaoCreator:ci,webglState:hn,needsVisibilityBuffer:!1,programBinder:eo(rt,to),objectBinder:_s(Vr,Jr,ms),tileBinder:Ss(Is,Es)}]},buildingModel:{fill:[{programName:"zbmModel",vaoCreator:ui,webglState:vn,needsVisibilityBuffer:!1,programBinder:eo(to,vt,fo,vo,gt),layerBinder:bt(wt,mt,xt),objectBinder:_s(Br,Do,Xo,er,Rr,Lr,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:2},{programName:"zbmModelIdentify",vaoCreator:mi,webglState:on,needsVisibilityBuffer:!1,programBinder:rt,objectBinder:_s(Br,ms),tileBinder:Ss(Is,Es),subRenderIndex:2,identify:!0},{programName:"zbmModelIdentify",vaoCreator:fi,webglState:on,needsVisibilityBuffer:!1,programBinder:rt,objectBinder:_s(Br,ms),tileBinder:Ss(Is,Es),depthTest:!0},{programName:"zbmShadow",vaoCreator:pi,webglState:gn,needsVisibilityBuffer:!1,objectBinder:_s(Br,Rr,ms),tileBinder:Ss(Is,Es),shadow:!0}],stroke:[{programName:"simpleLine",vaoCreator:vi,webglState:sn,needsVisibilityBuffer:!0,programBinder:go,layerBinder:bt(rt,wt,ht),objectBinder:_s(Br,Ho,Xo,er,rr,Rr,hs,ms,ds),tileBinder:Ss(Is,Ts,Es),subRenderIndex:5}]},shiftedLine:{solid:[{programName:"road",programBinder:eo(vt,fo,vo,gt),vaoCreator:Wt,webglState:ln,needsVisibilityBuffer:!1,layerBinder:wt,objectBinder:_s(Br,Do,er,or,cr),tileBinder:Ss(Ts,Is),zoomBinder:es}]},circle:{fill:[{programName:"circleMarker",vaoCreator:yi,webglState:ln,needsVisibilityBuffer:!1,programBinder:Eo,layerBinder:wt,objectBinder:_s(Br,Do,er,or),tileBinder:Ss(Is,Ts),subRenderIndex:2},{programName:"circleMarker",vaoCreator:yi,webglState:ln,needsVisibilityBuffer:!1,programBinder:Eo,layerBinder:wt,objectBinder:_s(Br,Ho,er,sr),tileBinder:Ss(Is,Ts),subRenderIndex:1},{programName:"circleMarker",vaoCreator:yi,webglState:ln,needsVisibilityBuffer:!1,programBinder:Eo,layerBinder:wt,objectBinder:_s(Br,Wo,er,ar),tileBinder:Ss(Is,Ts)},{identify:!0,programName:"circleMarkerIdentify",vaoCreator:bi,webglState:cn,needsVisibilityBuffer:!1,programBinder:po,objectBinder:_s(Br,lr),tileBinder:Is}]},arrow:{stroke:[{programName:"entrance",vaoCreator:gi,webglState:ln,needsVisibilityBuffer:!1,programBinder:yo,objectBinder:_s(Br,Do,er,Tr,nr,Pr,Ko),tileBinder:Ss(Is,Ts)},{identify:!0,programName:"entranceIdentify",vaoCreator:gi,webglState:cn,needsVisibilityBuffer:!1,programBinder:_o,objectBinder:_s(Br,Tr,Pr,Ko),tileBinder:Is}]},lineExtrusion:{fill:[{programName:"gradientDiffuse",vaoCreator:ri,webglState:an,needsVisibilityBuffer:!0,programBinder:Io,layerBinder:bt(wt,xt),objectBinder:_s(Br,Fr,Vo,Go,er,tr,Ko,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:9},{programName:"buildingShadow",shadow:!0,vaoCreator:si,webglState:yn,needsVisibilityBuffer:!0,objectBinder:_s(Br,Fr,ms),tileBinder:Ss(Is,Es)}],sideStroke:[{programName:"line",vaoCreator:ai,webglState:sn,needsVisibilityBuffer:!0,programBinder:So,layerBinder:wt,objectBinder:_s(Br,Fr,Qo,$o,er,tr,Ko,ms),tileBinder:Ss(Ts,Is,Es),subRenderIndex:10}],topStroke:[{programName:"simpleLine",vaoCreator:vi,webglState:sn,needsVisibilityBuffer:!0,programBinder:go,layerBinder:bt(wt,rt,ht),objectBinder:_s(Br,Fr,Ho,er,rr,hs,ms,ds),tileBinder:Ss(Ts,Is,Es),subRenderIndex:11}]},instances:{instances:[{objectBinder:vs(jr,Ar),vaoAttributesCreator:Pi},{identify:!0,objectBinder:vs(jr,Ar),vaoAttributesCreator:Pi},{depthTest:!0,objectBinder:vs(jr,Ar),vaoAttributesCreator:Li},{shadow:!0,objectBinder:vs(jr,Ar),vaoAttributesCreator:Pi}]},gltfModel:{fill:[{programName:"gltfModel",vaoCreator:Nt,programBinder:bo,layerBinder:bt(wt,xt,St),webglState:vn,needsVisibilityBuffer:!1,objectBinder:_s(Do,kr,er,Cr,ms,zr),tileBinder:Ss(ks,Rs,Es)},{identify:!0,programName:"gltfModelIdentify",vaoCreator:Nt,webglState:on,needsVisibilityBuffer:!1,layerBinder:St,programBinder:eo(to,vt,fo),objectBinder:_s(ms,zr),tileBinder:Ss(ks,Es)},{depthTest:!0,programName:"gltfModelIdentify",vaoCreator:Nt,webglState:on,needsVisibilityBuffer:!1,programBinder:eo(vt,to,fo),layerBinder:St,objectBinder:_s(ms,zr),tileBinder:Ss(ks,Es)},{programName:"gltfModelShadow",shadow:!0,vaoCreator:Nt,webglState:gn,needsVisibilityBuffer:!1,layerBinder:St,objectBinder:_s(ms,zr),tileBinder:Ss(ks,Es)}]},raster:{fill:[{programName:"rectWithTexture",vaoCreator:wi,webglState:ln,needsVisibilityBuffer:!1,programBinder:eo(vt,fo),layerBinder:mt,objectBinder:_s(Br,br,_r),tileBinder:Ss(Is,Ts)}]},heatmap:{framebuffer:[{programName:"heatmap",vaoCreator:xi,webglState:bn,needsVisibilityBuffer:!1,programBinder:Po,objectBinder:_s(Br,Hr,Zr),zoomBinder:es,tileBinder:Ss(Is,Ts)}],fill:[{programName:"heatmapTexture",vaoCreator:Si,webglState:ln,needsVisibilityBuffer:!1,layerBinder:mt,objectBinder:_s(Br,br,wr,vr),tileBinder:Ts,subRenderIndex:1}]},dem:{mesh:[{programName:"demMesh",vaoCreator:Ii,programBinder:eo(to,vt,fo,vo),layerBinder:wt,webglState:on,needsVisibilityBuffer:!1,objectBinder:_s(is,os,ms),tileBinder:Ss(Is,Ts,Ms,Es)},{identify:!0,programName:"demMesh",vaoCreator:Ii,programBinder:eo(to,ro),webglState:on,needsVisibilityBuffer:!1,objectBinder:_s(ns,ms),tileBinder:Ss(Is,Ms,Es)}],ground:[{programName:"demGround",vaoCreator:Ii,programBinder:to,tileBinder:Ss(Is,Ts,Es),webglState:on,needsVisibilityBuffer:!1,objectBinder:_s(ms)}],elevation:[{programName:"demElevation",vaoCreator:Mi,webglState:dn,needsVisibilityBuffer:!1,layerBinder:mt,objectBinder:_s(br),tileBinder:Is}],hillshade:[{programName:"demHillshade",vaoCreator:Ei,webglState:cn,needsVisibilityBuffer:!1,programBinder:to,objectBinder:_s(ms),tileBinder:Ss(Is,Es)}],flatBottom:[{programName:"demFlatBottom",vaoCreator:Ti,webglState:dn,needsVisibilityBuffer:!1,objectBinder:_s(rs,ms),tileBinder:Ss(Is,Es)}]},mapMesh:{fill:[{programName:"mapMesh",vaoCreator:Ai,webglState:vn,zoomBinder:_s(us),programBinder:xo,layerBinder:bt(wt,xt),objectBinder:_s(fs,as,ms,ls,ps),tileBinder:Ss(Ts,Is,Es),subRenderIndex:Number.MAX_SAFE_INTEGER},{identify:!0,programName:"mapMesh",vaoCreator:Ai,webglState:on,zoomBinder:_s(us),programBinder:xo,layerBinder:bt(wt,xt),objectBinder:_s(fs,as,ms,ls,ps),tileBinder:Ss(Is,Es),subRenderIndex:Number.MAX_SAFE_INTEGER},{depthTest:!0,programName:"mapMesh",vaoCreator:Ai,webglState:on,zoomBinder:_s(us),programBinder:xo,layerBinder:bt(wt,xt),objectBinder:_s(as,ms,ls,ps),tileBinder:Ss(Is,Es),subRenderIndex:Number.MAX_SAFE_INTEGER}]}},this.addExtension("OES_vertex_array_object").addExtension("OES_element_index_uint").addExtension("OES_standard_derivatives").addExtension("OES_texture_float").addExtension("OES_texture_float_linear").addExtension("ANGLE_instanced_arrays").addExtension("WEBGL_depth_texture").addExtension("EXT_frag_depth"),2===Fa.webglVersion&&this.addExtension("EXT_color_buffer_float").addExtension("EXT_frag_depth"),this.setPixelRatio(window.devicePixelRatio).setSize(t.layout.mapContainer.clientWidth,t.layout.mapContainer.clientHeight),e.collectStats&&(this.timers=new Fs(this._gl)),t.layout.canvas.addEventListener("webglcontextlost",this.trackContextLost)}getViewportSize(e=1){const t=this.getPixelRatio();return this.state.size.map((i=>Math.floor(i*t/e)))}setClearColor(e){return this.clearColor=(0,K.m2)(e),this.addRerenderEvent(),this}setSize(e,t){return this.modules.layout.setCanvasSize(e,t),this.updateFrameBuffersSize(),this}updateFrameBuffersSize(){var e;this.framebuffers.forEach((e=>{e&&e.onResize()}));const t=this.getPixelRatio(),i=this.state.size.map((e=>Math.ceil(e*t)));null===(e=this.modules.postEffectsManager)||void 0===e||e.invalidateSize(),this.identifyBuffer.setSize(i.map((e=>Math.ceil(e*T.identify.pixelDensity)))),this.labelingTextureBuffer.setSize(i)}clear(e=!0){return this.clearWithColor(this.clearColor,e),this}addRerenderEvent(e){this.state.rerenderEvents.push(e||{type:"coreNeedRerender"})}isNeedRerender(){return this.state.needRerender||this.state.rerenderEvents.length>0}clearWithColor(e,t=!0){const i=this._gl,n=!0===t?i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT:i.COLOR_BUFFER_BIT;nn(i,t?Sn:In,this.modules.renderer.lastAppliedGlState),i.clearDepth(1),i.clearColor(e[0],e[1],e[2],e[3]),i.clear(n)}renderTileObjects(e){this.state.collectStats&&this.timers&&this.timers.addTimer();let t=!1;const i=this.getRenderObjectsByGroups(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 r,s,a,l;const d=this.modules.map.state.demMode&&(void 0===o||!0===o.useDem),c=!o,h=(null==o?void 0:o.isCacheFramebuffer)&&!this.modules.renderCacheManager.hasReadyCache(),u=!o&&this.modules.postEffectsManager.hasActiveEffects();u&&(o=this.modules.postEffectsManager.mainFrameBufferWrapper);const m=Ma(this.state,this.modules,i.tiers,null==o?void 0:o.renderTarget,d);if(o)null===(r=o.onRenderStart)||void 0===r||r.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]),o.clearColor&&this.clearWithColor(o.clearColor,!!o.clearDepth);else{const{size:e,viewport:t}=this.state,i=window.devicePixelRatio;this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null),this._gl.viewport(t.left*i,t.bottom*i,e[0]*i,e[1]*i),this.clear(!0)}(c||h)&&(this.modules.environmentManager.renderSky(this._gl),d&&i.flatObjectsGroup&&!this.modules.renderCacheManager.hasReadyCache()&&!t&&(t=!0,this.renderDemMesh(m,i.flatObjectsGroup,!1,o))),c&&this.modules.renderCacheManager.render();const f=null!==(a=null===(s=null==o?void 0:o.getViewProjectionMatrix)||void 0===s?void 0:s.call(o))&&void 0!==a?a:this.modules.camera.viewProjectionMatrix,p=d?this.modules.demManager.demTextureMatrix:void 0;n.forEach((e=>{e.updateMvpMatrix(f,p)})),oa(this.state,this.modules,e,m),null==o||o.renderTarget.unbind(this._gl),null===(l=null==o?void 0:o.onRenderEnd)||void 0===l||l.call(o),u&&this.modules.postEffectsManager.render(this._gl)})),this.state.collectStats&&this.timers){this.timers.stopTimer();const e=this.timers.tryToGetFirstTimerValue();e&&this.modules.map.emit("gpuRenderTime",e)}return this}renderLabelingTexture(e){if(this.modules.renderCacheManager.hasReadyCache())return;if(this.state.labelingDepthTestDisabled=!0,this.state.styleZoom<15)return;const t=this._gl,i=[],n=Ma(this.state,this.modules,void 0,this.labelingTextureBuffer),o=e.filter((e=>e.depthTestChildren[0]));o.forEach((e=>{e.updateMvpMatrix(this.modules.camera.viewProjectionMatrix)})),o.forEach((e=>{i.push(...e.depthTestChildren)})),this.state.labelingDepthTestDisabled=!1,this.labelingTextureBuffer.bind(t),this.clearWithColor([1,1,1,1]),t.viewport(0,0,this.labelingTextureBuffer.options.size[0],this.labelingTextureBuffer.options.size[1]),oa(this.state,this.modules,i,n),this.labelingTextureBuffer.unbind(t)}renderIdentify(e){const t=this._gl,i=this.getRenderObjectsByGroups(e,!0);i.groups.forEach((({objects:e,tileObjects:n,framebuffer:o})=>{var r,s,a;const l=this.modules.map.state.demMode&&(void 0===o||!0===o.useDem),d=o?o.renderTarget:this.identifyBuffer,c=Ma(this.state,this.modules,i.tiers,d,l);d.bind(t),this.clearIdentify(),l&&i.flatObjectsGroup&&this.renderDemMesh(c,i.flatObjectsGroup,!0),d.bind(t),t.viewport(0,0,d.options.size[0],d.options.size[1]);const h=null!==(s=null===(r=null==o?void 0:o.getViewProjectionMatrix)||void 0===r?void 0:r.call(o))&&void 0!==s?s:this.modules.camera.viewProjectionMatrix,u=l?this.modules.demManager.demTextureMatrix:void 0;n.forEach((e=>{e.updateMvpMatrix(h,u)})),oa(this.state,this.modules,e,c),d.unbind(t),null==o||o.renderTarget.unbind(this._gl),null===(a=null==o?void 0:o.onRenderEnd)||void 0===a||a.call(o)})),this.addRerenderEvent()}readIdentifyPixels(){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,t){var i,n;let o=this.shaderPrograms[e];o||(o={},this.shaderPrograms[e]=o);let r=o[this.commonShaderDefines.hash];r||(r={},o[this.commonShaderDefines.hash]=r);const s=null!==(i=null==t?void 0:t.hash)&&void 0!==i?i:"",a=null!==(n=null==t?void 0:t.defines)&&void 0!==n?n:[];let l=r[s];return l||(l=new it(this.shaderProgramOptions[e],Qe.createShaderDefinitions([...this.commonShaderDefines.defines,...a])),r[s]=l),l}destroy(){this.lastRenderedFramebuffers=[],this.framebuffers.forEach((e=>{null==e||e.renderTarget.remove()})),this.modules.layout.canvas.removeEventListener("webglcontextlost",this.trackContextLost);const e=this._gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.modules.layout.destroy(),this.mapMeshFramebufferId=void 0,this.mapMeshIdFramebufferId=void 0}addFramebuffer(e){return this.framebuffers.push(e),this.framebuffers.length-1}getFramebuffer(e){if(e!==yt.ze)return this.framebuffers[e]}removeFramebuffer(e){var t;null===(t=this.framebuffers[e])||void 0===t||t.renderTarget.remove(),this.framebuffers[e]=void 0}renderDemMesh(e,t,i=!1,n){const{framebuffer:o,tiles:r}=t;if(!o)return;let s=this.modules.demManager.getFlatMapTextures();if(i&&(s=s.filter((e=>0===e.detailLevel))),!s.length)return;const a=this.modules.demManager.getMeshTiles();if(!a.length)return;const l=a[0],d=(i?l.identifyChildren:l.children)[0],c=this.state.handyStyleId,h=this.modules.styleManager.getStyleLayer(c,zi.he);if(!h||(0,na.OB)(d))return;const{size:u,viewport:m}=this.state,f=window.devicePixelRatio,{programBinder:p,layerBinder:_,programName:v}=d.layerSettings,g=this.modules.renderer.getShaderProgram(v),y=[];r.forEach(((e,t)=>{y.push({objects:e,tile:t})}));const b=e.copy(o.renderTarget,!1,!0);s.forEach((t=>{var r,s;const l=y.filter((e=>Oa(t.viewport,e.tile.bounds.values()))).reduce(((e,i)=>{i.tile.updateMvpMatrix(t.mvpMatrix,this.modules.demManager.demTextureMatrix);const n=0===t.detailLevel?i.objects:i.objects.filter((e=>{if(e.type===nt.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===(r=o.onRenderStart)||void 0===r||r.call(o),o.renderTarget.bind(this._gl),this._gl.viewport(0,0,o.renderTarget.options.size[0],o.renderTarget.options.size[1]),o.clearColor&&this.clearWithColor(o.clearColor,!1),oa(this.state,this.modules,l,b),o.renderTarget.unbind(this._gl),null===(s=o.onRenderEnd)||void 0===s||s.call(o),i){this.identifyBuffer.bind(this._gl);const e=this.identifyBuffer.options.size;this._gl.viewport(0,0,e[0],e[1])}else n?(this._gl.viewport(0,0,n.renderTarget.options.size[0],n.renderTarget.options.size[1]),n.renderTarget.bind(this._gl)):this._gl.viewport(m.left*f,m.bottom*f,u[0]*f,u[1]*f);g.enable(this._gl),null==p||p(this._gl,g,this.state,this.modules,!0),null==_||_(this._gl,g,this.state,this.modules,h),e.useState(d,h),a.forEach((n=>{if(n.needSync&&n.syncReplicas(this.state),Oa(t.viewport,n.bounds.values())){n.updateMvpMatrix(this.modules.camera.viewProjectionMatrix,this.modules.demManager.demTextureMatrix,t.texMatrix);const o=i?n.identifyChildren:n.children;e.drawSymbol(o,h,this.state,this.modules)}})),i&&this.identifyBuffer.unbind(this._gl)}))}getMapMeshFramebufferId(){return void 0===this.mapMeshFramebufferId&&(this.mapMeshFramebufferId=this.createMapMeshFramebuffer()),this.mapMeshFramebufferId}getMapMeshIdFramebufferId(){return void 0===this.mapMeshIdFramebufferId&&(this.mapMeshIdFramebufferId=this.createMapMeshFramebuffer(!0)),this.mapMeshIdFramebufferId}rebuildExternalShaderDefinitions(){const e=this.prepareExternalShaderDefinitions();this.commonShaderDefines.hash!==e.hash&&(this.commonShaderDefines=e)}getRenderObjectsByGroups(e,t){const i=this.modules.demManager,n={},o={framebuffer:void 0,objects:[],tileObjects:new Set},r={},s=t?i.getIdentifyFlatFramebufferId():i.getFlatFramebufferId();let a;if(this.modules.map.state.demMode){const e=this.getFramebuffer(s);e&&(a={framebuffer:e,tiles:new Map})}t||o.objects.push(...this.modules.styleManager.getCustomSceneObjects()),e.forEach((e=>{(t?e.identifyChildren:e.children).forEach((i=>{var s;const l=this.modules.styleManager.getFramebufferId(i.attributes.styleId,i.attributes.layerId),d=l?l[i.sink]:void 0;if(d!==yt.ze)if(void 0!==d){var c,h;n[d]||(n[d]={framebuffer:this.getFramebuffer(d),objects:[],tileObjects:new Set}),n[d].objects.push(i),n[d].tileObjects.add(e)}else{const l=i.attributes.tiers;if(this.state.immersiveLevel.tiers&&l){let t=!1;if(l.forEach((n=>{n?(r[n]||(r[n]={objects:[],tileObjects:new Set}),r[n].objects.push(i),r[n].tileObjects.add(e)):t=!0})),!t)return}if(!this.modules.map.state.demMode||(c=i.symbol,h=i.sink,"dem"===c&&"mesh"===h||"mapMesh"===c||"point"===c||"polygonExtrusion"===c||"lineExtrusion"===c||"buildingModel"===c||"gltfModel"===c||"instances"===c||"mesh"===c)){if(!t&&this.modules.renderCacheManager.tryToCacheObjects(n,i,e))return;o.objects.push(i),o.tileObjects.add(e)}else(null==a?void 0:a.tiles.has(e))?null===(s=null==a?void 0:a.tiles.get(e))||void 0===s||s.push(i):null==a||a.tiles.set(e,[i]),this.modules.renderCacheManager.checkFlatObjectAnimation(i)}}))}));const l=Object.values(n).filter((e=>!!e.framebuffer));return l.sort(((e,t)=>{var i,n,o,r;return(null!==(n=null===(i=e.framebuffer)||void 0===i?void 0:i.renderIndex)&&void 0!==n?n:0)-(null!==(r=null===(o=t.framebuffer)||void 0===o?void 0:o.renderIndex)&&void 0!==r?r:0)})),l.push(o),{flatObjectsGroup:a,groups:l,tiers:r}}clearIdentify(){const e=this._gl;e.depthMask(!0),e.clearColor(ka[0],ka[1],ka[2],ka[3]),e.clearDepth(1),e.clearStencil(0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)}clearFramebuffer(e){e.clearColor&&(e.renderTarget.bind(this._gl),this._gl.viewport(0,0,e.renderTarget.options.size[0],e.renderTarget.options.size[1]),this.clearWithColor(e.clearColor,!1),e.renderTarget.unbind(this._gl))}createMapMeshFramebuffer(e){const t=this.modules.renderer.getRenderingContext(),i=window.devicePixelRatio,n=e?$e.NearestFilter:$e.LinearFilter,o=R.bA([],this.modules.map.state.size,i),r=e?T.identify.pixelDensity:1;let s=this.getMapMeshScale(o);const a=new Ye({size:[Math.trunc(o[0]*r*s[0]),Math.trunc(o[1]*r*s[1])],magFilter:n,minFilter:n,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping}),l={getViewProjectionMatrix:()=>{const e=1-Math.cos(this.modules.map.state.pitch);return qe.wA(Ra,[0,e/s[1],0],[1/s[0],1/s[1],1]),qe.Jp(this.mapMeshMvpMatrix,Ra,this.modules.camera.viewProjectionMatrix),this.mapMeshMvpMatrix},onResize:()=>{const e=window.devicePixelRatio,i=R.bA([],this.modules.map.state.size,e);s=this.getMapMeshScale(i),l.scale=s,a.setSize([Math.trunc(i[0]*e*s[0]*r),Math.trunc(i[1]*e*s[1]*r)]),a.bind(t),a.unbind(t)},renderTarget:a,scale:s};return this.modules.renderer.addFramebuffer(l)}getMapMeshScale(e){return[Math.min(1.3,Math.min(this.webglContextState.MAX_TEXTURE_SIZE,this.webglContextState.MAX_VIEWPORT_DIMS[0])/e[0]),Math.min(2,Math.min(this.webglContextState.MAX_TEXTURE_SIZE,this.webglContextState.MAX_VIEWPORT_DIMS[1])/e[1])]}prepareExternalShaderDefinitions(){const e=[];return this.modules.environmentManager.isFogEnabled()&&e.push({type:"FOG"}),this.modules.environmentManager.isSkyEnabled()&&e.push({type:"SKY"}),this.modules.shadowManager.texture&&e.push({type:"RENDER_SHADOWS"}),this.state.disableAntiAliasing||e.push({type:Zn.TAA}),zn(this._gl)&&e.push({type:"DEPTH_TEXTURE_SHADOW"}),Qe.createShaderDefinitions(e)}}function Oa(e,t){for(const i of t)if((0,Ni.M4)(e,i))return!0;return!1}Fa.webglVersion=NaN;var Da=i(1375);class Ba{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 De([{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,Ge.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=R.al(e[0]-t.left,e[1]-t.top),n=this.state.identifyPickDistance*window.devicePixelRatio;let o,r=1/0,s=!1;const a=R.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(s&&!t)continue;const n=R.TE(i,a);(!o||!s&&t||e.phase>o.phase||e.phase===o.phase&&n<r)&&(o=e,r=n,t&&(s=!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),r=4*((i[1]-1-Math.floor(e[1]*t))*i[0]+o),s=(this.colorBuffer[r+3]<<24|this.colorBuffer[r+2]<<16|this.colorBuffer[r+1]<<8|this.colorBuffer[r])>>>0;return this.indexToIdentifierResponse(s)}fillCache(){const e=this.modules.tileManager.getTileObjects();this.modules.renderer.renderIdentify(e),this.colorBuffer=this.modules.renderer.readIdentifyPixels();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 r=this.identifyData[o],{dynamicObjectId:s,ids:a,metatileHash:l,sourceId:d,tileKey:c}=r,{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 S=e-h,I=4*S*2;if(m.byteLength<I)return void 0;const M=new Uint32Array(m,I,2),T=new Uint32Array(_)[S],E=new Uint8Array(y)[S],P=new Uint32Array(b)[S];let L,A,C="";const z=new Uint32Array(f,4*S*2,2);z[0]===ji.gl&&z[1]===ji.gl||(A=(0,D.Ru)(z[0],z[1]));const k=this.modules.assetManager.getMetatile(l);if(k){(null===(t=k.reverseDictionaries.db_sublayer)||void 0===t?void 0:t[T])&&(L=k.reverseDictionaries.db_sublayer[T]);const o=x[e];C=void 0!==o?o.objectClass:null!==(n=null===(i=null==k?void 0:k.reverseDictionaries.db_object_class)||void 0===i?void 0:i[P])&&void 0!==n?n:""}const R=new Uint16Array(v)[S],F=new Uint32Array(g)[S],O=this.modules.styleManager.getStyleLayer(R,F);if(!O||"custom"===O.type)return;const B=new Int32Array(w,S*Int32Array.BYTES_PER_ELEMENT*2,2);return{id:(0,D.Ru)(M[0],M[1]),layerId:F,floorId:A,phase:new Float32Array(p)[S],dynamicObjectId:s,sourceId:d,tileKey:c,sublayer:L,symbol:O.type,instanceId:E,objectClass:C,center:B[0]!==ot.Cd||B[1]!==ot.Cd?[B[0],B[1]]:void 0}}}}var ja=i(6479);function Na(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 Ua(e,t="image/png"){const i=new Blob([e],{type:t}),n=URL.createObjectURL(i),o=document.createElement("img");return new Promise((t=>{o.onload=()=>{URL.revokeObjectURL(n),t(o)},0===e.byteLength?o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=":o.src=n}))}function Va(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 Ga=i(3487),Ha=i(4576),Za=i(4847);class Wa extends Za.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 Xa=i(2627),Ka=i(1284);function qa(e){const t=new Ka.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 $a=i(199);function Ya(e,t,i){const{map:{state:n},collector:o,imageManager:r,renderer:s,tileManager:a,modelsScene:l}=i;let d;try{d=function(e,t,i){const n=(0,K.jJ)(e.styleZoom,e.styleState,[]),o=t.style.color,r=[];if(s=o.argument,"object"!=typeof s||"heatmap-density"!==s.type)throw new Error(`Heatmap color must be interpolate expression with 'heatmap-density' argument in layer ${t.id}`);var s;const a=i-1;for(let e=0;e<i;e++){const t=e/a,i=(0,K.o4)(o,t,n);r.push(...i.value)}return new $e(new Uint8Array(r),{size:[i,1]})}(n,e,256)}catch(e){return void console.error(e)}const c=r.addPreparedTexture(d),h=s.getRenderingContext(),{downscale:u}=e.style,{size:m}=n,f=new Ye({size:[Math.ceil(m[0]*window.devicePixelRatio/u),Math.ceil(m[1]*window.devicePixelRatio/u)],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping}),p=f.getTexture();if(!p)return void console.error("Can't init HeatMap Layer. Missing FrameBuffer texture");const _=r.addPreparedTexture(p),v=s.addFramebuffer({renderTarget:f,clearColor:[0,0,0,0],onResize:()=>{f.setSize([Math.ceil(n.size[0]*window.devicePixelRatio/u),Math.ceil(n.size[1]*window.devicePixelRatio/u)]),f.bind(h),f.unbind(h);const e=f.getTexture();e&&r.updatePreparedTexture(_,e)}});(0,G.XI)({collector:o,generator:At.B.generateTexture,args:[t,e,_,c]});const g=o.getAccumulatedData(),y=new F.W("dynamicObject",g.data,s,l,n);return a.addObject(y),o.reset(),e.framebufferId={framebuffer:v},e=>{a.removeObject(y),y.clean(e),r.deleteTexture(_),r.deleteTexture(c),s.removeFramebuffer(v)}}class Ja{constructor(e){this.modules=e,this.customLayers=new Map,this.maxCountStyleLayers=1e4,this.styleIndex=1,this.handyStylesMap=new Map,this.waitingStyleRequests=new Map,this.onRemoveLayerHooks=new Map}createStyle(e,t,i,n){const{state:o}=this.modules.map;if(!Number.isNaN(o.handyStyleId)){const e=this.getStyle(o.handyStyleId);e&&(e.layers.forEach((e=>{const t=this.onRemoveLayerHooks.get(e.innerId);t&&t(o)})),this.onRemoveLayerHooks.clear())}const r=this.styleIndex++,s=(0,W.Cp)(e,r,i,n);(0,j.As)(s,t),this.handyStylesMap.set(s.id,s),this.setMaxLayersCount(s.layers.length);const a=this.waitingStyleRequests.get(r);return a&&a.resolve(s),this.modules.workers.syncStyle(s),s.layers.forEach((e=>this.initHandyLayer(r,e))),s}hasLayer(e){const t=this.getStyle(this.modules.map.state.handyStyleId);return void 0!==(null==t?void 0:t.layerIdToInnerId[e])}addLayer(e,t){const i=this.getStyle(this.modules.map.state.handyStyleId);if(!i)return void console.error('Cannot add layer before map style was completely set. Please use "styleload" event.');const n=(0,W.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 r=Object.values(t.groupsById).find((e=>e&&e.id===i));if(r)o=t.layers.findIndex((e=>e.groupId===r.innerId));else{o=t.layers.findIndex((e=>e.id===i));const r=null===(n=t.layers[o])||void 0===n?void 0:n.groupId;if(void 0!==r&&"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 «${r}». 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 r=[];if("group"!==e.type){r=[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,$n.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,$n.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,r=e.layers;t.revision++,t.layers.splice(o,0,...r),r.forEach((e=>{if(t.layersById[e.innerId]=e,t.layerIdToInnerId[e.id]=e.innerId,"point"===e.type||"polygon"===e.type||"metricPoint"===e.type||"embankment"===e.type){const i=Math.max(0,...Object.keys(t.rasterSets.byIndex).map((e=>Number(e)))),n=new Ka.x(i+1);(0,W.z8)(e,n).forEach((e=>{t.rasterSets.byKey[e.key]||(t.rasterSets.byIndex[e.index]=e,t.rasterSets.byKey[e.key]=e)}))}})),qa(t)}(n,i,t),this.setMaxLayersCount(i.layers.length),"custom"===e.type&&"custom"===n.type?this.initCustomLayer(i.id,n,e.render,e.onRemove,e.onAdd):this.initHandyLayer(i.id,n),this.modules.workers.syncStyle(i))}setTerrainStyle(e){const t=this.getStyle(this.modules.map.state.handyStyleId);t&&(t.dem=(0,W.vR)(e),this.modules.demManager.onTerrainStyleChange(),this.modules.renderer.addRerenderEvent())}addIcon(e,t){const i=this.getStyle(this.modules.map.state.handyStyleId);if(!i)return console.error('Cannot add icons before map style was completely set. Please use "styleload" event.'),!1;const n=i.layers.filter((t=>("point"===t.type||"metricPoint"===t.type)&&void 0!==t.style.iconImage&&(0,K.EG)(t.style.iconImage).some((t=>t===e)))),o=i.layers.filter((t=>("polygon"===t.type||"embankment"===t.type)&&Boolean(t.style.textureImage)&&(0,K.EG)(t.style.textureImage).some((t=>t===e))));if(Boolean(i.icons[e]))return console.error(`The icon with the name ${e} already exists.`),!1;const r=Math.max(0,...Object.keys(i.rasterSets.byIndex).map((e=>Number(e)))),s=new Ka.x(r+1);return[...n,...o].forEach((t=>{const{imageType:n,anchor:o}=(0,W.Jn)(t),r=(0,W.Wy)(e,n,s,o);i.rasterSets.byIndex[r.index]=r,i.rasterSets.byKey[r.key]=r})),i.icons[e]=t,i.revision++,this.modules.workers.syncStyle(i),!0}removeIcon(e){const t=this.getStyle(this.modules.map.state.handyStyleId);if(!t)return console.error('Cannot remove icons before map style was completely set. Please use "styleload" event.'),!1;delete t.icons[e];let i=!1;return t.layers.filter((e=>"point"===e.type&&Boolean(e.style.iconImage)||"polygon"===e.type&&Boolean(e.style.textureImage)||"metricPoint"===e.type&&Boolean(e.style.iconImage)||"embankment"===e.type&&Boolean(e.style.textureImage))).forEach((n=>{const{image:o,imageType:r,anchor:s}=(0,W.Jn)(n);(0,K.EG)(o).forEach((n=>{if(n===e){const e="icon"===r?(0,Co.PR)(n,s[0],s[1]):(0,Co.FD)(n),o=t.rasterSets.byKey[e];o&&(this.modules.assetManager.removeRasterSet(o,t.id),i=!0)}}))})),!!i&&(t.revision++,this.modules.workers.syncStyle(t),!0)}addModel(e,t){const i=this.getStyle(this.modules.map.state.handyStyleId);if(!i)return console.error('Cannot add models before map style was completely set. Please use "styleload" event.'),!1;return void 0!==i.modelIndex[e]?(console.error(`The model with the name ${e} already exists.`),!1):(i.models.push(t),i.modelIndex[e]=i.models.length-1,i.revision++,this.modules.workers.syncStyle(i),!0)}removeLayer(e){const t=this.getStyle(this.modules.map.state.handyStyleId);t?$a.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 r=t.groupsById[n];if(r){if(o=r.layers,delete t.groupsById[n],delete t.layerIdToInnerId[r.id],0===o.length)return}else{const i=t.layersById[n];if(!i)return void(0,$n.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 s=t.layers.findIndex((e=>e.id===o[0].id));-1!==s&&(o.forEach((e=>{const{styleManager:n,map:{state:o}}=i,r=n.getRemoveLayerHook(e.innerId);r&&(r(o),n.clearRemoveLayerHook(e.innerId)),delete t.layersById[e.innerId],delete t.layerIdToInnerId[e.id]})),t.layers.splice(s,o.length),qa(t))}(e,t,this.modules),this.modules.workers.syncStyle(t)):console.error('Cannot remove layer before map style was completely set. Please use "styleload" event.')}setDynamicStyle(e){this.handyStylesMap.set(Z.jf,e),this.modules.workers.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}getMaxLayersCount(){return this.maxCountStyleLayers}getStyleLayerForObject(e){const t=this.getStyle(e.attributes.styleId);return t?t.layersById[e.attributes.layerId]:null}update(){const e=this.getStyle(this.modules.map.state.handyStyleId);e&&(e.light.lightingModesResolved=(0,K.Oh)(e.light.lightingModes,(0,K.jJ)(this.modules.map.state.styleZoom,this.modules.map.state.styleState,[],!1)))}initHandyLayer(e,t){let i;switch(t.type){case"group":return void t.layers.forEach((t=>this.initHandyLayer(e,t)));case"heatmap":i=Ya(t,e,this.modules)}i&&this.modules.styleManager.addRemoveLayerHook(t.innerId,i)}setMaxLayersCount(e){this.maxCountStyleLayers<e&&(this.maxCountStyleLayers=e)}initCustomLayer(e,t,i,n,o){const r={sceneObject:{type:nt.H.Custom,attributes:{styleId:e,layerId:t.innerId,tileData:[]},tile:{zoomLevel:0},layerSettings:{},canRender:!0},layer:t,renderFunction:i};null==o||o(),this.customLayers.set(t.innerId,r),this.modules.styleManager.addRemoveLayerHook(t.innerId,(()=>{null==n||n(),this.customLayers.delete(t.innerId)}))}}var Qa=i(4619);const el=new Set(["position","texcoord_0","texcoord_1","texcoord_2","texcoord_3","normal","tangent"]);class tl extends F.Y{constructor(){super("model"),this.children=[],this.identifyChildren=[],this.depthTestChildren=[],this.shadowChildren=[]}setTileCoords(e){throw new Error("GLTF tile object does not support setting coordinates")}syncReplicas(e){}}function il(e,t,i,n,o){return nl(e,i.scenes[i.scene].nodes,i,[],t,n,o),e}function nl(e,t,i,n,o,r,s){var a,l,d,c,h;if(!t)return;const u=o.symbolSettingsList.gltfModel.fill;if(u&&0!==u.length)for(const m of t){const t=i.nodes[m];if(t.matrix&&n.push(t.matrix),t.translation&&t.rotation&&t.scale){const e=qe.Ue();qe.Iw(e,t.rotation,t.translation,t.scale),n.push(e)}if(void 0!==t.mesh){const m=i.meshes[t.mesh],f=new tl;f.modelMatrices.set(0,sl(n)),e.objects.push(f);for(const t of m.primitives){const n=[],m={};let p,_=0;for(const o in t.attributes){const r=/TEXCOORD_(\d+)/.exec(o);r&&(n[parseInt(r[1],10)]=!0);const s=o.toLowerCase();if(!el.has(s)){0;continue}const d=t.attributes[o],c=i.accessors[d];if(void 0===c.bufferView)continue;const h=i.bufferViews[c.bufferView];if(void 0===h)continue;const u=rl(e,i,c.bufferView,c.componentType);u&&(m[o.toLowerCase()]=new Et.K(u,{itemSize:al(c.type),dataType:dl(c.componentType),stride:null!==(a=h.byteStride)&&void 0!==a?a:0,offset:null!==(l=c.byteOffset)&&void 0!==l?l:0,normalized:!!c.normalized}),0===_&&(_=c.count))}if(void 0!==t.indices){const n=i.accessors[t.indices];if(void 0===n.bufferView)continue;if(p=rl(e,i,n.bufferView,n.componentType,!0),!p)continue;_=n.count}if(void 0===t.material)continue;const v=i.materials[t.material];if(!v)continue;if(void 0===v.pbrMetallicRoughness)continue;const g={styleId:NaN,layerId:NaN,colorTexture:NaN,aoTexture:NaN,pbrTexture:NaN,modelId:r,tileData:[]},y={},b=v.pbrMetallicRoughness.baseColorTexture;if(void 0===b)continue;y.texcoord_color=`texcoord_${null!==(d=b.texCoord)&&void 0!==d?d:0}`,ol(e,i,b),g.colorTexture=b.index;const w=[];if(v.pbrMetallicRoughness){const t=v.pbrMetallicRoughness.metallicRoughnessTexture;if(t){w.push({type:"PBR_TEXTURE"}),ol(e,i,t),g.pbrTexture=t.index;const o="number"==typeof t.texCoord?t.texCoord:0;y.texcoord_pbr=`texcoord_${o}`,n[o]=!1}else g.roughness=null!==(c=v.pbrMetallicRoughness.roughnessFactor)&&void 0!==c?c:1,g.metallic=null!==(h=v.pbrMetallicRoughness.metallicFactor)&&void 0!==h?h:1;Number.isNaN(s.style.roughness)||w.push({type:"METALLIC_ROUGHNESS_DEBUG"})}else g.roughness=.9,g.metallic=0;"pbr"===s.style.lightingModel?w.push({type:Vs,value:"2"}):w.push({type:Vs,value:"1"});const x=v.occlusionTexture;if(x){w.push({type:"AO_TEXTURE"}),ol(e,i,x),g.aoTexture=x.index;const t="number"==typeof x.texCoord?x.texCoord:0;y.texcoord_ao=`texcoord_${t}`,n[t]=!1}const S=o.getShaderProgram("gltfModel"),I=new Pt(S,m,p);I.setAttributesAliases(y);for(const e of u){let i=f.children;e.identify?i=f.identifyChildren:e.depthTest?i=f.depthTestChildren:e.shadow&&(i=f.shadowChildren),i.push({id:(0,z.f)(),type:nt.H.Tile,layerSettings:e,stride:1,rangeStart:0,rangeEnd:_,attributes:g,attributesHash:JSON.stringify(g),drawMode:t.mode,vao:I,tile:f,symbol:"gltfModel",sink:"fill",meta:{availableTextureCoords:n},canRender:!0,shaderDefinitions:Qe.createShaderDefinitions(w)})}}}t.children&&nl(e,t.children,i,n,o,r,s)}}function ol(e,t,i){var n;const o=null!==(n=i.index)&&void 0!==n?n:0,r=t.textures[o];if(!r||void 0===r.source||void 0===r.sampler)return;const s=t.images[r.source],a=t.samplers[r.sampler];if(!a||!s)return;const l={flipY:!1};a.magFilter&&(l.magFilter=cl(a.magFilter)),a.minFilter&&(l.minFilter=cl(a.minFilter)),a.wrapS&&(l.wrapS=cl(a.wrapS)),a.wrapT&&(l.wrapT=cl(a.wrapT)),void 0!==i.texCoord&&(l.texcoord=i.texCoord),s.image||!s.bufferView?e.textures[o]=new $e(s.image,l):function(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){if(!t.bufferView)return!1;const i=e.bufferViews[t.bufferView];if(void 0===i)return!1;const n=e.buffers[i.buffer].buffer;return!!n&&Ua(new Uint8Array(n,i.byteOffset,i.byteLength),t.mimeType)}))}(t,s).then((t=>{t&&(s.image=t,e.textures[o]=new $e(s.image,l))}))}function rl(e,t,i,n,o=!1){const r=t.bufferViews[i];if(void 0!==r){if(!e.buffers[i]){const s=t.buffers[r.buffer].buffer;if(!s)return;const a=new DataView(function(e){if(e instanceof ArrayBuffer)return e;return e.buffer}(s),r.byteOffset,r.byteLength),l=new Tt.l(a,{dataType:dl(n)});l.type=o?Tt.l.ElementArrayBuffer:Tt.l.ArrayBuffer,e.buffers[i]=l}return e.buffers[i]}}function sl(e){if(0===e.length)return qe.Ue();const t=qe.d9(e[0]);for(let i=1;i<e.length;i++)qe.dC(t,t,e[i]);return t}function al(e){switch(e[0]){case"S":return 1;case"V":return Number(e[3]);case"M":return Math.pow(Number(e[3]),2)}return console.error(`Failed to determine channels count from accessor type = ${e}`),0}const ll=window.WebGLRenderingContext;function dl(e){if(void 0===e)return;const t={[ll.UNSIGNED_BYTE]:Tt.l.UnsignedByte,[ll.UNSIGNED_SHORT]:Tt.l.UnsignedShort,[ll.UNSIGNED_INT]:Tt.l.UnsignedInt,[ll.BYTE]:Tt.l.Byte,[ll.SHORT]:Tt.l.Short,[ll.INT]:Tt.l.Int,[ll.FLOAT]:Tt.l.Float}[e];return void 0===t?(console.error(`Cannot translate ${e} gltf componentType`),NaN):t}function cl(e){if(void 0===e)return;const t={[ll.CLAMP_TO_EDGE]:$e.ClampToEdgeWrapping,[ll.REPEAT]:$e.Repeat,[ll.MIRRORED_REPEAT]:$e.MirroredRepeat,[ll.NEAREST]:$e.NearestFilter,[ll.NEAREST_MIPMAP_NEAREST]:$e.NearestMipMapNearestFilter,[ll.NEAREST_MIPMAP_LINEAR]:$e.NearestMipMapLinearFilter,[ll.LINEAR]:$e.LinearFilter,[ll.LINEAR_MIPMAP_NEAREST]:$e.LinearMipMapNearestFilter,[ll.LINEAR_MIPMAP_LINEAR]:$e.LinearMipMapLinearFilter,[ll.RGBA]:$e.RgbaFormat,[ll.ALPHA]:$e.AlphaFormat,[ll.RGB]:$e.RgbFormat,[ll.UNSIGNED_BYTE]:$e.UnsignedByte,[ll.FLOAT]:$e.Float}[e];return void 0===t?(console.error(`Failed to translate texture parameter ${e}`),NaN):t}class hl{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 ul extends hl{constructor(e,t){super(),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.modelsWorker=new this.modules.workers.models.ModelsSource,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 Ga.c,this.requestFontRanges=new Ga.c,this.pendingFontRanges=0,this.loadedFontRanges=0,this.models={},this.dataModelIdToUrl={},this.visibleBuildingIds=new Set,this.metatileLoader=(e,t,i)=>{const n=(0,L.GG)(t);fetch(e).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,L.nF),this.setPreparedMetatile(ot.L2,(0,Qa.X4)()),this.metatiles[ot.DL]=new Wa(i)}fillDataModelUrlMap(e){for(const t in e)this.dataModelIdToUrl[e[t]]=t}getDataModelUrlById(e){return this.dataModelIdToUrl[e]}loadMetatile(e,t,i){this.requestedMetatiles.has(t)||(this.requestedMetatiles.add(t),this.metatileLoader(e,t,i))}setMetatile(e,t,i){(0,Xa.lG)(i),i.tileProps=i.tileProps.map(Xa.dx);const n=(0,L.ev)(i);this.setPreparedMetatile(e,n),void 0===this.projectMetatileMetadata&&(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 r=this.modules.styleManager.getStyle(e);if(!r)return void console.error(`Not found style ${e} in AssetManager#prepareRasters`);const{rasterSets:s}=r,a=this.modules.renderer.getRenderingContext(),l=t.length/7;for(let e=0;e<l;e++){const l=t[7*e],d=t[7*e+1],c=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=s.byIndex[l];if(p.isSvg){const e={rasterIndex:d,rasterSetIndex:l,x:h,y:u,w:m,h:f,anchorX:p.anchorX,anchorY:p.anchorY,atlasIndex:c,isPacked:!0};p.rasters[d]=e,null===(o=null===(n=this.requestedSvgs[r.id])||void 0===n?void 0:n[l])||void 0===o||o.then((t=>{const i=this.textures[e.atlasIndex];Na(t,e.w,e.h).then((t=>{i.subImage(a,t,e.x,e.y),this.modules.renderer.addRerenderEvent()}))}))}else{const e=p.rasters[d];e.x=h,e.y=u,e.atlasIndex=c,e.isPacked=!0}void 0===this.textures[c]&&(this.textures[c]=new $e(void 0,{size:T.atlasSize,flipY:!1,premultiplyAlpha:!Ce||!p.isSvg,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter}).prepare(this.modules.renderer.getRenderingContext()));const _=this.textures[c],v=i&&i[e];void 0===v||(_.subImage(a,v,h,u),this.modules.renderer.addRerenderEvent())}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],r=n<<16|o,s=this.modules.styleManager.getStyle(t);if(!s){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(r))continue;const{rasterSets:a}=s,l=a.byIndex[n];!1!==l.rasters[o].isPacked?(this.requestedRasters[t].add(r),l.isSvg?this.loadSvg(r,s,n):this.loadPng(r,s,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,r;const s=e<<16|i;null===(n=this.loadedRasters[t])||void 0===n||n.delete(s),null===(o=this.failedRasters[t])||void 0===o||o.delete(s),null===(r=this.requestedRasters[t])||void 0===r||r.delete(s)})),e.rasters.length=0;const r=this.modules.styleManager.getStyle(t);r&&(delete r.rasterSets.byIndex[n],delete r.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&&this.allModelsLoaded()}dangerouslySetMetatiles(e){this.metatiles=e}dangerouslySetRasters(e,t){this.loadedRasters=e,this.failedRasters=t}loadModelByIndex(e,t){const i=this.getModelUniqueKey(e);if(void 0!==this.models[i])return;const n=this.modules.styleManager.getStyle(this.state.handyStyleId);if(void 0===n)return void(0,$n.$z)({layer:"prepare",message:"Style not found. Can't determine url"});const o=n.models[e];if(void 0===o)return void(0,$n.$z)({layer:"prepare",message:`Model with index "${e}" is missing in the style.`});const r=(0,j.gA)(o.url,n);this.fetchModel(r,e,i,!1,t)}loadModel(e,t,i,n,o){const r=this.getModelUniqueKey(t);void 0===this.models[r]?this.fetchModel(e,t,r,i,n,o):null==o||o()}getModel(e){return this.models[this.getModelUniqueKey(e)]}allModelsLoaded(){for(const e in this.models)if("pending"===this.models[e].status)return!1;return!0}isModelLoaded(e){const t=this.models[this.getModelUniqueKey(e)];return t&&t.objects.length>0}invalidateUsedGltfModels(){const e=new Set,t=this.modules.tileManager.getTileObjects();for(const i of t)for(const t of i.children){if(!(0,na.OB)(t))continue;const i=this.modules.styleManager.getStyleLayer(t.attributes.styleId,t.attributes.layerId);if(!i||"gltfModel"!==i.type)continue;const n=this.modules.modelsScene.getCurrentLayerModelId(t);t.attributes.modelIndices.forEach((t=>{const o=this.getModel(t);if(o)e.add(o);else if(n===t){const e=this.dataModelIdToUrl[t];e?this.loadModel(e,t,!1,i):this.loadModelByIndex(t,i)}}))}for(const t in this.models){const i=this.models[t];!i.preserve&&!e.has(i)&&i.buffers.length>0&&this.removeModel(t)}}removeModel(e){const t=this.models[e];t&&(t.objects.forEach((e=>e.clean(this.state))),delete this.models[e])}fetchModel(e,t,i,n,o,r){const s=this.models[i]=function(e){return{buffers:[],objects:[],textures:[],status:"pending",preserve:e}}(n);this.modelsWorker.loadModel(e).then((e=>{if("ok"===e.type){if(s.status="loaded",!e.result)return;il(s,this.modules.renderer,e.result,t,o),this.emit("modelloaded",t),this.modules.renderer.addRerenderEvent(),null==r||r()}else(0,$n.$z)(e),s.status="failed"}))}getModelUniqueKey(e){return e>=0?`${this.state.handyStyleId},${e}`:String(e)}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((0,j.fb)(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 ${ot.Uo}`),fetch((0,j.fb)(ot.Uo,t,n)).then((e=>{if(!e.ok)throw new Error(`Could not load default font ${ot.Uo} for range ${t}`);return e}))))).then((e=>e.arrayBuffer())),r=(0,Ha.Xq)(o);return this.prepareFontAtlas(e,t,r),this.modules.workers.labeling.appendFont(e,r.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:r,glyphData:s}=i;this.fontGlyphs[e]||(this.fontGlyphs[e]={});for(const t in s)this.fontGlyphs[e][t]=s[t];const a=new $e(new Uint8Array(n),{size:[o,r],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,format:$e.AlphaFormat,premultiplyAlpha:!1,flipY:!1});this.fontTextures.set(e,t,a),this.state.needLabeling=!0}loadPng(e,t,i,n){const o=this.modules.renderer.getRenderingContext(),{rasterSets:r}=t,s=r.byIndex[i],a=s.rasters[n],l=this.textures[a.atlasIndex];let d="";if(s.type===ja.f.Unique){const e=(0,D.Ak)(s.id);d=s.url?(0,j.U0)(s.url,a.w,a.h):(0,P.Gr)("dynamicPoi",{host:this.state.tileServer,tileSet:this.state.tileSet,protocol:this.state.tileProtocol,subdomain:(0,P.Sy)(this.state.subdomains,e),id:e,width:a.w.toString(),height:a.h.toString(),regionId:String(s.regionId)})}else if(s.type===ja.f.Static){const i=t.icons[s.name];if(!i)return console.error(`There is no appropriate icon config in the style for raster set: "${s.name}"`),void this.failedRasters[t.id].add(e);d=(0,j.bX)(i.url,t,(0,P.Sy)(this.state.subdomains,s.name))}this.modules.workers.parser.prepareAtlas(d).then((i=>{i?(i.isBitmap?(l.subImage(o,i.data[0],a.x,a.y),this.modules.renderer.addRerenderEvent()):Ua(i.data[0]).then((e=>{l.subImage(o,e,a.x,a.y),this.modules.renderer.addRerenderEvent()})),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)return console.error(`Attempt to load svg without existing style for raster set: "${o.name}"`),void this.failedRasters[t.id].add(e);const r=t.icons[o.name];if(!r)return console.error(`There is no appropriate icon config in the style for raster set: "${o.name}"`),void this.failedRasters[t.id].add(e);const s=(0,j.bX)(r.url,t,(0,P.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(s,{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];Na(i,e.w,e.h).then((i=>{t.subImage(n,i,e.x,e.y),this.modules.renderer.addRerenderEvent()}))}this.loadedRasters[t.id].add(e)})).catch((i=>{console.error(`Can't load an SVG for the "${o.name}" raster set. Error: `,i),this.failedRasters[t.id].add(e)}))}}var ml=i(3429),fl=i(6757);class pl{constructor(e,t,i,n,o,r,s,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=r,this.styleId=s,this.styleRevision=a,this.modelRevision=n.revision,this.objects=[]}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.objects=function(e,t){var i,n;const o=new vl(e,t),r=[],s=_l(null!==(n=null!==(i=o.children[0])&&void 0!==i?i:o.identifyChildren[0])&&void 0!==n?n:o.depthTestChildren[0]);s&&["children","identifyChildren","depthTestChildren"].forEach((e=>{var i;const n=null!==(i=o.modelMatrices.get(0))&&void 0!==i?i:qe.Ue();qe.JG(n,s),o.modelMatrices.set(0,n);let a=o[e].length;for(;a--;){const i=o[e][a],s=_l(i);if(!s)continue;if(qe.I6(n,s))continue;let l=r.find((e=>{const t=e.modelMatrices.get(0);return!!t&&qe.I6(t,s)}));l||(l=new vl([],t),l.modelMatrices.set(0,qe.JG(qe.Ue(),s)),r.push(l)),l[e].push(i),i.tile=l,o[e].splice(a,1)}}));return[o,...r]}(e,this.modules.renderer),this.updateMinAndMaxStyleZoom(this.objects),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.objects.length&&(this.objects.forEach((e=>e.clean(this.mapState))),this.objects=[]),this.ready=!1}canBeRemoved(){return"initial"===this.status}loadModel(){const{model:{regionId:e,metatileHash:t,id:i,sourceModel:{fileName:n,matrix:o,offset:r}}}=this,s=(0,D.IL)(i),a={url:(0,P.Gr)("model",{host:this.mapState.tileServer,tileSet:this.mapState.tileSet,protocol:this.mapState.tileProtocol,subdomain:(0,P.Sy)(this.mapState.subdomains,n),regionId:e.toString(),name:n}),id:s,regionId:e,metatileHash:t,selected:this.selectedIds.some((e=>(0,D.v7)(e,s))),pixelRatio:window.devicePixelRatio,styleState:this.mapState.styleState,styleId:this.mapState.handyStyleId,offset:r,matrix:o};this.modules.defaultSource.generateModel(a).then((e=>{this.model.prepareTextures(e.textures),this.processResponse=e}))}updateMinAndMaxStyleZoom(e){this.minStyleZoom=Math.min(...e.map((e=>Math.min(...e.children.map((e=>{var t;const i=this.modules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);return"dem"===(null==i?void 0:i.type)?1/0:null!==(t=null==i?void 0:i.minzoom)&&void 0!==t?t:-1/0})))))),this.maxStyleZoom=Math.max(...e.map((e=>Math.max(...e.children.map((e=>{var t;const i=this.modules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);return"dem"===(null==i?void 0:i.type)?-1/0:null!==(t=null==i?void 0:i.maxzoom)&&void 0!==t?t:1/0}))))))}}function _l(e){if(e&&"matrix"in e.attributes)return e.attributes.matrix}class vl extends F.Y{constructor(e,t){super("model");const{buffers:i,objects:n,identifyObjects:o,depthTestObjects:r,shadowObjects:s}=(0,fl.B)(t,e,this);this.buffers=i,this.children=n,this.identifyChildren=o,this.depthTestChildren=r,this.shadowChildren=s,this.size=(0,H.aq)(this.coords[2]),this.zoomLevel=this.coords[2],this.detailLevel=this.coords[3]}setTileCoords(e,t){}syncReplicas(e){}}class gl{constructor(e,t,i,n,o,r){this.modules=e,this.mapState=t,this.cache=i,this.regionId=n,this.metatileHash=o,this.sourceModel=r,this.revision=0,this.texturesLoaded=!1,this.textures=[],this.readiness=0,this.id=r.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(),$.Vx(this.readinessTickerName,{step:(e,t)=>this.readiness=t},this.mapState)}isAnimating(){return $.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,D.IL)(this.id),n=this.mapState.selectedIds.filter((e=>(0,D.v7)(e,i)));if(this.currentMod||this.newMod){if(this.currentMod){if((0,D.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,D.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 $e(e,{flipY:!1}))),this.texturesLoaded=!0,this.startReadinessTicker()):Promise.all(e.data.map((e=>Ua(e)))).then((e=>{this.textures=e.map((e=>new $e(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 r=t.map((e=>`${e.lo},${e.hi}`)).join("|");return`model=${e}_sId=${i}_sRev=${n}_mRev=${o}_sel=${r}`}(this.id,e,t,i,n),r=this.cache.get(o);r?(this.newMod=r,this.newMod.useful=!0):this.newMod=new pl(this.modules,this.mapState,this.cache,this,o,e,t,i)}startReadinessTicker(){this.readiness=0,$.BL(this.readinessTickerName,{easing:T.buildingAnimation.easing},this.mapState,0,1,T.buildingAnimation.duration)}stopReadinessTicker(){this.readiness=0,$.sT(this.readinessTickerName,this.mapState)}}class yl{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.hiddenBuildingIds=new Set,this.cache=new ml.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=>{"zenith"===e.type&&e.serverMetadata&&e.serverMetadata.forEach((t=>{const i=this.modules.sourceStorage.getSourceById(e.sourceId);if(void 0!==i&&"getUrl"in i){const e=i.getUrl("modelInfo",{regionId:t.regionId.toString()});this.loadModelsInfo(e,t.regionId,t.metatileHash)}else{const e=(0,P.Gr)("modelInfo",{host:this.mapState.tileServer,tileSet:this.mapState.tileSet,protocol:this.mapState.tileProtocol,subdomain:this.mapState.subdomains[0],regionId:t.regionId.toString()});this.loadModelsInfo(e,t.regionId,t.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(),this.updateObjectsVisibility()}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:r}=this.mapState;return r<n||r>=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}))}setHiddenBuildingIds(e){e.forEach((e=>{this.hiddenBuildingIds.add(e)}))}unsetHiddenBuildingIds(e){e.forEach((e=>{this.hiddenBuildingIds.delete(e)}))}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;if(this.hiddenBuildingIds.has(t.id))return;(0,Ni.M4)(this.mapState.extendedTilesBounds,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.objects.length&&i.objects.forEach((e=>this.modules.tileManager.removeObject(e))),e=!0)})),t.forEach(((t,i)=>{this.displayedMods.has(i)||(t.objects.length&&t.objects.forEach((e=>this.modules.tileManager.addObject(e))),e=!0),this.cache.get(i)})),e&&(this.displayedMods=t,this.modules.renderer.addRerenderEvent(),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,i){this.requestedModelsInfo.has(t)||(this.requestedModelsInfo.add(t),fetch(e).then((e=>{if(!e.ok)throw new Error(`Failed to load models info for region ${t}`);return e.json()})).then((e=>{e.forEach((e=>{const n=new gl(this.modules,this.mapState,this.cache,t,i,e);this.models.set(n.id,n)})),this.loadedModelsInfo.add(t)})).catch((e=>{this.loadedModelsInfo.add(t),console.error(e)})))}updateObjectsVisibility(){this.models.forEach((e=>{var t;const i=(null===(t=this.getVisibleModelData(e.id))||void 0===t?void 0:t.opacity)||0;i>=.5&&!this.modules.map.state.hiddenObjects.other.has(e.id)?(this.modules.map.state.hiddenObjects.other.add(e.id),this.modules.map.state.objectsIdsToUpdate.add(e.id)):i<.5&&this.modules.map.state.hiddenObjects.other.has(e.id)&&(this.modules.map.state.hiddenObjects.other.delete(e.id),this.modules.map.state.objectsIdsToUpdate.add(e.id))}))}}var bl=i(7204),wl=i(2153);class xl{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 bl.c,this.currentTrafficState=!1,this.currentSelectedIds=[],this.currentModKey=Sl(this.currentTrafficState,this.currentSelectedIds)}setPersonalPoi(e){this.currentPois=e;const t=new bl.c;for(const i of e)t.add((0,D.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,r=this.modules.map.state;this.isGenerating=!0,this.modules.workers.parser.generatePersonalPoi(t,n,o,window.devicePixelRatio,r.selectedIds,r.handyStyleId,r.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:r}=i;void 0!==o&&this.modules.assetManager.prepareRasters(n,o),this.modules.assetManager.loadRasters(r),this.modCache.set(e,t),this.isGenerating=!1}))}show(e,t,i){const{metatileHash:n}=i,{collectorOutput:{labels:o,identifyIds:r},styleId:s}=t;this.modules.labeler.removeLabels("ppoi"),o.length&&this.modules.labeler.addLabels("ppoi",wl.AL.PersonalPoi,[{metatileHash:n,labels:o,styleId:s}]),this.identifyDataChunk={metatileHash:n,ids:r},this.modules.identifier.resetCache(),this.displayedModKey=e}updateModKey(){const e=(0,H.vX)(this.mapState.selectedIds,this.currentIdSet),t=this.modules.trafficTileLayer.isEnabled();(0,D.y5)(this.currentSelectedIds,e)&&this.currentTrafficState===t||(this.currentTrafficState=t,this.currentSelectedIds=e,this.currentModKey=Sl(t,e))}}function Sl(e,t){return`ppoi_${e}_${t.map((e=>`${e.lo},${e.hi}`)).join("|")}`}const Il=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(self))return self;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};Il.toString();var Ml="[\\.|\\-|\\+|\\w|/|@]+",Tl="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function El(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function Pl(e,t,n){var o={};o[n]=[];var r=t.toString(),s=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||r.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return o;for(var a,l=s[1],d=new RegExp("(\\\\n|\\W)"+El(l)+Tl,"g");a=d.exec(r);)"dll-reference"!==a[3]&&o[n].push(a[3]);for(d=new RegExp("\\("+El(l)+'\\("(dll-reference\\s('+Ml+'))"\\)\\)'+Tl,"g");a=d.exec(r);)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 c,h=Object.keys(o),u=0;u<h.length;u++)for(var m=0;m<o[h[u]].length;m++)c=o[h[u]][m],isNaN(1*c)||(o[h[u]][m]=1*o[h[u]][m]);return o}function Ll(e){return Object.keys(e).reduce(((t,i)=>t||e[i].length>0),!1)}function Al(e,t,i,n){let o=e[n].map((e=>`"${e}": ${t[n][e].toString()}`)).join(","),r=Il.toString().split("ENTRY_MODULE");return`${r[0]}{${o}}${r[1]}"${i}"${r[2]}`}function Cl(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:{}};Ll(i);)for(var r=Object.keys(i),s=0;s<r.length;s++){var a=r[s],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 d=Pl(e,e[a][l],a),c=Object.keys(d),h=0;h<c.length;h++)i[c[h]]=i[c[h]]||[],i[c[h]]=i[c[h]].concat(d[c[h]])}}return n}(n,e),r="";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__; })",r+=`var ${e} = (${Al(o,n,t,modules)})();\n`})),r+=`(${Al(o,n,e,"main")})();`;var s=new window.Blob([r],{type:"text/javascript"});if(t.bare)return s;var a=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(s),l=new window.Worker(a);return l.objectURL=a,l}var zl=i(7256),kl=i(4500),Rl=i(6892),Fl=i(4411),Ol=i(2176),Dl=i(603),Bl=i(8894);class jl{constructor(){this.connector=new zl.H,this.fnRegistry=new kl.J(this.connector),this.classRegistry=new Fl.Z(this.fnRegistry),this.parserWorker=Cl(2458),this.connector.addWorker(Rl.P.Parser,this.parserWorker),this.labelingWorker=Cl(4009),this.connector.addWorker(Rl.P.Labeling,this.labelingWorker),this.modelsWorker=Cl(6100),this.connector.addWorker(Rl.P.Models,this.modelsWorker),this.parser=function(e,t){return{setMetatile:e.get(Rl.P.Parser,"setMetatile"),generateFloor:e.get(Rl.P.Parser,"generateFloor"),loadFloor:e.get(Rl.P.Parser,"loadFloor"),prepareAtlas:e.get(Rl.P.Parser,"prepareAtlas"),packRasters:e.get(Rl.P.Parser,"packRasters"),fetchTrafficTile:e.get(Rl.P.Parser,"fetchTrafficTile"),deleteTrafficTile:e.get(Rl.P.Parser,"deleteTrafficTile"),abortTrafficTileRequest:e.get(Rl.P.Parser,"abortTrafficTileRequest"),generateTrafficTile:e.get(Rl.P.Parser,"generateTrafficTile"),generatePersonalPoi:e.get(Rl.P.Parser,"generatePersonalPoi"),syncStyle:e.get(Rl.P.Parser,"syncStyle"),GeoJsonSource:t.set("GeoJsonSource",Ol.T).get(Rl.P.Parser),ZenithSource:t.set("ZenithWorker",Dl.Z).get(Rl.P.Parser)}}(this.fnRegistry,this.classRegistry),this.labeling=function(e){return{setCommercialPoiRandomSeed:e.get(Rl.P.Labeling,"setComPoiRandomSeed"),appendFont:e.get(Rl.P.Labeling,"appendFont"),markFontAsLoaded:e.get(Rl.P.Labeling,"markFontAsLoaded"),addNewRasterSets:e.get(Rl.P.Labeling,"addNewRasterSets"),updatePackingInfo:e.get(Rl.P.Labeling,"updatePackingInfo"),syncStyle:e.get(Rl.P.Labeling,"syncStyle"),loadRtlPlugin:e.get(Rl.P.Labeling,"loadRtlPlugin"),markRtlPluginLoaded:e.get(Rl.P.Labeling,"markRtlPluginLoaded")}}(this.fnRegistry),this.models=function(e){return{ModelsSource:e.set("ModelsWorker",Bl.q).get(Rl.P.Models)}}(this.classRegistry)}syncStyle(e){this.parser.syncStyle(e),this.labeling.syncStyle(e)}destroy(){this.parserWorker.terminate(),this.labelingWorker.terminate(),this.modelsWorker.terminate()}}class Nl extends C.c{constructor(e,t){super(),this.fogFactorBreakpoint=.4,this.demElevation=0,this.demTilesRevision=NaN,this.options=(0,pe.kn)(t,Nl.options),this.uniqId=(0,z.f)(),this.labelKey=`html-${this.uniqId}`;const i=(0,A.yq)(this.options.coordinates);this.position={userValue:i,normalizedValue:(0,A.I0)(i)},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?Ul:Vl;let{offset:n}=this.options;const{labeling:o}=this.options;"none"!==o.type&&(void 0!==o.offset&&(n=o.offset),this.modules.labeler.addLabelBox(this.labelKey,{id:this.uniqId,width:o.width,height:o.height,position:this.position.normalizedValue,offset:n,labelingGroup:this.getLabelingGroup(),parentPoiId:"pinnedToPoi"===o.type?o.poiId:void 0}))}destroy(){this.removeHtml(),this.modules.labeler.removeLabels(this.labelKey),this.modules.layers.removeLayer(this)}update(){const e=this.checkZoom(),t=this.checkFog(),i=!this.isInvolvedInLabeling()||this.modules.labeler.isLabelBoxSurvived(this.uniqId);e&&t&&i?this.show():this.hide(),this.updatePosition()}setZIndex(e){this.options.zIndex=e,this.html.style.zIndex=String(e)}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){const t=(0,A.yq)(e);this.position={userValue:t,normalizedValue:(0,A.I0)(t)},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,A.PA)(this.position.userValue)}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}nearCenterScreenPosition(){var e,t;const i=this.modules.demManager,n=this.mapState;let o=0;if(n.demMode){const r=i.getTilesRevision();this.demTilesRevision!==r&&(this.demElevation=null!==(e=i.getElevation(this.position.normalizedValue))&&void 0!==e?e:0,this.demTilesRevision=r),o=(this.demElevation-(null!==(t=n.elevation)&&void 0!==t?t:0))*n.elevationScale}const r=this.mapState.visibleMapReplicas.map((e=>{const t=[this.position.normalizedValue[0]+ot.sX*e,this.position.normalizedValue[1],this.position.normalizedValue[2]+o*A.C];return this.modules.camera.project(t,!0)})),s=r.map((e=>Math.abs(this.mapState.size[0]/2-(isNaN(e[0])?-1/0:e[0]))));return r[s.findIndex((e=>e===Math.min(...s)))]}updatePosition(){const e=this.nearCenterScreenPosition();this.html.hidden=Number.isNaN(e[0]),this.rounder(e,e[0]+this.options.offset[0],e[1]+this.options.offset[1],this.mapState.stillness),R.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.position.normalizedValue,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}checkFog(){if(!this.modules.environmentManager.isFogEnabled())return!0;const{fogLimits:e}=this.modules.environmentManager,{fogDistance:t,position:i}=this.modules.camera,n=(this.position.normalizedValue[0]-i[0])/t,o=(this.position.normalizedValue[1]-i[1])/t,r=Math.sqrt(Math.pow(n,2)+Math.pow(o,2)),s=e[1]-e[0];return(0,pe.uZ)((r-e[0])/s,0,1)<this.fogFactorBreakpoint}isInvolvedInLabeling(){return"full"===this.options.labeling.type||"pinnedToPoi"===this.options.labeling.type}}Nl.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 Ul=(e,t,i,n)=>{const o=Math.round(t)-t,r=Math.round(i)-i;e[0]=t+n*o,e[1]=i+n*r},Vl=(e,t,i)=>{e[0]=t,e[1]=i};var Gl=i(4389);const Hl=ee.Ue();class Zl extends k{constructor(e,t){var i,n,o,r,s,a,l;super(e),this.options=t,this.vectors=this.options.coordinates.map((e=>e.map(A.yq))),this.bouncePosition=0,this.growPosition=1;const{tileManager:d,dynamicStyle:c,collector:h,layers:u,renderer:m,modelsScene:f}=this.modules,p=(0,W.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!==(r=this.options.borderWidth)&&void 0!==r?r:1,tipWidth:null!==(s=this.options.wingWidthMultiplier)&&void 0!==s?s: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(!p)return;c.addLayer(p,this.options.zIndex),this.layerId=p.innerId;const _=this.getTileInfo(),v=(0,Z.FJ)({id:[0,0]}),g=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,v,L.wz);(0,G.Eu)(p,g);for(let e=0;e<this.vectors.length;e++){const t=this.vectors[e],i=this.getVertices(t,_);v[L.Dz.id]=[e,0],(0,G.XI)({collector:h,generator:Gl.l.generate,args:[c.getStyle().id,p,g,i]})}const y=h.getAccumulatedData(),b=new F.W("dynamicObject",y.data,m,f,this.mapState,_.coords,this);if(this.tileObjects.push(b),d.addObject(b),this.identifyIds.push(y.identifyIds),this.options.animate){const e=`entrance-bounce-${this.uniqId}`,t=`entrance-grow-${this.uniqId}`;this.bounceTickerUpdate=$.Vx.bind(null,e,{step:(e,t)=>this.bouncePosition=t,complete:()=>{this.bounceTickerUpdate=void 0}},this.mapState),this.growTickerUpdate=$.Vx.bind(null,t,{step:(e,t)=>this.growPosition=t,complete:()=>{this.growTickerUpdate=void 0}},this.mapState),$.BL(e,{easing:T.entranceAnimation.bounceType},this.mapState,-1,0,T.entranceAnimation.bounceTime),$.BL(t,{easing:T.entranceAnimation.growType},this.mapState,0,1,T.entranceAnimation.growTime)}else this.bouncePosition=0,this.growPosition=1;u.addLayer(this),h.reset(),this.modules.renderer.addRerenderEvent()}update(){super.update(),this.bounceTickerUpdate&&this.bounceTickerUpdate(),this.growTickerUpdate&&this.growTickerUpdate()}isOutOfMainReplica(){return!1}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=te.Ue();for(let t=0;t<this.vectors.length;t++){const i=this.vectors[t];for(let t=0;t<i.length;t++)te.aM(e,i[t])}return(0,H.Bs)((0,H.x7)(e))}getVertices(e,t){const i=[],n=[];for(let o=0;o<e.length;o++)(0,H.a2)(Hl,e[o],t),i[o]=Hl[0],n[o]=Hl[1];return{x:i,y:n}}}class Wl{constructor(e){this.layers=[],this.renderer=e.renderer}addLayer(e){this.layers.push(e),this.renderer.addRerenderEvent()}removeLayer(e){const t=this.layers.indexOf(e);-1!==t&&(this.layers.splice(t,1),this.renderer.addRerenderEvent())}getLayers(){return this.layers}getDynamicObjectLayers(){return this.layers.filter((e=>e instanceof k))}getHtmlMarkers(){return this.layers.filter((e=>e instanceof Nl))}entranceAnimationFinished(){return this.layers.every((e=>!(e instanceof Zl)||!e.entranceAnimationInProgress()))}}const Xl=()=>"",Kl=[.5,.5];class ql{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),r=this.getFromCache(o,t);if(r)return r;const s=yield this.loadIcon(e,t,i,n);return s&&this.storeInCache(s,o,t),s}))}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:r,assetManager:s}=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]]:Kl,t=[i[0]*window.devicePixelRatio,i[1]*window.devicePixelRatio],s=(0,ys.W8)([{w:t[0],h:t[1],x:0,y:0,atlasIndex:0,isPacked:!1,anchorX:e[0],anchorY:e[1]}]);o.appendRasterSet(s),r.labeling.addNewRasterSets(o.getStyle().id,[s]);const a=new Uint16Array(3);return a[0]=t[0],a[1]=t[1],a[2]=s.index,r.parser.packRasters(a).then((e=>({packedRasters:e.packedRasters,rasterSet:s,scaledSize:t})))})).then((e=>{const{packedRasters:t,rasterSet:i,scaledSize:n}=e;return void 0!==t&&s.prepareRasters(o.getStyle().id,t,[Va(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||Xl)}storeInCache(e,t,i){this.cache[t]||(this.cache[t]=new Map),this.cache[t].set(i||Xl,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 $l{constructor(e,t,i,n,o,r,s,a,l,d,c,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=ot.DL,this.styleId=r,this.styleRevision=s,this.floorIndex=a,this.cache=l,this.onGenerated=h,this.useful=!0,this.selectedIds=d.slice(0),this.needFilterIds=c}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,this.mapState.defaultSourceModelsRootUrl).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 F.W("floor",e,this.modules.renderer,this.modules.modelsScene,this.mapState,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 Yl{constructor(e,t,i,n,o,r){this.onModGenerated=e=>{let t=this.idSetByFloorIndex.get(e.floorIndex);if(!t){t=new bl.c;const i=e.getGeoIds();i&&t.addFromFlatArray(i),this.idSetByFloorIndex.set(e.floorIndex,t)}e.needFilterIds&&(e.needFilterIds=!1,e.selectedIds=(0,H.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=r,this.createNewMod(r,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,H.vX)(n,o)),this.currentMod||this.newMod){if(this.currentMod){if((0,D.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,D.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 r=i.map((e=>`${e.lo},${e.hi}`)).join("|");return`floor_plan=${e}_ind=${t}_sId=${n}_sRev=${o}_sel=${r}`}(this.id,e,t,i,n),r=this.cache.get(o);if(r)this.newMod=r,this.newMod.useful=!0;else{const r=!this.idSetByFloorIndex.has(e);this.newMod=new $l(this.modules,this.mapState,o,this.id,this.regionId,i,n,e,this.cache,t,r,this.onModGenerated)}}}const Jl={trafficOn:!1,parkingOn:!1,navigatorOn:!1};function Ql(e){return Object.assign(Object.assign({},Jl),e)}function ed(e,t,i,n){return Object.assign(Object.assign({},e),{_activeFloorIds:t,_activeFloorBuildingIds:i,_activeFloorIsMetro:n})}function td(e,t){if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const id=["default","metro"];class nd{constructor(e,t){this.isStyleUpdateInProgress=!1,this.activeGroup="default",this.groupsInViewport={default:!1,metro:!1},this.state=e,this.modules=t,this.floors=new Map,this.complexDescriptors={default:new Map,metro:new Map},this.allowedFloors=new Set,this.floorIdsToObjectIds=new Map,this.displayedMods=new Map,this.requestedFloors=new Set,this.failedRequestedFloors=new Set,this.hiddenObjectIds=new Set,this.needUpdate=!1,this.cache=new ml.L(10,((e,t)=>t.remove())),this.stateDiffer=new De([{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(){var e,t,i;if(this.state.floorsEnabled){if(this.stateDiffer.check(this.state)||this.needUpdate){this.needUpdate=!1;const i=this.findActiveFloors(),n=i.filter((e=>{var t;return!(null===(t=this.activeFloor)||void 0===t?void 0:t.includes(e))}));(null!==(t=null===(e=this.activeFloor)||void 0===e?void 0:e.filter((e=>!i.includes(e))))&&void 0!==t?t:[]).forEach((e=>{this.modules.map.emit("floorcomplexhide",{id:e})})),n.forEach((e=>{const t=this.complexDescriptors[this.activeGroup].get(e);if(t){const{id:e,regionId:i,defaultFloor:n,floors:o}=t;let r=this.floors.get(e);r?r.setUsefulMod():(r=new Yl(this.modules,this.state,e,i,this.cache,n),this.floors.set(e,r));const s=r.getUsefulMod();this.modules.map.emit("floorcomplexshow",{id:e,currentFloor:s?s.floorIndex:n,floorNames:o.map((({name:e})=>e)),firmsToFloorIndexMap:t.firmsToFloorIndexMap})}})),this.lastFloor=this.activeFloor,this.activeFloor=i}this.floors.forEach((e=>e.setAllModsNeedless())),null===(i=this.activeFloor)||void 0===i||i.forEach((e=>{const t=this.floors.get(e);t&&t.setUsefulMod()})),this.activeFloor&&0!==this.activeFloor.length||this.lastFloor&&(this.cache.setSize(1),this.floors.forEach(((e,t)=>{var i;(null===(i=this.lastFloor)||void 0===i?void 0:i.includes(t))||(e.remove(),this.floors.delete(t))})),this.cache.setSize(10),this.lastFloor=void 0),this.floors.forEach(((e,t)=>{e.update(),e.canBeRemoved()&&this.floors.delete(t)})),this.updateStyleState(),this.isStyleUpdateInProgress||this.commitMods(),this.updateScene(),this.updateHiddenIds()}else this.activeFloor&&this.hideFloors()}getActiveFloorHiddenIds(){return Array.from(this.hiddenObjectIds)}isObjectHidden(e){return this.hiddenObjectIds.has(e)}prepareFloors(e,t,i,n){"zenith"===n&&i.forEach(((i,n)=>{const o=(0,D.Ak)(n);let r=this.floorIdsToObjectIds.get(o);void 0===r&&(r=new Set,this.floorIdsToObjectIds.set(o,r));for(let e=0;e<i.length;e+=2)r.add((0,D.Ak)((0,D.Ru)(i[e],i[e+1])));this.loadFloor(o,e,t)}))}changeFloorNumber(e,t){const i=this.floors.get(e),n=this.complexDescriptors[this.activeGroup].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){var t;if(!this.activeFloor||0===this.activeFloor.length)return!1;for(const i of null!==(t=this.activeFloor)&&void 0!==t?t:[]){const t=this.complexDescriptors[this.activeGroup].get(i),n=this.floors.get(i);if(!t||!n)return!1;const o=n.getCurrentMod();if(!o||!o.ready)return!1;if(o.isDataEmpty())return!1;for(let i=0;i<t.buildings.length;i++){const n=this.floorIdsToObjectIds.get(t.buildings[i]);if(n&&(Array.isArray(e)&&e.some((e=>n.has(e)))||"string"==typeof e&&n.has(e)))return!0}}return!1}activateStyleUpdating(){this.isStyleUpdateInProgress=!0,this.needUpdate=!0}finishStyleUpdating(){this.isStyleUpdateInProgress=!1}activeFloorLoadingOrReady(){if(!this.activeFloor||0===this.activeFloor.length)return!0;return this.activeFloor.map((e=>this.floors.get(e))).every((e=>{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.default.has(e)||this.complexDescriptors.metro.has(e);const i=t.getUsefulMod();return Boolean(!i||i.ready)}))}configure(e){var t;this.activeGroup=e.activeGroup,this.allowedFloors=new Set(null!==(t=e.allowedFloorIds)&&void 0!==t?t:[]),this.needUpdate=!0,this.modules.map.emit("floorsactivegroupchange",this.activeGroup)}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);const o=n.isMetroSchema?"metro":"default";this.complexDescriptors[o].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,isMetroSchema:n.isMetroSchema}),this.needUpdate=!0})))}updateStyleState(){const{styleState:e}=this.state;this.activeFloor&&0!==this.activeFloor.length?this.activeFloor.forEach((t=>{const i=this.complexDescriptors[this.activeGroup].get(t),n=this.floors.get(t);if(!i||!n)return;const o=n.getUsefulMod();if(!o)return;const r=i.floors[o.floorIndex].ids,s=i.buildings;r===e._activeFloorIds&&s===e._activeFloorBuildingIds||(this.state.styleState=ed(e,r,s,i.isMetroSchema))})):(e._activeFloorIds||e._activeFloorBuildingIds)&&(this.state.styleState=ed(e,void 0,void 0,void 0))}updateScene(){let e=!1;const t=new Map;this.activeFloor&&this.activeFloor.forEach((e=>{const i=this.floors.get(e);if(!i)return;const n=i.getCurrentMod();n&&n.ready&&t.set(n.key,n)})),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.modules.renderer.addRerenderEvent(),this.modules.identifier.resetCache())}updateHiddenIds(){if(!this.activeFloor||0===this.activeFloor.length)return void this.markHiddenObjectsForUpdate();const e=new Set;this.activeFloor.forEach((t=>{const i=this.complexDescriptors[this.activeGroup].get(t),n=this.floors.get(t);if(!i||!n)return;const o=n.getCurrentMod();if(o&&!o.isDataEmpty())for(let t=0;t<i.buildings.length;t++){const n=this.floorIdsToObjectIds.get(i.buildings[t]);n&&n.forEach((t=>e.add(t)))}})),this.markHiddenObjectsForUpdate(e)}markHiddenObjectsForUpdate(e){if(e){(function(e,t){const i=new Set;return e.forEach((e=>{t.has(e)||i.add(e)})),t.forEach((t=>{e.has(t)||i.add(t)})),i})(this.hiddenObjectIds,e).forEach((e=>{this.state.objectsIdsToUpdate.add(e)})),this.hiddenObjectIds=new Set(e)}else this.hiddenObjectIds.forEach((e=>{this.state.objectsIdsToUpdate.add(e)})),this.hiddenObjectIds.clear()}addFloorMod(e){e.object&&(this.modules.tileManager.addObject(e.object),this.modules.labeler.addLabels(e.key,wl.AL.Floor,e.getLabels()))}removeFloorMod(e){e.object&&(this.modules.tileManager.removeObject(e.object),this.modules.labeler.removeLabels(e.key))}commitMods(){this.activeFloor&&this.activeFloor.forEach((e=>{const t=this.floors.get(e);t&&t.commitMod()}))}setGroupsInViewport(e){Object.keys(e).forEach((t=>{if(this.groupsInViewport[t]!==e[t]){const i=e[t]?"floorplanin":"floorplanout";this.modules.map.emit(i,{group:t}),this.groupsInViewport[t]=e[t]}}))}findActiveFloors(){const{center:e,zoom:t,styleZoom:i,rotation:n,size:o,pitch:r,viewport:s,padding:a,cameraConfig:l}=this.state;if(i<T.floors.displayStyleZoom)return this.setGroupsInViewport({default:!1,metro:!1}),[];const d=new Xi.V({center:e,zoom:t,rotation:n,size:[Math.floor(o[0]*(1-T.floors.viewportPadding)),Math.floor(o[1]*(1-T.floors.viewportPadding))],pitch:r,viewport:s,padding:a,cameraConfig:l}).getViewportVertices();if(this.allowedFloors.size>0){const e=this.complexDescriptors[this.activeGroup],t=[];return this.allowedFloors.forEach((i=>{const n=e.get(i);n&&(0,Ni.M4)(d,n.bound)&&t.push(i)})),t}let c=1/0;const h={metro:void 0,default:void 0};return id.forEach((e=>{this.complexDescriptors[e].forEach((t=>{const i=R.TE(this.state.center,t.center);i<c&&(0,Ni.M4)(d,t.bound)&&(c=i,h[e]=t.id)}))})),this.setGroupsInViewport({default:!!h.default,metro:!!h.metro}),h[this.activeGroup]?[h[this.activeGroup]]:[]}hideFloors(){this.displayedMods.forEach((e=>{this.removeFloorMod(e)})),this.resetCache(),this.state.needLabeling=!0,this.modules.renderer.addRerenderEvent()}}class od{constructor(e,t){this.state=e,this.modules=t,this.tileLayers=[],this.objects=[],this.viewportDiffer=new De([{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"}]),this.parentChildrenMap=new Map,this.childParentMap=new Map,this.parentChildrenMapByTile=new Map,this.selectedIdsByApi=[]}addTileLayer(e){-1===this.tileLayers.indexOf(e)&&(this.tileLayers.push(e),e.redraw(),this.modules.identifier.resetCache(),this.state.needLabeling=!0,this.modules.renderer.addRerenderEvent())}removeTileLayer(e){(0,pe.VJ)(this.tileLayers,e)&&(e.resetHoverId(),this.modules.identifier.resetCache(),this.state.needLabeling=!0,this.modules.renderer.addRerenderEvent())}redraw(){this.modules.labeler.clearPreviousLabels();for(const e of this.tileLayers)e.resetHoverId(),e.redraw();this.modules.renderer.addRerenderEvent()}activateStyleUpdating(){this.tileLayers.forEach((e=>e.activateStyleUpdating()))}finishStyleUpdating(){this.tileLayers.forEach((e=>e.finishStyleUpdating()))}setSelectedIds(e){this.selectedIdsByApi=e;const t=this.getIdsToSelect(e);this.state.selectedIds=t.map(D.IL).filter((e=>!Number.isNaN(e.lo)&&!Number.isNaN(e.hi))).sort(((e,t)=>e.hi-t.hi||e.lo-t.lo)),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}e.objectsIdsToUpdate.clear()}getTileObjects(){return this.objects}addObject(e,t){if(-1===this.objects.indexOf(e)){if(this.objects.push(e),t)return;this.modules.renderer.addRerenderEvent()}}removeObject(e,t){if((0,pe.VJ)(this.objects,e)){if(t)return;this.modules.renderer.addRerenderEvent()}}updateParentChildrenData(e,t){this.updateTileParentChildrenData(e,t)&&(t&&t.size&&t.forEach(((e,t)=>{const i=this.parentChildrenMap.get(t);i?e.forEach((e=>{i.add(e),this.childParentMap.set(e,t)})):(this.parentChildrenMap.set(t,new Set(e)),e.forEach((e=>{this.childParentMap.set(e,t)})))})),this.setSelectedIds(this.selectedIdsByApi))}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)))}getIdsToSelect(e){const t=new Set(e);return e.forEach((e=>{if(this.parentChildrenMap.has(e)){const i=this.parentChildrenMap.get(e);(null==i?void 0:i.size)&&i.forEach(t.add,t)}else{const i=this.childParentMap.get(e);i&&t.add(i)}})),Array.from(t)}updateTileParentChildrenData(e,t){const i=this.parentChildrenMapByTile.get(e);return!function(e,t){if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const[i,n]of e){if(!t.has(i))return!1;if(!td(n,t.get(i)))return!1}return!0}(i,t)&&(i&&i.forEach(((e,t)=>{const i=this.parentChildrenMap.get(t);e.forEach((e=>{null==i||i.delete(e),this.childParentMap.delete(e)}))})),this.parentChildrenMapByTile.delete(e),t&&this.parentChildrenMapByTile.set(e,t),!0)}}const rd=$.Vx.bind(null,"labelingOpacity",{step:(e,t)=>e.labelingOpacity=t});class sd{constructor(e,t){this.state=e,this.modules=t,this.labelTileRevision=0,this.viewportDiffer=new De([{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.labelTiles=[],this.worker=(e=>({appendLabels:e.get(Rl.P.Labeling,"appendLabels"),appendLabelBox:e.get(Rl.P.Labeling,"appendLabelBox"),removeLabels:e.get(Rl.P.Labeling,"removeLabels"),processLabels:e.get(Rl.P.Labeling,"processLabels"),clearPreviousLabels:e.get(Rl.P.Labeling,"clearPreviousLabels")}))(this.modules.workers.fnRegistry),this.setLabelingInterval(T.labeling.interval)}disableThrottleUpdateOnce(){this.useThrottleUpdate=!1}update(){rd(this.state),this.state.needReplicasUpdate&&this.labelTiles.forEach((e=>{e.needSync=!0})),!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=Re((()=>{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}getLabelingRevision(){return this.labelTileRevision}generateLabelingTile(){const e=(0,H.x7)((0,Ni.BS)(this.state.tilesBounds),T.labeling.tileMultiplier);let t=[{coords:e,center:this.state.center,tilesBounds:this.state.tilesBounds}];if(e[2]<0)t=[{coords:[0,0,0,0],center:[0,0,0],tilesBounds:[[-ot.ed,-ot.ed,0],[ot.ed,-ot.ed,0],[ot.ed,ot.ed,0],[-ot.ed,ot.ed,0]]}];else{const i=(0,H.Sl)(e),n=Math.pow(2,e[2]),o=i.min[0]<-ot.ed,r=i.max[0]>ot.ed;if(o||r){const i=[...e];i[0]+=o?n:-n;const r=[...this.state.center];r[0]+=o?ot.sX:-ot.sX;const{min:s,max:a}=(0,H.Sl)(i);t.push({coords:i,center:r,tilesBounds:[[s[0],s[1],0],[a[0],s[1],0],[a[0],a[1],0],[s[0],a[1],0]]})}}const i=this.modules.tileManager.getLabelingData(),n=t.map((({coords:e,center:t,tilesBounds:i})=>({center:t,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:i,debugLabels:this.modules.labelsDebug.isEnabled(),disableSurvivedPoiPrevalence:this.state.disableSurvivedPoiPrevalence,tileInfo:(0,H.Bs)(e),cameraConfig:this.state.cameraConfig}))),o=function(e,t){const{config:i,ascSortedZoomNumbers:n}=t;if(0===n.length)return{city:T.labeling.commercialMargins.city};if(e<n[0])return{city:i[n[0]]};if(e>=n[n.length-1])return{city:i[n[n.length-1]]};for(let t=1;t<n.length;t++)if(e<n[t])return{city:i[n[t-1]]};return{city:T.labeling.commercialMargins.city}}(this.state.styleZoom,this.state.cityCommPoiLabeling);this.worker.processLabels(i,this.alwaysActiveLabelKeys,n,window.devicePixelRatio,this.modules.floorManager.getActiveFloorHiddenIds(),Object.assign(Object.assign({},T.labeling.commercialMargins),o),this.skipHysteresisInNextLabeling).then((i=>{this.survivedLabelBoxes.clear(),this.labelTiles.forEach((e=>{this.modules.tileManager.removeObject(e),e.clean(this.state)})),this.labelTiles.length=0;const n=[];i.forEach(((e,i)=>{e.survivedLabelBoxIds.forEach((e=>this.survivedLabelBoxes.add(e))),n.push(...e.survivedCommPois),this.modules.assetManager.loadRasters(e.collectorOutput.rastersToLoad);const o=new F.W("labeling",e.collectorOutput.data,this.modules.renderer,this.modules.modelsScene,this.state,t[i].coords);this.labelTiles.push(o),this.modules.tileManager.addObject(o)})),this.processSurvivedCommPoiIds(n),this.labelTileRevision++;const o=this.state.metrics;Number.isNaN(o.firstlabeling)&&i.some((({collectorOutput:e})=>e.data.length>0))&&(o.firstlabeling=performance.now()-o.start);const{animationTime:r,animationType:s,interval:a}=T.labeling;var l,d,c,h,u;l=this.state,d=s,c=0,h=1,u=Math.min(r,a),$.BL("labelingOpacity",{easing:d},l,c,h,u),this.modules.renderer.addRerenderEvent(),i[0].labels&&e[2]>=0&&this.modules.labelsDebug.drawLabels(i[0].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.id)));0!==t.length&&this.modules.map.emit("commpoishow",{commPois:t}),this.prevSurvivedCommPoiIds=new Set(e.map((e=>e.id)))}enrichWithElevation(e,t){const{demManager:i,map:n}=this.modules;if(n.state.demMode){const n=this.demKeys[t],o=i.getLabelsDemKey(e);if(void 0===o||o===n)return;i.enrichWithElevation(e),this.demKeys[t]=o}}}const ad=10,ld=7,dd=3,cd=2,hd=0,ud=4,md=2,fd="#ffffff",pd="#667799",_d="#ffffff",vd=5,gd=4,yd=2,bd=1,wd="#667799",xd="#ffffff",Sd="#00000026",Id="#66779966",Md=13,Td={start:{en:"Start",ru:"Старт"},addPoint:{en:"Add point",ru:"Добавить точку"},meter:{en:"m",ru:"м"},kilometer:{en:"km",ru:"км"}};function Ed(e,t,i){if(t)return Td.start[i]||Td.start.en;if(e<1e3)return`${e} ${Td.meter[i]||Td.meter.en}`;return`${(e/1e3).toFixed(1)} ${Td.kilometer[i]||Td.kilometer.en}`}function Pd(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 Ld(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 Td.addPoint[e]||Td.addPoint.en}(t)}\n        </div>\n    `}function Ad(e,t,i,n){return new q(n,{coordinates:e,interactive:i,draggable:i,width:t?ld:hd,borderWidth:t?dd:ud,border2Width:t?cd:md,color:fd,borderColor:pd,border2Color:_d,zIndex:ad})}function Cd(e,t,i){return new ph(i,{coordinates:e,zIndex:vd,zIndex2:vd-1,zIndex3:vd-2,width:gd,width2:t?0:gd+2*yd,width3:t?0:gd+2*(yd+bd),color:t?Id:wd,color2:xd,color3:Sd,interactive:!t})}const zd="PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjIiIGhlaWdodD0iMjIiPjxkZWZzPjxwYXRoIGlkPSJBIiBkPSJNMTIgMTAuNTg2bDMuNzkzLTMuNzkzIDEuNDE0IDEuNDE0TDEzLjQxNCAxMmwzLjc5MyAzLjc5My0xLjQxNCAxLjQxNEwxMiAxMy40MTRsLTMuNzkzIDMuNzkzLTEuNDE0LTEuNDE0TDEwLjU4NiAxMiA2Ljc5MyA4LjIwN2wxLjQxNC0xLjQxNEwxMiAxMC41ODZ6Ii8+PC9kZWZzPjxnIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTEpIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMC41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiMwMDAiIHN0cm9rZS1vcGFjaXR5PSIuMTUiLz48bWFzayBpZD0iQiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjQSIvPjwvbWFzaz48dXNlIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0ibm9uemVybyIgeGxpbms6aHJlZj0iI0EiLz48ZyBmaWxsPSIjMjYyNjI2IiBtYXNrPSJ1cmwoI0IpIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6Ii8+PC9nPjwvZz48L3N2Zz4=";class kd extends C.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=Ed(n,i,e.state.lang),this.point=t,this.distance=n,this.label=function(e,t,i){const n=Pd(t,Md),o=function(e,t){return.55*t*e.length}(t,Md);return new Nl(i,{coordinates:e,html:n,offset:[(ld+dd+cd)/2+2,-Md/2-2],labeling:{type:"full",width:o,height:Md},animate:!1,zIndex:vd+1})}(t,this.labelText,e),this.marker=Ad(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,${zd}" alt="close">\n    `)}deactivateHover(){this.label.setContent(Pd(this.labelText,Md))}}class Rd{constructor(e,t){this.onDocumentMouseMove=e=>{this.mousePos=(0,O.yK)(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 De([{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 Nl(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,A.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,A.vn)(n.getPoint(),t.getPoint())}const r=this.createJoint(t.getPoint(),n,o);e.push(r)})),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 kd(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,A.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=Cd(e,!1,this.modules.map);t.on("mousemove",(e=>{if(void 0===this.draggableJointIndex){if(this.popup){const i=t.snapPoint(e.point),n=Ed(i.distance,!1,this.state.lang);this.popup.setPosition(i.point),this.popup.setContent(Ld(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,A.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=Cd(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=Ad(this.snapPoint,!0,!1,this.modules.map))}}class Fd{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=(0,O.yK)(this.handler.container,e.clientX,e.clientY);return new Od(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=(0,O.yK)(this.handler.container,e.clientX,e.clientY);return this.handler.modules.identifier.search("contextmenu",t,!0).then((i=>{U("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 Dd(this.mouseDownPoint,this.handler))}returnToInitialState(){return this.handler.mapState.userHasInteracted=!0,this.handler.modules.map.emit("interactionend",{target:"pitch/rotation"}),new Wd(this.handler)}}class Od{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,pe.Te)(e.size,this.mouseDownPoint),i=(0,pe.Te)(e.size,this.mouseMovePoint),n=(t[0]-i[0])*T.zoom.mouseRotateDelta,o=(i[1]-t[1])*T.zoom.mousePitchDelta;Fe(e),e.disableRotationByUserInteraction||ue(e,e.rotation+n,{animate:!1}),e.disablePitchByUserInteraction||ve(e,(0,pe.uZ)(e.pitch+o,e.minPitch,e.maxPitch),{animate:!1}),this.mouseDownPoint=this.mouseMovePoint,this.handler.modules.renderer.addRerenderEvent()}processMouseMoveAction(e){return this.mouseMovePoint=(0,O.yK)(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 Dd(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 Wd(this.handler)}}class Dd{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 Wd(this.handler))}processMouseMoveAction(e){const t=(0,O.yK)(this.handler.container,e.clientX,e.clientY);return this.handler.mapState.disableDragging?(this.mouseDownPoint=t,this.dragStartPoint=t,this.toInitialOnMouseUp=!0,this):R.TE(this.mouseDownPoint,t)<T.events.dragThreshold?(this.dragStartPoint=t,this):new Bd(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=(0,O.yK)(this.handler.container,e.clientX,e.clientY);Fe(t),we(t,i,{duration:T.zoom.animDuration,zoomPoint:t.keepCenterWhileUserZoomRotate?void 0:n}),this.handler.modules.renderer.addRerenderEvent()}}else{const t=(0,O.yK)(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((()=>{U("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 Wd(this.handler)}processKeyDownAction(e){return"Control"===e.key||"Meta"===e.key?(this.handler.modules.map.emit("interactionend",{target:"center"}),new Fd("keyPrimary",this.mouseDownPoint,this.handler)):this}}class Bd{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=ee.d9(e.center);ee.IH(n,n,t),ee.lu(n,n,i),Fe(e),ae(e,n,{animate:!1}),this.dragStartPoint=this.mouseMovePoint,this.handler.modules.renderer.addRerenderEvent()}processMouseMoveAction(e){return this.mouseMovePoint=(0,O.yK)(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 Fd("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 Wd(this.handler)}}var jd=i(9090);class Nd{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 Gd(e,this.handler,!1)}processTouchMoveAction(e){return e.preventDefault(),this.touchMovePoints=(0,O.KK)(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 Wd(this.handler)):new Gd(e,this.handler,!1)}}class Ud extends Nd{constructor(e,t,i){super(e,t,i),this.startPxAngle=0,this.rotationDetected=!1,t.length>1&&(this.startPxAngle=(0,jd.Hl)(t[0],t[1]))}update(e){if(this.touchStartPoints.length<2||this.touchMovePoints.length<2)return;const t=(0,jd.L$)(this.touchMovePoints[0],this.touchMovePoints[1]),i=R.TK(this.touchMovePoints[0],this.touchMovePoints[1])/R.TK(this.touchStartPoints[0],this.touchStartPoints[1]),n=e.zoom+Math.log(i)/Math.log(2)*T.zoom.mobilePinchDelta;let o=0,r=0;if(!this.rotationDetected){const e=(0,jd.Hl)(this.touchMovePoints[0],this.touchMovePoints[1]);r=Math.abs(this.startPxAngle-e),r>Math.PI&&(r=2*Math.PI-r),r>=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,jd.Hl)(e,t)-(0,jd.Hl)(i,n)}}const s=e.rotation+o,a=e.center;e.keepCenterWhileUserZoomRotate||ee.IH(a,e.center,(0,pe.Kv)(e,t,{zoom:n,rotation:s})),Fe(e),ae(e,a,{animate:!1}),we(e,n,{animate:!1}),this.handler.mapState.disableRotationByUserInteraction||ue(e,s,{animate:!1}),this.touchStartPoints=this.touchMovePoints,this.handler.modules.renderer.addRerenderEvent()}}class Vd extends Nd{constructor(e,t,i){super(e,t,i)}update(e){const t=this.touchStartPoints.map((t=>(0,pe.Te)(e.size,t))),i=this.touchMovePoints.map((t=>(0,pe.Te)(e.size,t))),n=(0,jd.L$)(t[0],t[1]),o=((0,jd.L$)(i[0],i[1])[1]-n[1])*T.zoom.mousePitchDelta;Fe(e),ve(e,(0,pe.uZ)(e.pitch+o,e.minPitch,e.maxPitch),{animate:!1}),this.touchStartPoints=this.touchMovePoints,this.handler.modules.renderer.addRerenderEvent()}}class Gd{constructor(e,t,i){this.handler=t,this.needClickOnTouchEnd=i,this.toZoomRotate=!1,this.touchStartPoints=(0,O.KK)(e.touches,this.handler.container),this.handler.mapState.userHasInteracted=!0,this.isTimerStarted=void 0!==this.handler.dblClickTimer,(0,O.N2)(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=(0,O.KK)(e.touches,this.handler.container),this}processTouchMoveAction(e){e.preventDefault();const t=(0,O.KK)(e.touches,this.handler.container);if(!(0,O.N2)(e))return R.TE(this.touchStartPoints[0],t[0])<T.events.dragThreshold?(this.touchStartPoints=t,this):this.isTimerStarted?new Zd(t[0],this.touchStartPoints[0],this.handler):this.handler.mapState.disableDragging?(this.touchStartPoints=t,this.needClickOnTouchEnd=!1,this):new Hd(t[0],this.touchStartPoints[0],this.handler);if(this.touchStartPoints.length<2)return this.processTouchStartAction(e);const i=R.Ue(),n=R.Ue();R.lu(i,t[0],this.touchStartPoints[0]),R.lu(n,t[1],this.touchStartPoints[1]);const o=R.AK(i,n);if(o>0){const e=R.TE(this.touchStartPoints[0],t[0]),i=R.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 Vd(t,this.touchStartPoints,this.handler)}if(o<0)return new Ud(t,this.touchStartPoints,this.handler);return(0,jd.se)(i)||(0,jd.se)(n)?this.pitchWaitingTimer?this:this.toZoomRotate?(this.toZoomRotate=!1,new Ud(t,this.touchStartPoints,this.handler)):(this.pitchWaitingTimer=window.setTimeout((()=>{this.toZoomRotate=!0,this.pitchWaitingTimer=void 0}),T.events.pitchWaitingTime),this):new Ud(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 Wd(this.handler)):((0,O.N2)(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=(0,O.KK)(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;Fe(t),we(t,i,{duration:T.zoom.animDuration,zoomPoint:n}),this.handler.modules.renderer.addRerenderEvent()}}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((()=>{U("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 Wd(this.handler)}}class Hd{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=ee.d9(e.center);ee.IH(n,n,t),ee.lu(n,n,i),Fe(e),ae(e,n,{animate:!1}),this.touchStartPoint=this.touchMovePoint,this.handler.modules.renderer.addRerenderEvent()}processTouchStartAction(e){return this.handler.container.classList.remove("mapgl-dragging"),this.handler.modules.map.emit("interactionend",{target:"center"}),new Gd(e,this.handler,!1)}processTouchMoveAction(e){e.preventDefault();const t=(0,O.KK)(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 Wd(this.handler)}}class Zd{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,pe.uZ)(this.startZoom+i*T.zoom.mobileTapDelta,e.minZoom,e.maxZoom),o=e.center;e.keepCenterWhileUserZoomRotate||ee.IH(o,e.center,(0,pe.Kv)(e,this.touchStartPoint,{zoom:n})),Fe(e),ae(e,o,{animate:!1}),we(e,n,{animate:!1}),this.handler.modules.renderer.addRerenderEvent()}processTouchStartAction(e){return this.handler.modules.map.emit("interactionend",{target:"zoom/rotation"}),new Gd(e,this.handler,!1)}processTouchMoveAction(e){e.preventDefault();const t=(0,O.KK)(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 Wd(this.handler)}}class Wd{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=(0,O.yK)(this.handler.container,e.clientX,e.clientY);switch(e.button){case 0:if(e.ctrlKey||e.metaKey)return new Fd("keyPrimary",t,this.handler);if(this.handler.modules.layout.isActionWithCanvas(e)){U("mousedown",this.handler.modules.identifier.searchSync(t),e,t,this.handler.modules)}return new Dd(t,this.handler);case 1:return new Fd("auxiliary",t,this.handler);case 2:return new Fd("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=(0,O.yK)(this.handler.container,e.changedTouches[0].clientX,e.changedTouches[0].clientY);U("touchstart",this.handler.modules.identifier.searchSync(t),e,t,this.handler.modules)}return new Gd(e,this.handler,1===e.touches.length)}}class Xd{processAction(){return this}}class Kd{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 Xd||(this.state=t)},this.state=new Wd(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 Xd)return;const{map:e}=this.modules;switch(this.container.classList.remove("mapgl-dragging"),this.container.classList.remove("mapgl-rotating"),this.state.constructor){case Dd:case Bd:case Hd:e.emit("interactionend",{target:"center"});break;case Fd:case Od:e.emit("interactionend",{target:"pitch/rotation"});break;case Zd:e.emit("interactionend",{target:"zoom/rotation"});break;case Ud:case Vd:e.emit("interactionend",{target:"pitch/zoom/rotation"});break;case Gd:{const t=this.state.getStartedInteractionTarget();e.emit("interactionend",{target:t});break}}this.state=new Xd}unblock(){this.state instanceof Wd||this.state instanceof Xd&&(this.state=new Wd(this))}}var qd=i(9311),$d=i(4288),Yd=i(4635),Jd=i(9833),Qd=i(1683),ec=i(1285);class tc{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,z.f)(),this.gridState=(0,Yd.y7)("traffic",0,this.id,e.trafficMinZoom,e.trafficMaxZoom,e.trafficMinZoom,e.trafficMaxDetailLevel,t,e),this.viewportDiffer=new De([{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,Yd.d1)(this.gridState),this.enabled=!1,this.modules.map.emit("traffichide"))}isEnabled(){return this.enabled}destroy(){(0,Yd.d1)(this.gridState)}redraw(){this.enabled&&((0,Yd.d1)(this.gridState),(0,qd.o)(this.gridState,this.mapState))}activateStyleUpdating(){this.enabled&&(0,ec.I2)(this.gridState,this.mapState.handyStyleId,this.modules.styleManager.getStyleRevision(this.mapState.handyStyleId),this.modules.map.core.getIsFirstStyleUpdate())}finishStyleUpdating(){this.enabled&&(0,ec.cA)(this.gridState)}update(){if(!this.enabled)return;if((0,pe.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,qd.o)(this.gridState,this.mapState),this.modules.renderer.addRerenderEvent());const e=Object.assign({},this.gridState.displayedMods);(0,$d.r)(this.gridState,this.mapState,this.modules),this.fetch((0,Yd.w1)(this.gridState),this.timestamp),this.abortFetch((0,Yd.lH)(this.gridState)),this.generate((0,Yd.e)(this.gridState)),this.clearTiles((0,Yd.HM)(this.gridState)),(0,Yd.aq)(this.modules,this.mapState,this.gridState,e)}viewportTilesReady(){return(0,Yd.ej)(this.gridState.tiles,this.gridState.viewportTiles)}fetch(e,t){e.sort(((e,t)=>(0,H.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===Jd.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,H.qu)(this.mapState.center,e,t))).forEach((e=>{const t=(0,Jd._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((e=>{e?Array.isArray(e.results)&&(0,Qd.aK)(t,e.results):(0,$n.wm)("traffic")}))}))}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,P.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=>{this.isMetaLoading=!1,console.error(e)}))}}class ic{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.canvas.style.display="block",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 nc{constructor(e){this.loadingCounter=0,this.isIdle=()=>0===this.loadingCounter,this.modules=e,this.textureKeys=[],this.texturesMap=new Map}addTexture(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.loadingCounter++;const i=yield Ua(e);return yield this.storeTexture(i,t)}))}addPreparedTexture(e){const t=`prepared-${(0,z.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,r=null!==(i=null==t?void 0:t.pixelRatio)&&void 0!==i?i:window.devicePixelRatio,s=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 d=this.modules.renderer.getRenderingContext(),c=(o||[e.width,e.height]).map((e=>e*r)),h=Va(e,c),u=c.map((e=>e+2*s));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 $e(void 0,{size:u,flipY:!1,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter}).prepare(d);return m.subImage(d,h,s,s),this.texturesMap.set(a,m),this.textureKeys.push(a),this.modules.renderer.addRerenderEvent(),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 oc=i(6849);const rc=[0];class sc{constructor(e){this.isLoading=!1,this.attempts=0,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&&oc.ns){const e=(0,P.IG)(oc.ns,{keyID:t});this.isLoading=!0;const i=()=>(0,M.mG)(this,void 0,void 0,(function*(){return rc.length>=this.attempts?(this.attempts&&(yield new Promise((e=>{this.lastTimeout=window.setTimeout(e,1e3*rc[this.attempts])})),this.clearLastTimeout()),this.attempts++,fetch(e).then((e=>e.ok?e.json():i()),i)):(console.error("Could not load tile key info. A style layers with commercial POI will be added to applied styles."),Promise.resolve(void 0))}));this.request=i().then((e=>{if(this.isLoading=!1,!e||!e.result||200!==e.meta.code)return{showCommPoi:true,urbi:false,error:!0};const{showCommPoi:t,urbi:i}=e.result.service.properties.public;return{showCommPoi:null==t||t,urbi:null!=i&&i}}))}else this.request=Promise.resolve({showCommPoi:!1,urbi:!1})}destroy(){this.clearLastTimeout()}clearLastTimeout(){void 0!==this.lastTimeout&&(clearTimeout(this.lastTimeout),this.lastTimeout=void 0)}}class ac{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))}}class lc{constructor(e,t,i){var n;this.options=t,this.type="zenith",this.id=(0,kn.Q)(),this.modelsAppearStrategy=null!==(n=t.modelsAppearStrategy)&&void 0!==n?n:ot.jm,this.state=e.state,this.modules=e.modules,this.zenithSource=new Xa.nt(this.id,this.modules,this.options),this.tileLayer=new Mt.I(T.tiles.maxUniverseZoom+1,T.tiles.maxRegionalZoom,T.tiles.maxUniverseZoom+1,T.tiles.maxDetailLevel,this.modules,this.state,this.zenithSource,this.options),this.modules.tileManager.addTileLayer(this.tileLayer),this.modules.sourceStorage.addSource(this),this.mapglApiSource=i}getObjectAttributes(e,t){return this.zenithSource.getObjectAttributes(e,t)}getId(){return this.id}getAttributes(){return this.zenithSource.getAttributes()}getZoomDirection(){return this.tileLayer.getZoomDirection()}setAttributes(e){this.zenithSource.setAttributes(e),this.tileLayer.redraw()}getUrl(e,t){return(0,P.Gr)(e,Object.assign({host:this.options.tileServer,tileSet:this.options.tileSet,protocol:this.options.tileProtocol,subdomain:this.options.subdomains[0]},t))}destroy(){this.modules.tileManager.removeTileLayer(this.tileLayer),this.tileLayer.destroy(),this.modules.sourceStorage.removeSource(this.id),this.zenithSource.destroy()}setFeatureStateMap(e){this.zenithSource.setFeatureStateMap(e)}setFeatureStateMapBinary(e){this.zenithSource.setFeatureStateMapBinary(e)}isIdentifiedAsDefault(){var e;return null===(e=this.options.identifyAsDefaultSource)||void 0===e||e}}var dc=i(7231);const cc="gltfModels";class hc{constructor(e,t){var i,n,o;this.modules=t,this.type="default",this.id=(0,kn.Q)(),this.options={tileServer:e.tileServer,tileSet:e.tileSet,tileProtocol:e.tileProtocol,tileKey:e.tileKey,subdomains:e.subdomains,appId:e.appId,defaultLang:e.tileServerDefaultLang,sessionId:null!==(i=e.tileSessionId)&&void 0!==i?i:e.sessionId,isDefaultSource:!0,identifyAsDefaultSource:!0,modelsPath:e.defaultSourceModelsRootUrl},this.modelsAppearStrategy=null!==(n=e.defaultSourceModelsAppearStrategy)&&void 0!==n?n:ot.jm,this.zenithSource=new Xa.nt(this.id,this.modules,this.options),this.universeTileLayer=new Mt.I(0,T.tiles.maxUniverseZoom,0,T.tiles.maxUniverseZoom,this.modules,e,this.zenithSource,{requestOddTiles:e.mobileSdkMode}),this.universeTileLayer.getLabelingData=()=>{const e=Mt.I.prototype.getLabelingData.call(this.universeTileLayer);return this.regionalTileLayer.isBlank()||(e.labelsKeys=[]),e},this.modules.tileManager.addTileLayer(this.universeTileLayer),this.regionalTileLayer=new Mt.I(T.tiles.maxUniverseZoom+1,T.tiles.maxRegionalZoom,T.tiles.maxUniverseZoom+1,T.tiles.maxDetailLevel,this.modules,e,this.zenithSource,{requestOddTiles:e.mobileSdkMode}),this.modules.tileManager.addTileLayer(this.regionalTileLayer),this.commercialPoiSource=new dc.n(this.id,this.modules,{url:(0,P.Nt)("commercialPoi",{host:e.tileServer,tileSet:e.commercialTileSet,protocol:T.tiles.protocol,lang:e.lang}),flipY:!0,identifyAsDefaultSource:!0}),this.commercialPoiTileLayer=new Mt.I(T.commercialPoi.minZoom,T.commercialPoi.maxZoom,T.commercialPoi.minZoom,Ao.rR,this.modules,e,this.commercialPoiSource,{viewportPadding:ot.bQ}),this.modules.tileManager.addTileLayer(this.commercialPoiTileLayer),this.modelsSource=new dc.n(this.id,this.modules,{minZoom:T.models.minZoom,maxZoom:T.models.maxZoom,url:(0,P.Nt)({url:e.modelsTilesUrl},{host:e.tileServer,tileSet:e.modelsTileSet,protocol:T.tiles.protocol,lang:e.lang}),ignoreMissingTiles:!0,identifyAsDefaultSource:!0,modelsPath:null!==(o=e.defaultSourceModelsRootUrl)&&void 0!==o?o:(0,P.Nt)("gltfModel",{host:e.tileServer,tileSet:e.tileSet,protocol:T.tiles.protocol,lang:e.lang}),flipY:!0,attributes:{sourceName:cc}}),this.modelsTileLayer=new Mt.I(T.models.minZoom,T.models.maxZoom,T.models.minZoom,T.tiles.maxDetailLevel,this.modules,e,this.modelsSource,{viewportPadding:ot.bQ}),this.modules.tileManager.addTileLayer(this.modelsTileLayer),this.modules.sourceStorage.addSource(this)}destroy(){var e;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.modules.tileManager.removeTileLayer(this.modelsTileLayer),this.modelsTileLayer.destroy(),this.modelsSource.destroy(),this.modules.sourceStorage.removeSource(this.id)}setAttributes(e){var t,i;this.zenithSource.setAttributes(Object.assign(Object.assign({},e),L.so)),this.universeTileLayer.redraw(),this.regionalTileLayer.redraw(),null===(t=this.commercialPoiSource)||void 0===t||t.setAttributes(e),null===(i=this.commercialPoiTileLayer)||void 0===i||i.redraw(),this.modelsSource.setAttributes(Object.assign(Object.assign({},e),{sourceName:cc})),this.modelsTileLayer.redraw()}getAttributes(){return this.zenithSource.getAttributes()}getId(){return this.id}getZoomDirection(){return this.regionalTileLayer.getZoomDirection()}setHoverId(e){this.regionalTileLayer.setHoverId(e)}setDisabledRegionsId(e){this.regionalTileLayer.disabledRegions=e,this.universeTileLayer.disabledRegions=e}resetHoverId(){this.regionalTileLayer.resetHoverId()}setFeatureStateMap(e){this.zenithSource.setFeatureStateMap(e),this.universeTileLayer.onFeatureStateMapChange(),this.regionalTileLayer.onFeatureStateMapChange(),this.modules.modelLayer.onFeatureStateMapChange()}setFeatureStateMapBinary(e){this.zenithSource.setFeatureStateMapBinary(e),this.universeTileLayer.onFeatureStateMapChange(),this.regionalTileLayer.onFeatureStateMapChange(),this.modules.modelLayer.onFeatureStateMapChange()}generateHoverTile(e,t,i,n,o,r,s,a){return this.zenithSource.generateTile(e,t,i,n,o,r,s,a)}generateModel(e){return this.zenithSource.generateModel(e)}isIdentifiedAsDefault(){return!0}setDataType(e){this.options.dt===e||this.options.dt&&e&&(0,pe.$I)(this.options.dt,e)||(this.options.dt=e,this.regionalTileLayer.redraw())}getDataType(){return this.options.dt}}const uc={dead:!0,alive:!0,unused:!0,commercialDead:!1,commercialAlive:!1};class mc{constructor(e,t){this.mapState=e,this.modules=t,this.options={},this.viewportDiffer=new De([{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 De([{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=uc){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={[wl.m3.Dead]:"#ff0000",[wl.m3.Alive]:"#30763c",[wl.m3.Unused]:"#aaa",[wl.m3.CommercialAlive]:"#3a9f22",[wl.m3.CommercialDead]:"#ff0000"},o=new Int32Array(e),r={[wl.m3.Dead]:[],[wl.m3.Alive]:[],[wl.m3.Unused]:[],[wl.m3.CommercialAlive]:[],[wl.m3.CommercialDead]:[]};for(let e=0;e<o.length;e+=5){const t=o[e+4];r[t].push({x:o[e],y:o[e+1],width:o[e+2],height:o[e+3]})}this.clear();const s=window.devicePixelRatio,a=e=>{t.strokeStyle=n[e],r[e].forEach((e=>t.strokeRect(e.x*s+.5,e.y*s+.5,e.width*s,e.height*s)))};t.setLineDash([]),i.unused&&a(wl.m3.Unused),i.dead&&a(wl.m3.Dead),i.alive&&a(wl.m3.Alive),t.setLineDash([6]),i.commercialDead&&a(wl.m3.CommercialDead),i.commercialAlive&&a(wl.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 fc{constructor(e){this.fogLimits=new Float32Array([3.7,4.5]),this.fogHorizonBlend=.12,this.fogHorizonLevel=-.07,this.lastStyleId=NaN,this.modules=e;const t=this.modules.renderer.getShaderProgram("sky"),i=new Tt.l(new Float32Array([-1,-1,1,-1,1,1,-1,1]));this.vao=((e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.Float,stride:0,offset:0,normalized:!1});return new Pt(t,{a_vec2_vertex:i})})(i,t)}update(){const e=this.modules.map.state;isNaN(e.handyStyleId)||this.lastStyleId!==e.handyStyleId&&(this.updateSky(),this.lastStyleId=e.handyStyleId)}setParameters(e){const t=this.modules.map.state;void 0!==e.min&&(this.fogLimits[0]=e.min),void 0!==e.max&&(this.fogLimits[1]=e.max),void 0!==e.horizonBlend&&(this.fogHorizonBlend=e.horizonBlend),void 0!==e.horizonLevel&&(this.fogHorizonLevel=e.horizonLevel);const i=this.modules.styleManager.getStyleLayer(t.handyStyleId,zi.d6);i&&(void 0!==e.fogColor&&(i.style.fogColor=(0,Co.nS)(e.fogColor)?(0,Co.lK)(e.fogColor):e.fogColor),void 0!==e.skyColor&&(i.style.skyColor=(0,Co.nS)(e.skyColor)?(0,Co.lK)(e.skyColor):e.skyColor),this.modules.renderer.addRerenderEvent())}renderSky(e){var t;if(!this.isSkyEnabled())return;const i=null===(t=this.envStyleLayer)||void 0===t?void 0:t.style.skyColor,n=this.modules.map.state,o=(0,K.jJ)(n.styleZoom,n.styleState,[]),r=this.modules.renderer.webGlExtensions,s=this.modules.renderer.lastAppliedGlState;nn(e,ln,s);const a=this.modules.renderer.getShaderProgram("sky");a.enable(e),a.bind(e,{u_sky_color:(0,K.m2)((0,K.zn)(i,o))}),((e,t,i)=>{const n=i.camera.viewMatrixTranspose,o=i.camera.projectionMatrixInverse;t.bind(e,{u_mat4_view_transposed:n,u_mat4_proj_inverted:o})})(e,a,this.modules),vt(e,a,this.modules.map.state,this.modules),fo(e,a,this.modules.map.state,this.modules),this.vao.bind({gl:e,extensions:r}),e.drawArrays(e.TRIANGLE_FAN,0,4)}isFogEnabled(){var e;const t=null===(e=this.envStyleLayer)||void 0===e?void 0:e.style.fogColor;return t&&(!(0,qn.gC)(t)||0!==t.value[3])}isSkyEnabled(){var e;const t=null===(e=this.envStyleLayer)||void 0===e?void 0:e.style.skyColor;return t&&(!(0,qn.gC)(t)||0!==t.value[3])}updateSky(){const e=this.modules.styleManager.getStyleLayer(this.modules.map.state.handyStyleId,zi.d6);this.envStyleLayer=e}}class pc{constructor(e,t){this.mapState=e,this.mapModules=t,this.state={}}add(e,t=0,i=1,n=T.buildingAnimation.easing,o=T.buildingAnimation.duration){this.state[e]||(this.state[e]={tickerConfig:{start:t,end:i,duration:o,easing:n},tickerKey:"",readiness:t===i?1:0})}has(e){return Boolean(this.state[e])}remove(e){this.state[e]&&delete this.state[e];const t=this.buildTickerKey(e);$.rS(t,this.mapState)&&$.sT(t,this.mapState)}getReadiness(e){var t;return null===(t=this.state[e])||void 0===t?void 0:t.readiness}isAnimating(e){if(!e){for(const e in this.state)if(void 0!==$.U2(this.state[e].tickerKey,this.mapState))return!0;return!1}return!!this.state[e]&&void 0!==$.U2(this.state[e].tickerKey,this.mapState)}update(){const e=[];for(const t in this.state){const i=this.state[t];if(this.mapModules.tileManager.viewportTilesReady()){const n=i.readiness,{start:o,end:r,duration:s,easing:a}=i.tickerConfig;if(i.tickerKey)$.Vx(i.tickerKey,{step:(e,t)=>{i.readiness=t}},this.mapState);else{const e=this.buildTickerKey(t);i.tickerKey=e,$.BL(e,{easing:a},this.mapState,o,r,s)}1===i.readiness&&1!==n&&e.push(t)}}return e}buildTickerKey(e){return`gltf-${e}`}}var _c=i(7407);const vc="#ffffffff";class gc extends k{constructor(e,t){var i,n,o;super(e),this.map=e,this.hovered=!1,this.status=t.hideOnInit?"hidden":"visible",this.interactive=null!==(i=t.interactive)&&void 0!==i&&i,this.disableAnimation=t.disableAnimation,this.linkedIds=t.linkedIds;const r=(0,E.projectGeoToMap)(t.coordinates);this.position={userValue:r,normalizedValue:(0,A.I0)(r)};const{dynamicStyle:s,collector:a,tileManager:l,layers:d,renderer:c,modelsScene:h,assetManager:u}=this.modules,{rotation:m,scale:f,offset:p,ignoreGlobalLighting:_,colorTextureUvIndex:v,nearCameraFade:g,showRatio:y}=t;if(this.layer=(0,W.qw)({type:"model",id:`dynamic-gltf-model-${this.uniqId}`,style:{modelSrc:["get","model_src"],rotation:Array.isArray(m)?["literal",m]:m,scale:Array.isArray(f)?["literal",f]:f,offset:Array.isArray(p)?["literal",p]:p,linkedIds:["get","linkedIds"],ignoreGlobalLighting:_,colorTextureUvIndex:v,nearCameraFade:g,showRatio:y,color:["match",["objectAttr","hovered"],[!0],(null===(n=t.hover)||void 0===n?void 0:n.color)||vc,t.color||vc]},minzoom:t.minZoom,maxzoom:t.maxZoom}),!this.layer)return;(null===(o=t.hover)||void 0===o?void 0:o.color)&&(this.on("mouseover",this.switchToHoveredColor),this.on("mouseout",this.switchToNormalColor)),s.addLayer(this.layer,t.zIndex);const b=(0,H.IR)(this.position.normalizedValue),w=(0,Z.FJ)({id:t.interactive?(0,D.Ru)(0,0):NaN,model_src:t.modelSrc,linkedIds:t.linkedIds}),x=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,w,L.wz);(0,G.Eu)(this.layer,x),(0,G.XI)({collector:a,generator:_c.m.generateInstanced,args:[s.getStyle(),this.layer,x,{x:[0],y:[0]},(0,H.Bs)(b),NaN]});const S=a.getAccumulatedData(),I=new F.W("dynamicObject",S.data,c,h,this.mapState,b,this);u.fillDataModelUrlMap(S.dataModelsUrls),this.modelId=S.dataModelsUrls[t.modelSrc],void 0!==this.modelId&&(u.loadModel(t.modelSrc,this.modelId,!0,this.layer,(()=>{"visible"===this.status&&(l.addObject(I),this.modules.renderer.addRerenderEvent(),this.linkedIds&&this.map.hideBuildingsById(this.linkedIds),this.updateIdentifier()),setTimeout((()=>this.emit("modelloaded")),0)})),this.tileObjects.push(I),t.interactive&&this.identifyIds.push(S.identifyIds),d.addLayer(this),a.reset())}isAnimationDisabled(){return this.disableAnimation}getLinkedIds(){return this.linkedIds}isVisible(){return"visible"===this.status}hide(){"visible"===this.status&&(this.status="hidden",this.tileObjects.forEach((e=>{this.modules.tileManager.removeObject(e)})),this.showHiddenBuildings(),this.modules.renderer.addRerenderEvent(),this.updateIdentifier())}isOutOfMainReplica(){return!1}show(){"hidden"===this.status&&(this.status="visible",this.tileObjects.forEach((e=>{this.modules.tileManager.addObject(e)})),this.linkedIds&&this.map.hideBuildingsById(this.linkedIds),this.modules.renderer.addRerenderEvent(),this.updateIdentifier())}destroy(){if("destroyed"!==this.status){if(this.status="destroyed",void 0!==this.modelId){this.modules.layers.getDynamicObjectLayers().filter((e=>e instanceof gc&&e!==this)).some((e=>e.modelId===this.modelId))||this.modules.assetManager.removeModel(String(this.modelId))}this.updateIdentifier(),this.layer&&this.modules.dynamicStyle.removeLayer(this.layer.innerId),this.showHiddenBuildings(),this.off("mouseover",this.switchToHoveredColor),this.off("mouseout",this.switchToNormalColor),super.destroy()}}switchToHoveredColor(){this.hovered=!0,this.modules.renderer.addRerenderEvent()}switchToNormalColor(){this.hovered=!1,this.modules.renderer.addRerenderEvent()}updateIdentifier(){this.interactive&&this.modules.identifier.resetCache()}showHiddenBuildings(){if(!this.linkedIds)return;const e=this.modules.layers.getDynamicObjectLayers().filter((e=>e instanceof gc&&e!==this&&e.isVisible()));this.linkedIds.forEach((t=>{const i=e.every((e=>{var i;return!(null===(i=e.getLinkedIds())||void 0===i?void 0:i.includes(t))}));i&&this.map.showHiddenBuildingsById([t])}))}}var yc=i(462);const bc="commmodelshow";class wc{constructor(e,t){this.mapState=e,this.mapModules=t,this.modelsAnimator=new pc(e,t),this.modelInfo={},this.buildingIds=new Set,this.objectIdToLayerModelKey={},this.linkedIdToObjectId={},this.layerModelKeyBySourceTile=new Map}addLayerModelToSourceTileMap(e){const t=xc(e),i=Sc(e.attributes.styleId,e.attributes.sourceId,e.tile.coords),n=this.layerModelKeyBySourceTile.get(i);n?n.add(t):this.layerModelKeyBySourceTile.set(i,new Set([t]))}clearSourceTileMapByTiles(e,t){t.map((t=>Sc(this.mapState.handyStyleId,e,t.coords))).forEach((e=>this.layerModelKeyBySourceTile.delete(e)))}clearSourceTileMapBySource(e){Array.from(this.layerModelKeyBySourceTile).map((e=>e[0])).filter((t=>t.split("_")[1]===String(e))).forEach((e=>this.layerModelKeyBySourceTile.delete(e)))}setCurrentLayerModelId(e,t){if(e.layerSettings.identify||e.layerSettings.depthTest||e.layerSettings.shadow)return;const i=xc(e);let n=this.modelInfo[i];n||(n=this.addLayerModel(e,i)),n&&(n.prevModelId=n.currModelId,n.currModelId=t)}getCurrentLayerModelId(e){var t;const i=xc(e);return null===(t=this.modelInfo[i])||void 0===t?void 0:t.currModelId}hasBuildingId(e){return this.buildingIds.has(e)}getModelOpacity(e){var t;if(!e)return 0;const i=xc(e);return i&&null!==(t=this.modelsAnimator.getReadiness(i))&&void 0!==t?t:0}getModelHeightFactor(e){var t;if(!e)return 1;const i=xc(e);return null!==(t=this.modelsAnimator.getReadiness(i))&&void 0!==t?t:1}isAnimating(e){if(!e)return this.modelsAnimator.isAnimating();const t=this.linkedIdToLayerModelKey(e);return!!t&&this.modelsAnimator.isAnimating(t)}hasModelFor(e){const t=this.linkedIdToLayerModelKey(e);return t&&t in this.modelInfo}objectIdToKey(e){return this.objectIdToLayerModelKey[e]}update(){const e=this.getModelSceneObjects();this.syncStateWithSceneObjects(e);const t=this.modelsAnimator.update();this.generateCommModelEvents(t),this.updateObjectsVisibility()}allObjectsHaveCurrentModelId(e,t,i){var n;const o=Sc(i,e,t),r=this.layerModelKeyBySourceTile.get(o);if(!r)return!0;for(const e of r)if(void 0===(null===(n=this.modelInfo[e])||void 0===n?void 0:n.currModelId))return!1;return!0}finishStyleUpdating(){Array.from(this.layerModelKeyBySourceTile).map((e=>e[0])).filter((e=>e.split("_")[0]!==String(this.mapState.handyStyleId))).forEach((e=>this.layerModelKeyBySourceTile.delete(e)))}getModelSceneObjects(){const e=[],t=this.mapModules.tileManager.getTileObjects();for(const i of t)for(const t of i.children){if(!(0,na.OB)(t))continue;const i=this.mapModules.styleManager.getStyleLayer(t.attributes.styleId,t.attributes.layerId);i&&"gltfModel"===i.type&&(t.canRender=!1,this.updateModel(t)&&(t.canRender=!0,e.push(t)))}return e}updateModel(e){const{assetManager:t,sourceStorage:i,styleManager:n}=this.mapModules,o=this.mapState,{modelIndices:r,modelZooms:s}=e.attributes;if(!r.length)return this.setCurrentLayerModelId(e),!1;const a=function(e,t){let i=0;for(;i<e.length&&!(t<e[i]);)i++;return i-1}(s,o.styleZoom);if(-1===a)return this.setCurrentLayerModelId(e),!1;const l=r[a];if(void 0===l)return this.setCurrentLayerModelId(e),!1;const d=t.getModel(l);if(d&&"loaded"===d.status)return this.setCurrentLayerModelId(e,l),!0;if(!d){const i=n.getStyleLayer(e.attributes.styleId,e.attributes.layerId),o=t.getDataModelUrlById(l);i&&(void 0===o?t.loadModelByIndex(l,i):o.length&&t.loadModel(o,l,!1,i))}if(1===r.length)return this.setCurrentLayerModelId(e),!1;const c=i.getSourceById(e.attributes.sourceId);if(!c)return this.setCurrentLayerModelId(e),!1;const h=c.getZoomDirection();if(h===yc.Y.Stationary){const i=this.getCurrentLayerModelId(e);if(void 0===i)return this.setCurrentLayerModelId(e),!1;const n=t.getModel(i);if(n&&"loaded"===n.status)return this.setCurrentLayerModelId(e,i),!0}else{const i=r.slice(0,a).reverse(),n=r.slice(a+1),o=h===yc.Y.ZoomingIn?i.concat(n):n.concat(i);for(let i=0;i<o.length;i++){const n=t.getModel(o[i]);if(n&&"loaded"===n.status)return this.setCurrentLayerModelId(e,o[i]),!0}}return this.setCurrentLayerModelId(e),!1}syncStateWithSceneObjects(e){const t=new Set;for(const i of e){const e=xc(i),n=this.modelInfo[e],o=i.tile.dynamicObject instanceof gc&&i.tile.dynamicObject.isAnimationDisabled();t.add(e),this.modelsAnimator.has(e)||this.startAnimation(e,n,o),this.modelInfo[e]?this.objectIdToLayerModelKey[i.id]||this.indexateObject(e,i,n):this.addLayerModel(i,e)}const i=this.mapState.styleZoom;for(const e in this.modelInfo){const n=this.modelInfo[e];t.has(e)||this.removeLayerModel(e,n),(i<n.layer.minzoom||i>=n.layer.maxzoom)&&this.removeLayerModel(e,n)}}addLayerModel(e,t){var i;const n=this.mapModules.styleManager.getStyleLayer(e.attributes.styleId,e.attributes.layerId);if(!n)return;const o={layer:n,isCommercial:1===e.attributes.isCommModel,linkedIds:[],ownerIds:new Set,visible:!1};return o.isCommercial&&(o.mapPoint=(0,E.projectGeoToMap)(e.attributes.lngLat),o.buildingId=(null===(i=e.meta)||void 0===i?void 0:i.buildingId)||""),this.indexateObject(t,e,o),this.modelInfo[t]=o,o}startAnimation(e,t,i){var n;if(i)return void this.modelsAnimator.add(e,1,1);const o=null!==(n=t.layer.minzoom)&&void 0!==n?n:NaN;t.linkedIds.length>0&&this.mapModules.buildingHeightAnimator.getBuildingHeight(o)>.5?this.modelsAnimator.add(e,.5,1):this.modelsAnimator.add(e)}generateCommModelEvents(e){const t=this.mapModules.camera.getViewportVertices();for(const i of e){const e=this.modelInfo[i];if(!e.isCommercial||!e.mapPoint)continue;const n=(0,Ni.M4)(t,{min:e.mapPoint,max:e.mapPoint}),o=e.visible;n!==o&&(e.visible=n,n&&!o?this.emitCommModelShow(e,i):this.emitCommModelHide(e,i))}}indexateObject(e,t,i){var n,o,r;this.objectIdToLayerModelKey[t.id]=e,i.ownerIds.add(t.id),i.buildingId=(null===(n=t.meta)||void 0===n?void 0:n.buildingId)||"",i.buildingId&&this.buildingIds.add(i.buildingId);const s=null!==(r=null===(o=t.meta)||void 0===o?void 0:o.linkedIds)&&void 0!==r?r:[];if(i.linkedIds.push(...s),"c3d"!==t.tile.purpose)for(const e of s)this.linkedIdToObjectId[e]=t.id}removeLayerModel(e,t){for(const e of t.linkedIds)this.mapState.objectsIdsToUpdate.add(e),this.mapState.hiddenObjects.other.delete(e);for(const e of t.ownerIds)delete this.objectIdToLayerModelKey[e];t.buildingId&&this.buildingIds.delete(t.buildingId),this.modelsAnimator.remove(e),t.visible&&this.emitCommModelHide(t,e),delete this.modelInfo[e]}linkedIdToLayerModelKey(e){const t=this.linkedIdToObjectId[e];if(!t)return null;const i=this.objectIdToLayerModelKey[t];return i||null}emitCommModelHide({buildingId:e,isCommercial:t},i){t&&(e?this.mapModules.map.emit("commmodelhide",{buildingId:e}):console.warn(`No buildingId for commercial model ${i}`))}emitCommModelShow({buildingId:e,isCommercial:t},i){t?e?this.mapModules.map.emit(bc,{buildingId:e}):console.warn(`No buildingId for commercial model ${i}`):console.warn(`Could not send commmodelshow event for non-commercial model ${i}`)}updateObjectsVisibility(){var e;for(const t in this.modelInfo){const i=this.modelInfo[t],n=null!==(e=this.modelsAnimator.getReadiness(t))&&void 0!==e?e:0;for(const e of i.linkedIds)this.mapState.hiddenObjects.gltfModel.has(e)?this.mapState.hiddenObjects.other.has(e)||(this.mapState.hiddenObjects.other.add(e),this.mapState.objectsIdsToUpdate.add(e)):n>.5&&!this.mapState.hiddenObjects.other.has(e)?(this.mapState.hiddenObjects.other.add(e),this.mapState.objectsIdsToUpdate.add(e)):n<.5&&this.mapState.hiddenObjects.other.has(e)&&(this.mapState.hiddenObjects.other.delete(e),this.mapState.objectsIdsToUpdate.add(e))}}}function xc({attributes:e}){return`${e.layerId}${JSON.stringify(e.modelIndices)}`}function Sc(e,t,i){return`${e}_${t}_${JSON.stringify(i)}`}const Ic=1/0;class Mc{constructor(e,t){this.prevFrameAnimationLayerindex=void 0,this.cacheObjectsCount=0,this.needRerenderCore=!1,this.animationLayersMinIndex=Ic,this.state=e,this.modules=t,this.copyProgram=this.modules.renderer.getShaderProgram("copyDepth");const i=new Tt.l(new Uint8Array([-1,-1,1,-1,1,1,-1,1]));this.vao=((e,t)=>{const i=new Et.K(e,{itemSize:2,dataType:Tt.l.Byte,stride:0,offset:0,normalized:!1});return new Pt(t,{a_vec2_vertex:i})})(i,this.copyProgram),this.cacheFramebufferId=void 0,this.isReadyCache=!1,this._gl=this.modules.renderer.getRenderingContext(),this.isLowZoom=this.state.zoom<6,this.cacheDisabled=!1,this.animationLayersUniqueIds=new Set,this.needRerenderCore=!1,this.debugMode=!1}frameEnd(){this.needRerenderCore&&this.modules.renderer.addRerenderEvent()}initInDebugMode(){this.debugMode=!0}frameStart(){this.cacheObjectsCount=0,this.isLowZoom=this.state.zoom<6,this.isReadyCache=!1;let e=!1;this.needRerenderCore=!1,this.animationLayersUniqueIds.clear(),this.cacheFramebufferId||this.cacheDisabled||(this.cacheFramebufferId=this.createCacheFramebuffer()),this.cacheDisabled||(this.animationLayersMinIndex=Ic,this.state.rerenderEvents.forEach((t=>{if("layerAnimationTicker"===t.type){const e=this.getUniqueRenderIndex(t.styleId,t.layerId);this.animationLayersUniqueIds.add(e),this.animationLayersMinIndex=Math.min(this.animationLayersMinIndex,e)}else e=!0})),this.animationLayersMinIndex!==Ic&&this.animationLayersMinIndex===this.prevFrameAnimationLayerindex&&(this.isReadyCache=!0),(this.state.needRerender||e)&&(this.prevFrameAnimationLayerindex=void 0,this.isReadyCache=!1))}checkFlatObjectAnimation(e){const t=this.getUniqueRenderIndex(e.attributes.styleId,e.attributes.layerId);this.animationLayersUniqueIds.has(t)&&(this.needRerenderCore=!0)}tryToCacheObjects(e,t,i){if(this.cacheDisabled)return!1;if(!this.cacheFramebufferId||this.animationLayersMinIndex===Ic||this.isLowZoom)return!1;return!(this.getUniqueRenderIndex(t.attributes.styleId,t.attributes.layerId)>=this.animationLayersMinIndex)&&(e[this.cacheFramebufferId]||(e[this.cacheFramebufferId]={framebuffer:this.modules.renderer.getFramebuffer(this.cacheFramebufferId),objects:[],tileObjects:new Set}),this.cacheObjectsCount++,this.isReadyCache||(e[this.cacheFramebufferId].objects.push(t),e[this.cacheFramebufferId].tileObjects.add(i)),!0)}hasReadyCache(){return this.isReadyCache&&!this.cacheDisabled}render(){var e;if(this.cacheDisabled)return!1;if(!this.cacheFramebufferId||0===this.cacheObjectsCount||this.isLowZoom)return;this.prevFrameAnimationLayerindex=this.animationLayersMinIndex;const t=null===(e=this.modules.renderer.getFramebuffer(this.cacheFramebufferId))||void 0===e?void 0:e.renderTarget;t&&(this.isWebgl2Context()?this.copyRenderTargetToCanvasBlit(this._gl,t):this.copyRenderTargetToCanvasTexture(this._gl,t))}destroy(){this.cacheFramebufferId=void 0,this.vao.remove()}getUniqueRenderIndex(e,t){const i=this.modules.styleManager.getStyleLayer(e,t);if(!i)return Ic;return-e*this.modules.styleManager.getMaxLayersCount()+i.renderIndex}createCacheFramebuffer(){if(!this.isWebgl2Context()&&!this.modules.renderer.webGlExtensions.EXT_frag_depth)return console.warn('Render cache disabled - WebGL extension "EXT_frag_depth" not available'),void(this.cacheDisabled=!0);const e=this.modules.renderer.getViewportSize(),t=this.modules.renderer.webglContextState.MAX_TEXTURE_SIZE;if(Math.max(...e)>t)return(0,$n.cM)(`Disabling post-effects as viewport size ${e[0]}x${e[1]} exceeds hardware limits of ${t}x${t}`),void(this.cacheDisabled=!0);const i=this._gl,n=$e.LinearFilter,o=this.modules.renderer.getViewportSize(),r=new Ye({size:[o[0],o[1]],magFilter:n,minFilter:n,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,useHighDepthPrecision:!0,depthInternalFormat:this.isWebgl2Context()?WebGL2RenderingContext.DEPTH_COMPONENT24:WebGLRenderingContext.DEPTH_COMPONENT16,depthTexture:!this.isWebgl2Context(),format:this.isWebgl2Context()&&this.debugMode?$e.RedFormat:$e.RgbaFormat});return this.modules.renderer.addFramebuffer({onResize:()=>{const e=this.modules.renderer.getViewportSize();r.setSize([e[0],e[1]]),r.bind(i),r.unbind(i)},renderTarget:r,onRenderStart:()=>{if(this.isReadyCache||!this.cacheFramebufferId)return;const e=this.modules.renderer.getFramebuffer(this.cacheFramebufferId);if(!e)return;e.renderTarget.bind(i);const t=(0,K.m2)((0,qn.MV)(this.state.defaultBackgroundColor)),n=i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT;this.storeWebglState(i),i.depthMask(!0),i.enable(i.DEPTH_TEST),i.clearDepth(1),i.clearColor(t[0],t[1],t[2],t[3]),i.clear(n),e.renderTarget.unbind(i),this.restoreWebglState(i)},onRenderEnd:()=>{},isCacheFramebuffer:!0,useDem:!0,renderIndex:Ic})}isWebgl2Context(){return!(this.modules.map.getWebGLContext()instanceof WebGLRenderingContext)}copyRenderTargetToCanvasBlit(e,t){if(!this.cacheFramebufferId)return;const i=this.modules.renderer.getViewportSize(),{viewport:n}=this.state,o=window.devicePixelRatio;e.bindFramebuffer(e.FRAMEBUFFER,null),t.bind(e,e.READ_FRAMEBUFFER),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.clearBufferfv(e.DEPTH,0,[0,0,0,0]),e.blitFramebuffer(0,0,t.options.size[0],t.options.size[1],0+n.left*o,0+n.bottom*o,i[0]+n.left*o,i[1]+n.bottom*o,e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT,e.NEAREST)}copyRenderTargetToCanvasTexture(e,t){const{viewport:i}=this.state,n=window.devicePixelRatio,o=this.modules.renderer.getViewportSize();e.bindFramebuffer(e.FRAMEBUFFER,null),e.viewport(i.left*n,i.bottom*n,o[0],o[1]),this.storeWebglState(e),e.depthMask(!0),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),this.debugMode&&(e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA_SATURATE,e.ONE_MINUS_SRC_COLOR));const r=this.modules.renderer.webGlExtensions;this.vao.bind({gl:e,extensions:r});const s=t.getTexture();null==s||s.enable(e,0);const a=t.getDepthAttachment();null==a||a.enable(e,1),this.copyProgram.enable(e),this.copyProgram.bind(e,{u_texture:0,u_depth:1}),e.drawArrays(e.TRIANGLE_FAN,0,4),this.restoreWebglState(e)}storeWebglState(e){this.stateWebgl={depthmask:e.getParameter(e.DEPTH_WRITEMASK),depthTest:e.getParameter(e.DEPTH_TEST),depthFunc:e.getParameter(e.DEPTH_FUNC),clearDepth:e.getParameter(e.DEPTH_CLEAR_VALUE)}}restoreWebglState(e){this.stateWebgl&&(e.depthMask(this.stateWebgl.depthmask),this.stateWebgl.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(this.stateWebgl.depthFunc),e.clearDepth(this.stateWebgl.clearDepth))}}const Tc=ee.Ue(),Ec=ee.Ue(),Pc=qe.Ue(),Lc=ee.al(0,0,1),Ac=ee.Ue();class Cc{constructor(e,t){this.clipToShadowMatrix=new Float32Array(16),this.baseBias=T.defaultShadowsSettings.bias,this.bias=0,this.shadowMapParams=new Float32Array([T.defaultShadowsSettings.textureSize[0],T.defaultShadowsSettings.textureSize[1],T.defaultShadowsSettings.shadowRadius,1]),this.volumeMultiplier=2,this.volumeMinSize=Math.pow(2,15),this.discreteVolume=!1,this.volumeSizeStep=Math.pow(2,15),this.adaptiveVerticalSize=!0,this.debugDraw=!1,this.shadowMatrix=new Float64Array(16),this.orthoMath=new Float64Array(16),this.renderTarget=null,this.debugSize=400,this.lightDir=ee.Fv(new Float32Array(3),[1,-1,-1]),this.shadowLightDir=null,this.modules=t,this.mapState=e;const i=new Tt.l(new Uint8Array([-1,-1,1,-1,1,1,-1,1]));this.copyProgram=this.createDebugProgram(),this.debugVao=Ci(i,this.copyProgram)}get texture(){if(!this.renderTarget)return null;const e=this.renderTarget.getDepthAttachment();return e instanceof $e?e:this.renderTarget.getTexture()}setShadowResolution(e,t){this.shadowMapParams[0]=e,this.shadowMapParams[1]=t,this.renderTarget&&this.renderTarget.setSize([e,t])}update(){this.shadowLightDir=null;const e=this.modules.styleManager.getStyle(this.mapState.handyStyleId);if(!e||!e.light.lightingModesResolved)return void(this.renderTarget&&this.renderTarget.remove());const t=e.light.lightingModesResolved;for(const e in t){const i=t[e];if(0===i.shadowLightIndex){this.shadowLightDir=i.dir1Direction,this.shadowMapParams[2]=i.shadowRadius;break}if(1===i.shadowLightIndex){this.shadowLightDir=i.dir2Direction,this.shadowMapParams[2]=i.shadowRadius;break}}this.shadowLightDir?this.renderTarget||(this.renderTarget=this.createRenderTarget()):this.renderTarget&&this.renderTarget.remove()}drawShadowMap(e){if(!this.shadowLightDir||!this.renderTarget)return;ee.tk(this.lightDir,this.shadowLightDir);const t=e.filter((e=>{for(const t of e.shadowChildren){const e=this.modules.styleManager.getStyleLayerForObject(t);if(!e)continue;const i=It(e,this.modules,this.mapState);if(i&&i.lightConfig.shadowLightIndex>-1)return!0}return!1})),i=Ma(this.mapState,this.modules,void 0,this.renderTarget),n=this.modules.map.state.center,o=this.modules.camera.position[2];let r=Math.max(this.volumeMultiplier*o);this.discreteVolume&&(r-=r%this.volumeSizeStep),r=Math.max(r,this.volumeMinSize),this.shadowMapParams[3]=this.baseBias/r,this.bias=5e-8*this.baseBias*Math.sqrt(r),this.bias=Math.min(this.bias,.01);let s=1;if(this.adaptiveVerticalSize){const e=Math.abs(ee.AK(this.lightDir,Lc));s=Math.max(e,.3)}const a=r,l=s*r,d=3*r;qe.M5(this.orthoMath,-a,a,-l,l,-d,d);const c=Pc;qe.zB(c,Ac,this.lightDir,Lc);const h=ee.fF(Tc,n,c),u=2*a/this.shadowMapParams[0],m=2*l/this.shadowMapParams[1],f=ee.al(h[0]-h[0]%u,h[1]-h[1]%m,h[2]),p=qe.U_(c,c),_=ee.fF(Ec,f,null!=p?p:qe.yR(Pc)),v=ee.IH(Tc,_,this.lightDir);qe.zB(this.shadowMatrix,_,v,Lc),qe.Jp(this.shadowMatrix,this.orthoMath,this.shadowMatrix);const g=this.modules.camera.viewProjectionMatrixInverse;qe.Jp(this.clipToShadowMatrix,this.shadowMatrix,g);const y=this.modules.renderer.getRenderingContext(),b=[];t.forEach((e=>{e.updateMvpMatrix(this.shadowMatrix)})),t.forEach((e=>{b.push(...e.shadowChildren)})),this.renderTarget.bind(y),nn(y,Sn,this.modules.renderer.lastAppliedGlState),y.clearColor(1,1,1,1),y.clearDepth(1),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT),y.viewport(0,0,this.renderTarget.options.size[0],this.renderTarget.options.size[1]),oa(this.mapState,this.modules,b,i),this.renderTarget.unbind(y)}drawDebugFbIfNeeded(){if(!this.debugDraw)return;const e=this.texture;if(!e)return;const t=this.mapState.viewport,i=this.modules.renderer.getViewportSize(),n=this.debugSize,o=this.modules.renderer.getRenderingContext();o.bindFramebuffer(o.FRAMEBUFFER,null),o.viewport(i[0]+t.left-n,t.bottom,n,n);const r=this.modules.renderer.webGlExtensions;nn(o,cn,this.modules.renderer.lastAppliedGlState),this.copyProgram.enable(o),this.copyProgram.bind(o,{u_texture:1}),e.enable(o,1),this.debugVao.bind({gl:o,extensions:r}),o.drawArrays(o.TRIANGLE_FAN,0,4)}createRenderTarget(){const e=[this.shadowMapParams[0],this.shadowMapParams[1]];return zn(this.modules.renderer.getRenderingContext())?new Ye({size:e,magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,depthTexture:!0,hasColorOutput:!1,compareFunc:$e.CompareRefToTexture}):new Ye({size:e,magFilter:$e.NearestFilter,minFilter:$e.NearestFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping,flipY:!1,type:$e.UnsignedByte,useHighDepthPrecision:!0})}createDebugProgram(){const e=[];zn(this.modules.renderer.getRenderingContext())&&e.push({type:"IS_DEPTH_TEXTURE"});const t=Qe.createShaderDefinitions(e);return this.modules.renderer.getShaderProgram("copy",t)}}class zc{constructor(e,t,i){this.map=i,this.camera=new Xi.V(e),this.layout=new ic(t),this.collector=new Ke.P("main"),this.workers=new jl,this.styleManager=new Ja(this),this.assetManager=new ul(e,this),this.imageManager=new nc(this),this.floorManager=new nd(e,this),this.personalPoiManager=new xl(e,this),this.buildingHeightAnimator=new Xe(e,this),this.modelsScene=new wc(e,this),this.renderer=new Fa(e,this),this.layers=new Wl(this),this.sourceStorage=new ac,this.tileManager=new od(e,this),this.modelLayer=new yl(e,this),this.dynamicStyle=new Z.hX,this.imageCache=new ql(this),this.identifier=new Ba(e,this),this.labeler=new sd(e,this),this.ruler=new Rd(e,this),this.trafficTileLayer=new tc(e,this),this.handler=new Kd(e,this),this.mouseMoveHandler=new Ze(this),this.tileKeyInfo=new sc(e),this.demManager=new Hn(this),this.defaultSource=new hc(e,this),this.labelsDebug=new mc(e,this),this.environmentManager=new fc(this),this.postEffectsManager=new Yn(e,this),this.renderCacheManager=new Mc(e,this),this.shadowManager=new Cc(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.renderCacheManager.destroy(),this.tileKeyInfo.destroy(),this.layout.destroy()}}class kc{constructor(e,t={},i){var n,o,r,s,a,l,d,c,h,u;this.isStyleUpdateInProgress=!1,this.isFirstStyleUpdate=!0,this.lastResizeTime=-1/0,this.replicasDiffer=new De([{path:"visibleMapReplicas",type:"replicas"}]),this.renderLoop=e=>{this.requestedFrame=requestAnimationFrame(this.renderLoop),this.updateImmersiveLevel(),this.modules.map.emit("framestart");const t=this.state;t.time=Date.now(),t.collectStats&&(t.stats.drawCount=0,t.stats.vertexCount=0,t.stats.tileCount=0);const i=t.metrics,n=performance.now()-i.start>T.metricsTimeout;if(Number.isNaN(i.interactive+i.firstlabeling+i.ready)&&!n||t.metricsSent||(i.fail=n,this.modules.map.emit("metrics",t.metrics),t.metricsSent=!0),this.state.enableTrackResize&&this.autoResize(e),this.modules.mouseMoveHandler.update(),this.handlers.forEach((e=>e.update())),Se(t),de(t),fe(t),ye(t),this.stillnessUpdater.update(t),oe(t,this.modules.layout.rootContainer),((e,t,i)=>{$.Vx("viewport",{step:(e,n)=>{e.viewport={top:n[0],right:n[1],bottom:n[2],left:n[3]},Y(e,t,i)}},e)})(t,this.modules.layout.rootContainer,this.modules.renderer),((e,t)=>{$.Vx("padding",{step:(e,i)=>{e.padding={top:i[0],right:i[1],bottom:i[2],left:i[3]},Q(e,t)}},e)})(t,this.modules.renderer),t.demMode=this.checkDemEnabled()&&t.elevationScale>0,this.modules.camera.update(),t.pitch=this.modules.camera.correctedPitch,this.updateElevation(),this.updateTilesBounds(),this.replicasDiffer.check(t)&&(t.needReplicasUpdate=!0),this.modules.demManager.update(),this.modules.environmentManager.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.styleManager.update(),this.modules.buildingHeightAnimator.update(),this.modules.modelsScene.update(),this.modules.shadowManager.update(),this.modules.map.emit("update"),this.modules.labeler.update(),this.performanceChecker.update(),this.modules.identifier.update(),this.modules.postEffectsManager.update(),t.loopWorld&&!this.modules.renderer.isNeedRerender()&&(0,A.kC)(t.center),T.render.alwaysRerender||this.modules.renderer.isNeedRerender()){let e=this.modules.tileManager.getTileObjects();t.demMode&&(e=e.concat(this.modules.demManager.getGroundTiles())),this.modules.renderer.rebuildExternalShaderDefinitions(),Number.isNaN(t.metrics.firstdraw)&&(t.metrics.firstdraw=performance.now()-t.metrics.start),e.forEach((e=>{e.needSync&&e.syncReplicas(this.state)})),this.modules.renderCacheManager.frameStart(),this.modules.shadowManager.drawShadowMap(e),this.modules.renderer.renderLabelingTexture(e),this.modules.renderer.renderTileObjects(e),this.modules.shadowManager.drawDebugFbIfNeeded(),t.needRerender=!1,this.state.rerenderEvents=new Array,this.modules.renderCacheManager.frameEnd(),t.collectStats&&this.modules.map.emit("stats",t.stats)}this.finishStyleUpdatingCheck(),this.modules.map.update(),this.isReady()&&this.modules.assetManager.invalidateUsedGltfModels(),t.needReplicasUpdate=!1,t.shouldIsReadyWaitForUpdates=!1,this.modules.map.emit("frameend")};const m=Object.assign(Object.assign({},kc.options),t),f=Object.assign(Object.assign({},kc.options.padding),m.padding),p=Object.assign(Object.assign({},kc.options.viewport),m.viewport),_=m.maxBounds?te.X3(m.maxBounds):m.loopWorld?A._L:A.Vv,v=(0,A.yq)(m.center);(0,A.kC)(v),te.Rk(v,_,v);const g=this.state={time:Date.now(),center:v,zoom:void 0!==m.styleZoom?(0,A.Z3)(m.styleZoom,v):m.zoom,rotation:(0,pe.Id)(m.rotation),pitch:(0,pe.Id)(m.pitch),styleZoom:void 0!==m.styleZoom?m.styleZoom:(0,A.X$)(m.zoom,v),zoomTypePreserving:void 0!==m.styleZoom?"styleZoom":"zoom",minZoom:m.minZoom,maxZoom:m.maxZoom,maxBounds:_,loopWorld:null!==(n=m.loopWorld)&&void 0!==n&&n,touchRotationThreshold:(0,pe.Id)(m.touchRotationThreshold),minPitch:(0,pe.Id)(m.minPitch),maxPitch:(0,pe.Id)(m.maxPitch),lowZoomMaxPitch:m.lowZoomMaxPitch?(0,pe.Id)(m.lowZoomMaxPitch):null,size:[Math.max(1,e.clientWidth-p.left-p.right),Math.max(1,e.clientHeight-p.top-p.bottom)],selectedIds:[],hiddenObjects:{other:new Set,gltfModel:new Set},objectsIdsToUpdate:new Set,tickers:{},stillness:1,needRerender:!0,needLabeling:!1,needReplicasUpdate:!1,userHasInteracted:!1,viewport:p,padding:f,labelingOpacity:0,tileServer:m.tileServer,tileSet:m.tileSet,tileProtocol:m.tileProtocol,commercialTileSet:m.commercialTileSet,modelsTileSet:null!==(o=m.modelsTileSet)&&void 0!==o?o:T.models.tileSet,modelsTilesUrl:null!==(r=m.modelsTilesUrl)&&void 0!==r?r:T.urls.models,defaultSourceModelsRootUrl:m.defaultSourceModelsRootUrl,defaultSourceModelsAppearStrategy:m.defaultSourceModelsAppearStrategy,subdomains:m.subdomains.split(""),floorsEnabled:m.floorsEnabled,floorsUrl:m.floorsUrl,collectStats:m.collectStats,stats:{tileCount:0,dynamicTileCount:0,drawCount:0,vertexCount:0},trafficServer:m.trafficServer,trafficProtocol:m.trafficProtocol,identifyPickDistance:T.identify.pickDistance,lang:m.lang,tileServerDefaultLang:m.tileServerDefaultLang,tileKey:m.key,appId:m.appId,disableHoverStyles:m.disableHoverStyles,keepCenterWhileUserZoomRotate:!!m.keepCenterWhileUserZoomRotate,disableRotationByUserInteraction:!!m.disableRotationByUserInteraction,disablePitchByUserInteraction:!!m.disablePitchByUserInteraction,disableDragging:!!m.disableDragging,performanceCaveatEmitted:!1,sessionId:m.sessionId,tileSessionId:m.tileSessionId,shownRegionIds:new Set,preserveDrawingBuffer:!!m.preserveDrawingBuffer,defaultBackgroundColor:m.defaultBackgroundColor,handyStyleId:NaN,styleState:Ql(m.styleState),disableIconCache:m.disableIconCache,rtlPlugin:{scenario:null!==(s=m.useRtlTextPlugin)&&void 0!==s?s:"depends-on-language",loadFailed:!1,url:null!==(a=m.rtlPluginUrl)&&void 0!==a?a:oc.k0,hash:null!==(l=m.rtlPluginHash)&&void 0!==l?l:oc.aT},mobileSdkMode:m.mobileSdkMode,demMode:!1,visibleMapReplicas:[0],tilesBounds:[[0,0],[0,0],[0,0],[0,0]],extendedTilesBounds:[[0,0],[0,0],[0,0],[0,0]],elevation:void 0,elevationScale:0,minElevation:void 0,skipElevationAnimation:m.skipElevationAnimation,metrics:{start:performance.now(),init:NaN,firstdraw:NaN,firstlabeling:NaN,firstcontent:NaN,interactive:NaN,ready:NaN,fail:!1},metricsSent:!1,shouldIsReadyWaitForUpdates:!1,commercialPoiRandomSeed:m.commercialPoiRandomSeed,disableSurvivedPoiPrevalence:Boolean(m.disableSurvivedPoiPrevalence),webglVersion:m.webglVersion,enableTrackResize:!!m.enableTrackResize,autoResizeInterval:T.render.autoResizeInterval,showDefaultTileBounds:!!m.showDefaultTileBounds,immersiveLevel:{tiers:!1},pitchHightLimitation:void 0===m.pitchHightLimitation?(0,pe.Id)(90):(0,pe.Id)(m.pitchHightLimitation),labelingDepthTestDisabled:!1,disableAntiAliasing:null===(d=m.disableAntiAliasing)||void 0===d||d,rerenderEvents:new Array,cameraConfig:Object.assign({},T.defaultCameraConfig),cityCommPoiLabeling:{config:m.cityCommPoiLabelingConfig,ascSortedZoomNumbers:(y=m.cityCommPoiLabelingConfig,y?Object.keys(y).map(Number).sort(((e,t)=>e-t)):[])},trafficMinZoom:null!==(c=m.trafficMinZoom)&&void 0!==c?c:T.traffic.minZoom,trafficMaxZoom:null!==(h=m.trafficMaxZoom)&&void 0!==h?h:T.traffic.maxZoom,trafficMaxDetailLevel:null!==(u=m.trafficMaxDetailLevel)&&void 0!==u?u:T.traffic.maxDetailLevel};var y,b,w,x,S,I,M;m.cameraConfig&&Object.assign(g.cameraConfig,m.cameraConfig),this.modules=new zc(g,e,i),"number"==typeof g.commercialPoiRandomSeed&&this.modules.workers.labeling.setCommercialPoiRandomSeed(g.commercialPoiRandomSeed),this.modules.styleManager.setDynamicStyle(this.modules.dynamicStyle.getStyle()),this.handlers=[new je(g,this.modules.layout.mapContainer),new Ne(this.modules)],m.disableZoomOnScroll||this.handlers.push(new Oe(g,this.modules.layout.mapContainer)),Le&&Ae&&this.handlers.push(new Ue(g,e,i)),this.performanceChecker=new Ve(g),this.stillnessUpdater=new He,this.requestedFrame=requestAnimationFrame(this.renderLoop),m.sendAnalytics&&(b=window,w=document,x="script",S="ga",b.GoogleAnalyticsObject=S,b.ga=b.ga||function(){(b.ga.q=b.ga.q||[]).push(arguments)},b.ga.l=Date.now(),I=w.createElement(x),M=w.getElementsByTagName(x)[0],I.async=1,I.src="https://www.google-analytics.com/analytics.js",M.parentNode.insertBefore(I,M),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")))}destroy(){cancelAnimationFrame(this.requestedFrame),this.modules.destroy(),this.handlers.forEach((e=>e.destroy()))}isIdle(){return!this.modules.renderer.isNeedRerender()&&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.modelsScene.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.modules.postEffectsManager.isReady()&&!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}getIsFirstStyleUpdate(){return this.isFirstStyleUpdate}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.modelsScene.finishStyleUpdating(),this.modules.personalPoiManager.redraw();const e=this.modules.styleManager.getStyle(this.state.handyStyleId);e&&(this.modules.renderer.setClearColor(e.background.color),this.modules.postEffectsManager.setClearColor(e.background.color)),this.isStyleUpdateInProgress=!1,this.isFirstStyleUpdate=!1,this.modules.renderer.addRerenderEvent(),this.state.needLabeling=!0}}checkDemEnabled(){return!0===this.state.styleState.terrainEnabled?this.modules.demManager.isEnabled()||this.modules.demManager.enable():this.modules.demManager.isEnabled()&&this.modules.demManager.disable(),this.modules.demManager.isEnabled()}updateImmersiveLevel(){const e=!!this.state.styleState.immersiveRoadsOn;this.state.immersiveLevel.tiers=e&&this.state.styleZoom>=T.DEFAULT_MIN_TIERS_STYLE_ZOOM}updateTilesBounds(){const{size:e,zoom:t}=this.state,[i,n,o,r]=this.modules.camera.getViewportVertices(),s=(0,Ki.hS)(i,n);let a=(0,Ki.Oy)(o,s);const l=this.state.cameraConfig;let d=(0,A.h0)(e[1],t)*l.viewportLimitRatio;if(d<l.minTrapezeHeight&&(d=l.minTrapezeHeight),a>d){const e=d/a;ee.t7(o,n,o,e),ee.t7(r,i,r,e),a=d}if(ee.JG(this.state.tilesBounds[0],i),ee.JG(this.state.tilesBounds[1],n),ee.JG(this.state.tilesBounds[2],o),ee.JG(this.state.tilesBounds[3],r),this.state.visibleMapReplicas=this.state.loopWorld?(0,H.tW)(this.state.tilesBounds):[0],this.state.demMode){const e=(0,Ki.iE)(this.modules.camera.position,s);if(e<0){const t=(a+Math.abs(e))/a;ee.t7(i,r,i,t),ee.t7(n,o,n,t)}if(void 0!==this.state.elevation&&!Number.isNaN(this.state.elevation)){const e=this.modules.camera.position[2],t=void 0===this.state.minElevation||Number.isNaN(this.state.minElevation)?this.state.elevation:this.state.minElevation,s=Math.max(this.state.elevation-t,0)*A.C/e+1,a=(s-1)*Math.max(1-this.state.pitch/this.state.maxPitch,.1)+1,l=Math.max(this.state.pitch/this.state.maxPitch*30,4);ee.t7(i,this.modules.camera.position,i,Math.min(a,l)),ee.t7(n,this.modules.camera.position,n,Math.min(a,l)),ee.t7(r,this.modules.camera.position,r,Math.min(s,l)),ee.t7(o,this.modules.camera.position,o,Math.min(s,l))}}this.state.extendedTilesBounds[0]=i,this.state.extendedTilesBounds[1]=n,this.state.extendedTilesBounds[2]=o,this.state.extendedTilesBounds[3]=r}updateElevation(){if(this.state.elevationScale=this.modules.demManager.getVerticalScale(),!this.state.demMode)return void(void 0!==this.state.elevation&&(this.modules.renderer.addRerenderEvent(),this.state.elevation=void 0));const e=this.modules.demManager.getElevation(this.state.center);if(void 0!==e)if(void 0===this.state.elevation||this.state.skipElevationAnimation)this.state.elevation=e;else{const t=.1*(e-this.state.elevation);Math.abs(t)<.3?this.state.elevation=e:this.state.elevation+=t;const i=this.modules.demManager.getElevation(this.modules.camera.position);if(void 0!==i){const e=this.state.elevationScale,t=i*e,n=this.modules.camera.position[2]/A.C,o=Math.min(30,.2*n),r=this.state.elevation*e+n-o;t>r&&(this.state.elevation+=(t-r)/e)}}const t=this.modules.demManager.getMinElevation();void 0!==t&&(this.state.minElevation=t)}autoResize(e){if(e-this.lastResizeTime>=this.state.autoResizeInterval){const t=this.modules.layout.canvas,{clientWidth:i,clientHeight:n}=this.modules.layout.rootContainer,o=window.devicePixelRatio;t.width===Math.floor(i*o)&&t.height===Math.floor(n*o)||(this.lastResizeTime=e,this.modules.map.invalidateSize())}}}kc.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,lowZoomMaxPitch: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({},Jl),styleOptions:{rootUrl:"",iconsPath:"",fontsPath:"",stylePath:"",modelsPath:""},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,skipElevationAnimation:!1,enableTrackResize:!1,showDefaultTileBounds:!1,immersiveOn:!1,pitchHightLimitation:90,trafficMinZoom:T.traffic.minZoom,trafficMaxZoom:T.traffic.maxZoom,trafficMaxDetailLevel:T.traffic.maxDetailLevel};const Rc=["disableDragging","enableTrackResize","loopWorld"];var Fc=i(3379),Oc=i.n(Fc),Dc=i(7795),Bc=i.n(Dc),jc=i(569),Nc=i.n(jc),Uc=i(3565),Vc=i.n(Uc),Gc=i(9216),Hc=i.n(Gc),Zc=i(4589),Wc=i.n(Zc),Xc=i(5618),Kc={};Kc.styleTagTransform=Wc(),Kc.setAttributes=Vc(),Kc.insert=Nc().bind(null,"head"),Kc.domAPI=Bc(),Kc.insertStyleElement=Hc();Oc()(Xc.Z,Kc);Xc.Z&&Xc.Z.locals&&Xc.Z.locals;var qc=i(7636),$c=i(9981),Yc=i(1e3),Jc=i(297);const Qc=2,eh=20,th=()=>{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};var ih=i(9865);const nh=5e3;class oh{constructor(e,t){var i;this.queue=[],this.commPoiMsgOrderNumber=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.onCommPoiShowEvent=({commPois:e})=>{const t=Date.now(),{tileKey:i,sessionId:n}=this.map.state;for(const o of e)this.queue.push(rh(o,t,this.commPoiMsgOrderNumber++,i,this.utcOffset,n));this.timer||(this.timer=window.setTimeout(this.sendMessages,nh))},this.onMetricsEvent=e=>{const t=Date.now();this.queue.push(this.getMetricsMessage(e,t)),this.timer||(this.timer=window.setTimeout(this.sendMessages,nh))},this.onSendFail=e=>{this.unsentMessages.push(...e),this.timer||(this.timer=window.setTimeout(this.sendMessages,nh))},this.sendMessages=()=>{this.timer=void 0;const e=[...this.unsentMessages,...this.queue];this.queue=[],this.unsentMessages=[],e.length&&fetch(this.bssUrl,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}).then((t=>{t.ok||this.onSendFail(e)}),(()=>this.onSendFail(e)))},this.map=e,this.bssUrl=null!==(i=t.bssUrl)&&void 0!==i?i:"https://s1.bss.2gis.com/bss/3",t.disableBssStatisticsForCommPoi||e.on("commpoishow",this.onCommPoiShowEvent),e.on("metrics",this.onMetricsEvent)}destroy(){clearTimeout(this.timer),this.queue=[],this.timer=void 0,this.map.off("commpoishow",this.onCommPoiShowEvent)}getMetricsMessage(e,t){const i=function(e){const t={};for(const[i,n]of Object.entries(e))(0,ih.f)(n)?t[i]=Array.from(n):t[i]=n;return t}(function(e){var t,i;const n={1:["stateSetVersion","webGlVersion","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","COMPRESSED_TEXTURE_FORMATS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","PACK_ALIGNMENT","SUBPIXEL_BITS","UNPACK_ALIGNMENT","VIEWPORT","SHADING_LANGUAGE_VERSION","VENDOR","RENDERER","MAX_3D_TEXTURE_SIZE","MAX_ARRAY_TEXTURE_LAYERS","MAX_CLIENT_WAIT_TIMEOUT_WEBGL","MAX_COLOR_ATTACHMENTS","MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS","MAX_COMBINED_UNIFORM_BLOCKS","MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS","MAX_DRAW_BUFFERS","MAX_ELEMENT_INDEX","MAX_ELEMENTS_INDICES","MAX_ELEMENTS_VERTICES","MAX_FRAGMENT_INPUT_COMPONENTS","MAX_FRAGMENT_UNIFORM_BLOCKS","MAX_FRAGMENT_UNIFORM_COMPONENTS","MAX_PROGRAM_TEXEL_OFFSET","MAX_SAMPLES","MAX_SERVER_WAIT_TIMEOUT","MAX_TEXTURE_LOD_BIAS","MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS","MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS","MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS","MAX_UNIFORM_BLOCK_SIZE","MAX_UNIFORM_BUFFER_BINDINGS","MAX_VARYING_COMPONENTS","MAX_VERTEX_OUTPUT_COMPONENTS","MAX_VERTEX_UNIFORM_BLOCKS","MAX_VERTEX_UNIFORM_COMPONENTS","MIN_PROGRAM_TEXEL_OFFSET"]};n[2]=[...n[1],"UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL","precisionLow","precisionMedium","precisionHigh","devicePixelRatio"];const o=null!==(t=n[e[0]])&&void 0!==t?t:{},r={};for(let t=0;t<e.length;t++)r[null!==(i=o[t])&&void 0!==i?i:t]=e[t];return r}(function(e){const t=[2,e instanceof WebGLRenderingContext?1:2,e.getParameter(e.ALIASED_LINE_WIDTH_RANGE),e.getParameter(e.ALIASED_POINT_SIZE_RANGE),e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),e.getParameter(e.MAX_RENDERBUFFER_SIZE),e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),e.getParameter(e.MAX_TEXTURE_SIZE),e.getParameter(e.MAX_VARYING_VECTORS),e.getParameter(e.MAX_VERTEX_ATTRIBS),e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),e.getParameter(e.MAX_VIEWPORT_DIMS),e.getParameter(e.PACK_ALIGNMENT),e.getParameter(e.SUBPIXEL_BITS),e.getParameter(e.UNPACK_ALIGNMENT),e.getParameter(e.VIEWPORT),e.getParameter(e.SHADING_LANGUAGE_VERSION),e.getParameter(e.VENDOR),e.getParameter(e.RENDERER)];e instanceof WebGLRenderingContext?t.push(new Array(28).fill("Unsupported")):t.push(e.getParameter(e.MAX_3D_TEXTURE_SIZE),e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),e.getParameter(e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL),e.getParameter(e.MAX_COLOR_ATTACHMENTS),e.getParameter(e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS),e.getParameter(e.MAX_COMBINED_UNIFORM_BLOCKS),e.getParameter(e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS),e.getParameter(e.MAX_DRAW_BUFFERS),e.getParameter(e.MAX_ELEMENT_INDEX),e.getParameter(e.MAX_ELEMENTS_INDICES),e.getParameter(e.MAX_ELEMENTS_VERTICES),e.getParameter(e.MAX_FRAGMENT_INPUT_COMPONENTS),e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),e.getParameter(e.MAX_FRAGMENT_UNIFORM_COMPONENTS),e.getParameter(e.MAX_PROGRAM_TEXEL_OFFSET),e.getParameter(e.MAX_SAMPLES),e.getParameter(e.MAX_SERVER_WAIT_TIMEOUT),e.getParameter(e.MAX_TEXTURE_LOD_BIAS),e.getParameter(e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS),e.getParameter(e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS),e.getParameter(e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS),e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),e.getParameter(e.MAX_VARYING_COMPONENTS),e.getParameter(e.MAX_VERTEX_OUTPUT_COMPONENTS),e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),e.getParameter(e.MAX_VERTEX_UNIFORM_COMPONENTS),e.getParameter(e.MIN_PROGRAM_TEXEL_OFFSET));const i=e.getExtension("WEBGL_debug_renderer_info");i?t.push(e.getParameter(i.UNMASKED_VENDOR_WEBGL),e.getParameter(i.UNMASKED_RENDERER_WEBGL)):t.push("Unsupported","Unsupported");const n=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT),o=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),r=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);return r&&o&&n?(t.push(`[${n.rangeMin},${n.rangeMax}](${n.precision})`),t.push(`[${o.rangeMin},${o.rangeMax}](${o.precision})`),t.push(`[${r.rangeMin},${r.rangeMax}](${r.precision})`)):t.push(new Array(3).fill("Unsupported")),t.push(window.devicePixelRatio),t}(this.map.getWebGLContext()))),n=this.map.performanceChecker.getFpsStats(),o=this.map.state.center,r=this.map.state.zoom,s=this.map.state.rotation,a=this.map.state.pitch;return{type:411,eventType:"mapglCounter",eventId:th(),timestamp:t,payload:{mapGlMapMetrics:Object.assign(Object.assign({},e),{webglStats:i,fps:n,center:o,zoom:r,rotation:s,pitch:a})},common:{formatVersion:3,appVersion:"v1",product:44}}}}function rh(e,t,i,n,o,r){const s={adsHighlight:!0,entity:{id:e.id,type:"branch"}};void 0!==e.adsPriority&&(s.adsPriority=e.adsPriority);const a={type:302,eventType:"view",eventId:th(),eventOrdinal:i,uiElement:{name:"POI",ownerName:"map"},timestamp:t,utcOffset:o,payload:{POI:s},common:{formatVersion:3,appVersion:"v1",product:44,apikey:n}};return r&&(a.common.sessionId=r),a}const sh=e=>"number"==typeof e&&!isNaN(e)&&e!==Number.NEGATIVE_INFINITY&&e!==Number.POSITIVE_INFINITY;var ah;!function(e){e[e.IgnoreCall=0]="IgnoreCall",e[e.UseDefault=1]="UseDefault"}(ah||(ah={}));const lh={[ah.IgnoreCall]:"Method call will be ignored.",[ah.UseDefault]:"Method call will use default value."};const dh=new class{constructor(e){this.options=e}isValidGeoPoint(e,t){return this.processValidationResult(e,function(e){return Array.isArray(e)&&sh(e[0])&&sh(e[1])}(e),"Invalid GeoPoint",t)}processValidationResult(e,t,i,n){return!t&&this.options.reportToConsole&&console.warn(`${i}: ${JSON.stringify(e)}\n${lh[n]}`),t}}({reportToConsole:!0}),ch=["zoom","rotation","pitch","center"],hh=["static","immersive_roads"];class uh extends C.c{constructor(e,t){var i;super();const n=this.core=new kc(e,t,this);this.state=n.state,this.modules=n.modules,this.performanceChecker=n.performanceChecker,this.values={isMoveChanging:!1,isIdle:!1},ch.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"),ke({eventAction:"FPS",eventLabel:"performancecaveat"})})),this.performanceChecker.on("fps",(e=>ke({eventAction:"FPS",eventLabel:"Average",eventValue:e})));this.setStyle(null!==(i=null==t?void 0:t.style)&&void 0!==i?i:ot.rx,null==t?void 0:t.styleOptions).catch((e=>{if(e instanceof Error)throw e})),this.setLang(this.state.lang),!t||t.disableBssStatistics||Yc.X||(this._bssDispatcher=new oh(this,{disableBssStatisticsForCommPoi:!!t.disableBssStatisticsForCommPoi,bssUrl:t.bssUrl})),this.state.metrics.init=performance.now()-this.state.metrics.start,this.updateDataToggle()}setCenter(e,t){if(!dh.isValidGeoPoint(e,ah.IgnoreCall))return this;this.state.userHasInteracted=!1;let i=(0,A.yq)(e);return this.state.loopWorld||(i=(0,A.I0)(i)),ae(this.state,i,t),this}setZoom(e,t){return(0,pe.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.zoomTypePreserving="zoom",this.state.userHasInteracted=!1,we(this.state,e,t),this.state.shouldIsReadyWaitForUpdates=!0,this):this}setStyleZoom(e,t){if(!(0,pe.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER))return this;const i=(0,A.Z3)(e,this.state.center);return this.state.zoomTypePreserving="styleZoom",this.state.userHasInteracted=!1,we(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,pe.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.userHasInteracted=!1,ue(this.state,(0,pe.Id)(e),t),this):this}setPitch(e,t){return(0,pe.Kh)(e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)?(this.state.userHasInteracted=!1,ve(this.state,(0,pe.Id)(e),t),this):this}setMinPitch(e,t){return this.state.minPitch=(0,pe.Id)(e),this.setPitch((0,pe.ZY)(this.state.pitch),t),this}setMaxPitch(e,t){return this.state.maxPitch=(0,pe.Id)(e),this.setPitch((0,pe.ZY)(this.state.pitch),t),this}setLowZoomMaxPitch(e,t){return this.state.lowZoomMaxPitch=(0,pe.Id)(e),this.setPitch((0,pe.ZY)(this.state.pitch),t),this}setViewport(e,t){return this.state.userHasInteracted=!1,((e,t,i,n,o={})=>{const r=Object.assign({top:0,right:0,bottom:0,left:0},n);if(!1===o.animate||0===o.duration)e.viewport=r,Y(e,t,i);else{const t=e.viewport,i=void 0!==o.easing?o.easing:"easeOutCubic",n=void 0!==o.duration?o.duration:300;$.BL("viewport",{easing:i},e,[t.top,t.right,t.bottom,t.left],[r.top,r.right,r.bottom,r.left],n)}})(this.state,this.modules.layout.rootContainer,this.modules.renderer,e,t),this}setMaxBounds(e){return this.state.maxBounds=(0,te.X3)(e),this}setPadding(e,t){var i,n,o,r;const s={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!==(r=e.bottom)&&void 0!==r?r:0};return this.state.userHasInteracted=!1,((e,t,i,n={})=>{const o=J(i,e.size);if(!1===n.animate||0===n.duration)e.padding=o,Q(e,t);else{const t=e.padding,i=void 0!==n.easing?n.easing:"easeOutCubic",r=void 0!==n.duration?n.duration:300;$.BL("padding",{easing:i},e,[t.top,t.right,t.bottom,t.left],[o.top,o.right,o.bottom,o.left],r)}})(this.state,this.modules.renderer,s,t),this}getPadding(){return this.state.padding}getCenter(){const e=(0,A.I0)(this.state.center);return(0,A.PA)(e)}getZoom(){return this.state.zoom}getStyleZoom(){return this.state.styleZoom}getMinZoom(){return this.state.minZoom}getMaxZoom(){return this.state.maxZoom}getRotation(){return(0,pe.ZY)(this.state.rotation)}getPitch(){return(0,pe.ZY)(this.state.pitch)}getViewport(){return this.state.viewport}getSize(){return[this.state.size[0],this.state.size[1]]}getBounds(e){let t=this.modules.camera;(null==e?void 0:e.skipPadding)&&(t=new Xi.V(Object.assign(Object.assign({},this.state),{padding:{left:0,right:0,top:0,bottom:0}}))),t.update();const i=(0,Ni.BS)(t.getViewportVertices());return{southWest:(0,A.PA)(i.min),northEast:(0,A.PA)(i.max)}}getDefaultSource(){return this.modules.defaultSource}hideBuildingsById(e){e.forEach((e=>{this.state.hiddenObjects.gltfModel.add(e),this.state.hiddenObjects.other.add(e),this.state.objectsIdsToUpdate.add(e)})),this.modules.modelLayer.setHiddenBuildingIds(e),this.modules.renderer.addRerenderEvent()}showHiddenBuildingsById(e){e.forEach((e=>{this.state.hiddenObjects.gltfModel.delete(e),!this.modules.modelsScene.hasBuildingId(e)&&this.state.hiddenObjects.other.has(e)&&(this.state.hiddenObjects.other.delete(e),this.state.objectsIdsToUpdate.add(e))})),this.modules.modelLayer.unsetHiddenBuildingIds(e),this.modules.renderer.addRerenderEvent()}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.modules.tileManager.setSelectedIds(e),this.modules.identifier.debouncedFillCache(),this}project(e){return this.modules.camera.project((0,A.yq)(e))}unproject(e){return(0,A.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.modules.renderer.addRerenderEvent(),this}destroy(){var e;this.core.destroy(),null===(e=this._bssDispatcher)||void 0===e||e.destroy()}refresh(){return this.modules.renderer.addRerenderEvent(),this.state.needLabeling=!0,this.modules.identifier.resetCache(),this}changeFloorNumber(e,t){return this.modules.floorManager.changeFloorNumber(e,t),this.state.shouldIsReadyWaitForUpdates=!0,this}hasLayer(e){return this.modules.styleManager.hasLayer(e)}addLayer(e,t){return"custom"===e.type&&(this.state.disableAntiAliasing=!0),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,$c.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}addModel(e,t){if(!e)return console.error("The model name is empty."),this;return this.modules.styleManager.addModel(e,t)&&this.core.activateStyleUpdating(),this}useOldStyles(e){return this.setCustomStyleById(ot.rx,e),this}waitForGpuToFinishDrawing(){return this.modules.renderer.readIdentifyPixels(),this}setLang(e){const t=(0,Jc.Iw)(this.state.rtlPlugin.scenario,e);this.state.rtlPlugin.loadFailed&&t||(this.state.lang=e,this.state.rtlPlugin.loadFailed||(0,Jc.w7)(this.state.rtlPlugin,this.modules,e).catch((e=>{throw this.state.rtlPlugin.loadFailed=!0,this.setLang(T.defaultLang),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(),r=this.getPadding(),s=(null==i?void 0:i.skipMapPadding)?n:(l=n,{top:(a=r).top+l.top,bottom:a.bottom+l.bottom,left:a.left+l.left,right:a.right+l.right});var a,l;const d=this.getSize(),c=(null==i?void 0:i.considerRotation)?this.getRotation():0;if(d[0]-s.left-s.right<=0||d[1]-s.top-s.bottom<=0)return console.warn("Map cannot fit within canvas with the given bounds and padding."),this;(null==i?void 0:i.considerRotation)||ue(this.state,c,{animate:!1});const h=(0,qc.g)([[t[0],e[1]],e,[e[0],t[1]],t],c,[d[0]-s.left-s.right,d[1]-s.top-s.bottom]);if(!h)return console.warn("Map cannot fit within canvas with the given bounds and padding."),this;const u=[(d[0]-s.left-s.right)/2+s.left+o.left,(d[1]-s.top-s.bottom)/2+s.top+o.top];let m;m=void 0!==(null==i?void 0:i.maxZoom)?Math.min(h.zoom,null==i?void 0:i.maxZoom):h.zoom,m=(0,pe.uZ)(m,this.state.minZoom,this.state.maxZoom);const f=new Xi.V({zoom:m,rotation:this.state.rotation,size:this.state.size,padding:this.state.padding,viewport:this.state.viewport,pitch:0,center:h.center,cameraConfig:this.state.cameraConfig}).unproject(u),p=[0,0];R.lu(p,h.center,f);const _=[0,0,0];R.IH(_,h.center,p);const v=(null==i?void 0:i.animation)?i.animation:{};v.easing||(v.easing="easeOutCubic");const g=Object.assign(Object.assign({},v),{animateHeight:!0});return ae(this.state,_,v),we(this.state,m,g),ve(this.state,0,v),this}update(){const e=this.state,{time:t,userHasInteracted:i}=e,n=this.values,o={};ch.forEach((i=>{let r=e[i];"zoom"===i&&"styleZoom"===e.zoomTypePreserving&&(r=e.styleZoom),o[`${i}start`]=!n[`is${i}Changing`]&&!this.areEqual(r,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(r,n[`${i}1`]),t-n[`${i}EndTime`]>150&&(o[`${i}end`]=this.areEqual(r,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(r,`${i}End1`),n[`${i}EndTime`]=t)),this.copyFromValuesToValues(`${i}2`,`${i}1`),this.copyFromStateToValues(r,`${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 r=n.isIdle,s=n.isReady;n.isIdle=this.isIdle(),n.isReady=this.isReady(),o.idle=!r&&n.isIdle,o.ready=!s&&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=Ql(e),this.updateDataToggle(),this.modules.renderer.addRerenderEvent()}getStyleState(){return Object.assign({},this.state.styleState)}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,_activeFloorIsMetro:t._activeFloorIsMetro})),this.updateDataToggle(),this.modules.renderer.addRerenderEvent()}setOption(e,t){if(-1!==Rc.indexOf(e)){if("loopWorld"===e){if(this.state.loopWorld===t)return;const e=t?A._L:A.Vv,i=this.state.maxBounds;(R.I6(i.min,A._L.min)&&R.I6(i.max,A._L.max)||R.I6(i.min,A.Vv.min)&&R.I6(i.max,A.Vv.max))&&(this.state.maxBounds=e),this.modules.renderer.addRerenderEvent()}this.state[e]=t}else console.error(`Can't change the "${e}" option.`)}getOption(e){if(-1!==Rc.indexOf(e))return this.state[e];console.error(`Can't get the value of the "${e}" option.`)}getGroundPoint(e){return this.modules.demManager.getGroundPoint(e)}configureFloors({activeGroup:e,allowedFloorIds:t}){this.modules.floorManager.configure({activeGroup:e,allowedFloorIds:t})}getDataToggle(){return this.modules.defaultSource.getDataType()}setLightingStyle(e){const t=this.modules.styleManager.getStyle(this.state.handyStyleId);t&&(t.light=(0,W.XG)(e,t.dem),t.light.lightingModesResolved={},this.state.needRerender=!0)}setCustomStyleById(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.currentPendingStyle=e;const i=(0,pe.kn)(t||{},{rootUrl:T.styles.url,stylePath:T.styles.path,iconsPath:T.icons.defaultUrl,fontsPath:T.fonts.defaultUrl,modelsPath:oc.LP}),n=yield this.fetchStyleById((0,j.z)(i),e,ot.rx);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:r}=n;return yield this.setCustomStyle(o,i,r),e}))}setCustomStyleFromUrl(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){this.currentPendingStyle=e;const i=(0,pe.kn)(t||{},{rootUrl:e,iconsPath:"",fontsPath:"",stylePath:"style.json",modelsPath:""}),n=yield function(e){return fetch(e).then((e=>{if(e.ok)return e.json()}))}((0,j.z)(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.protocol,n=window.location.host,o=(0,pe.kn)(t||{},{rootUrl:`${i}//${n}`,stylePath:"",iconsPath:"",fontsPath:"",modelsPath:""});return this.setCustomStyle(e,o)}setCustomStyle(e,t,i){return(0,M.mG)(this,void 0,void 0,(function*(){if(this.currentPendingStyle=void 0,!e)throw new Error("Can't set empty style");const{showCommPoi:n}=yield this.modules.tileKeyInfo.getKeyInfo(),o=this.modules.styleManager.createStyle(e,t,n,i);this.state.handyStyleId=o.id,this.core.activateStyleUpdating()}))}copyFromStateToValues(e,t){mh(e)?R.JG(this.values[t],e):this.values[t]=e}cloneFromStateToValues(e,t){const i=this.state[e];mh(i)?this.values[t]=R.d9(i):this.values[t]=i}copyFromValuesToValues(e,t){const i=this.values[t];mh(i)?R.JG(this.values[e],i):this.values[e]=i}areEqual(e,t){return mh(e)&&mh(t)?R.I6(e,t):e===t}fetchStyleById(e,t,i){return(0,M.mG)(this,void 0,void 0,(function*(){const n=new URL((0,P.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 r=yield o.json();return r&&r.result?{loadedId:t,style:r.result}:void 0}))}updateDataToggle(){this.modules.defaultSource.setDataType(this.state.styleState.immersiveRoadsOn?hh:void 0)}}function mh(e){return void 0!==e.length}var fh=i(8450);class ph extends k{constructor(e,t){var i,n,o,r,s,a,l,d,c,h,u,m;super(e),this.length=1,this.isGeometryOutOfMainReplica=!1,this.removed=!1,this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i;const{dynamicStyle:f,layers:p}=this.modules;this.dynamicStyleId=f.getStyle().id,this.geoPoints=this.options.coordinates.filter(((e,t,i)=>0===t||!ee.I6(i[t],i[t-1]))),this.points=this.geoPoints.map(A.yq),this.isGeometryOutOfMainReplica=this.points.some((e=>e[0]>ot.ed||e[0]<-ot.ed));let _=0;this.distances=[],this.distances.push(_);for(let e=1;e<this.geoPoints.length;e++)_+=(0,A.vn)(this.geoPoints[e-1],this.geoPoints[e]),this.distances.push(_);if(this.stateDiffer=new De([{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,Ge.D)((()=>{this.generate()}),200),this.tileAttrs=(0,Z.FJ)({id:this.isInteractive?(0,D.Ru)(0,0):NaN,beginningIsCut:0,endingIsCut:0,db_tiers:t.tiers}),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},webglState:"3d"!==this.options.renderingMode?this.options.webglState:{depthTest:!0}};const e=(0,W.qw)(this.rawStyleLayer);if(e&&(this.styleLayerId=e.innerId,f.addLayer(e,null!==(r=this.options.zIndex)&&void 0!==r?r:0)),"3d"===this.options.renderingMode&&this.options.hiddenPartColor){this.rawHiddenStyleLayer={type:"line",id:`dynamic-polyline-hidden-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.hiddenPartColor,width:null!==(s=this.options.width)&&void 0!==s?s:3},webglState:{depthTest:!0,depthMask:!1,cullFace:!1,depthFunc:window.WebGLRenderingContext.GREATER}};const e=(0,W.qw)(this.rawHiddenStyleLayer);e&&(this.styleHiddenLayerId=e.innerId,f.addLayer(e,null!==(a=this.options.zIndex)&&void 0!==a?a:0))}if(t.showAnimation&&!1!==t.showAnimation.animate&&this.points.length>1){this.animationTickerName=`polyline-${this.uniqId}`;const t=null==e?void 0:e.innerId;t&&this.startShowTicker(this.animationTickerName,t)}}if(this.options.width2){this.rawStyleLayer2={type:"line",id:`dynamic-polyline2-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:null!==(l=this.options.color2)&&void 0!==l?l:"#00000000",width:null!==(d=this.options.width2)&&void 0!==d?d:0}};const e=(0,W.qw)(this.rawStyleLayer2);e&&(this.styleLayer2Id=e.innerId,f.addLayer(e,null!==(c=this.options.zIndex2)&&void 0!==c?c:-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!==(h=this.options.color3)&&void 0!==h?h:"#00000000",width:null!==(u=this.options.width3)&&void 0!==u?u:0}};const e=(0,W.qw)(this.rawStyleLayer3);e&&(this.styleLayer3Id=e.innerId,f.addLayer(e,null!==(m=this.options.zIndex3)&&void 0!==m?m:-2))}void 0===this.styleLayerId&&void 0===this.styleLayer2Id&&void 0===this.styleLayer3Id||(p.addLayer(this),this.generate())}update(){this.removed||(super.update(),this.stateDiffer.check(this.mapState)&&this.debouncedGenerate(),this.animationTickerName&&this.updateShowTicker(this.animationTickerName))}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}snapPoint(e){function t([e,t],i=0){return[i+(e+ot.ed)/ot.sX,(t+ot.ed)/ot.sX]}function i([e,t]){return[e*ot.sX-ot.ed,t*ot.sX-ot.ed]}const n=this.mapState.visibleMapReplicas,o=this.points.map((e=>t(e)));let r=1/0,s=o[0],a=0;for(const l of n){const n=t(this.modules.camera.unproject(e),l);for(let e=0;e<o.length-1;e++){const t=o[e],l=o[e+1],d=(0,Ki.Z4)(n,t,l),c=d[0]-n[0],h=d[1]-n[1],u=c*c+h*h;u<r&&(r=u,s=i(d),a=e)}}const l=(0,A.PA)(s);return{point:l,distance:this.distances[a]+(0,A.vn)(l,this.geoPoints[a])}}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),this.setSubLayerStyle(this.styleHiddenLayerId,this.rawHiddenStyleLayer,e.hiddenPartColor)}remove(){this.removed||(this.removed=!0,this.animationTickerName&&($.sT(this.animationTickerName,this.mapState),this.animationTickerName=void 0),this.isInteractive&&this.modules.identifier.resetCache(),void 0!==this.styleLayerId&&this.modules.dynamicStyle.removeLayer(this.styleLayerId),void 0!==this.styleHiddenLayerId&&this.modules.dynamicStyle.removeLayer(this.styleHiddenLayerId),void 0!==this.styleLayer2Id&&this.modules.dynamicStyle.removeLayer(this.styleLayer2Id),void 0!==this.styleLayer3Id&&this.modules.dynamicStyle.removeLayer(this.styleLayer3Id),super.destroy())}startShowTicker(e,t){var i,n,o;const r=void 0!==(null===(i=this.options.showAnimation)||void 0===i?void 0:i.easing)?this.options.showAnimation.easing:"linear",s=void 0!==(null===(n=this.options.showAnimation)||void 0===n?void 0:n.duration)?this.options.showAnimation.duration:250;$.BL(e,{easing:r,animationGroup:null===(o=this.options.showAnimation)||void 0===o?void 0:o.animationGroup},this.mapState,0,1,s,{layerId:t,styleId:this.dynamicStyleId}),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,W.qw)(t);o&&(n.updateLayerStyle(e,o),this.modules.renderer.addRerenderEvent())}}updateShowTicker(e){$.Vx(e,{step:(e,t)=>{var i,n,o,r;const s=(0,pe.sB)((null===(n=null===(i=this.options.showAnimation)||void 0===i?void 0:i.durationRange)||void 0===n?void 0:n.start)||0,(null===(r=null===(o=this.options.showAnimation)||void 0===o?void 0:o.durationRange)||void 0===r?void 0:r.end)||1,t);s!==this.length&&(this.length=s,this.generate())}},this.mapState)}generate(){if(this.points.length<2||this.removed)return;const e=!!this.animationTickerName,{dynamicStyle:t,collector:i,tileManager:n,identifier:o,map:r,renderer:s,modelsScene:a}=this.modules,{tileProps:l}=L.nF,d=Math.min(Math.floor(r.getZoom()),12),c=(0,H.aq)(d),h=(0,Ki.z_)(this.points,this.distances,this.length),u=(0,Ki.Jh)(h,c),m=ee.Ue(),f=te.Ue();this.tileObjects.forEach((t=>{t.clean(this.mapState),n.removeObject(t,e)})),this.tileObjects=[];for(let o=0;o<u.length;o++){const r=u[o];te.mc(f);for(let e=0;e<r.length;e++)te.aM(f,r[e]);te.be(m,f);const c=(0,H.z6)(m,d),h=Math.pow(2,c[2]),p=[...this.mapState.visibleMapReplicas];if(this.isOutOfMainReplica()){const e=p[0],t=p[p.length-1];p.push(e-1,t+1)}if(p.map((e=>[c[0]+e*h,c[1],c[2],c[3]])).every((e=>!(0,H.Ny)(e,this.mapState.tilesBounds))))continue;if(this.options.displayTileBounds){const o=t.getStyle().layers.find((e=>"debug-tile-bounds"===e.id));(0,Da.cX)(i,o,this.mapState.styleState);const r=i.getAccumulatedData(),l=new F.W("dynamicObject",r.data,s,a,this.mapState,c);this.tileObjects.push(l),n.addObject(l,e)}const _=(0,H.Bs)(c),v=[],g=[];for(let e=0;e<r.length;e++)(0,H.a2)(m,r[e],_),v[e]=m[0],g[e]=m[1];this.tileAttrs[l.beginningIsCut]=0,this.tileAttrs[l.endingIsCut]=0,0!==o&&(this.tileAttrs[l.beginningIsCut]=1),o+1!==u.length&&(this.tileAttrs[l.endingIsCut]=1);const y=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,this.tileAttrs,L.wz);if(void 0!==this.styleLayerId){const e=t.getStyle().layersById[this.styleLayerId];(0,fh.ot)(e)&&((0,G.Eu)(e,y),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,e,y,_,{x:v,y:g}]}))}if(void 0!==this.styleHiddenLayerId){const e=t.getStyle().layersById[this.styleHiddenLayerId];(0,fh.ot)(e)&&((0,G.Eu)(e,y),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,e,y,_,{x:v,y:g}]}))}if(void 0!==this.styleLayer2Id){const e=t.getStyle().layersById[this.styleLayer2Id];(0,fh.ot)(e)&&((0,G.Eu)(e,y),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,e,y,_,{x:v,y:g}]}))}if(void 0!==this.styleLayer3Id){const e=t.getStyle().layersById[this.styleLayer3Id];(0,fh.ot)(e)&&((0,G.Eu)(e,y),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,e,y,_,{x:v,y:g}]}))}const b=i.getAccumulatedData(),w=new F.W("dynamicObject",b.data,s,a,this.mapState,_.coords,this);n.addObject(w,e),this.tileObjects.push(w),this.isInteractive&&this.identifyIds.push(b.identifyIds)}this.isInteractive&&o.resetCache(),i.reset(),e||this.modules.renderer.addRerenderEvent()}}var _h=i(3097);class vh extends k{constructor(e,t){var i,n,o,r,s,a,l,d,c,h,u,m;super(e),this.isGeometryOutOfMainReplica=!1,this.length=1;const{dynamicStyle:f}=this.modules;this.dynamicStyleId=f.getStyle().id,this.removed=!1,this.options=t,this.interactive=null===(i=t.interactive)||void 0===i||i,this.points=this.options.coordinates.map(A.yq),this.isGeometryOutOfMainReplica=this.points.some((e=>e[0]>ot.ed||e[0]<-ot.ed)),this.distances=[],this.stateDiffer=new De([{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,Ge.D)((()=>{this.generate()}),200),this.tileAttrs=(0,Z.FJ)({previousPointX:0,previousPointY:0,nextPointX:0,nextPointY:0,beginningIsCut:0,endingIsCut:0,componentDistanceStart:0,objectLength:0,id:this.interactive?(0,D.Ru)(0,0):NaN,db_tiers:t.tiers});const{layers:p}=this.modules;if(p.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!==(r=this.options.width)&&void 0!==r?r:8},webglState:"3d"!==this.options.renderingMode?this.options.webglState:{depthTest:!0}},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===(s=this.options)||void 0===s?void 0:s.width2)&&void 0!==a?a:12},webglState:"3d"!==this.options.renderingMode?this.options.webglState:{depthTest:!0}},this.dashLayer=(0,W.qw)(this.dashLayerRaw),this.baseLayer=(0,W.qw)(this.baseLayerRaw),"3d"===t.renderingMode&&t.hiddenPartDashColor&&(this.hiddenDashLayerRaw={type:"dashedLine",id:`dynamic-hidden-dashed-polyline-dash-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:t.hiddenPartDashColor,dashLength:null!==(l=this.options.dashLength)&&void 0!==l?l:6,gapColor:this.options.hiddenPartGapColor,gapLength:null!==(d=this.options.gapLength)&&void 0!==d?d:20,width:null!==(c=this.options.width)&&void 0!==c?c:8},webglState:{depthTest:!0,depthMask:!1,cullFace:!1,depthFunc:window.WebGLRenderingContext.GREATER}},this.hiddenDashLayer=(0,W.qw)(this.hiddenDashLayerRaw),this.options.hiddenPartDash2Color&&(this.hiddenBaseLayerRaw={type:"line",id:`dynamic-hidden-dashed-polyline-base-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.hiddenPartDash2Color,width:null!==(u=null===(h=this.options)||void 0===h?void 0:h.width2)&&void 0!==u?u:12},webglState:{depthTest:!0,depthMask:!1,cullFace:!1,depthFunc:window.WebGLRenderingContext.GREATER}},this.hiddenBaseLayer=(0,W.qw)(this.hiddenBaseLayerRaw))),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,A.vn)(this.options.coordinates[t-1],this.options.coordinates[t]),this.distances.push(e);this.animationTickerName=`dashedLine-${this.uniqId}`;const t=null===(m=this.baseLayer)||void 0===m?void 0:m.innerId;t&&this.startShowTicker(this.animationTickerName,t)}this.generate()}update(){this.removed||(super.update(),this.stateDiffer.check(this.mapState)&&this.debouncedGenerate(),this.animationTickerName&&this.updateShowTicker(this.animationTickerName))}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}setStyle(e){const{dashColor:t,dash2Color:i,gapColor:n,hiddenPartDashColor:o,hiddenPartGapColor:r,hiddenPartDash2Color:s}=e,{dynamicStyle:a}=this.modules;if(this.dashLayer){void 0!==t&&(this.dashLayerRaw.style.color=t),void 0!==n&&(this.dashLayerRaw.style.gapColor=n);const e=(0,W.qw)(this.dashLayerRaw);e&&a.updateLayerStyle(this.dashLayer.innerId,e)}if(this.baseLayer){void 0!==i&&(this.baseLayerRaw.style.color=i);const e=(0,W.qw)(this.baseLayerRaw);e&&a.updateLayerStyle(this.baseLayer.innerId,e)}if(this.hiddenDashLayer&&this.hiddenDashLayerRaw){void 0!==o&&(this.hiddenDashLayerRaw.style.color=o),void 0!==n&&(this.hiddenDashLayerRaw.style.gapColor=r);const e=(0,W.qw)(this.hiddenDashLayerRaw);e&&a.updateLayerStyle(this.hiddenDashLayer.innerId,e)}if(this.hiddenBaseLayer&&this.hiddenBaseLayerRaw){void 0!==s&&(this.hiddenBaseLayerRaw.style.color=s);const e=(0,W.qw)(this.hiddenBaseLayerRaw);e&&a.updateLayerStyle(this.hiddenBaseLayer.innerId,e)}this.modules.renderer.addRerenderEvent()}remove(){this.removed||(this.removed=!0,this.animationTickerName&&($.sT(this.animationTickerName,this.mapState),this.animationTickerName=void 0),this.interactive&&this.modules.identifier.resetCache(),this.baseLayer&&this.modules.dynamicStyle.removeLayer(this.baseLayer.innerId),this.dashLayer&&this.modules.dynamicStyle.removeLayer(this.dashLayer.innerId),this.hiddenBaseLayer&&this.modules.dynamicStyle.removeLayer(this.hiddenBaseLayer.innerId),this.hiddenDashLayer&&this.modules.dynamicStyle.removeLayer(this.hiddenDashLayer.innerId),super.destroy())}updateShowTicker(e){$.Vx(e,{step:(e,t)=>{var i,n,o,r;const s=(0,pe.sB)((null===(n=null===(i=this.options.showAnimation)||void 0===i?void 0:i.durationRange)||void 0===n?void 0:n.start)||0,(null===(r=null===(o=this.options.showAnimation)||void 0===o?void 0:o.durationRange)||void 0===r?void 0:r.end)||1,t);s!==this.length&&(this.length=s,this.generate())}},this.mapState)}startShowTicker(e,t){var i,n,o;const r=void 0!==(null===(i=this.options.showAnimation)||void 0===i?void 0:i.easing)?this.options.showAnimation.easing:"linear",s=void 0!==(null===(n=this.options.showAnimation)||void 0===n?void 0:n.duration)?this.options.showAnimation.duration:250;$.BL(e,{easing:r,animationGroup:null===(o=this.options.showAnimation)||void 0===o?void 0:o.animationGroup},this.mapState,0,1,s,{layerId:t,styleId:this.dynamicStyleId}),this.length=0}generate(){if(this.points.length<2||this.removed)return;const e=!!this.animationTickerName,{dynamicStyle:t,collector:i,tileManager:n,map:o,identifier:r,renderer:s,modelsScene:a}=this.modules,{tileProps:l}=L.nF,d=Math.min(Math.floor(o.getZoom()),12),c=(0,H.aq)(d),h=(0,Ki.z_)(this.points,this.distances,this.length),u=(0,Ki.Jh)(h,c),m=ee.Ue(),f=te.Ue();this.tileObjects.forEach((t=>{t.clean(this.mapState),n.removeObject(t,e)})),this.tileObjects=[];const p=[];let _=0;for(const e of u){te.mc(f);for(let t=0;t<e.length;t++)te.aM(f,e[t]);te.be(m,f);const t=(0,H.z6)(m,d),i=(0,H.Bs)(t),n=[],o=[];let r=0;for(let t=0;t<e.length;t++)if((0,H.a2)(m,e[t],i),n[t]=m[0],o[t]=m[1],0!==t){const e=n[t]-n[t-1],i=o[t]-o[t-1];r+=Math.sqrt(e*e+i*i)}_+=r,p.push({vertices:{x:n,y:o},tileInfo:i,distance:r})}let v=0;const g=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,this.tileAttrs,L.wz);p.forEach(((o,r)=>{var d,c,h,f;const{tileInfo:y,distance:b,vertices:w}=o;if(this.tileAttrs[l.beginningIsCut]=0,this.tileAttrs[l.endingIsCut]=0,this.tileAttrs[l.previousPointX]=0,this.tileAttrs[l.previousPointY]=0,this.tileAttrs[l.nextPointX]=0,this.tileAttrs[l.nextPointY]=0,this.tileAttrs[l.componentDistanceStart]=v,v+=b,this.tileAttrs[l.objectLength]=_,0!==r){const e=u[r-1],t=e[e.length-2];(0,H.a2)(m,t,y),this.tileAttrs[l.beginningIsCut]=1,this.tileAttrs[l.previousPointX]=m[0],this.tileAttrs[l.previousPointY]=m[1]}if(r!==p.length-1){const e=u[r+1][1];(0,H.a2)(m,e,y),this.tileAttrs[l.endingIsCut]=1,this.tileAttrs[l.nextPointX]=m[0],this.tileAttrs[l.nextPointY]=m[1]}const x=Math.pow(2,y.coords[2]),S=[...this.mapState.visibleMapReplicas];if(this.isOutOfMainReplica()){const e=S[0],t=S[S.length-1];S.push(e-1,t+1)}if(S.map((e=>[y.coords[0]+e*x,y.coords[1],y.coords[2],y.coords[3]])).every((e=>!(0,H.Ny)(e,this.mapState.tilesBounds))))return;this.dashLayer&&(t.addLayer(this.dashLayer,null!==(d=this.options.zIndex)&&void 0!==d?d:0),(0,G.Eu)(this.dashLayer,g),(0,G.XI)({collector:i,generator:_h.L.generate,args:[t.getStyle().id,this.dashLayer,g,y,w]})),this.baseLayer&&(t.addLayer(this.baseLayer,null!==(c=this.options.zIndex2)&&void 0!==c?c:-1),(0,G.Eu)(this.baseLayer,g),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,this.baseLayer,g,y,w]})),this.hiddenDashLayer&&(t.addLayer(this.hiddenDashLayer,null!==(h=this.options.zIndex)&&void 0!==h?h:0),(0,G.Eu)(this.hiddenDashLayer,g),(0,G.XI)({collector:i,generator:_h.L.generate,args:[t.getStyle().id,this.hiddenDashLayer,g,y,w]})),this.hiddenBaseLayer&&(t.addLayer(this.hiddenBaseLayer,null!==(f=this.options.zIndex2)&&void 0!==f?f:-1),(0,G.Eu)(this.hiddenBaseLayer,g),(0,G.XI)({collector:i,generator:jt.z.generate,args:[t.getStyle().id,this.hiddenBaseLayer,g,y,w]}));const I=i.getAccumulatedData(),M=new F.W("dynamicObject",I.data,s,a,this.mapState,y.coords,this);n.addObject(M,e),this.tileObjects.push(M),this.interactive&&this.identifyIds.push(I.identifyIds)})),this.interactive&&r.resetCache(),i.reset(),e||this.modules.renderer.addRerenderEvent()}}var gh=i(7084);class yh extends k{constructor(e,t){var i;super(e),this.isGeometryOutOfMainReplica=!1,this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i;const n=this.options.coordinates.map((e=>{const t=e.map(A.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 r=[],{dynamicStyle:s,collector:a,tileManager:l,identifier:d,layers:c,renderer:h,modelsScene:u}=this.modules;n.forEach((e=>{o.length&&r.push(o.length),o=o.concat(e)})),this.isGeometryOutOfMainReplica=o.some((e=>e[0]>ot.ed||e[0]<-ot.ed));const m=(0,W.qw)({type:"polygon",id:`dynamic-polygon-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.color||"#3388ff33"}});if(!m)return;s.addLayer(m,this.options.zIndex),this.fillLayerId=m.innerId;const f=(0,Z.FJ)({id:this.isInteractive?(0,D.Ru)(0,0):NaN,beginningIsCut:0,endingIsCut:0,db_tiers:t.tiers}),p=te.Ue();for(let e=0;e<o.length;e++)te.aM(p,o[e]);const _=(0,H.x7)(p),v=(0,H.Bs)(_),g=[];for(let e=0;e<o.length;e++)g.push(o[e][0]),g.push(o[e][1]);const y=gh(g,r),b=ee.Ue(),w=[],x=[],S=[],I=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,f,L.wz);(0,G.Eu)(m,I);for(let e=0;e<y.length;e+=3){for(let t=0;t<3;t++)(0,H.a2)(b,o[y[e+t]],v),w[t]=b[0],x[t]=b[1],S[t]=0;(0,G.XI)({collector:a,generator:Ot.a.generate,args:[s.getStyle().id,m,I,{x:w,y:x,cut:S},(0,$c.o1)(window.devicePixelRatio),s.getStyle().rasterSets]})}if(0!==this.options.strokeWidth){const e=(0,W.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}});e&&(s.addLayer(e,this.options.zIndex),this.borderLayerId=e.innerId,(0,G.Eu)(e,I),n.forEach((t=>{const i=[],n=[];t.forEach(((e,t)=>{(0,H.a2)(b,e,v),i[t]=b[0],n[t]=b[1]})),(0,G.XI)({collector:a,generator:jt.z.generate,args:[s.getStyle().id,e,I,v,{x:i,y:n}]})})))}const M=a.getAccumulatedData(),T=new F.W("dynamicObject",M.data,h,u,this.mapState,v.coords,this);l.addObject(T),this.tileObjects.push(T),this.isInteractive&&this.identifyIds.push(M.identifyIds),c.addLayer(this),a.reset(),this.modules.renderer.addRerenderEvent(),this.isInteractive&&d.resetCache()}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}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 bh extends k{constructor(e,t){var i,n,o,r,s;if(super(e),this.isGeometryOutOfMainReplica=!1,this.options=t,this.isInteractive=null===(i=t.interactive)||void 0===i||i,t.segments&&t.segments<=0)return;const{dynamicStyle:a,collector:l,tileManager:d,identifier:c,layers:h,renderer:u,modelsScene:m}=this.modules,f=function(e,t,i){const n=[];if(i>0){n.push(ee.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),r=t*Math.sin(i);n.push(ee.al(e[0]+o,e[1]+r,e[2]),ee.al(e[0]+o,e[1]-r,e[2]))}n.push(ee.al(e[0]-t,e[1],e[2]))}return n}((0,A.yq)(this.options.coordinates),(0,A.a4)(this.options.coordinates,this.options.radius),null!==(n=this.options.segments)&&void 0!==n?n:150);this.isGeometryOutOfMainReplica=f.some((e=>e[0]>ot.ed||e[0]<-ot.ed));const p=(0,W.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!==(r=this.options.borderWidth)&&void 0!==r?r:1,strokeColor:null!==(s=this.options.borderColor)&&void 0!==s?s:"#3388ff"}});if(!p)return;a.addLayer(p,this.options.zIndex),this.layerId=p.innerId;const _=(0,Z.FJ)({id:this.isInteractive?(0,D.Ru)(0,0):NaN,db_tiers:t.tiers}),v=te.Ue();for(let e=0;e<f.length;e++)te.aM(v,f[e]);const g=(0,H.x7)(v),y=(0,H.Bs)(g),b=[],w=[],x=[],S=ee.Ue(),I=0!==this.options.borderWidth?1:0;for(let e=0;e<f.length;e++)(0,H.a2)(S,f[e],y),b[e]=S[0],w[e]=S[1],x[e]=I;const M=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,_,L.wz);(0,G.Eu)(p,M),(0,G.XI)({collector:l,generator:Ot.a.generate,args:[a.getStyle().id,p,M,{x:b,y:w,cut:x},(0,$c.o1)(window.devicePixelRatio)]});const T=l.getAccumulatedData(),E=new F.W("dynamicObject",T.data,u,m,this.mapState,y.coords,this);d.addObject(E),this.tileObjects.push(E),this.isInteractive&&this.identifyIds.push(T.identifyIds),h.addLayer(this),l.reset(),this.modules.renderer.addRerenderEvent(),this.isInteractive&&c.resetCache()}remove(){this.isInteractive&&this.modules.identifier.resetCache(),this.layerId&&this.modules.dynamicStyle.removeLayer(this.layerId),super.destroy()}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}}function wh(e,t,i,n,o,r){if(o-n<=i)return;const s=n+o>>1;xh(e,t,s,n,o,r%2),wh(e,t,i,n,s-1,r+1),wh(e,t,i,s+1,o,r+1)}function xh(e,t,i,n,o,r){for(;o>n;){if(o-n>600){const s=o-n+1,a=i-n+1,l=Math.log(s),d=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*d*(s-d)/s)*(a-s/2<0?-1:1);xh(e,t,i,Math.max(n,Math.floor(i-a*d/s+c)),Math.min(o,Math.floor(i+(s-a)*d/s+c)),r)}const s=t[2*i+r];let a=n,l=o;for(Sh(e,t,n,i),t[2*o+r]>s&&Sh(e,t,n,o);a<l;){for(Sh(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*n+r]===s?Sh(e,t,n,l):(l++,Sh(e,t,l,o)),l<=i&&(n=l+1),i<=l&&(o=l-1)}}function Sh(e,t,i,n){Ih(e,i,n),Ih(t,2*i,2*n),Ih(t,2*i+1,2*n+1)}function Ih(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Mh(e,t,i,n){const o=e-i,r=t-n;return o*o+r*r}const Th=e=>e[0],Eh=e=>e[1];class Ph{constructor(e,t=Th,i=Eh,n=64,o=Float64Array){this.nodeSize=n,this.points=e;const r=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new r(e.length),a=this.coords=new o(2*e.length);for(let n=0;n<e.length;n++)s[n]=n,a[2*n]=t(e[n]),a[2*n+1]=i(e[n]);wh(s,a,n,0,s.length-1,0)}range(e,t,i,n){return function(e,t,i,n,o,r,s){const a=[0,e.length-1,0],l=[];let d,c;for(;a.length;){const h=a.pop(),u=a.pop(),m=a.pop();if(u-m<=s){for(let s=m;s<=u;s++)d=t[2*s],c=t[2*s+1],d>=i&&d<=o&&c>=n&&c<=r&&l.push(e[s]);continue}const f=Math.floor((m+u)/2);d=t[2*f],c=t[2*f+1],d>=i&&d<=o&&c>=n&&c<=r&&l.push(e[f]);const p=(h+1)%2;(0===h?i<=d:n<=c)&&(a.push(m),a.push(f-1),a.push(p)),(0===h?o>=d:r>=c)&&(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,r){const s=[0,e.length-1,0],a=[],l=o*o;for(;s.length;){const d=s.pop(),c=s.pop(),h=s.pop();if(c-h<=r){for(let o=h;o<=c;o++)Mh(t[2*o],t[2*o+1],i,n)<=l&&a.push(e[o]);continue}const u=Math.floor((h+c)/2),m=t[2*u],f=t[2*u+1];Mh(m,f,i,n)<=l&&a.push(e[u]);const p=(d+1)%2;(0===d?i-o<=m:n-o<=f)&&(s.push(h),s.push(u-1),s.push(p)),(0===d?i+o>=m:n+o>=f)&&(s.push(u+1),s.push(c),s.push(p))}return a}(this.ids,this.coords,e,t,i,this.nodeSize)}}function Lh(e,t){const i=[],n=[],o=[],r=ee.Ue();return e.forEach((({mapCoords:e,weight:s})=>{!function(e,t,i){e[0]=(t[0]-i.offset[0])*ot._H/i.size,e[1]=(t[1]-i.offset[1])*ot._H/i.size}(r,e,t);const a=r[0],l=r[1];for(let e=0;e<6;e++)i.push(a,l),o.push(s);n.push(-1,-1,1,-1,-1,1,-1,1,1,-1,1,1)})),{vertices:new Tt.l(new Uint16Array(i),{itemSize:2,dataType:Tt.l.UnsignedShort,stride:0,offset:0,normalized:!0}),widens:new Tt.l(new Int8Array(n),{itemSize:2,dataType:Tt.l.Byte,stride:0,offset:0,normalized:!1}),weights:new Tt.l(new Float32Array(o),{itemSize:1,dataType:Tt.l.Float,stride:0,offset:0,normalized:!1})}}function Ah(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,qn.MV)(e[i])}));const r=Math.min(...n),s=Math.max(...n);return r>0&&(o[0]=o[r]),s<1&&(o[1]=o[s]),o}function Ch(e,t){const i=Object.keys(e).map((e=>Number(e))).sort(((e,t)=>e-t));let n=0;const o=[],r=t-1;for(let s=0;s<t;s++){const t=s/r;t>i[n+1]&&n++;const a=i[n],l=i[n+1],d=(t-a)/(l-a);for(let t=0;t<4;t++)o[4*s+t]=zh(e[a].value[t],e[l].value[t],d)}return o.map((e=>Math.round(e)))}function zh(e,t,i){return e*(1-i)+t*i}const kh={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 Rh extends k{constructor(e,t={}){super(e),this.offscreenTextureIndex=-1,this.fillBuffers=e=>{if(!this.tree)return;const t=(0,Ni.BS)(this.mapState.tilesBounds),i=(0,H.x7)(t);if(this.tileCoords&&(n=i,o=this.tileCoords,n.every(((e,t)=>e===o[t]))))return;var n,o;this.resetBuffers(),this.tileCoords=i;const r=(0,H.aq)(i[2]),s=(0,H.Oy)(i);qe.wA(this.matrix,s,ee.al(r,r,ot._9));const a=this.tree.range(s[0],s[1],s[0]+r,s[1]+r).map((e=>this.points[e])),l=(0,H.Bs)(i);this.buffers=Lh(a,l),this.vertexCount=6*a.length,this.vao=new Pt(e,{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);const e=this.frameBuffer.getTexture();e?this.modules.imageManager.updatePreparedTexture(this.offscreenTextureIndex,e):(0,$n.cM)("Can't update a non-prepared texture"),this.heatmapNeedRerender=!0,this.modules.renderer.addRerenderEvent()};const{downscale:i,palette:n,points:o,minZoom:r,maxZoom:s,zIndex:a,pointRadius:l,intensity:d,opacity:c}=t;this.rampTextureIndex=this.modules.imageManager.addPreparedTexture(function(e,t){const i=Ch(Ah(e),t);return new $e(new Uint8Array(i),{size:[t,1]})}(null!=n?n:kh,256)),this.gl=this.modules.renderer.getRenderingContext(),this.downscale=null!=i?i:1,this.frameBuffer=new Ye({size:[Math.ceil(this.mapState.size[0]*window.devicePixelRatio/this.downscale),Math.ceil(this.mapState.size[1]*window.devicePixelRatio/this.downscale)],magFilter:$e.LinearFilter,minFilter:$e.LinearFilter,wrapS:$e.ClampToEdgeWrapping,wrapT:$e.ClampToEdgeWrapping});const h=this.frameBuffer.getTexture();h?this.offscreenTextureIndex=this.modules.imageManager.addPreparedTexture(h):(0,$n.cM)("Can't add a non-prepared texture."),this.points=[],this.vertexCount=0,this.isDestroyed=!1,this.heatmapNeedRerender=!1,this.matrix=qe.Ue(),this.mvpMatrix=qe.Ue(),this.viewDiffer=new De([{path:"center",type:"vec2"},{path:"zoom",type:"number"},{path:"rotation",type:"number"},{path:"pitch",type:"number"},{path:"padding",type:"padding"}]),this.sizeDiffer=new De([{path:"size",type:"vec2"}]),this.throttledFillBuffer=Re(this.fillBuffers,50);const u=(0,W.qw)({type:"heatmap",id:`dynamic-heatmap-${this.uniqId}`,minzoom:r,maxzoom:s,style:{opacity:null!=c?c:.5,intensity:null!=d?d:3,radius:null!=l?l:10}});if(!u)throw new Error("There is no correct style layer for heatmap");this.layer=u,this.modules.dynamicStyle.addLayer(u,a),o&&this.setPoints(o)}isOutOfMainReplica(){return!1}setPoints(e){if(!this.isDestroyed){if(this.points=e.map((({coordinates:e,weight:t})=>({mapCoords:(0,A.yq)(e),weight:null!=t?t:1}))),this.tree=new Ph(this.points,(e=>e.mapCoords[0]),(e=>e.mapCoords[1])),this.tileCoords=void 0,!this.tileObjects.length){const{layers:e,collector:t,dynamicStyle:i,tileManager:n,renderer:o,modelsScene:r}=this.modules;(0,G.XI)({collector:t,generator:At.B.generateTexture,args:[i.getStyle().id,this.layer,this.offscreenTextureIndex,this.rampTextureIndex]});const s=t.getAccumulatedData(),a=new F.W("dynamicObject",s.data,o,r,this.mapState);n.addObject(a),this.tileObjects.push(a),e.addLayer(this),t.reset()}this.modules.renderer.addRerenderEvent(),this.heatmapNeedRerender=!0}}update(){super.update();const e=this.modules.renderer.getShaderProgram("heatmap",this.modules.renderer.commonShaderDefines);if(this.sizeDiffer.check(this.mapState)&&this.resizeFrameBuffer(),!this.heatmapNeedRerender&&!this.viewDiffer.check(this.mapState)&&!this.modules.renderer.isNeedRerender())return;if(!this.tree)return;const{zoom:t,styleZoom:i,styleState:n}=this.mapState,o=this.gl;if(this.throttledFillBuffer(e),!(this.vao&&this.buffers&&this.tree&&this.tileCoords))return;const r=(0,K.jJ)(i,n,[]),s=(0,K.vn)(this.layer.style.radius,r),a=(0,K.vn)(this.layer.style.intensity,r),l=ot.y4*Math.pow(2,t-this.tileCoords[2])*window.devicePixelRatio;e.enable(o),Po(o,e,this.mapState,this.modules),e.bind(o,{u_mat4_mvp:qe.dC(this.mvpMatrix,this.modules.camera.viewProjectionMatrix,this.matrix),u_mat4_model:this.matrix,u_float_radius:s*window.devicePixelRatio,u_float_intensity:a,u_float_tile_to_pixel_ratio:1/l}),this.vao.bind({gl:o,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(o),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),nn(o,bn,this.modules.renderer.lastAppliedGlState),o.drawArrays(o.TRIANGLES,0,this.vertexCount),this.frameBuffer.unbind(o),this.heatmapNeedRerender=!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();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 Fh=i(9808),Oh=i(4333);const Dh=[0,0],Bh=[0,0,0,0];var jh;!function(e){e[e.initial=0]="initial",e[e.hidden=1]="hidden",e[e.fadeIn=2]="fadeIn",e[e.visible=3]="visible",e[e.fadeOut=4]="fadeOut"}(jh||(jh={}));class Nh extends k{constructor(e,t,i){var n,o,r,s,a,l,d,c,h,u,m,f,p;super(e,i),this.lastLabelingRevision=-1,this.status="visible",this.labelingStatus=jh.initial,this.options=t,this.isInteractive=null!==(n=t.interactive)&&void 0!==n&&n,this.labelKey=`point-label-${this.uniqId}`;const _=null!==(o=t.font)&&void 0!==o?o:ot.Uo,v=null!==(r=t.fontSize)&&void 0!==r?r:T.fonts.baseSize,g=null!==(s=t.letterSpacing)&&void 0!==s?s:0,y=null!==(a=t.lineHeight)&&void 0!==a?a:T.fonts.baseLineHeight,b=[null!==(d=null===(l=this.options.offset)||void 0===l?void 0:l[0])&&void 0!==d?d:Dh[0],null!==(h=null===(c=this.options.offset)||void 0===c?void 0:c[1])&&void 0!==h?h:Dh[1]],w=(0,W.qw)({type:"point",id:`dynamic-pointLabel-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{textFont:_,textFontSize:v,textColor:null!==(u=t.color)&&void 0!==u?u:"#000000",textHaloWidth:null!==(m=t.haloRadius)&&void 0!==m?m:0,textHaloColor:null!==(f=t.haloColor)&&void 0!==f?f:"#ffffff",textLetterSpacing:g,textLineHeight:y,textOffset:b,allowElevation:!0}}),x=(0,A.yq)(this.options.coordinates);if(this.position={userValue:x,normalizedValue:(0,A.I0)(x)},!w)return;const{dynamicStyle:S,collector:I,assetManager:M,styleManager:E,tileManager:P,layers:C,defaultSource:z,renderer:k,modelsScene:R}=this.modules,O=null!==(p=this.options.zIndex)&&void 0!==p?p:0;S.addLayer(w,O);const B=(0,Z.FJ)({id:this.isInteractive?(0,D.Ru)(0,0):NaN,db_label:this.options.text}),j=(0,H.IR)(this.position.normalizedValue),N=(0,K.Yi)(this.mapState.styleState,L.i4,L.nF.tileProps,B,L.wz);(0,G.Eu)(w,N),(0,G.XI)({collector:I,generator:Oh.p,args:[S.getStyle(),w,N,L.nF,j,z.getId(),{x:[0],y:[0]},(0,$c.o1)(window.devicePixelRatio)]});const U=I.getAccumulatedData();if(!U.labels.length)return;const V=[{metatileHash:-1,labels:U.labels,styleId:S.getStyle().id}],X=(0,Fh.v)(V,wl.AL.DynamicObject,E,this.mapState.styleState,this.mapState.styleZoom);if(1!==X.length)return;const q=X[0];Jc.GY.then((()=>{var e;q.label=null!==(e=(0,Jc.iY)(q.label))&&void 0!==e?e:"",q.updateRanges()})).then((()=>Promise.all(q.ranges.map((e=>M.loadFont(_,e)))))).then((()=>{if("destroyed"===this.status)return;q.textMetrics=(0,Ha.JA)(q.label,g,M.getFontGlyphs(_));const e=function(e){return[e&&void 0!==e[0]?(0,pe.uZ)(e[0],0,1):.5,e&&void 0!==e[1]?(0,pe.uZ)(e[1],0,1):.5]}(t.anchor),i=v/T.fonts.baseSize,n=v*y*q.textMetrics.lines.length,o=i*q.textMetrics.maxWidth,r=[-o*(e[0]-.5),-n*(e[1]-.5)],[s,a]=b,l=[s+r[0],a+r[1]];(0,G.XI)({collector:I,generator:Lo.qp,args:[q,1,q.textMetrics,[0,0,0],0,l,w,S.getStyle().fontNameToIndex[_],window.devicePixelRatio]});const d=I.getAccumulatedData(),c=new F.W("dynamicObject",d.data,k,R,this.mapState,(0,H.IR)(this.position.normalizedValue));Uh(c,this.position.userValue[2]),C.addLayer(this),this.tileObjects.push(c),this.isInteractive&&(this.identifyIds.push(U.identifyIds),this.modules.identifier.resetCache()),I.reset(),this.options.labeling&&"none"!==this.options.labeling.type?(this.labelBox={id:this.uniqId,width:o,height:n,position:this.position.normalizedValue,offset:[l[0]-e[0]*o,l[1]-e[1]*n],labelingGroup:"pointLabel"},this.addLabelToLabeler(),this.update()):"visible"===this.status&&P.addObject(c),this.modules.renderer.addRerenderEvent(),this.initImageIfNeed(q,o,n,b,r)}))}hide(){"visible"===this.status&&(this.status="hidden",this.removeLabelFromLabeler(),this.removeTilesFromMap(),this.labelingStatus=jh.hidden)}show(){"hidden"===this.status&&(this.status="visible",this.labelBox||this.addTilesToMap(),this.labelingStatus=jh.initial,this.addLabelToLabeler(),this.update())}isOutOfMainReplica(){return!1}remove(){"destroyed"!==this.status&&(this.isInteractive&&this.modules.identifier.resetCache(),this.removeLabelFromLabeler(),super.destroy(),this.status="destroyed")}setCoordinates(e){if("destroyed"===this.status)return;const t=(0,A.yq)(e);this.position={userValue:t,normalizedValue:(0,A.I0)(t)},this.tileObjects.forEach((e=>{e.setTileCoords((0,H.IR)(this.position.normalizedValue),this.mapState),Uh(e,this.position.userValue[2])})),this.labelBox&&(this.labelBox.position=this.position.normalizedValue,this.addLabelToLabeler()),0!==this.tileObjects.length&&"visible"===this.status&&this.modules.renderer.addRerenderEvent()}getCoordinates(){return(0,A.PA)(this.position.userValue)}update(){if("destroyed"===this.status)return;if(super.update(),"visible"!==this.status||!this.labelBox||this.lastLabelingRevision===this.modules.labeler.getLabelingRevision())return;this.lastLabelingRevision=this.modules.labeler.getLabelingRevision();const e=this.modules.labeler.isLabelBoxSurvived(this.uniqId),t=this.labelingStatus;let i=G.jh.none;switch(this.labelingStatus){case jh.initial:e?(this.addTilesToMap(),i=G.jh.none,this.labelingStatus=jh.visible):this.labelingStatus=jh.hidden;break;case jh.hidden:e&&(this.addTilesToMap(),i=G.jh.fadeIn,this.labelingStatus=jh.fadeIn);break;case jh.fadeIn:e?this.labelingStatus=jh.visible:(this.labelingStatus=jh.fadeOut,i=G.jh.fadeOut);break;case jh.visible:e||(i=G.jh.fadeOut,this.labelingStatus=jh.fadeOut);break;case jh.fadeOut:e?(i=G.jh.fadeIn,this.labelingStatus=jh.fadeIn):(this.removeTilesFromMap(),this.labelingStatus=jh.hidden)}t!==this.labelingStatus&&this.labelingStatus!==jh.hidden&&this.tileObjects.forEach((e=>e.children.forEach((e=>{e.attributes.animDirection=i}))))}initImageIfNeed(e,t,i,n,o){var r,s;return(0,M.mG)(this,void 0,void 0,(function*(){if(!this.options.image)return;const{imageCache:a,dynamicStyle:l,collector:d,renderer:c,modelsScene:h,tileManager:u}=this.modules,m=window.devicePixelRatio,f=yield a.getRasterSet(this.options.image.url,void 0,this.options.image.size,[0,0]);if(!f||"destroyed"===this.status)return;const p=f.rasters[0];l.appendRasterSet(f,(0,Co.PR)(this.options.image.url,0,0));const[_,v,g,y]=this.options.image.padding||Bh,b=(t+y+v)*m,w=(i+_+g)*m,x=((v-y)/2+n[0]+o[0])*m,S=((g-_)/2+n[1]+o[1])*m,I=null===(r=this.options.image.stretchX)||void 0===r?void 0:r.map((([e,t])=>[e*m,t*m])),M=null===(s=this.options.image.stretchY)||void 0===s?void 0:s.map((([e,t])=>[e*m,t*m]));(0,G.XI)({collector:d,generator:Lo.GN,args:[e,[0,0,0],0,p,b,w,x,S,window.devicePixelRatio,I,M]});const T=d.getAccumulatedData();d.reset();const E=new F.W("dynamicObject",T.data,c,h,this.mapState,(0,H.IR)(this.position.normalizedValue));Uh(E,this.position.userValue[2]),this.tileObjects.push(E),"hidden"===this.status||this.labelBox||u.addObject(E),this.labelBox&&(this.labelBox.height=i+_+g,this.labelBox.width=t+y+v,this.labelBox.offset[0]-=y,this.labelBox.offset[1]-=_,this.addLabelToLabeler(),this.labelingStatus!==jh.hidden&&this.labelingStatus!==jh.initial&&(u.addObject(E),this.mapState.needRerender=!0),this.lastLabelingRevision=-1)}))}addTilesToMap(){this.tileObjects.forEach((e=>{this.modules.tileManager.addObject(e)}))}removeTilesFromMap(){this.tileObjects.forEach((e=>{this.modules.tileManager.removeObject(e)}))}addLabelToLabeler(){this.removeLabelFromLabeler(),this.labelBox&&(this.modules.labeler.addLabelBox(this.labelKey,this.labelBox),this.lastLabelingRevision=-1)}removeLabelFromLabeler(){this.labelBox&&this.modules.labeler.removeLabels(this.labelKey)}}function Uh(e,t){e.modelMatrices.forEach((e=>{e[14]=t}))}const Vh=[.5,.5],Gh=[0,18];class Hh extends V{constructor(e,t){super(e,t.draggable),this.map=e;const{coordinates:i,size:n,zIndex:o,minZoom:r,maxZoom:s,interactive:a,hoverIcon:l,hoverSize:d,hoverAnchor:c,label:h,rotation:u}=t;this.status="normal";const m=(0,A.yq)(i);this.position={userValue:m,normalizedValue:(0,A.I0)(m)},this.rotation=(0,pe.Id)(null!=u?u:0),this.zIndex=void 0!==o?o:0,this.minZoom=null!=r?r:-1/0,this.maxZoom=null!=s?s:1/0,this.interactive=void 0===a||a;const f=void 0!==t.icon?t.icon:T.defaultMarkerIcon,p=void 0!==t.icon?t.anchor:T.defaultMarkerAnchor;this.on("mouseover",this.switchToHoveredStyle),this.on("mouseout",this.switchToNormalStyle),this.modules.layers.addLayer(this),this.setIconInternal({icon:f,anchor:p,size:n}).then((()=>{void 0!==l&&this.setHoverIconInternal({icon:l,anchor:c,size:d})})),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())}isOutOfMainReplica(){return!1}setRotation(e){"destroyed"!==this.status&&(this.rotation=(0,pe.Id)(e),this.normalStateData&&(this.normalStateData.styleLayer.style.iconRotation=this.rotation,this.modules.renderer.addRerenderEvent()),this.hoverStateData&&(this.hoverStateData.styleLayer.style.iconRotation=this.rotation,this.modules.renderer.addRerenderEvent()))}getRotation(){return(0,pe.ZY)(this.rotation)}setIcon(e){"destroyed"!==this.status&&this.setIconInternal(e)}setHoverIcon(e){if("destroyed"!==this.status)return e?void this.setHoverIconInternal(e):("hover"===this.status&&this.switchToNormalStyle(),void(this.hoverStateData&&((0,pe.VJ)(this.tileObjects,this.hoverStateData.tileObject),(0,pe.VJ)(this.identifyIds,this.hoverStateData.identifyIds),this.hoverStateData.tileObject.clean(this.mapState),this.hoverStateData=void 0)))}setLabel(e){var t,i,n,o,r;"destroyed"!==this.status&&(null===(t=this.label)||void 0===t||t.remove(),e&&(this.label=new Nh(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||Vh,offset:e.offset||Gh,zIndex:null!==(r=e.zIndex)&&void 0!==r?r:this.zIndex+1e-5,interactive:this.interactive}),this)))}setCoordinates(e){var t;this.setPosition((0,A.yq)(e)),null===(t=this.label)||void 0===t||t.setCoordinates(e)}getCoordinates(){return(0,A.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.modules.renderer.addRerenderEvent(),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.modules.renderer.addRerenderEvent(),this.interactive&&this.modules.identifier.resetCache()),this.status="hidden"}setPosition(e){this.position={userValue:e,normalizedValue:(0,A.I0)(e)},this.tileObjects.length&&(this.tileObjects.forEach((e=>{e.setTileCoords((0,H.IR)(this.position.normalizedValue),this.mapState)})),"hidden"!==this.status&&(this.modules.renderer.addRerenderEvent(),this.interactive&&this.modules.identifier.resetCache()))}getPosition(){return this.position.userValue}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,r=this.modules.camera.project(this.position.normalizedValue),s=r[0]-n[0]*o[0],a=r[0]+n[0]*(1-o[0]),l=r[1]-n[1]*o[1],d=r[1]+n[1]*(1-o[1]);return e[0]>s&&e[0]<a&&e[1]>l&&e[1]<d}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.modules.renderer.addRerenderEvent()}}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.modules.renderer.addRerenderEvent()}}getMarkerStateData(e,{icon:t,anchor:i,size:n}){const{zIndex:o,interactive:r,position:s}=this,{collector:a,dynamicStyle:l,styleManager:d,defaultSource:c,renderer:h,modelsScene:u}=this.modules,m=(0,Z.FJ)({id:r?(0,D.Ru)(0,0):NaN,dpi:96*window.devicePixelRatio}),f=(0,H.IR)(s.normalizedValue),p=(0,W.qw)({type:"point",id:`dynamic-marker-${this.uniqId}`,minzoom:this.minZoom,maxzoom:this.maxZoom,style:{iconImage:t,iconAnchor:i,iconRotation:this.rotation}});if(!p)throw new Error(`Marker with icon ${t} was created with null style layer`);const _=(0,Co.pV)(p.style.iconAnchor);l.addLayer(p,o),l.appendRasterSet(e,(0,Co.PR)(t,_[0],_[1]));const v=(0,K.Yi)(this.mapState.styleState,L.i4,L.nF.tileProps,m,L.wz);(0,G.Eu)(p,v),(0,G.XI)({collector:a,generator:Oh.p,args:[l.getStyle(),p,v,L.nF,f,c.getId(),{x:[0],y:[0]},(0,$c.o1)(window.devicePixelRatio)]});const{identifyIds:g,labels:y}=a.getAccumulatedData();if(!y.length)throw new Error(`Marker with icon ${t} was created with empty labels`);const b=[{metatileHash:-1,labels:y,styleId:l.getStyle().id}],w=(0,Fh.v)(b,wl.AL.DynamicObject,d,this.mapState.styleState,this.mapState.styleZoom);if(1!==w.length)throw new Error(`Marker with icon ${t} has empty unpacked labels`);const x=w[0];(0,Lo.vg)(a,x,[0,0,0],0,e.rasters[0],window.devicePixelRatio);const{data:S}=a.getAccumulatedData();a.reset();return{styleLayer:p,tileObject:new F.W("dynamicObject",S,h,u,this.mapState,f,this),identifyIds:g,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]}}setIconInternal(e){return(0,M.mG)(this,void 0,void 0,(function*(){return 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.modules.renderer.addRerenderEvent(),this.interactive&&this.modules.identifier.resetCache()),i&&((0,pe.VJ)(this.tileObjects,i.tileObject),(0,pe.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}))}))}setHoverIconInternal(e){return(0,M.mG)(this,void 0,void 0,(function*(){return 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.modules.renderer.addRerenderEvent(),this.interactive&&this.modules.identifier.resetCache()),i&&((0,pe.VJ)(this.tileObjects,i.tileObject),(0,pe.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}))}))}}var Zh=i(5600),Wh=i(2702);const Xh=(0,Zh.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)=>(0,Wh.v)([e,t.innerId],t,i),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,o){const r=o.x,s=o.y,a=e.idIndexer.getIndex({id:n.tileAttrs[n.tileProps.id],styleId:t,layer:i,sublayer:n.tileAttrs[n.tileProps.db_sublayer]}),l=(0,K.FR)(i.ignoreTier,n)?null:n.tileAttrs[n.tileProps.db_tiers],d=e.getBucket(i.type,"fill",Ot.a.sinks.fill.packObjectAttributes(t,i,l,n),Ot.a.sinks.fill.binder);let c=d.elements.offset;!function(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}(d.indices,c,0,1,2,2,1,3),Kh(d,c++,r[0],s[0],a),Kh(d,c++,r[1],s[1],a),Kh(d,c++,r[2],s[2],a),Kh(d,c++,r[3],s[3],a),d.elements.offset=c}});function Kh(e,t,i,n,o){const r=4*t;e.views.position[r]=ot.jO+i,e.views.position[r+1]=ot.jO+n;const s=2*t;e.views.localID[s]=o}class qh extends k{constructor(e,t){super(e),this.isGeometryOutOfMainReplica=!1;const{dynamicStyle:i,collector:n,tileManager:o,identifier:r,layers:s,renderer:a,modelsScene:l}=this.modules;this.options=t,this.points=[];const d=(0,W.qw)({type:"polygon",id:`dynamic-polygon-${this.uniqId}`,minzoom:this.options.minZoom,maxzoom:this.options.maxZoom,style:{color:this.options.color||"#0085a0"}});if(!d)return;i.addLayer(d,this.options.zIndex),this.layerId=d.innerId;const c=(0,Z.FJ)({id:this.options.interactive?[0,this.uniqId]:NaN,db_tiers:t.tiers});this.points=function(e,t,i){const n=t/2,o=i/2,r=e[0],s=e[1],a=e[2];return[[r-n,s-o,a],[r+n,s-o,a],[r-n,s+o,a],[r+n,s+o,a]]}((0,A.yq)(this.options.center),(0,A.a4)(this.options.center,this.options.width),(0,A.a4)(this.options.center,this.options.height)),this.isGeometryOutOfMainReplica=this.points.some((e=>e[0]>ot.ed||e[0]<-ot.ed));const h=te.Ue();for(let e=0;e<this.points.length;e++)te.aM(h,this.points[e]);const u=(0,H.x7)(h),m=(0,H.Bs)(u),f=[],p=[],_=ee.Ue();for(let e=0;e<this.points.length;e++)(0,H.a2)(_,this.points[e],m),f[e]=_[0],p[e]=_[1];const v=(0,K.Yi)(this.mapState.styleState,L.i4,L.Dz,c,L.wz);(0,G.XI)({collector:n,generator:Xh.generate,args:[i.getStyle().id,d,v,{x:f,y:p}]});const g=n.getAccumulatedData(),y=new F.W("dynamicObject",g.data,a,l,this.mapState,u,this);o.addObject(y),this.tileObjects.push(y),this.options.interactive&&this.identifyIds.push(g.identifyIds),s.addLayer(this),n.reset(),this.modules.renderer.addRerenderEvent(),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()}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}}class $h extends k{constructor(e,t){super(e),this.isGeometryOutOfMainReplica=!1;const{dynamicStyle:i}=this.modules;this.options=Object.assign(Object.assign({},t),{image:{url:t.image.url}}),this.points=[],this.styleLayer=(0,W.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()}))}isOutOfMainReplica(){return this.isGeometryOutOfMainReplica}generate(){var e;if(!this.styleLayer||void 0===this.textureIndex)return;const{collector:t,dynamicStyle:i,tileManager:n,layers:o,renderer:r,modelsScene:s}=this.modules;this.points=function(e){const{min:t,max:i}=te.X3(e);return[t,[i[0],t[1]],[t[0],i[1]],i]}(this.options.bounds),this.isGeometryOutOfMainReplica=this.points.some((e=>e[0]>ot.ed||e[0]<-ot.ed));const a=te.Ue();for(let e=0;e<this.points.length;e++)te.aM(a,this.points[e]);const l=(0,H.x7)(a),d=(0,H.Bs)(l),c=[],h=[],u=ee.Ue();for(let e=0;e<this.points.length;e++)(0,H.a2)(u,this.points[e],d),c[e]=u[0],h[e]=u[1];const m=(0,K.Yi)(this.mapState.styleState,{},L.Dz,[],L.wz);(0,G.XI)({collector:t,generator:Lt.h.generate,args:[{x:c,y:h},i.getStyle().id,m,this.styleLayer,this.textureIndex,null!==(e=this.options.tiers)&&void 0!==e?e:null]});const f=t.getAccumulatedData(),p=new F.W("dynamicObject",f.data,r,s,this.mapState,l,this);n.addObject(p),this.tileObjects.push(p),o.addLayer(this),t.reset(),this.modules.renderer.addRerenderEvent()}clean(){const e=this.tileObjects[0];e&&(e.clean(this.mapState),this.modules.tileManager.removeObject(e),this.modules.layers.removeLayer(this),this.tileObjects=[])}}class Yh{constructor(e,t,i){this.id=e,this.modules=t,this.options=i,this.type="raster",this.textureIndices={},this.tileLoader=new Bi.U("arrayBuffer"),this.attributes={},this.tiles=new Map,this.sourceAttrs=i.attributes||{},this.url=e=>{const[t,i,n]=(0,H._W)(e),{min:o,max:r}=(0,H.Sl)(e),s={southWest:[o[0],o[1]].map((e=>e/ot.gL)),northEast:[r[0],r[1]].map((e=>e/ot.gL))};return this.options.url(t,i,n,s)}}deleteTextures(){for(const e in this.textureIndices)this.modules.imageManager.deleteTexture(this.textureIndices[e]);this.textureIndices={}}abortTileFetch(e){this.tileLoader.abortRequest((0,H.gx)(e))}deleteTile(e){const t=(0,H.gx)(e),i=this.textureIndices[t];isNaN(i)||this.modules.imageManager.deleteTexture(i),this.tiles.delete(t)}fetchTile(e){const t=(0,H.gx)(e),i=this.url(e);return this.tileLoader.fetch(e,(()=>i)).then((n=>{if(n.error){const t=this.modules.sourceStorage.getSourceById(this.id);"raster"===(null==t?void 0:t.type)&&this.modules.map.emit("error",{type:"rasterTileLoadError",tileCoords:(0,H._W)(e),tileUrl:i,source:t,responseMessage:n.error.message,responseStatus:n.error.status})}n.rejected||this.tiles.set(t,n.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),r=(0,H.gx)(t),s=this.tiles.get(r);if(!s||!o)return Promise.resolve({results:i,transferable:n});const a=yield this.modules.imageManager.addTexture(s,{imagePadding:0});if(void 0===a)return Promise.resolve({results:i,transferable:n});this.textureIndices[r]=a;const l=[],d=[],c=ee.Ue(),h=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,H.Oy)(t),(0,H.aq)(t[2])),u=(0,H.Bs)(t);for(let e=0;e<h.length;e++)(0,H.a2)(c,h[e],u),l[e]=c[0],d[e]=c[1];const m=(0,K.Yi)(e.styleState,this.sourceAttrs,L.Dz,[],L.wz);o.layers.filter((e=>"raster"===e.type&&(0,K.FR)(e.filter,m))).forEach((e=>{(0,G.Eu)(e,m),(0,G.XI)({collector:this.modules.collector,generator:Lt.h.generate,args:[{x:l,y:d},o.id,m,e,a,null]})}));const f=this.modules.collector.getAccumulatedData();return i.push({regionId:0,metatileHash:0,styleId:o.id,collectorOutput:f}),n.push(...f.transferable),Promise.resolve({results:i,transferable:n})}))}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e}destroy(){this.tileLoader.destroy()}}class Jh{constructor(e,t,i){var n,o;this.type="raster",this.id=(0,kn.Q)(),this.modules=e.modules,this.source=new Yh(this.id,this.modules,t);const r=null!==(n=t.minZoom)&&void 0!==n?n:T.MAP_DEFAULTS.minZoom,s=null!==(o=t.maxZoom)&&void 0!==o?o:T.MAP_DEFAULTS.maxZoom;this.layer=new Mt.I(r,s,r,s,this.modules,e.state,this.source),this.modules.tileManager.addTileLayer(this.layer),this.modules.sourceStorage.addSource(this),this.mapglApiSource=i}destroy(){this.source.deleteTextures(),this.modules.tileManager.removeTileLayer(this.layer),this.modules.sourceStorage.removeSource(this.getId()),this.layer.destroy()}getAttributes(){return this.source.getAttributes()}getZoomDirection(){return this.layer.getZoomDirection()}getId(){return this.source.id}setAttributes(e){this.source.setAttributes(e),this.layer.redraw()}isIdentifiedAsDefault(){return!1}}class Qh extends k{constructor(e,t){var i;super(e);const n=(0,A.yq)(t.coordinates);this.position={userValue:n,normalizedValue:(0,A.I0)(n)},this.zIndex=null!==(i=t.zIndex)&&void 0!==i?i:0,this.isDestroyed=!1,this.labelKey=`onlineMarker-${this.uniqId}`,this.elevation=t.elevation?t.elevation*(0,A.Xg)(t.coordinates[1])*A.C:0,this.actualIcon=t.icon,this.setIcon(t.icon)}destroy(){this.isDestroyed=!0,this.modules.identifier.resetCache(),this.modules.labeler.removeLabels(this.labelKey),super.destroy()}isOutOfMainReplica(){return!1}setIcon(e){this.actualIcon=e;const{url:t,transformer:i,size:n,anchor:o}=e;this.modules.imageCache.getRasterSet(t,i,n,o).then((i=>{if(this.isDestroyed||!i||this.actualIcon!==e)return;this.removeIcon();const r=(0,W.qw)({type:"point",id:`dynamic-onlineMarker-${this.uniqId}`,minzoom:-1/0,maxzoom:1/0,style:{iconImage:t,iconAnchor:o}}),s=(0,Z.FJ)({id:(0,D.Ru)(0,0)}),{collector:a,dynamicStyle:l,styleManager:d,defaultSource:c,renderer:h,modelsScene:u}=this.modules,m=this.zIndex;if(!r)return;const f=(0,Co.pV)(r.style.iconAnchor);l.addLayer(r,m),l.appendRasterSet(i,(0,Co.PR)(t,f[0],f[1]));const p=(0,H.IR)(this.position.normalizedValue),_=(0,K.Yi)(this.mapState.styleState,L.i4,L.nF.tileProps,s,L.wz);(0,G.Eu)(r,_),(0,G.XI)({collector:a,generator:Oh.p,args:[l.getStyle(),r,_,L.nF,p,c.getId(),{x:[0],y:[0]},(0,$c.o1)(window.devicePixelRatio)]});const v=a.getAccumulatedData(),{identifyIds:g,labels:y}=v;if(!y.length)return;const b=[{metatileHash:-1,labels:y,styleId:l.getStyle().id}],w=(0,Fh.v)(b,wl.AL.DynamicObject,d,this.mapState.styleState,this.mapState.styleZoom);if(1!==w.length)return;const x=w[0];(0,Lo.vg)(a,x,[0,0,this.elevation],0,i.rasters[0],window.devicePixelRatio);const S=a.getAccumulatedData();a.reset();const I=new F.W("dynamicObject",S.data,h,u,this.mapState,(0,H.IR)(this.position.normalizedValue),this);this.tileObjects.push(I),this.identifyIds=[g],this.modules.tileManager.addObject(I),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:n[0],height:n[1],position:this.position.normalizedValue,offset:[-o[0],-o[1]],labelingGroup:"marker"}),this.modules.renderer.addRerenderEvent()}))}removeIcon(){const e=this.tileObjects[0];e&&(e.clean(this.mapState),this.modules.tileManager.removeObject(e),this.tileObjects=[])}}function eu(e){return{type:"data",key:(0,H.gx)(e),coords:e,zoomLevel:e[2],detailLevel:e[3],needFetch:!1,needAbortFetch:!1,status:Jd.z3.Initial}}function tu(e,t,i,n,o){return function(e,t,i,n,o,r){return{type:e,maxDetailLevel:r,minDetailLevel:o,maxZoomLevel:n,minZoomLevel:i,zoomLevel:Math.floor(t),tiles:{},viewportTiles:[]}}("data",e,t,i,n,o)}class iu extends C.c{constructor(e,t,i){super(),this.prevZoomLevel=0,this.mapState=e,this.modules=t,this.config=i,this.gridState=tu(e.styleZoom,i.minZoom,i.maxZoom,i.minZoom,i.maxZoom),this.viewportDiffer=new De([{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 Bi.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,pe.uZ)(e.zoomLevel,e.minZoomLevel,e.maxZoomLevel),o=(0,pe.uZ)(e.zoomLevel,e.minDetailLevel,e.maxDetailLevel);e.viewportTiles=(0,H.b5)(t,n,e.minZoomLevel,o).map(H.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,H.cL)(n)))}}(this.gridState,this.mapState,eu),this.emit("tilesSetChanged",{tileIds:this.gridState.viewportTiles})}for(const e in this.gridState.tiles)this.gridState.viewportTiles.includes(e)?this.gridState.tiles[e].status===Jd.z3.Initial&&(this.gridState.tiles[e].needFetch=!0,this.gridState.tiles[e].status=Jd.z3.Loading):this.gridState.tiles[e].status===Jd.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 r=e.tiles[o],s=!t||t(r);!i.has(o)&&s&&n.push(r)}return n}(this.gridState)))}fetch(e){e.sort(((e,t)=>(0,H.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 nu{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 ou=i(8585),ru={};ru.styleTagTransform=Wc(),ru.setAttributes=Vc(),ru.insert=Nc().bind(null,"head"),ru.domAPI=Bc(),ru.insertStyleElement=Hc();Oc()(ou.Z,ru);const su=ou.Z&&ou.Z.locals?ou.Z.locals:void 0,au=`\n    <div class="${su.root}">\n        <button class="${su.button} ${su.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="${su.button} ${su.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 lu extends nu{constructor(e,t){super(e,au,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(`.${su.zoomIn}`),this._zoomOutButton=this._wrap.querySelector(`.${su.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 du=i(4928),cu={};cu.styleTagTransform=Wc(),cu.setAttributes=Vc(),cu.insert=Nc().bind(null,"head"),cu.domAPI=Bc(),cu.insertStyleElement=Hc();Oc()(du.Z,cu);const hu=du.Z&&du.Z.locals?du.Z.locals:void 0;class uu extends nu{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 hu.hard;if(e>3)return hu.medium;return hu.easy}(this._score):hu.none,t=`\n            <div class="${hu.root}">\n                <button class="${hu.button} ${e}">\n                    ${this._trafficVisible&&void 0!==this._score?this._score:'<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'}\n                </button>\n            </div>\n        `;this._wrap.innerHTML=t;this._wrap.querySelector(`.${hu.button}`).addEventListener("click",this._onClick)}}var mu=i(4306),fu={};fu.styleTagTransform=Wc(),fu.setAttributes=Vc(),fu.insert=Nc().bind(null,"head"),fu.domAPI=Bc(),fu.insertStyleElement=Hc();Oc()(mu.Z,fu);const pu=mu.Z&&mu.Z.locals?mu.Z.locals:void 0;var _u;!function(e){e.osm="osm",e.api="api",e.license="license"}(_u||(_u={}));class vu extends nu{constructor(e,t){var i;super(e,(i=t.copyrightType,`\n    <div class=${pu.container}>\n        <div class=${pu.logos}>\n            ${"2gis"===i?'<a href="https://dev.2gis.ru" target="_blank" style="height: 20px;">\n    <svg width="40" height="20" viewBox="0 0 40 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n        <path d="M2.00011 8.72731C1.98229 5.72738 4.05025 4 6.80779 4C9.47674 4 11.2797 5.58179 11.2797 8.05437C11.2797 10.1091 10.0602 11.2546 7.99196 12.2727C7.21431 12.6547 6.34807 13.1818 5.46454 13.4544H11.3681V16H2.00011V12.66C3.85604 12.0235 4.88111 11.3271 6.59576 10.4728C7.90363 9.81815 8.71666 9.23633 8.71666 8.1819C8.71666 7.16358 7.97439 6.36366 6.80779 6.36366C5.27006 6.36366 4.52753 7.52729 4.56292 8.72731H2.00011Z" fill="#6E7173"/>\n        <path d="M23.6348 9.63643V10.5453C23.6348 13.5455 21.6552 16 18.067 16C14.6202 16 12.2518 13.4727 12.2518 9.99986C12.2518 6.52731 14.5497 4 18.1554 4C21.2487 4 23.1751 5.8363 23.6348 7.99991H21.0717C20.6301 6.96353 19.534 6.36366 18.2261 6.36366C15.9813 6.36366 14.7263 8.14523 14.7263 9.99986C14.7263 11.8545 15.9991 13.6363 18.2086 13.6363C19.5872 13.6363 20.736 12.9456 21.0896 11.8181H17.7313V9.63643H23.6348Z" fill="#6E7173"/>\n        <path d="M27.4528 16H24.9783V4H27.4528V16Z" fill="#6E7173"/>\n        <path d="M38.4292 7.63648H35.8662C35.6185 6.85461 34.947 6.18167 33.4446 6.18167C32.1543 6.18167 31.5004 6.69096 31.5004 7.41809C31.5004 8.30915 32.7375 8.56366 34.293 8.83623L34.361 8.84818C36.4076 9.20779 38.5 9.57545 38.5 12.2727C38.5 14.8 36.4672 16 33.7274 16C31.1998 16 28.9373 14.4727 28.6899 12.1818H31.2527C31.5712 13.1273 32.5079 13.8181 33.8512 13.8181C35.1415 13.8181 35.8662 13.3818 35.8662 12.5455C35.8662 11.514 34.3606 11.2653 32.8555 11.0167C32.8221 11.0112 32.7887 11.0056 32.7553 11.0001C31.1468 10.7273 28.8844 9.9818 28.8844 7.54535C28.8844 5.34534 30.7581 4 33.5332 4C36.2727 4 38.164 5.41814 38.4292 7.63648Z" fill="#6E7173"/>\n    </svg>\n</a>':'<a href="https://dev.urbi.ae" target="_blank" style="height: 20px; line-height: 20px;">\n    <svg style="width: auto; height: 16px;" width="29" height="12" viewBox="0 0 29 12" fill="none" xmlns="http://www.w3.org/2000/svg">\n        <path fill-rule="evenodd" clip-rule="evenodd" d="M5 4V8.0625C5 9.13823 4.64701 9.5 3.75 9.5C3.00479 9.5 2.5 9.15185 2.5 8.0625V4H0V8.5C0 10.6515 1.45917 12 3.75 12C6.19263 12 7.5 10.6515 7.5 8.5V4H5ZM18.5 9.5V2H16V11.9993L20.5 12C23.013 12.0276 24.5 10.4576 24.5 8C24.5 5.4872 23.2711 4 20.5 4H19.5V6.5H20.5C21.6954 6.5 22 6.9645 22 8C22 9.06311 21.3422 9.51381 20.5 9.5H18.5ZM13 4C12.1529 4 11.7541 4.19542 11.5 5L11 4H9.01412V12H11.5V7.75C11.5 6.87606 12.1106 6.5 13 6.5H15V4H13ZM28.25 12V4H25.75V12H28.25ZM27 3C27.9508 3 28.75 2.32569 28.75 1.5C28.75 0.674312 27.9508 0 27 0C26.0492 0 25.25 0.674312 25.25 1.5C25.25 2.32569 26.0492 3 27 3Z" fill="#6E7173"/>\n    </svg>\n</a>'}\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 _u}(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(`.${pu.container}`).addEventListener("click",this._onClick)}destroy(){this._wrap.querySelector(`.${pu.container}`).removeEventListener("click",this._onClick),super.destroy()}}var gu=i(438),yu={};yu.styleTagTransform=Wc(),yu.setAttributes=Vc(),yu.insert=Nc().bind(null,"head"),yu.domAPI=Bc(),yu.insertStyleElement=Hc();Oc()(gu.Z,yu);const bu=gu.Z&&gu.Z.locals?gu.Z.locals:void 0;const wu=` <div class=${bu.container}>Your MapGL key is invalid. Please contact api@2gis.com to get MapGL key.</div> `;class xu 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,wu),e._impl.on("invalidtilekey",(()=>{this.isDisplayed()||this.display()}))}initWrap(){const e=document.createElement("div");return e.classList.add(`${bu.wrap}`),e.innerHTML=this.content,e}}class Su{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 Iu=i(1704),Mu={};Mu.styleTagTransform=Wc(),Mu.setAttributes=Vc(),Mu.insert=Nc().bind(null,"head"),Mu.domAPI=Bc(),Mu.insertStyleElement=Hc();Oc()(Iu.Z,Mu);const Tu=Iu.Z&&Iu.Z.locals?Iu.Z.locals:void 0,Eu=`\n    <div class="${Tu.root}">\n        <div class="${Tu.container}">\n            <div class="${Tu.scroller}">\n                <div class="${Tu.content}" />\n            </div>\n        </div>\n    </div>\n`;class Pu extends nu{constructor(e,t){super(e,Eu,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 r;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=Tu.control,n.innerHTML=`<div class="${Tu.label}">${t}</div>`,n.name=e.toLocaleString(),i===e&&(n.disabled=!0,r=n);const o=this._controlHandler(e);n.addEventListener("click",o),this._handlers.set(n,o),this._content.append(n)})),r&&r.offsetTop){const e=null===(t=r.parentElement)||void 0===t?void 0:t.parentElement;e&&(e.scrollTop=r.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(`.${Tu.control}[name="${this._floor.currentFloorLevelIndex}"]`).disabled=!1,this._wrap.querySelector(`.${Tu.control}[name="${e}"]`).disabled=!0,this._floor.currentFloorLevelIndex=e)},this._map=e,this._root=this._wrap.querySelector(`.${Tu.root}`),this._content=this._wrap.querySelector(`.${Tu.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 Lu=i(3274),Au={};Au.styleTagTransform=Wc(),Au.setAttributes=Vc(),Au.insert=Nc().bind(null,"head"),Au.domAPI=Bc(),Au.insertStyleElement=Hc();Oc()(Lu.Z,Au);const Cu=Lu.Z&&Lu.Z.locals?Lu.Z.locals:void 0;class zu{constructor(e,t){this.wrap=document.createElement("div"),this.wrap.className=Cu.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(Cu.container,Cu[e]),this.wrap.appendChild(t),t}}var ku=i(6032),Ru={};Ru.styleTagTransform=Wc(),Ru.setAttributes=Vc(),Ru.insert=Nc().bind(null,"head"),Ru.domAPI=Bc(),Ru.insertStyleElement=Hc();Oc()(ku.Z,Ru);const Fu=ku.Z&&ku.Z.locals?ku.Z.locals:void 0,Ou={en:"m",ru:"м"},Du={en:"km",ru:"км"};class Bu extends nu{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="${Fu.root}">\n                <div class="${Fu.label}">\n                    ${function(e,t){if(e<1e3)return`${e} ${Ou[t]||Ou.en}`;return`${(e/1e3).toFixed(1)} ${Du[t]||Du.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),e.on("move",this._render),e.on("resize",this._render)}destroy(){this._map.off("zoom",this._render),this._map.off("pitch",this._render),this._map.off("changeLanguage",this._render),this._map.off("move",this._render),this._map.off("resize",this._render),super.destroy()}_calcSize(e,t,i){return A.$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 ju{constructor(e){this._impl=e._impl.getDefaultSource()}setFeatureStateMap(e){this._impl.setFeatureStateMap(e)}setFeatureStateMapBinary(e){this._impl.setFeatureStateMapBinary(e)}}function Nu(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}var Uu=i(9687),Vu={};Vu.styleTagTransform=Wc(),Vu.setAttributes=Vc(),Vu.insert=Nc().bind(null,"head"),Vu.domAPI=Bc(),Vu.insertStyleElement=Hc();Oc()(Uu.Z,Vu);const Gu=Uu.Z&&Uu.Z.locals?Uu.Z.locals:void 0;class Hu extends nu{constructor(e,t){super(e,"",t),this._onFloorsActiveGroupChange=e=>{this._causedScenarioChange?this._causedScenarioChange=!1:(this._active="metro"===e,this._render())},this._onFloorPlanIn=({group:e})=>{"metro"===e&&(this._visible=!0,this._render())},this._onFloorPlanOut=({group:e})=>{"metro"===e&&(this._visible=!1,this._render())},this._onClick=()=>{this._causedScenarioChange=!0,this._map._impl.modules.floorManager.configure({activeGroup:this._active?"default":"metro"}),this._active=!this._active,this._render()},this._map=e,this._active=!1,this._causedScenarioChange=!1,this._visible=!1,this._render(),e.on("floorsactivegroupchange",this._onFloorsActiveGroupChange),e.on("floorplanin",this._onFloorPlanIn),e.on("floorplanout",this._onFloorPlanOut)}destroy(){this._map.off("floorsactivegroupchange",this._onFloorsActiveGroupChange),this._map.off("floorplanin",this._onFloorPlanIn),this._map.off("floorplanout",this._onFloorPlanOut)}_render(){const e=this._active?Gu.easy:Gu.none,t=`\n            <div class="${Gu.root}" style="${this._visible?"":"display: none;"}">\n                <button class="${Gu.button} ${e}">\n                    <?xml version="1.0" encoding="utf-8"?>\r\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\r\n\t width="20px" height="20px" viewBox="337.5 232.3 125 85.9" xml:space="preserve"\r\n\t>\r\n<polygon fill="#FF0013" points="453.9,306.2 424.7,232.3 400,275.5 375.4,232.3 346.1,306.2 337.5,306.2 337.5,317.4 381.7,317.4 \r\n\t381.7,306.2 375.1,306.2 381.5,287.8 400,318.2 418.5,287.8 424.9,306.2 418.3,306.2 418.3,317.4 462.5,317.4 462.5,306.2 "/>\r\n</svg>\r\n\n                </button>\n            </div>\n        `;this._wrap.innerHTML=t;this._wrap.querySelector(`.${Gu.button}`).addEventListener("click",this._onClick)}}const Zu={center:[0,0],zoom:0,minZoom:Qc,maxZoom:eh,rotation:0,touchRotationThreshold:10,pitch:0,minPitch:0,maxPitch:45,lowZoomMaxPitch:45,viewport:{top:0,right:0,bottom:0,left:0},padding:{top:0,right:0,bottom:0,left:0},style:"",lang:"en",disableHoverStyles:!1,disableZoomOnScroll:!1,disableDragging:!1,disableRotationByUserInteraction:!1,disablePitchByUserInteraction:!1,defaultBackgroundColor:"#f6f2de",disableIconCache:!1,mobileSdkMode:!1,skipElevationAnimation:!1,enableTrackResize:!1,showDefaultTileBounds:!1,immersiveOn:!1,pitchHightLimitation:90,loopWorld:!1,cityCommPoiLabelingConfig:T.cityCommPoiLabelingConfig};class Wu extends hl{constructor(e,t){var i;let n;if(super(),"string"==typeof e){const t=document.getElementById(e);if(!t)throw new Error(`Could not found html element with id: ${e}`);n=t}else n=e;const o=Object.assign({},t.styleOptions),r=Nu(this._validateOptions(t),Zu),s=Object.assign(Object.assign({},r),{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:o,styleState:t.styleState,sessionId:th(),tileSessionId:t.tileSessionId});this._impl=new uh(n,s),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}))).on("floorplanin",(e=>this.emit("floorplanin",e))).on("floorplanout",(e=>this.emit("floorplanout",e))).on("floorsactivegroupchange",(e=>this.emit("floorsactivegroupchange",e))).on("commmodelshow",(e=>this.emit("commmodelshow",e))).on("commmodelhide",(e=>this.emit("commmodelhide",e))),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("error",(e=>this._emitMapErrorEvent("error",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 zu(this,{padding:t.controlsLayoutPadding}),this._initControls(t),new xu(this),this._defaultSource=new ju(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}setLowZoomMaxPitch(e,t){return this._impl.setLowZoomMaxPitch(e,t),this}getSize(){return this._impl.getSize()}isIdle(){return this._impl.isIdle()}getBounds(e){return new Su(this._impl.getBounds(e))}project(e){return this._impl.project(e)}unproject(e){return this._impl.unproject(e)}getProjectionMatrix(){return this._impl.getCameraViewProjectionMatrix().slice()}getProjectionMatrixForGltfPlugin(){return this._impl.getCameraProjectionMatrix().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)}))}setStyleFromUrl(e,t){return(0,M.mG)(this,void 0,void 0,(function*(){return this._impl.setStyle(e,t)}))}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)}hasLayer(e){return this._impl.hasLayer(e)}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}addModel(e,t){return this._impl.addModel(e,t),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}getStyleState(){return this._impl.getStyleState()}setStyleOptions(e){return this._impl.patchStyleState({trafficOn:e.traffic}),this}setOption(e,t){return this._impl.setOption(e,t),this}getOption(e){return this._impl.getOption(e)}patchStyleState(e){return this._impl.patchStyleState(e),this}destroy(){this._controlPane.destroy(),this._impl.destroy(),this.emit("destroy")}triggerRerender(){this._impl.modules.renderer.addRerenderEvent({type:"triggerRerender"})}setControlsLayoutPadding(e){this._controlPane.setPadding(e)}getControlsLayoutPadding(){return this._controlPane.getPadding()}setHiddenObjects(e){this._impl.hideBuildingsById(e)}setEnvironmentParams(e){this._impl.modules.environmentManager.setParameters(e)}unsetHiddenObjects(e){this._impl.showHiddenBuildingsById(e)}showLabelsDebug(e){this._impl.showLabelsDebug(e)}hideLabelsDebug(){this._impl.hideLabelsDebug()}getGroundPoint(e){return this._impl.getGroundPoint(e)}configureFloors({activeGroup:e,allowedFloorIds:t}){this._impl.configureFloors({activeGroup:e,allowedFloorIds:t})}setLightingStyle(e){this._impl.setLightingStyle(e)}_emitMapEvent(e,t){this.emit(e,{isUser:t.isUser})}_emitMapErrorEvent(e,t){const{tileCoords:i,tileUrl:n,source:o,responseMessage:r,responseStatus:s}=t;if("raster"===(null==o?void 0:o.type)){const t=o.mapglApiSource;this.emit(e,{type:"rasterTileLoadError",responseMessage:r,responseStatus:s,tileUrl:n,tileCoords:[i[0],i[1],i[2]],source:t})}}_emitMapPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o,target:r,targetData:s}=t;let a,l;if(void 0!==s)switch(s.type){case"geojson":a={type:s.type,source:s.source.mapglApiSource,feature:s.feature};break;case"zenith":a={type:s.type,id:s.id,source:s.source.mapglApiSource,attributes:s.attributes};break;case"default":{a={type:s.type,id:s.id};const{floorId:e}=s;e&&(a.floorId=e);break}}void 0!==r&&(l={id:r.id},r.center&&(l.center=r.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((t=>{t.error||new vu(this,{position:"string"==typeof e.copyright?e.copyright:"bottomRight",interactive:e.interactiveCopyright,copyrightType:t.urbi?"Urbi":"2gis"})})),!1!==e.zoomControl){const t="string"==typeof e.zoomControl?e.zoomControl:"topRight";new lu(this,{position:t})}if(e.trafficControl){const t="string"==typeof e.trafficControl?e.trafficControl:"topRight";new uu(this,{position:t})}if(e.metroControl){const t="string"==typeof e.metroControl?e.metroControl:"topRight";new Hu(this,{position:t})}if(e.scaleControl){const t="string"==typeof e.scaleControl?e.scaleControl:"bottomLeft";new Bu(this,{position:t})}if(e.floorControl){const t="string"==typeof e.floorControl?e.floorControl:"topRight";new Pu(this,{position:t})}}_validateOptions(e){return"object"==typeof(e=Object.assign({},e))&&"center"in e&&(dh.isValidGeoPoint(e.center,ah.UseDefault)||(e.center=void 0)),e}}const Xu={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"},Ku={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 qu extends hl{constructor(e,t){super(),t.icon||(t.anchor=[15,46]);const i=Nu(t,Ku);this.userData=i.userData,this.rootOptions={zIndex:i.zIndex,minZoom:i.minZoom,maxZoom:i.maxZoom},this._impl=new Hh(e._impl,{coordinates:i.coordinates,icon:i.icon,zIndex:i.zIndex,minZoom:i.minZoom,maxZoom:i.maxZoom,interactive:i.interactive,label:$u(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($u(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 $u(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 r=Nu(t,Xu);return void 0===t.offset&&void 0!==t.anchor&&(r.offset=t.anchor.map((e=>-e))),{text:r.text,image:t.image,minZoom:r.minZoom,maxZoom:r.maxZoom,color:r.color,fontSize:r.fontSize,haloRadius:r.haloRadius,haloColor:r.haloColor,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,zIndex:r.zIndex,offset:r.offset,anchor:r.relativeAnchor,font:"Noto_Sans"}}const Yu={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,interactive:!1};class Ju extends hl{constructor(e,t){super(),this.userData=t.userData;const i=Nu(t,Yu);void 0===t.offset&&void 0!==t.anchor&&(i.offset=t.anchor.map((e=>-e))),this._impl=new Nh(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,labeling:t.labeling,image:t.image,font:"Noto_Sans",interactive:i.interactive}),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()}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()}_emitPointerEvent(e,t){const{originalEvent:i,lngLat:n,point:o}=t;this.emit(e,{originalEvent:i,lngLat:n,point:o,targetData:this})}}const Qu={minZoom:-1/0,maxZoom:1/0,zIndex:0,anchor:[-0,-0],preventMapInteractions:!0,userData:void 0,interactive:!0,disableRounding:!1};class em{constructor(e,t){this.userData=t.userData;const i=Nu(t,Qu);this._impl=new Nl(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,disableRounding:i.disableRounding})}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}setZIndex(e){return this._impl.setZIndex(e),this}getCoordinates(){return this._impl.getPosition()}getAnchor(){const e=this._impl.getOffset();return[-e[0],-e[1]]}getContent(){return this._impl.getHtmlElement()}getZIndex(){return this._impl.getZIndex()}}const tm={zIndex:0,minZoom:-1/0,maxZoom:1/0,color:"#3388ff33",strokeColor:"#3388ff",strokeWidth:1,interactive:!0,userData:void 0};class im extends hl{constructor(e,t){super(),this.userData=t.userData;const i=Nu(t,tm),n={coordinates:i.coordinates,radius:i.radius,minZoom:i.minZoom,maxZoom:i.maxZoom,interactive:i.interactive,color:i.color,zIndex:i.zIndex,borderWidth:i.strokeWidth,borderColor:i.strokeColor,segments:150,tiers:t.tiers};this._impl=new bh(e._impl,n),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 nm={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 om extends hl{constructor(e,t){super(),this.userData=t.userData,this.options=Nu(t,nm);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 q(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 rm={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,renderingMode:"2d"};class sm extends hl{constructor(e,t){super(),this.userData=t.userData;const i=Nu(t,rm);if(t.dashLength){const n={coordinates:i.coordinates,interactive:i.interactive,maxZoom:i.maxZoom,minZoom:i.minZoom,width:i.width,width2:i.width2,dashColor:i.color,dash2Color:i.color,gapColor:i.gapColor,dashLength:i.dashLength,dash2Length:0,zIndex:i.zIndex,zIndex2:i.zIndex2,gapLength:0===i.gapLength?i.dashLength:i.gapLength,displayTileBounds:!1,showAnimation:{animate:!1},renderingMode:i.renderingMode,hiddenPartDashColor:t.hiddenPartColor,hiddenPartDash2Color:t.hiddenPartColor,hiddenPartGapColor:t.hiddenPartGapColor,webglState:t.webglState,tiers:t.tiers};this._impl=new vh(e._impl,n),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 n={coordinates:i.coordinates,interactive:i.interactive,maxZoom:i.maxZoom,minZoom:i.minZoom,width:i.width,width2:i.width2,width3:i.width3,color:i.color,color2:i.color2,color3:i.color3,zIndex:i.zIndex,zIndex2:i.zIndex2,zIndex3:i.zIndex3,displayTileBounds:!1,showAnimation:{animate:!1},webglState:t.webglState,renderingMode:i.renderingMode,hiddenPartColor:t.hiddenPartColor,tiers:t.tiers};this._impl=new ph(e._impl,n),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 am={interactive:!0,maxZoom:1/0,minZoom:-1/0,color:"#3388ff33",zIndex:0,strokeWidth:3,strokeColor:"#3388ff",userData:void 0};class lm extends hl{constructor(e,t){super(),this.userData=t.userData;const i=Nu(t,am),n={coordinates:i.coordinates,interactive:i.interactive,maxZoom:i.maxZoom,minZoom:i.minZoom,color:i.color,zIndex:i.zIndex,strokeWidth:i.strokeWidth,strokeColor:i.strokeColor,tiers:t.tiers};this._impl=new yh(e._impl,n),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 dm={minZoom:-1/0,maxZoom:1/0,zIndex:0,opacity:1};class cm{constructor(e,t){const i=Nu(t,dm),n={bounds:i.bounds,image:{url:i.image.url},minZoom:i.minZoom,maxZoom:i.maxZoom,zIndex:i.zIndex,opacity:i.opacity,tiers:t.tiers};this._impl=new $h(e._impl,n)}updateImage(e){return(0,M.mG)(this,void 0,void 0,(function*(){yield this._impl.updateImage(e)}))}destroy(){this._impl.destroy()}}const hm={scale:1,rotation:0,offset:0,linkedIds:[],interactive:!1,minZoom:-1/0,maxZoom:1/0,zIndex:0,hideOnInit:!1,ignoreGlobalLighting:!1,colorTextureUvIndex:0,nearCameraFade:2500,showRatio:1,userData:void 0,disableAnimation:!1,hover:{},color:"#ffffffff"};class um extends hl{constructor(e,t){super(),this.userData=t.userData;const i=Nu(t,hm),n={coordinates:i.coordinates,modelSrc:i.modelSrc,scale:i.scale,rotation:i.rotation,offset:i.offset,linkedIds:i.linkedIds,interactive:i.interactive,minZoom:i.minZoom,maxZoom:i.maxZoom,zIndex:i.zIndex,hideOnInit:i.hideOnInit,ignoreGlobalLighting:i.ignoreGlobalLighting,colorTextureUvIndex:i.colorTextureUvIndex,nearCameraFade:i.nearCameraFade,showRatio:i.showRatio,disableAnimation:i.disableAnimation,hover:i.hover,color:i.color};this._impl=new gc(e._impl,n),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))).on("modelloaded",(()=>this._emitPointerEvent("modelloaded")))}destroy(){this._impl.destroy()}hide(){this._impl.hide()}show(){this._impl.show()}_emitPointerEvent(e,t){this.emit(e,t?{originalEvent:t.originalEvent,lngLat:t.lngLat,point:t.point,targetData:this}:void 0)}}const mm={attributes:{},maxZoom:17,dimensions:2,modelsPath:"",modelsAppearStrategy:"byModel"};class fm{constructor(e,t){this.options=Nu(t,mm),this._impl=new Ao.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 pm=i(3103),_m={};_m.styleTagTransform=Wc(),_m.setAttributes=Vc(),_m.insert=Nc().bind(null,"head"),_m.domAPI=Bc(),_m.insertStyleElement=Hc();Oc()(pm.Z,_m);const vm=pm.Z&&pm.Z.locals?pm.Z.locals:void 0;class gm extends nu{constructor(e,t){super(e,(e=>`\n    <div class=${vm.container}>\n        <div class=${vm.text}>\n            ${e}\n        </div>\n    </div>\n`)(t),{position:"bottomLeft"})}}const ym={attributes:{},attribution:"",minZoom:Qc,maxZoom:eh};class bm{constructor(e,t){this.options=Nu(t,ym),this._impl=new Jh(e._impl,this.options,this),this._attribution=new gm(e,this.options.attribution)}destroy(){this._impl.destroy(),this._attribution.destroy()}setAttributes(e){return this._impl.setAttributes(e),this}getAttributes(){return this._impl.getAttributes()}}class wm{constructor(e,t){this.options=t,this._impl=new lc(e._impl,Object.assign({tileKey:"",subdomains:[""],appId:e._impl.state.appId},this.options),this)}destroy(){this._impl.destroy()}setAttributes(e){return this._impl.setAttributes(e),this}getAttributes(){return this._impl.getAttributes()}setFeatureStateMap(e){this._impl.setFeatureStateMap(e)}setFeatureStateMapBinary(e){this._impl.setFeatureStateMapBinary(e)}}wm.tileTemplateUrl="{protocol}://{host}/v2/ald?ts={tileSet}&x={x}&y={y}&z={z}&lang={lang}",wm.metatileTemplateUrl="{protocol}://{host}/v2/ald/file/{hash}.json?ts={tileSet}",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("="))).find((e=>"callback"===e[0]));return i?i[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)},4713:(e,t,i)=>{i.d(t,{l:()=>r});var n,o=i(7663);class r{constructor(e,t,i=!1,n=!1){var o;this.elementsType=null,this.isDirty=!0,this._glBuffer=null,this._glContext=null,this._initData=e,this.byteLength=e.byteLength,this.type=i?r.ElementArrayBuffer:r.ArrayBuffer,this.options=Object.assign({},r.defaultOptions,t),this.drawType=null!==(o=null==t?void 0:t.drawType)&&void 0!==o?o:r.StaticDraw;const s=[r.UnsignedByte,r.UnsignedShort,r.UnsignedInt];i&&!s.includes(this.options.dataType)&&(console.warn("Please provide dataType of one of the following values:Buffer.UnsignedByte, Buffer.UnsignedShort, Buffer.UnsignedInt. Defaulting to UnsignedInt"),this.options.dataType=r.UnsignedInt),this._preserveData=n}static _dataTypeSize(e){switch(e){case r.Byte:case r.UnsignedByte:return 1;case r.UnsignedShort:case r.Short:return 2;case r.Float:case r.Int:case r.UnsignedInt:return 4}throw new Error(`[2gl] Unsupported Buffer data type: ${String(e)}`)}bind(e,t,i,n,s){if(this._glBuffer||this.prepare(e),this.type===r.ArrayBuffer){e.bindBuffer(e.ARRAY_BUFFER,this._glBuffer),t=t||0,i=i||this.options,s=null!=s?s:1,(0,o.S)(s);const a=this._toGlParam(e,i.dataType)||e.FLOAT;if(1===s)e.vertexAttribPointer(t,i.itemSize,a,i.normalized,i.stride,i.offset),this.bindVertexAttribDivisor(e,t,i,n);else{const o=r._dataTypeSize(i.dataType);for(let r=0;r<s;r++)e.vertexAttribPointer(t+r,s,a,i.normalized,i.stride,i.offset+r*s*o),this.bindVertexAttribDivisor(e,t+r,i,n)}}else this.type===r.ElementArrayBuffer&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this._glBuffer);return this}remove(){return this._unprepare(),this}subData(e,t,i){this._glBuffer||this.prepare(e);const n=this._toGlParam(e,this.type)||e.ARRAY_BUFFER;return e.bindBuffer(n,this._glBuffer),e.bufferSubData(n,t,i),this}replaceData(e){e&&(this._initData=e),this.isDirty=!0}commitData(e){const t=this._toGlParam(e,this.type)||e.ARRAY_BUFFER,i=this._toGlParam(e,this.drawType)||e.STATIC_DRAW;e.bindBuffer(t,this._glBuffer),e.bufferData(t,this._initData,i),this.isDirty=!1}prepare(e){return this._glContext=e,this._glBuffer=e.createBuffer(),this.commitData(e),this._preserveData||(this._initData=null),this}getGLType(e){return this._toGlParam(e,this.options.dataType)}getData(){return this._initData}_unprepare(){this._glBuffer&&this._glContext&&(this._glContext.deleteBuffer(this._glBuffer),this._glBuffer=null,this._glContext=null)}_toGlParam(e,t){return t===r.ArrayBuffer?e.ARRAY_BUFFER:t===r.ElementArrayBuffer?e.ELEMENT_ARRAY_BUFFER:t===r.StaticDraw?e.STATIC_DRAW:t===r.DynamicDraw?e.DYNAMIC_DRAW:t===r.Byte?e.BYTE:t===r.Short?e.SHORT:t===r.Int?e.INT:t===r.Float?e.FLOAT:t===r.UnsignedByte?e.UNSIGNED_BYTE:t===r.UnsignedShort?e.UNSIGNED_SHORT:t===r.UnsignedInt?e.UNSIGNED_INT:null}_hasRealWebGLContext(){return"undefined"!=typeof window&&("WebGLRenderingContext"in window||"WebGL2RenderingContext"in window)}bindVertexAttribDivisor(e,t,i,n){i.instanceDivisor&&this._hasRealWebGLContext()&&(e instanceof WebGLRenderingContext?n?n.vertexAttribDivisorANGLE(t,i.instanceDivisor):console.error("Can't set up instanced attribute divisor. Missing ANGLE_instanced_arrays extension"):e.vertexAttribDivisor(t,i.instanceDivisor))}}n=r,r.ArrayBuffer=1,r.ElementArrayBuffer=2,r.StaticDraw=10,r.DynamicDraw=11,r.Float=20,r.UnsignedByte=21,r.UnsignedShort=22,r.UnsignedInt=23,r.Byte=24,r.Short=25,r.Int=26,r.defaultOptions={itemSize:3,dataType:n.Float,stride:0,offset:0,normalized:!1,instanceDivisor:0,drawType:r.StaticDraw}},1634:(e,t,i)=>{i.d(t,{K:()=>o});var n=i(4713);class o{constructor(e,t={}){this._buffer=e,this.options=Object.assign({},n.l.defaultOptions,t)}get isDirty(){return this._buffer.isDirty}set isDirty(e){this._buffer.isDirty=e}bind(e,t,i,n,o){this._buffer.bind(e,t,i||this.options,n,o)}replaceData(e){this._buffer.replaceData(e)}commitData(e){this._buffer.commitData(e)}getData(){return this._buffer.getData()}}},7663:(e,t,i)=>{i.d(t,{L:()=>n,S:()=>o});class n{constructor(e){var t;this._enable=!1,this.name=e.name,this.index=e.index,this.location=void 0!==e.location?e.location:-1,this.locationsCount=null!==(t=e.locationsCount)&&void 0!==t?t:1,o(this.locationsCount)}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){if(!this._enable&&!0!==this.index){for(let t=0;t<this.locationsCount;t++)e.enableVertexAttribArray(this.location+t);this._enable=!0}return t.bind(e,this.location,void 0),this}disable(e){if(this._enable&&!0!==this.index){for(let t=0;t<this.locationsCount;t++)e.disableVertexAttribArray(this.location+t);this._enable=!1}return this}}function o(e){if(e<0||e>4)throw new Error("[2gl] Invalid attribute location count. Must be 1, 2, 3 or 4")}},9218:(e,t,i)=>{i.r(t),i.d(t,{DEFAULT_MIN_TIERS_STYLE_ZOOM:()=>W,MAP_DEFAULTS:()=>r,analytics:()=>g,atlasSize:()=>h,buildingAnimation:()=>x,cityCommPoiLabelingConfig:()=>T,commercialCitySublayers:()=>D,commercialModelSublayers:()=>N,commercialPoi:()=>a,commercialPremiumSublayers:()=>B,commercialSublayers:()=>j,defaultCameraConfig:()=>C,defaultLang:()=>P,defaultMarkerAnchor:()=>Z,defaultMarkerIcon:()=>H,defaultShadowsSettings:()=>X,entranceAnimation:()=>S,events:()=>v,floors:()=>R,fonts:()=>f,houseHover:()=>b,icons:()=>p,identify:()=>I,inertia:()=>A,labeling:()=>M,landmarkPoiSublayers:()=>V,landmarkRasterSizes:()=>G,loadModelsInfoStyleZoom:()=>c,maxZoomForDynamicNear:()=>k,metricsTimeout:()=>O,minCalculationScreenHeight:()=>z,modelCacheSize:()=>d,models:()=>l,performanceCheck:()=>F,personalSublayers:()=>U,render:()=>E,styles:()=>_,tileAnimation:()=>w,tiles:()=>s,traffic:()=>m,urls:()=>u,workerResetDebounceTime:()=>y,zoom:()=>L});var n=i(1e3),o=i(6849);const r={minZoom:2,maxZoom:20},s={protocol:n.X?"%TILES_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},a={minZoom:10,maxZoom:14,tileSet:"com_poi_web",rasterSizes:[96,84,72,60,48,36,24]},l={minZoom:15,maxZoom:15,tileSet:n.X?"%MODELS_TILESET%":"vector_immersive"},d=100,c=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}&dt={dt}",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}",gltfModel:"{protocol}://{host}/metafiles/{modelSrc}?ts={tileSet}",convertData:"{protocol}://{host}/metafiles/{hash}/convert.json?ts={tileSet}",dynamicPoi:"{protocol}://{host}/metafiles/{regionId}/poi/{id}_{width}_{height}.png?ts={tileSet}",models:"{protocol}://{host}/v2/ald?ts={tileSet}&x={x}&y={y}&z={z}",commercialPoi:"{protocol}://{host}/v2/ald?ts={tileSet}&x={x}&y={y}&z={z}&lang={lang}"},m={protocol:n.X?"%TRAFFIC_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_},_={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"},S={bounceType:"easeOutElastic",bounceTime:750,growType:"easeInOutQuad",growTime:750,stagger:0},I={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={0:M.commercialMargins.city,11:{topBottom:250,leftRight:250},12:{topBottom:170,leftRight:170}},E={alwaysRerender:!1,autoResizeInterval:50},P="en",L={macWheelDeltaToZoomDelta:.0018,notMacTrackpadDeltaToZoomDelta:.0054,wheelZoomDelta:.65,animDuration:400,throttleDelay:100,mouseRotateDelta:2.5,mousePitchDelta:2.5,mobilePinchDelta:1,mobileTapDelta:10},A={duration:1300,maxSpeed:8,minSpeed:.02,nonLinearity:5},C={fov:60*Math.PI/180,useDynamicNearFar:!1,near:1e3,far:Math.pow(2,34),viewportLimitRatio:2,minTrapezeHeight:262144,perspectiveDistanceLimitRatio:10,minFogDistance:2e4,pitchInterStartZoom:16.5,pitchInterEndZoom:19},z=1e3,k=16,R={enabled:!0,url:o.kv,displayStyleZoom:18,detailLevel:17,wallHeight:800,islandHeight:400,wallMinBrightness:.8265,wallMaxBrightness:.95,viewportPadding:.2},F={fpsCaveat:10},O=3e4,D=["Commercial_poi_city"],B=["Commercial_poi_premium"],j=["Commercial_poi_default","Commercial_poi_custom","Commercial_poi_navi",...D,...B],N=["Commercial_model"],U=["s_personal_poi"],V=["Landmark_poi","Landmark_point"],G=[105,84,63,42,21],H="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSI0OHB4IiB2aWV3Qm94PSIwIDAgMzAgNDgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1MS4yICg1NzUxOSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+PHRpdGxlPlBhZ2UgMSBDb3B5PC90aXRsZT48ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz48ZGVmcz48bGluZWFyR3JhZGllbnQgeDE9IjUwJSIgeTE9IjUwJSIgeDI9IjUwJSIgeTI9IjAlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+PHN0b3Agc3RvcC1jb2xvcj0iIzFCODlFRSIgb2Zmc2V0PSIwJSI+PC9zdG9wPjxzdG9wIHN0b3AtY29sb3I9IiMzMTk4RUMiIG9mZnNldD0iMTAwJSI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGlkPSJSZWNvdmVyeS0wMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTgzOS4wMDAwMDAsIC00MjUuMDAwMDAwKSI+PGcgaWQ9IlBhZ2UtMS1Db3B5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MzkuMDAwMDAwLCA0MjUuMDAwMDAwKSI+PGVsbGlwc2UgaWQ9Ik92YWwtMyIgZmlsbD0iIzAwMDAwMCIgb3BhY2l0eT0iMC4wMzYzODA1OTciIGN4PSIxNSIgY3k9IjQ1LjUiIHJ4PSIzIiByeT0iMS41Ij48L2VsbGlwc2U+PGVsbGlwc2UgaWQ9Ik92YWwtMy1Db3B5IiBmaWxsPSIjMDAwMDAwIiBvcGFjaXR5PSIwLjAzNjM4MDU5NyIgY3g9IjE1IiBjeT0iNDUuNSIgcng9IjQuNSIgcnk9IjIuNSI+PC9lbGxpcHNlPjxwYXRoIGQ9Ik0xNSw0NS44ODM2MzUzIEwxNS44ODIzNTI5LDQ1Ljg4MzYzNTMgQzE1Ljg4MjM1MjksMjkuMjE3NzUyOSAyMC43NzY3NjQ3LDIzLjc5NzQ1ODggMjcuOTg3MzUyOSwyMy43OTc0NTg4IEwyOC4zMjk3MDU5LDIzLjc5NzQ1ODggQzI5LjA3Nzk0MTIsMjEuNTkwNjk0MSAzMCwxNy45OTE1NzY1IDMwLDE1LjAwMDQgQzMwLDcuMTQzOTI5NDEgMjMuNzY3OTQxMiwwLjAwMDQgMTUsMC4wMDA0IEM2LjIzMjA1ODgyLDAuMDAwNCAwLDcuMTQzOTI5NDEgMCwxNS4wMDA0IEMwLDE3Ljk5MTU3NjUgMC45MjIwNTg4MjQsMjEuNTkwNjk0MSAxLjY3MDI5NDEyLDIzLjc5NzQ1ODggTDIuMDEyNjQ3MDYsMjMuNzk3NDU4OCBDOS4yMjQxMTc2NSwyMy43OTc0NTg4IDE0LjExNzY0NzEsMjkuMjE3NzUyOSAxNC4xMTc2NDcxLDQ1Ljg4MzYzNTMgTDE1LDQ1Ljg4MzYzNTMgWiIgaWQ9IkZpbGwtMSIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSI+PC9wYXRoPjwvZz48L2c+PC9nPjwvc3ZnPg==",Z=[15,46],W=16,X={bias:50,textureSize:[2048,2048],shadowRadius:1}},1e3:(e,t,i)=>{i.d(t,{X:()=>n});const n=!1},6849:(e,t,i)=>{i.d(t,{LP:()=>c,R_:()=>d,X:()=>o,_A:()=>r,aT:()=>m,hs:()=>l,k0:()=>u,k1:()=>a,kv:()=>s,ns:()=>h,rQ:()=>f});var n=i(1e3);const o=n.X?"%TILESERVER%":"tile{subdomain}.maps.2gis.com",r=n.X?"%TRAFFICSERVER%":"jam.api.2gis.com",s=n.X?"%FLOORSSERVER%":"https://floors.api.2gis.ru",a="https://styles.api.2gis.com",l="https://mapgl.2gis.com/api/fonts",d="https://disk.2gis.com/styles/assets/icons",c="https://disk.2gis.com/styles/assets/models",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.1.1.js",m=n.X?"%RTLPLUGINHASH%":"sha512-IyuCqmcNBfZyrExDMisGi0Xhp4PXupx6AMp4cjpKcAzJo+kSmOtRTLbL1xZsfxnsIqci9Q0piqY+kcwl1hCPyw==",f=n.X?"%DRACOPLUGIN%":"https://mapgl.2gis.com/api/js/plugins/draco_decoder_gltf.js"},6273:(e,t,i)=>{i.d(t,{$U:()=>m,Bq:()=>l,CW:()=>w,Cd:()=>I,DL:()=>x,Fg:()=>E,Fv:()=>g,Gt:()=>p,Jv:()=>P,L2:()=>S,LF:()=>u,Rw:()=>_,Uo:()=>b,_9:()=>a,_H:()=>d,ax:()=>f,bQ:()=>L,ed:()=>r,gL:()=>s,gt:()=>c,jO:()=>h,jm:()=>A,p7:()=>y,rx:()=>M,sX:()=>o,uC:()=>T,vL:()=>v,y4:()=>n});const n=256,o=Math.pow(2,32),r=o/2,s=r/20037508.34,a=Math.pow(2,20),l=Math.pow(2,15),d=Math.pow(2,16)-1,c=l/d,h=16383,u=2.54,m=96,f=o/(n/m*u),p=.7071067811865475,_=4294967295,v=1175494351e-47,g=3402823466e29,y=["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"],b="Noto_Sans",w=.5,x=-3,S=-4,I=2147483647,M="eb10e2c3-3c28-4b81-b74b-859c9c4cf47e",T=5,E=4,P=40,L=65e3,A="byModel"},3249:(e,t,i)=>{i.d(t,{FJ:()=>p,hX:()=>_,jf:()=>c});var n=i(6479),o=i(7188),r=i(6273),s=i(7464),a=i(4575),l=i(8450),d=i(412);const c=0,h={type:n.f.Loaded,index:-1,key:(0,s.PR)("",.5,.5),isSvg:!1,name:"",fileName:"",rasters:[]},u=["default","marker","markerText","htmlLabel"],m={default:0,marker:1,markerText:2,htmlLabel:3,pointLabel:4},f={default:{default:!0,marker:!1,markerText:!0,htmlLabel:!0,pointLabel:!1},marker:{default:!1,marker:!1,markerText:!0,htmlLabel:!1,pointLabel:!1},markerText:{default:!0,marker:!0,markerText:!0,htmlLabel:!1,pointLabel:!1},htmlLabel:{default:!0,marker:!1,markerText:!1,htmlLabel:!1,pointLabel:!1},pointLabel:{default:!1,marker:!1,markerText:!1,htmlLabel:!1,pointLabel:!0}};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:c,revision:0,background:{color:(0,d.MV)("f6f2de")},light:{defaultLightMode:"global",lightingModes:{}},layers:[],layersById:{},layerIdToInnerId:{},groupsById:{},iconBaseUrl:"",fontUrlTemplate:"",modelsBaseUrl:"",rasterSets:{byIndex:{},byKey:{}},labelingGroups:{indexToGroup:u,groupToIndex:m,table:f},fonts:r.p7,fontNameToIndex:(0,l.PU)(r.p7),icons:{},models:[],modelIndex:{},dem:(0,a.vR)({}),environment:(0,a.kZ)({})},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.layersById[e.innerId]||(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,precomputes:i}){const n=this.style.layersById[e];n&&(n.style=t,n.precomputes=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}}},7293:(e,t,i)=>{i.d(t,{u:()=>o});var n=i(314);function o(e,t){const i=t.precomputes;return e.map(((e,t)=>{const o=i[t];return o&&o.usage===n.Zx.Uniform?e:null}))}},412:(e,t,i)=>{i.d(t,{MV:()=>l,RY:()=>a,gC:()=>s,iL:()=>r});var n=i(7464);const o=(0,n.lK)([255,0,0,255]);function r(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 s(e){return!!e&&"object"==typeof e&&"color"===e.type}function a(e){return!!e&&"object"==typeof e&&"gradient-color"===e.type}function l(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),r=parseInt(t[3]+t[4],16),s=parseInt(t[5]+t[6],16),a=parseInt(t[7]+t[8],16);return(0,n.lK)([i,r,s,a])}(t);break;case"h":i=function(e){const t=d(e);t[0]/=360,t[1]/=100,t[2]/=100;const[i,o,r]=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]),s=void 0!==t[3]?255*t[3]:255;return(0,n.lK)([Math.round(i),Math.round(o),Math.round(r),Math.round(s)])}(t);break;case"r":i=function(e){const[t,i,o,r]=d(e),s=void 0!==r?255*r:255;return(0,n.lK)([Math.round(t),Math.round(i),Math.round(o),Math.round(s)])}(t)}return i}function d(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}},4575:(e,t,i)=>{i.d(t,{Jn:()=>R,vR:()=>B,kZ:()=>j,ys:()=>C,XG:()=>N,Wy:()=>k,z8:()=>z,Cp:()=>A,qw:()=>D});var n=i(3024),o=i(412),r=i(3754),s=i(7464),a=i(314),l=i(1284),d=i(6273),c=i(6479),h=i(3194);function u(e){const t=function(e){const t=(e.groups||[]).concat(r.YW.groups).reduce(((e,t)=>(e.includes(t)||e.push(t),e)),[]),i=(e.overlay||[]).concat(r.YW.overlay).concat(t.reduce(((e,t)=>(t===r.T_||t===r.R_||t===r.n3||e.push([t,r.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:r.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)),{}),r=[];for(let e=0;e<t.length;e++){const e=[];for(let i=0;i<t.length;i++)e.push(!0);r.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]],s=o[t[i]];r[n][s]=!1,r[s][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]],s=o[t[i]];r[n][s]=!0,r[s][n]=!0}}return{groups:t,table:r}}(t),o={};for(let e=0;e<n.length;e++){const t=n[e],r=i[e];o[r]={};for(let s=0;s<t.length;s++){const t=i[s];o[r][t]=n[e][s]}}const s=i.reduce(((e,t,i)=>(e[t]=i,e)),{});return{indexToGroup:i,groupToIndex:s,table:o}}var m=i(8450),f=i(2627),p=i(132),_=i(199);const v={verticalScale:["interpolate",["linear"],["zoom"],11,0,12,1.2],shadingIntensity:["interpolate",["linear"],["zoom"],12,0,14.5,.7]};function g(e){const t={};let i=0;for(const n in e)t[n]=i,i+=1;return t}let y=Number.MIN_SAFE_INTEGER;function b(){return y++}const w=b(),x=b(),S="__JAKARTA__DEM__LIGHTING__";class I extends Error{constructor(e){super(`Unknown expression type '${e[0]}' in '${JSON.stringify(e)}'`),this.name="UnknownExpressionTypeError",Object.setPrototypeOf(this,new.target.prototype)}}function M(e,t,i=a.Zx.Uniform){if((0,s.aH)(e))return(0,o.iL)(e)?(0,o.MV)(e):e;switch(e[0]){case"coalesce":return function(e,t,i){return{type:"coalesce",array:e.slice(1).map((e=>{try{return M(e,t,i)}catch(e){return console.debug(`Unknown expression in coalesce: ${e}`),null}}))}}(e,t,i);case"all":return function(e,t,i){return{type:"all",array:e.slice(1).map((e=>M(e,t,i)))}}(e,t,i);case"any":return function(e,t,i){return{type:"any",array:e.slice(1).map((e=>M(e,t,i)))}}(e,t,i);case"match":return function(e,t,i){const n={type:"match",input:M(e[1],t,i),cases:[],defaultOutput:M(e[e.length-1],t,i)},o=e.slice(2,-1);for(let e=0;e<o.length;e+=2){const r=o[e].reduce(((e,n)=>{"boolean"==typeof n&&e.push(Number(n));const o=M(n,t,i);return(0,s.HW)(o)?e.push(o):console.warn("MatchExpression supports only simple types: string, number, boolean or null",n),e}),[]),a={values:new Set(r),output:M(o[e+1],t,i)};n.cases.push(a)}return n}(e,t,i);case"in":return function(e,t,i){const n=M(e[1],t,i),o=e[2][0];if("get"!==o&&"global"!==o&&"sourceAttr"!==o)throw new Error("InExpression supports only get, global or source attr expression as a second argument");const r=M(e[2],t,i);return{type:"in",element:n,array:r}}(e,t,i);case"interpolate":return P(e,t,i);case"step":return function(e,t,i){const n={type:"step",steps:[],value:M(e[1],t,i)},o={key:0,value:M(e[2],t,i)};n.steps.push(o);const r=e.slice(3);for(let e=0;e<r.length;e+=2){const o={key:r[e],value:M(r[e+1],t,i)};n.steps.push(o)}return n}(e,t,i);case"featureState":case"get":case"sourceAttr":return L(e,t,i);case"objectAttr":return{type:"objectAttr",property:e[1]};case"global":return{type:"global",property:e[1]};case"zoom":return{type:"zoom"};case"height":return{type:"height"};case"heatmap-density":return{type:"heatmap-density"};case"shading-intensity":return{type:"shading-intensity"};case"to-boolean":case"to-color":case"!":case"log10":case"mappoints-to-meters":case"meters-to-pixels":return function(e,t,i){return{type:e[0],value:M(e[1],t,i)}}(e,t,i);case"uint64":return M(e[1],t,i);case"==":case"!=":case"<":case"<=":case">":case">=":return function(e,t,i){const n=M(e[1],t,i),o=M(e[2],t,i);return{type:e[0],leftValue:n,rightValue:o}}(e,t,i);case"+":return function(e,t,i){return{type:"+",array:e.slice(1).map((e=>M(e,t,i)))}}(e,t,i);case"*":return function(e,t,i){return{type:"*",array:e.slice(1).map((e=>M(e,t,i)))}}(e,t,i);case"^":return function(e,t,i){const n=M(e[1],t,i),o=M(e[2],t,i);return{type:"^",base:n,exponent:o}}(e,t,i);case"random":return function(e,t,i){const n=M(e[1],t,i),o=M(e[2],t,i);return{type:"random",start:n,end:o}}(e,t,i);case"literal":return Array.isArray(e[1])?function(e,t,i){return{type:"literalArray",array:e[1].map((e=>M(e,t,i)))}}(e,t,i):e[1];case"isBehindObjects":return{type:"isBehindObjects"};case"geometry-modifier":const o=[];return e.slice(1).forEach((e=>{const t=function(e){if(void 0===e||!Array.isArray(e))return;if("line-to-zigzag"===e[0])return{type:"zigzag-modifier",step:e[1],width:e[2],stopLines:Number(e[3])}}(e);t&&o.push(t)})),{type:"geometry-modifier",modifiers:o};case"pattern":return{type:"line-pattern",patternType:(0,n.R)(e[1]),parameters:e.slice(2).map((e=>M(e,t,i)))};case"precompute":{if(!t)throw new I(e);const n=t.precomputes.length;return t.precomputes.push({expr:M(e[1],void 0,i),usage:i}),{type:"precompute",precomputeIndex:n}}default:throw new I(e)}}function T(e,t,i=a.Zx.Uniform){return(0,s.nS)(e)||Array.isArray(e)&&0===e.length?e:M(e,t,i)}function E(e,t,i){return void 0===e?e:M(e,t,i)}function P(e,t,i){const n={type:"interpolate",base:1,argument:M(e[2],t,i),steps:[]};"exponential"===e[1][0]&&void 0!==e[1][1]&&(n.base=e[1][1]);const o=e.slice(3);for(let e=0;e<o.length;e+=2){const r={key:M(o[e],t,i),value:M(o[e+1],t,i)};n.steps.push(r)}return n}function L(e,t,i){var n;const o=e[0],r=(0,f.qS)(e[1]),s={type:o,property:r};if(i!==a.Zx.Generator&&t){const e=null!==(n=t.precomputes.length)&&void 0!==n?n:NaN;return t.precomputes.push({expr:s,usage:i}),"selected"===r&&"selectedIdx"in t&&(t.selectedIdx=e),{type:"precompute",precomputeIndex:e}}return s}function A(e,t,i,n){var r,s,a,c;const h=n===d.rx?v:{},f=B(null!==(r=e.terrain)&&void 0!==r?r:h),y=j(null!==(s=e.environment)&&void 0!==s?s:{}),b=N(e.light,f),w={id:t,revision:0,background:{color:(0,o.MV)(e.background.color)},light:b,layers:[],layersById:{[p.he]:f,[p.d6]:y},layerIdToInnerId:{},groupsById:{},iconBaseUrl:"",fontUrlTemplate:"",modelsBaseUrl:"",fonts:d.p7,fontNameToIndex:(0,m.PU)(d.p7),rasterSets:{byIndex:{},byKey:{}},icons:e.icons||{},models:Object.values(null!==(a=e.models)&&void 0!==a?a:{}),modelIndex:g(e.models||{}),labelingGroups:u(null!==(c=e.labelingGroups)&&void 0!==c?c:{}),dem:f,environment:y},x=new l.x;let S=e.layers;i&&(S=function(e,t){let i=0;function n(e,t){"custom"!==e.type&&(0,m.Kx)(e.filter)&&(i=t)}return e.forEach(((e,t)=>{"group"===e.type?e.layers.forEach((e=>n(e,t))):n(e,t)})),t.forEach((e=>{"point"===e.type&&(e.style.iconPriority=Number.MAX_SAFE_INTEGER)})),[...e.slice(0,i+1),...t,...e.slice(i+1)]}(e.layers,_.T));for(const e of S){const t=C(e);if(!t)continue;"group"===t.type&&(w.groupsById[t.innerId]=t,w.layerIdToInnerId[t.id]=t.innerId);("group"===t.type?t.layers:[t]).forEach((e=>{var t;const i=null!==(t=e.lightingMode)&&void 0!==t?t:b.defaultLightMode;if(b.lightingModes[i]||console.warn(`Не найден режим освещения ${i} для слоя ${e.type}. Будет использован режим освещения по умолчанию.`),w.layers.push(e),w.layersById[e.innerId]=e,w.layerIdToInnerId[e.id]=e.innerId,"point"===e.type||"polygon"===e.type||"metricPoint"===e.type||"embankment"===e.type){z(e,x).forEach((e=>{w.rasterSets.byKey[e.key]||(w.rasterSets.byIndex[e.index]=e,w.rasterSets.byKey[e.key]=e)}))}}))}return w}function C(e){return"group"===e.type?function(e){var t,i;const n={id:e.id,innerId:(0,p.Uv)(),renderIndex:F.getIndex(),type:e.type,layers:[],orderBy:[],precomputes:[]};return n.orderBy=null!==(i=null===(t=e.orderBy)||void 0===t?void 0:t.map((e=>L(e,n,a.Zx.Uniform))))&&void 0!==i?i:[],e.layers.forEach(((e,t)=>{const i=D(e,n);i&&(i.groupId=n.innerId,i.groupIndex=t,i.renderIndex=n.renderIndex,n.layers.push(i))})),n}(e):D(e)}function z(e,t){const i=[],{image:n,imageType:o,anchor:r}=R(e);return n?((0,h.EG)(n).forEach((e=>{"string"==typeof e&&e.length&&i.push(k(e,o,t,r))})),i):i}function k(e,t,i,n){const o="icon"===t?(0,s.PR)(e,n[0],n[1]):(0,s.FD)(e);return{type:c.f.Static,index:i.getUniqueIndex(o),key:o,isSvg:!0,name:e,fileName:e,anchorX:n[0],anchorY:n[1],rasters:[]}}function R(e){if("point"===e.type){const t=(0,s.pV)(e.style.iconAnchor);return{image:e.style.iconImage,imageType:"icon",anchor:t}}return"metricPoint"===e.type?{image:e.style.iconImage,imageType:"texture",anchor:[0,0]}:{image:e.style.textureImage,imageType:"texture",anchor:[0,0]}}const F=new l.x;function O(e,t){return"appearance"===e.type?{type:e.type,tipMovementAmplitude:M(e.tipMovementAmplitude,t)}:e}function D(e,t){var i,n,o,l,d,c,h,u,m,f;if("custom"===e.type)return{type:"custom",id:e.id,innerId:(0,p.Uv)(),renderIndex:F.getIndex(),filter:!1,minzoom:-1/0,maxzoom:1/0,precomputes:[],style:{}};if(!e.style||"none"===e.style.visibility)return;let _;try{const v={id:e.id,innerId:(0,p.Uv)(),renderIndex:F.getIndex(),filter:M(e.filter||!1,void 0),minzoom:U(e.minzoom,-1/0),maxzoom:U(e.maxzoom,1/0),precomputes:t?t.precomputes.slice(0):[],farLimit:e.farLimit,webglState:e.webglState,lightingMode:e.lightingMode};switch(e.type){case"line":{const t=(0,r.q0)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(i=e.ignoreTier)&&void 0!==i&&i,v),style:{color:M(t.color,v),width:M(t.width,v),shift:M(t.shift,v),pattern:M(t.pattern,v),startCap:M(t.startCap,v),endCap:M(t.endCap,v),geometryModifier:M(t.geometryModifier,v),lengthUnits:V(e.style.pattern)}});break}case"lineExtrusion":{const t=(0,r.l7)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{sideColor:M(t.sideColor,v),strokeWidth:M(t.strokeWidth,v),strokeColor:M(t.strokeColor,v),sideStrokeColor:M(t.sideStrokeColor,v),height:M(t.height,v),nearCameraFade:M(t.nearCameraFade,v)}});break}case"polygon":{const t=(0,r.IJ)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(n=e.ignoreTier)&&void 0!==n&&n,v),style:{color:M(t.color,v),textureImage:M(t.textureImage,v),textureSize:T(t.textureSize,v),textureOpacity:M(t.textureOpacity,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v)}});break}case"embankment":{const t=(0,r.pm)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{color:M(t.color,v),textureImage:M(t.textureImage,v),textureSize:T(t.textureSize,v),textureOpacity:M(t.textureOpacity,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v),nearCameraFade:M(t.nearCameraFade,v)}});break}case"metricPoint":{const t=(0,r.IN)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(o=e.ignoreTier)&&void 0!==o&&o,v),style:{iconImage:M(t.iconImage,v),color:M(t.color,v),rotation:M(t.rotation,v),width:M(t.width,v),height:M(t.height,v)}});break}case"polygonExtrusion":{const t=(0,r.bN)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{topColor:M(t.topColor,v),sideColor:M(t.sideColor,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v),sideStrokeColor:M(t.sideStrokeColor,v),height:M(t.height,v,a.Zx.Generator),nearCameraFade:M(t.nearCameraFade,v)}});break}case"dashedLine":{const t=(0,r.N5)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(l=e.ignoreTier)&&void 0!==l&&l,v),style:{color:M(t.color,v),gapColor:M(t.gapColor,v),width:M(t.width,v),shift:M(t.shift,v),gapLength:M(t.gapLength,v),dashLength:M(t.dashLength,v),geometryModifier:M(t.geometryModifier,v)}});break}case"shiftedLine":{const t=(0,r.sd)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(d=e.ignoreTier)&&void 0!==d&&d,v),style:{color:M(t.color,v),width:M(t.width,v),shift:M(t.shift,v)}});break}case"oneWayLine":{const t=(0,r.zn)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(c=e.ignoreTier)&&void 0!==c&&c,v),style:{color:M(t.color,v),lineWidth:M(t.lineWidth,v),lineLength:M(t.lineLength,v),tipWidth:t.tipWidth,tipHeight:t.tipHeight,priority:t.priority,duplicationSpacing:M(t.duplicationSpacing,v),endingOffsets:t.endingOffsets,labelingGroup:t.labelingGroup}});break}case"buildingModel":{const t=(0,r._0)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{color:M(t.color,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v),nearCameraFade:M(t.nearCameraFade,v)}});break}case"labelLine":{const t=(0,r.Ym)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(h=e.ignoreTier)&&void 0!==h&&h,v),style:{textField:M(t.textField,v,a.Zx.Labeling),textFont:t.textFont,textColor:M(t.textColor,v),textFontSize:M(t.textFontSize,v),textLetterSpacing:t.textLetterSpacing,textHaloColor:M(t.textHaloColor,v),textHaloWidth:t.textHaloWidth,textPriority:M(t.textPriority,v),textLabelingSideMargin:t.textLabelingSideMargin,textDuplicationSpacing:M(t.textDuplicationSpacing,v),labelingGroup:t.labelingGroup,lineEndingOffsets:t.lineEndingOffsets}});break}case"point":{const t=(0,r.TI)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{allowOverlap:t.allowOverlap,allowElevation:t.allowElevation,elevation:M(t.elevation,v),iconImage:M(t.iconImage,v),iconAnchor:T(t.iconAnchor,v),iconOffset:T(t.iconOffset,v),iconWidth:M(t.iconWidth,v),iconTextField:M(t.iconTextField,v,a.Zx.Labeling),iconTextFont:E(t.iconTextFont,v),iconTextAnchor:T(t.iconTextAnchor,v),iconTextOffset:T(t.iconTextOffset,v),iconTextColor:M(t.iconTextColor,v),iconTextFontSize:M(t.iconTextFontSize,v),iconTextLineHeight:t.iconTextLineHeight,iconTextLetterSpacing:t.iconTextLetterSpacing,iconTextPadding:T(t.iconTextPadding,v),iconTextHaloWidth:(0,s.mH)((0,s.Wx)(t.iconTextHaloWidth)),iconTextHaloColor:M(t.iconTextHaloColor,v),iconOpacity:M(t.iconOpacity,v),iconPriority:M(t.iconPriority,v),iconLabelingMargin:t.iconLabelingMargin,iconLabelingGroup:t.iconLabelingGroup,iconRotation:M(t.iconRotation,v),textField:M((0,s.Wx)(t.textField),v,a.Zx.Labeling),textFont:M((0,s.Wx)(t.textFont),v),textColor:M((0,s.Wx)(t.textColor),v),textFontSize:M((0,s.Wx)(t.textFontSize),v),textLineHeight:(0,s.mH)((0,s.Wx)(t.textLineHeight),1.2),textLetterSpacing:(0,s.mH)((0,s.Wx)(t.textLetterSpacing)),textField2:E((0,s._e)(t.textField),v,a.Zx.Labeling),textFont2:E((0,s._e)(t.textFont),v),textColor2:E((0,s._e)(t.textColor),v)||M((0,s.Wx)(t.textColor),v),textFontSize2:E((0,s._e)(t.textFontSize),v)||M((0,s.Wx)(t.textFontSize),v),textMaxLengthPerLine:t.textMaxLengthPerLine,textPlacement:M(t.textPlacement,v),textPriority:M(t.textPriority,v),textOffset:M((0,s.Wx)(t.textOffset),v),textOffset2:E((0,s._e)(t.textOffset),v),textHaloColor:M((0,s.Wx)(t.textHaloColor),v),textHaloColor2:E((0,s._e)(t.textHaloColor),v)||M((0,s.Wx)(t.textHaloColor),v),textHaloWidth:(0,s.mH)((0,s.Wx)(t.textHaloWidth)),textHaloWidth2:(0,s.mH)((0,s._e)(t.textHaloWidth)||(0,s.Wx)(t.textHaloWidth)),textLabelingMargin:(0,s.Wx)(t.textLabelingMargin),textLabelingMargin2:(0,s._e)(t.textLabelingMargin)||(0,s.Wx)(t.textLabelingMargin),textLabelingGroup:(0,s.Wx)(t.textLabelingGroup),textLabelingGroup2:(0,s._e)(t.textLabelingGroup)||(0,s.Wx)(t.textLabelingGroup),duplicationSpacing:M(t.duplicationSpacing,v),endingOffsets:t.endingOffsets}});break}case"arrow":{const t=(0,r.z4)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(u=e.ignoreTier)&&void 0!==u&&u,v),style:{color:M(t.color,v),strokeColor:M(t.strokeColor,v),lineWidth:M(t.lineWidth,v),strokeWidth:M(t.strokeWidth,v),tipWidth:M(t.tipWidth,v),tipHeight:M(t.tipHeight,v),animation:O(t.animation,v)}});break}case"raster":{const t=(0,r.tC)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,ignoreTier:M(null!==(m=e.ignoreTier)&&void 0!==m&&m,v),style:{opacity:M(t.opacity,v)}});break}case"circle":{const t=(0,r.th)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{color:M(t.color,v),strokeColor:M(t.strokeColor,v),strokeColor2:M(t.strokeColor2,v),width:M(t.width,v),strokeWidth:M(t.strokeWidth,v),strokeWidth2:M(t.strokeWidth2,v)}});break}case"heatmap":{const t=(0,r.Mk)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{color:M(t.color,v),radius:M(t.radius,v),opacity:M(t.opacity,v),intensity:M(t.intensity,v),weight:M(t.weight,v),downscale:t.downscale},framebufferId:{framebuffer:a.ze}});break}case"model":{const t=(0,r.M3)(e.style),i=null===(f=e.interactive)||void 0===f||f;_=Object.assign(Object.assign({},v),{interactive:i,type:"gltfModel",style:{modelSrc:M(t.modelSrc,v),offset:M(t.offset,v),scale:M(t.scale,v),rotation:M(t.rotation,v),color:M(t.color,v),linkedIds:M(t.linkedIds,v),colorTextureUvIndex:t.colorTextureUvIndex,roughness:t.roughness,metallic:t.metallic,nearCameraFade:M(t.nearCameraFade,v),ignoreGlobalLighting:t.ignoreGlobalLighting,showRatio:M(t.showRatio,v),lightingModel:t.lightingModel}});break}case"overpass":{const t=(0,r.Jb)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{debug:t.debug,sideColor:M(t.sideColor,v),bottomColor:M(t.bottomColor,v),topColor:M(t.borderTopColor,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v),thickness:M(t.thickness,v),borderHeight:M(t.borderHeight,v),borderWidth:M(t.borderWidth,v),color:M(t.color,v),nearCameraFade:M(t.nearCameraFade,v),tunnelHeight:M(t.tunnelHeight,v)}});break}case"tunnel":{const t=(0,r.Ug)(e.style);_=Object.assign(Object.assign({},v),{type:e.type,style:{sideColor:M(t.sideColor,v),bottomColor:M(t.bottomColor,v),topColor:M(t.topColor,v),strokeColor:M(t.strokeColor,v),strokeWidth:M(t.strokeWidth,v),color:M(t.color,v),nearCameraFade:M(t.nearCameraFade,v)}});break}}}catch(t){if(t instanceof I)return void console.warn(`Problem with layer #${e.id}: ${t}`);throw t}return _}function B(e){const t=(0,r.sy)(e),i={id:"dem",type:"dem",innerId:p.he,filter:!0,precomputes:[],minzoom:-1/0,maxzoom:1/0,renderIndex:w,style:{},framebufferId:{elevation:a.ze,hillshade:a.ze,flatBottom:a.ze},lightingMode:S};return i.style={lightingDirection:void 0!==t.lightingDirection?M(t.lightingDirection,i):null,shadingIntensity:M(t.shadingIntensity,i),shadingPalette:P(t.shadingPalette,i),verticalScale:M(t.verticalScale,i)},i}function j(e){const t=(0,r.p8)(e),i={id:"sky",type:"custom",innerId:p.d6,filter:!0,precomputes:[],minzoom:-1/0,maxzoom:1/0,renderIndex:x,style:{}};return i.style={skyColor:M(t.skyColor,i),fogColor:M(t.fogColor,i)},i}function N(e,t){var i,n;const o=(0,r.x6)(e),s={},a={ambientColor:{type:"color",value:[255,255,255,255]},ambientIntensity:0,dir1Color:{type:"color",value:[255,255,255,255]},dir1Altitude:0,dir1Azimuth:0,dir1Intensity:0,dir2Color:{type:"color",value:[255,255,255,255]},dir2Altitude:0,dir2Azimuth:0,dir2Intensity:0,shadowRadius:null===(i=o.shadows)||void 0===i?void 0:i.radius};for(const e in o.lightingModes){const i={ambientColor:{type:"color",value:[255,255,255,255]},ambientIntensity:0,dir1Color:{type:"color",value:[255,255,255,255]},dir1Altitude:0,dir1Azimuth:0,dir1Intensity:0,dir2Color:{type:"color",value:[255,255,255,255]},dir2Altitude:0,dir2Azimuth:0,dir2Intensity:0,shadowRadius:null===(n=o.shadows)||void 0===n?void 0:n.radius},r=o.lightingModes[e].map((e=>o.sources[e])).filter(Boolean),l=o.shadows?o.sources[o.shadows.source]:void 0;let d=0;r.forEach((n=>{n.color||(n.color="#FFFFFF"),"ambient"===n.type?(i.ambientColor=M(n.color,void 0),i.ambientIntensity=M(n.intensity,void 0),e===o.defaultLightingMode&&(a.ambientColor=i.ambientColor,a.ambientIntensity=i.ambientIntensity)):"directional"===n.type&&(n===l&&(i.shadowLightIndex=d),0===d?(d++,i.dir1Color=M(n.color,void 0),i.dir1Altitude=M(n.altitude,void 0),i.dir1Azimuth=M(n.azimuth,void 0),i.dir1Intensity=M(n.intensity,void 0),e===o.defaultLightingMode&&(a.dir1Color=i.dir1Color,a.dir1Intensity=i.dir1Intensity,a.dir1Azimuth=null===t.style.lightingDirection?i.dir1Azimuth:t.style.lightingDirection,a.dir1Intensity=M(n.intensity,void 0),a.dir1Altitude=i.dir1Altitude)):1===d&&(d++,i.dir2Color=M(n.color,void 0),i.dir2Altitude=M(n.altitude,void 0),i.dir2Azimuth=M(n.azimuth,void 0),i.dir2Intensity=M(n.intensity,void 0)))})),s[e]=i}return s[S]=a,{defaultLightMode:o.defaultLightingMode,lightingModes:s}}function U(e,t){return"number"!=typeof e||Number.isNaN(e)?t:e}function V(e){return e?(t=e[2],Array.isArray(t)&&"meters-to-pixels"===t[0]?a.vR.Meters:a.vR.Pixels):a.vR.Pixels;var t}},3754:(e,t,i)=>{i.d(t,{IJ:()=>l,IN:()=>c,Jb:()=>T,M3:()=>M,Mk:()=>S,N5:()=>v,R_:()=>A,TI:()=>b,T_:()=>z,Ug:()=>E,YW:()=>k,Ym:()=>p,_0:()=>m,bN:()=>h,l7:()=>f,n3:()=>C,p8:()=>P,pm:()=>d,q0:()=>u,sd:()=>g,sy:()=>I,tC:()=>x,th:()=>y,uj:()=>s,x6:()=>L,z4:()=>w,zn:()=>_});var n=i(6490),o=i(314),r=i(7464);const s="bottomCenter";function a(e,t){for(const i in t)void 0!==t[i]&&(e[i]=t[i])}function l(e){const t={color:"#000000",textureImage:"",textureSize:16,textureOpacity:1,strokeColor:"#00000000",strokeWidth:1,visibility:"visible"};if(a(t,e),void 0!==e.strokeColor||Boolean(t.textureImage)||(t.strokeColor=t.color),!Array.isArray(t.textureSize)||"step"===t.textureSize[0]||"literal"===t.textureSize[0])return t;if(t.textureSize.length){if(!(0,r.nS)(t.textureSize))return t;1===t.textureSize.length&&(t.textureSize=t.textureSize[0])}else t.textureSize=16;return t}function d(e){const t={color:"#000000",textureImage:"",textureSize:16,textureOpacity:1,strokeColor:"#00000000",strokeWidth:1,nearCameraFade:0,visibility:"visible"};if(a(t,e),void 0!==e.strokeColor||Boolean(t.textureImage)||(t.strokeColor=t.color),!Array.isArray(t.textureSize)||"step"===t.textureSize[0]||"literal"===t.textureSize[0])return t;if(t.textureSize.length){if(!(0,r.nS)(t.textureSize))return t;1===t.textureSize.length&&(t.textureSize=t.textureSize[0])}else t.textureSize=16;return t}function c(e){const t={iconImage:"",color:"#FFFFFF",rotation:0,width:1,visibility:"visible"};return a(t,e),void 0===e.height&&(t.height=t.width),t}function h(e){const t={topColor:"#000000",strokeColor:"#000000",strokeWidth:1,sideColor:"#000000",sideStrokeColor:"#000000",height:["mappoints-to-meters",["get","db_height"]],nearCameraFade:2500,visibility:"visible"};return a(t,e),void 0===e.strokeColor&&(t.strokeColor=t.topColor),void 0===e.sideColor&&(t.sideColor=t.topColor),void 0===e.sideStrokeColor&&(t.sideStrokeColor=t.sideColor),t}function u(e){const t={color:"#000000",width:1,shift:0,geometryModifier:["geometry-modifier"],pattern:["pattern","none"],startCap:"round",endCap:"round",visibility:"visible"};return a(t,e),t}function m(e){const t={color:"#000000",strokeColor:"#000000",strokeWidth:1,nearCameraFade:2500,visibility:"visible"};return a(t,e),void 0===e.strokeColor&&(t.strokeColor=t.color),t}function f(e){const t={sideColor:"#000000",strokeColor:"#000000",strokeWidth:1,sideStrokeColor:"#000000",height:0,visibility:"visible",nearCameraFade:2500};return a(t,e),void 0===e.strokeColor&&(t.strokeColor=t.sideColor),void 0===e.sideStrokeColor&&(t.sideStrokeColor=t.sideColor),t}function p(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:z};return a(t,e),t}function _(e){const t={color:"#000000",lineWidth:2,lineLength:10,tipWidth:1.5,tipHeight:2,priority:0,duplicationSpacing:0,endingOffsets:0,visibility:"visible",labelingGroup:z};return a(t,e),t}function v(e){const t={color:"#000000",gapColor:"#00000000",width:1,shift:0,gapLength:1,dashLength:1,geometryModifier:["geometry-modifier"],visibility:"visible"};return a(t,e),t}function g(e){const t={color:"#000000",width:1,shift:0,visibility:"visible"};return a(t,e),t}function y(e){const t={color:"#ffffff",strokeColor:"#3388ff",strokeColor2:"#00000000",width:20,strokeWidth:3,strokeWidth2:0,visibility:"visible"};return a(t,e),t}function b(e){const t={allowOverlap:!1,allowElevation:!1,elevation:NaN,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:z,iconLabelingMargin:{topBottom:0,leftRight:0},textField:[["get","db_label"],["get","db_label2"]],textFont:"",textColor:"#000000",textFontSize:16,textLineHeight:1.2,textLetterSpacing:0,textPlacement:s,textOffset:0,textHaloColor:"rgba(0, 0, 0, 0)",textHaloWidth:0,textLabelingMargin:{topBottom:0,leftRight:0},textPriority:0,textMaxLengthPerLine:30,visibility:"visible",textLabelingGroup:z,duplicationSpacing:100,endingOffsets:0};return a(t,e),t}function w(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),a(t,e),t}function x(e){const t={opacity:1,visibility:"visible"};return a(t,e),t}function S(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 I(e){return(0,n.kn)(e,{shadingIntensity:["interpolate",["linear"],["zoom"],12,0,14.5,.7],verticalScale:1,shadingPalette:["interpolate",["linear"],["shading-intensity"],0,0,1,1],lightingDirection:322})}function M(e){const t={modelSrc:"",offset:0,scale:1,rotation:0,color:"#fff",linkedIds:"",visibility:"visible",colorTextureUvIndex:0,nearCameraFade:2500,ignoreGlobalLighting:!1,showRatio:1,metallic:NaN,roughness:NaN,lightingModel:"phong"};return(0,n.kn)(e,t)}function T(e){const t={visibility:"visible",sideColor:"#000000",borderTopColor:"#000000",bottomColor:"#000000",strokeColor:"#000000",strokeWidth:1,debug:!1,thickness:1,borderHeight:0,borderWidth:.3,color:"#000000",nearCameraFade:0,tunnelHeight:5};return a(t,e),void 0===e.strokeColor&&(t.strokeColor=t.borderTopColor),void 0===e.sideColor&&(t.sideColor=t.borderTopColor),void 0===e.bottomColor&&(t.bottomColor=t.borderTopColor),t}function E(e){const t={visibility:"visible",sideColor:"#000000",topColor:"#000000",bottomColor:"#000000",strokeColor:"#000000",strokeWidth:1,color:"#ffffff",nearCameraFade:0};return a(t,e),t}function P(e){return(0,n.kn)(e,{skyColor:"#6EC0FF00",fogColor:"#FAFDFF00"})}function L(e){const t={sources:{sun:{type:"directional",altitude:50,azimuth:230,color:"#FFFFFF",intensity:.12},atmosphere:{type:"ambient",color:"#FFFFFF",intensity:.91}},lightingModes:{[o.OD.global]:["sun","atmosphere"]},defaultLightingMode:"global"},i=(0,n.kn)(null!=e?e:{},t);return i.lightingModes[o.OD.none]=[],i}const A="__overlapped",C="__commercial",z="default",k={groups:[z,A,C],overlay:[[z,A]],intersect:[[]]}},7464:(e,t,i)=>{i.d(t,{FD:()=>p,HW:()=>h,PR:()=>f,Uu:()=>l,Wx:()=>v,YI:()=>o,_e:()=>g,aH:()=>r,lK:()=>m,mH:()=>b,nS:()=>c,pV:()=>y,vB:()=>u,zV:()=>_});const n=new Set(["bottomCenter","bottomRight","bottomLeft","topCenter","topRight","topLeft","rightBottom","rightCenter","rightTop","leftBottom","leftCenter","leftTop","centerCenter"]);function o(e){return n.has(e)}function r(e){return"number"==typeof e||"boolean"==typeof e||"string"==typeof e||null===e}function s(e){if(Array.isArray(e)){const t=e;if(!t.length)return!1;if({zoom:!0,height:!0,coalesce:!0,"heatmap-density":!0,"shading-intensity":!0,objectAttr:!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,"+":!0,"*":!0,"^":!0,log10:!0,random:!0,literal:!0,isBehindObjects:!0,"mappoints-to-meters":!0,"meters-to-pixels":!0,uint64:!0,"geometry-modifier":!0,pattern:!0,precompute:!0}[t[0]])return!0}return!1}function a(e){return s(e)&&"literal"===e[0]}function l(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e&&void 0!==e.type&&"color"!==e.type}function d(e,t){return!!Array.isArray(e)&&(e.length>0&&e.every((e=>typeof e===t)))}function c(e){return d(e,"number")}function h(e){const t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||function(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e&&"color"===e.type}(e)||function(e){return d(e,"string")}(e)||c(e)}function u(e){return l(e)&&"get"===e.type}function m(e){return{type:"color",value:e}}function f(e,t,i){return`${e}_${t}_${i}`}function p(e){return`texture-${e}`}function _(e,t){return`unique-${e}_${t}`}function v(e){return a(e)&&Array.isArray(e[1])?e[1][0]:Array.isArray(e)?s(e)?e:e[0]:e}function g(e){return a(e)&&Array.isArray(e[1])?e[1][1]:Array.isArray(e)&&!s(e)&&void 0!==e[1]?e[1]:void 0}function y(e){if("number"==typeof e)return e;if(c(e))return e;if("literalArray"===e.type&&c(e.array))return e.array;throw new Error("Unsupported simple literal expression. Can't resolve.")}function b(e,t=0){const i=Number(e);return isNaN(i)?t:i}},1284:(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}}},132:(e,t,i)=>{i.d(t,{Uv:()=>o,d6:()=>s,he:()=>r});let n=0;function o(){return n++}const r=o(),s=o()},3194:(e,t,i)=>{i.d(t,{EG:()=>D,m2:()=>O,jJ:()=>C,Yi:()=>k,bs:()=>z,zn:()=>M,FR:()=>w,qv:()=>T,Oh:()=>B,vn:()=>E,Q9:()=>P,uA:()=>L,UP:()=>I,o4:()=>A});var n=i(9450),o=i(3287),r=i(351),s=i(1245);function a(){let e=new o.WT(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function l(e,t,i,n){let o,r,s,a,l,d=t[0],c=t[1],h=t[2],u=t[3],m=i[0],f=i[1],p=i[2],_=i[3];return d*m+c*f+h*p+u*_,r<0&&(-r,-m,-f,-p,-_),1-r>1e-6?(Math.acos(r),Math.sin(o),Math.sin((1-n)*o)/s,Math.sin(n*o)/s):(1-n,n),e[0]=a*d+l*m,e[1]=a*c+l*f,e[2]=a*h+l*p,e[3]=a*u+l*_,e}s.d9,s.al,s.JG,s.t8,s.IH,s.bA,s.AK,s.t7,s.kE,s.we;const d=s.Fv;s.I6,s.fS,function(){let e=n.Ue(),t=n.al(1,0,0),i=n.al(0,1,0)}(),function(){let e=a(),t=a()}(),function(){let e=r.Ue()}();var c=i(412),h=i(7464),u=i(309),m=i(9073),f=i(3672),p=i(6392),_=i(173),v=i(3754),g=i(6490),y=i(6273);const b=null;function w(e,t){var i;if(!(0,h.Uu)(e))return e;if(t.allowedExpressions&&!t.allowedExpressions.has(e.type))return(0,u.cM)(`Expression of type ${e.type} is not allowed here`),b;switch(e.type){case"objectAttr":return function(e,t){if("binder"===t.type&&t.dynamicObject)return t.dynamicObject[e.property]||null;return null}(e,t);case"coalesce":return function(e,t){for(const i of e.array){const e=w(i,t);if(null!==e)return e}return null}(e,t);case"all":return function(e,t){return e.array.every((e=>!0===w(e,t)))}(e,t);case"any":return function(e,t){return e.array.some((e=>!0===w(e,t)))}(e,t);case"featureState":return function(e,t){var i;if("generator"===t.type){const n=null!==(i=t.featureAttrs[t.tileProps[e.property]])&&void 0!==i?i:null;return Number.isNaN(n)?null:x(n)}throw new Error("Feature state expression can be resolved only in generator context")}(e,t);case"get":return S(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;if("generator"===t.type)return null!==(i=x(t.sourceAttrs[e.property]))&&void 0!==i?i:null;return null}(e,t);case"in":return function(e,t){const i=w(e.element,t),n=w(e.array,t);if(null===n)return!1;if(!Array.isArray(n))return(0,u.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,u.cM)("Interpolate expression contains 0 steps, cannot interpolate"),b;const i=w(e.steps[0].value,t),n=w(e.argument,t);if("number"!=typeof n)return(0,u.cM)(`Interpolate value resolved to non-number value: ${n} ${e.argument}`),0;if((0,c.gC)(i)){if((0,h.Uu)(e.argument)&&"height"===e.argument.type){const i={type:"gradient-color",values:[],steps:[]};return e.steps.forEach((e=>{const n=E(e.key,t),o=w(e.value,t);(0,c.gC)(o)&&!Number.isNaN(n)&&(i.values.push({type:"color",value:o.value}),i.steps.push(n))})),2!==i.steps.length?((0,u.cM)("Gradient expression must resolve 2 steps"),b):i}return A(e,n,t)}return I(e,n,t)}(e,t);case"match":return function(e,t){var i;const n=w(e.input,t),o=e.cases.find((e=>e.values.has(n)));return w(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(w(e.value,t)),n=R(e,i,t)-1;return w(e.steps[n].value,t)}(e,t);case"to-boolean":return function(e,t){return Boolean(w(e.value,t))}(e,t);case"to-color":return function(e,t){const i=w(e.value,t);if((0,c.iL)(i))return(0,c.MV)(i);if((0,c.gC)(i))return i;return console.warn(`Can't resolve expression. Must be color, but got ${i}`),(0,h.lK)([0,0,0,0])}(e,t);case"mappoints-to-meters":return function(e,t){if("generator"!==t.type||!t.tileInfo)throw new Error("Выражение `mappoints-to-meters` можно резолвить только в контексте генератора");return w(e.value,t)/(m.C*(0,p.iq)(t.tileInfo,[0,0]))}(e,t);case"meters-to-pixels":return function(e,t){let i,n=E(e.value,t)*y.y4/m.A5;if("generator"===t.type){if(!t.tileInfo)return null;i=t.tileInfo.coords[3],n*=(0,p.iq)(t.tileInfo,[0,0])}else i=t.styleZoom;return n*Math.pow(2,i+1)}(e,t);case"!":return function(e,t){return!w(e.value,t)}(e,t);case"==":case"!=":return function(e,t){const i=w(e.leftValue,t),n=w(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=w(e.leftValue,t);if(null===i)return null;const n=w(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,u.cM)(`Zoom expression cannot be used in ${t.type} context`),b);case"height":return 1;case"+":return function(e,t){const i=e.array.map((e=>w(e,t)));if(!(0,h.nS)(i))return(0,u.cM)(`Resolve AdditionExpression: arguments are not resolved as an array of numbers: ${i}`),null;return i.reduce(((e,t)=>e+t),0)}(e,t);case"*":return function(e,t){const i=e.array.map((e=>w(e,t)));if(!(0,h.nS)(i))return(0,u.cM)(`Resolve MultiplicationExpression: arguments are not resolved as an array of numbers: ${i}`),null;return i.reduce(((e,t)=>e*t),1)}(e,t);case"^":return function(e,t){const i=w(e.base,t);if("number"!=typeof i)return(0,u.cM)(`Resolve PowExpression: base resolved as non-number value: ${i}`),null;const n=w(e.exponent,t);if("number"!=typeof n)return(0,u.cM)(`Resolve PowExpression: exponent resolved as non-number value: ${n}`),null;return Math.pow(i,n)}(e,t);case"log10":return function(e,t){const i=w(e.value,t);if("number"!=typeof i)return(0,u.cM)(`Resolve Log10Expression: value resolved as non-number value: ${i}`),null;return Math.log10(i)}(e,t);case"random":return function(e,t){const i=w(e.start,t);if("number"!=typeof i)return(0,u.cM)(`Resolve RandomizationExpression: start resolved as non-number value: ${i}`),null;const n=w(e.end,t);if("number"!=typeof n)return(0,u.cM)(`Resolve RandomizationExpression: end resolved as non-number value: ${n}`),null;if(n<i)return(0,u.cM)("Resolve RandomizationExpression: end cannot be less than start."),null;return(0,_.ff)(t,i,n)}(e,t);case"literalArray":return function(e,t){return e.array.map((e=>w(e,t)))}(e,t);case"isBehindObjects":return"binder"===t.type?t.isBehind:((0,u.cM)(`isBehindObjects expression cannot be used in ${t.type} context`),b);case"geometry-modifier":return e.modifiers;case"line-pattern":return[e.patternType,...e.parameters.map((e=>w(e,t)))];case"precompute":return null!==(i=t.tileData[e.precomputeIndex])&&void 0!==i?i:null;default:return(0,u.cM)(`Not supported expression type <<${e.type}>> in ${JSON.stringify(e)}`),b}}function x(e){return(0,f.nI)(e)?(0,f.Ak)(e):e}function S(e,t){var i;if("generator"===t.type){const n=null!==(i=t.tileAttrs[t.tileProps[e.property]])&&void 0!==i?i:null;return Number.isNaN(n)?null:x(n)}throw new Error("Get expression can be resolved only in generator context")}function I(e,t,i){const n=R(e,t,i);if(0===n)return Number(w(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 E(n.value,t);return E(n.value,t)*Math.pow(o,i-E(n.key,t))}(e,i,t);const o=Number(w(e.steps[n-1].value,i));if("labeling"===i.type&&i.interpolateExpressionAsStep)return o;const r=F(e,t,n,i);return(1-r)*o+r*Number(w(e.steps[n].value,i))}function M(e,t){const i=w(e,t);return(0,c.gC)(i)?i:(0,c.RY)(i)?i.values[1]:(console.warn(`Can't resolve expression. Must be color, but got ${i}`),(0,h.lK)([0,0,0,0]))}function T(e,t){const i=w(e,t);return(0,c.RY)(i)?i:null}function E(e,t,i=NaN){const n=w(e,t);return"number"==typeof n?n:i}function P(e,t,i=""){const n=w(e,t);return"string"==typeof n?n:i}function L(e,t,i=v.uj){const n=w(e,t);return(0,h.YI)(n)?n:i}function A(e,t,i){const n=R(e,t,i);if(0===n)return M(e.steps[0].value,i);if(n===e.steps.length)return M(e.steps[e.steps.length-1].value,i);const o=F(e,t,n,i),r=M(e.steps[n-1].value,i).value,s=M(e.steps[n].value,i).value;return(0,h.lK)([r[0]*(1-o)+s[0]*o,r[1]*(1-o)+s[1]*o,r[2]*(1-o)+s[2]*o,r[3]*(1-o)+s[3]*o])}function C(e,t,i,n=!1,o){return{type:"binder",styleZoom:e,styleState:t,tileData:i,randomSeed:0,isBehind:n,dynamicObject:o}}function z(e,t,i,n){return{type:"labeling",styleZoom:e,styleState:t,interpolateExpressionAsStep:i,randomSeed:0,tileData:n}}function k(e,t,i,n,o,r){return{type:"generator",styleState:e,tileProps:i,tileAttrs:n,tileData:[],featureAttrs:o,sourceAttrs:t,randomSeed:0,tileInfo:r}}function R(e,t,i){let n=0;for(;n<e.steps.length&&!(t<E(e.steps[n].key,i));)n++;return n}function F(e,t,i,n){const o=e.base,r=E(e.steps[i].key,n)-E(e.steps[i-1].key,n),s=t-E(e.steps[i-1].key,n);return 1===o?s/r:(Math.pow(o,s)-1)/(Math.pow(o,r)-1)}function O(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 D(e,t,i,n=!1){const o=[];return U(o,e,t,i),n?o:Array.from(new Set(o))}function B(e,t){const i={};return Object.keys(e).forEach((n=>{i[n]=function(e,t){var i,n;const o={ambientColorIntensity:M(e.ambientColor,t).value.map((e=>e/255)),dir1ColorIntensity:M(e.dir1Color,t).value.map((e=>e/255)),dir1Direction:N(w(e.dir1Altitude,t),w(e.dir1Azimuth,t)),dir2ColorIntensity:M(e.dir2Color,t).value.map((e=>e/255)),dir2Direction:N(w(e.dir2Altitude,t),w(e.dir2Azimuth,t)),shadowLightIndex:null!==(i=e.shadowLightIndex)&&void 0!==i?i:-1,shadowRadius:null!==(n=e.shadowRadius)&&void 0!==n?n:1};return o.ambientColorIntensity[3]=w(e.ambientIntensity,t),o.dir1ColorIntensity[3]=w(e.dir1Intensity,t),o.dir2ColorIntensity[3]=w(e.dir2Intensity,t),o}(e[n],t)})),i}const j=a();function N(e,t){const i=new Float32Array(3);var o;return n.t8(i,1,0,0),(o=j)[0]=0,o[1]=0,o[2]=0,o[3]=1,function(e,t,i){i*=.5;let n=t[0],o=t[1],r=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);e[0]=n*l+o*a,e[1]=o*l-n*a,e[2]=r*l+s*a,e[3]=s*l-r*a}(j,j,-(0,g.Id)(t-90)),function(e,t,i){i*=.5;let n=t[0],o=t[1],r=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);e[0]=n*l-r*a,e[1]=o*l+s*a,e[2]=r*l+n*a,e[3]=s*l-o*a}(j,j,-(0,g.Id)(e)),n.VC(i,i,j),n.Fv(i,i),i}function U(e,t,i,n){if((0,h.Uu)(t))switch(t.type){case"all":return function(e,t,i,n){t.array.forEach((t=>U(e,t,i,n)))}(e,t,i,n);case"match":return function(e,t,i,n){U(e,t.defaultOutput),t.cases.forEach((t=>U(e,t.output,i,n)))}(e,t,i,n);case"step":case"interpolate":return function(e,t,i,n){t.steps.forEach((t=>U(e,t.value,i,n)))}(e,t,i,n);case"precompute":if(n){return void U(e,n.precomputes[t.precomputeIndex].expr,i,n)}break;case"get":{if(!i)return void console.error("There is no context to resolve the expression. The value from data will not be added to the result.");const n=S(t,i);return void e.push(n)}}else e.push(t)}},314:(e,t,i)=>{var n;i.d(t,{OD:()=>r,Zx:()=>n,vR:()=>s,ze:()=>o}),function(e){e[e.Uniform=1]="Uniform",e[e.Labeling=2]="Labeling",e[e.Generator=3]="Generator"}(n||(n={}));const o=-1;var r,s;!function(e){e.global="global",e.none="none"}(r||(r={})),function(e){e[e.Pixels=0]="Pixels",e[e.Meters=1]="Meters"}(s||(s={}))},8450:(e,t,i)=>{function n(e){return!!e&&"polygon"===e.type}function o(e){return!!e&&"line"===e.type}function r(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,{Kx:()=>s,PU:()=>r,nc:()=>n,ot:()=>o})},3741:(e,t,i)=>{i.r(t),i.d(t,{geoLineDistance:()=>o.XV,geoToMapDistance:()=>o.a4,getCenterZoomByPoints:()=>l,getMetersFromPixels:()=>u,getMousePositionInContainer:()=>d.yK,projectGeoToMap:()=>o.yq,projectGeoToScreen:()=>c,projectMapToGeo:()=>o.PA,projectMapToScreen:()=>m,projectScreenToGeo:()=>h});var n=i(6490),o=i(9073),r=i(4874),s=i(9218),a=i(7636);function l(e,t,i){const n=(0,a.g)(e,t,i);if(n)return{zoom:n.zoom,center:(0,o.PA)(n.center)}}var d=i(1274);function c(e,t,i,a,l,d,c={top:0,right:0,bottom:0,left:0},h={top:0,right:0,bottom:0,left:0}){return new r.V({center:(0,o.yq)(e),zoom:t,rotation:(0,n.Id)(i),size:a,pitch:(0,n.Id)(l),viewport:c,padding:h,cameraConfig:s.defaultCameraConfig}).project((0,o.yq)(d))}function h(e,t,i,a,l,d,c={top:0,right:0,bottom:0,left:0},h={top:0,right:0,bottom:0,left:0}){const u=new r.V({center:(0,o.yq)(e),zoom:t,rotation:(0,n.Id)(i),size:a,pitch:(0,n.Id)(l),viewport:c,padding:h,cameraConfig:s.defaultCameraConfig});return(0,o.PA)(u.unproject(d))}function u(e,t,i,n,r,s,a={top:0,right:0,bottom:0,left:0},l={top:0,right:0,bottom:0,left:0},d){return(0,o.$X)(e,t,i,n,r,s,a,l,d,d)}function m(e,t){return new r.V(e).project(t)}},4874:(e,t,i)=>{i.d(t,{V:()=>f});var n=i(9450),o=i(1245),r=i(127),s=i(6490),a=i(9073),l=i(9218);const d=[0,0,1],c=n.Ue(),h=n.Ue(),u=o.Ue(),m=o.Ue();class f{constructor(e){this.state=e,this.position=[0,0,0],this.projectionMatrix=[],this.viewMatrix=[],this.viewMatrixTranspose=[],this.projectionMatrixInverse=[],this.viewProjectionMatrix=[],this.viewProjectionMatrixInverse=[],this.fogDistance=0,this.correctedPitch=0,this.horizonPixelOffset=0,this.horizonPixelOffset=0,this.update()}setState(e){this.state=e,this.update()}update(){this.updatePosition(),this.updateProjectionMatrix(),this.updateViewMatrix(),r.Jp(this.viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),r.U_(this.viewProjectionMatrixInverse,this.viewProjectionMatrix),r.U_(this.projectionMatrixInverse,this.projectionMatrix),r.p4(this.viewMatrixTranspose,this.viewMatrix),this.updateHorizonPixelOffset(),this.updateFogDistance()}putProject(e,t,i=!1){const{size:n,viewport:r}=this.state;m[0]=t[0],m[1]=t[1],m[2]=t[2],m[3]=1,o.fF(u,m,this.viewProjectionMatrix);const[s,a,l,d]=u,c=2*d;if(i&&(l>c||l<-c||s>c||s<-c||a>c||a<-c))return e[0]=NaN,void(e[1]=NaN);const h=n[0]/2,f=n[1]/2;e[0]=h+r.left+s*h/d,e[1]=f+r.top-a*f/d}project(e,t=!1){const i=[0,0,0];return this.putProject(i,e,t),i}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 r=-this.position[2]/o[2];return o[0]=this.position[0]+o[0]*r,o[1]=this.position[1]+o[1]*r,o[2]=this.position[2]+o[2]*r,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,lowZoomMaxPitch:r,maxPitch:s}=this.state,l=(0,a.r9)(i,o);this.correctedPitch=this.calculateCorrectedPitch(n,i,r,s);const d=Math.max(l*Math.sin(this.correctedPitch),1);this.position[0]=e[0]+Math.sin(t)*d,this.position[1]=e[1]-Math.cos(t)*d,this.position[2]=l*Math.cos(this.correctedPitch)}calculateCorrectedPitch(e,t,i,n){if(!i||void 0===n)return e;let o=n;const r=this.state.cameraConfig;return n>i&&(o=t>r.pitchInterStartZoom?n-(r.pitchInterEndZoom-t)*(n-i)/(r.pitchInterEndZoom-r.pitchInterStartZoom):i),Math.min(e,o)}updateFogDistance(){const{center:e}=this.state,t=this.state.cameraConfig,i=n.TK(this.position,e);this.fogDistance=Math.max(t.minFogDistance,i)}updateViewMatrix(){r.zB(this.viewMatrix,this.position,this.state.center,d)}updateProjectionMatrix(){const e=this.state.cameraConfig,t=e.fov;e.useDynamicNearFar&&this.updateNearFarState();const{near:i,far:n}=e,{size:o,view:r}=this.correctViewAndSize(),s=o[0]/o[1];let a=i*Math.tan(t/2),l=2*a,d=s*l,c=-d/2;c+=r.x*d/o[0],a-=r.y*l/o[1],d*=r.width/o[0],l*=r.height/o[1];const h=c+d,u=a-l,m=this.projectionMatrix;m[0]=2*i/(h-c),m[5]=2*i/(a-u),m[8]=(h+c)/(h-c),m[9]=(a+u)/(a-u),m[10]=-(n+i)/(n-i),m[11]=-1,m[14]=-2*n*i/(n-i),m[1]=m[2]=m[3]=m[4]=m[6]=m[7]=m[12]=m[13]=m[15]=0}updateNearFarState(){const{zoom:e,cameraConfig:t}=this.state;if(e>l.maxZoomForDynamicNear)t.near=l.defaultCameraConfig.near;else{const i=.5*this.position[2],n=Math.min(16-e,1);t.near=i*n+l.defaultCameraConfig.near*(1-n)}const i=Math.pow(1-Math.min(e,20.5)/21,2);t.far=l.defaultCameraConfig.far*i}correctViewAndSize(){const{size:e,padding:t}=this.state,i=Math.max(0,t.top-t.bottom)*Math.tan(this.correctedPitch),n=(0,a.pc)(e[1])+i,o={x:(t.right-t.left)/2,y:(t.bottom-t.top)/2,width:e[0],height:e[1]};o.y+=(n-e[1])/2;return{view:o,size:[e[0],n]}}updateHorizonPixelOffset(){const{viewport:e,size:t,zoom:i}=this.state,o=this.unproject([e.left,t[1]+e.top,0]),r=this.unproject([e.left+t[0]/2,t[1]+e.top,0]),l=this.unproject([t[0]+e.left,t[1]+e.top,0]);n.lu(h,l,o),n.jI(h,h,c,(0,s.Id)(90)),n.Fv(h,h);const d=(0,a.h0)(t[1]*this.state.cameraConfig.perspectiveDistanceLimitRatio,i);n.bA(h,h,d),n.IH(h,r,h),this.putProject(h,h),this.horizonPixelOffset=Math.max(0,Math.ceil(h[1]))}}},7231:(e,t,i)=>{i.d(t,{n:()=>r});var n=i(7731),o=i(6392);class r{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){const r=this.options.modelsPath;return this.worker.generateTile(e,t,i,n,o,r)}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),this.modules.tileManager.updateParentChildrenData((0,o.gx)(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)}))}}},4619:(e,t,i)=>{i.d(t,{Sj:()=>s,X4:()=>d,Y0:()=>r,fZ:()=>l});var n=i(7188);const o={point:{point:!0,heatmap:!0,gltfModel:!0,metricPoint:!0},polygon:{polygon:!0,polygonExtrusion:!0,mesh:!0,embankment:!0,overpass:!0},line:{line:!0,lineExtrusion:!0,labelLine:!0,dashedLine:!0,oneWayLine:!0,metricPoint:!0,overpass:!0}};function r(e,t){return!!o[e][t]}function s(e){const t=e.vertices.x,i=e.vertices.y;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 d(){return(0,n.KP)(["id","db_label","db_label2","selected","hovered","componentDistanceStart","componentDistanceEnd","objectLength","beginningIsCut","endingIsCut","tech_db_geometry_type"],["Commercial_poi_default","Commercial_poi_city","Commercial_poi_premium"])}},5071:(e,t,i)=>{i.d(t,{Xm:()=>f,f7:()=>d,gs:()=>m,rR:()=>c});var n=i(7731),o=i(7619),r=i(7231),s=i(9218),a=i(9600),l=i(6273);const d=15,c=17;class h{constructor(e,t,i){var n,h,u;this.type="geojson",this.id=(0,a.Q)(),this.modelsAppearStrategy=null!==(n=t.modelsAppearStrategy)&&void 0!==n?n:l.jm,this.modules=e.modules,this.mapglApiSource=i,this.identifiedAsDefault=!!t.identifyAsDefaultSource,this.sourceCore=new r.n(this.id,this.modules,t);const m=null!==(h=t.minZoom)&&void 0!==h?h:s.MAP_DEFAULTS.minZoom,f=Math.min(null!==(u=t.maxZoom)&&void 0!==u?u:d,c);this.layer=new o.I(m,f,m,c,this.modules,e.state,this.sourceCore,t),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()}getZoomDirection(){return this.layer.getZoomDirection()}getId(){return this.sourceCore.id}isIdentifiedAsDefault(){return this.identifiedAsDefault}}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())}))}}},2176:(e,t,i)=>{i.d(t,{T:()=>me});var n=i(3672),o=i(5597),r=i(6392),s=i(7188),a=i(9981),l=i(7204),d=i(4619),c=i(5071);function h(e,t,i,n,o=2){const r=o+1;let s=n;const a=i-t>>1;let l,d=i-t;const c=e[t],m=e[t+1],f=e[i],p=e[i+1];for(let n=t+r;n<i;n+=r){const t=u(e[n],e[n+1],c,m,f,p);if(t>s)l=n,s=t;else if(t===s){const e=Math.abs(n-a);e<d&&(l=n,d=e)}}s>n&&(l-t>r&&h(e,t,l,n,o),e[l+2]=s,i-l>r&&h(e,l,i,n,o))}function u(e,t,i,n,o,r){let s=o-i,a=r-n;if(0!==s||0!==a){const l=((e-i)*s+(t-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return s=e-i,a=t-n,s*s+a*a}function m(e,t,i,n,o,r=3){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,r);else if("Polygon"===t)f(s,i[0],r);else if("MultiLineString"===t)for(const e of i)f(s,e,r);else if("MultiPolygon"===t)for(const e of i)f(s,e[0],r);return s}function f(e,t,i=3){for(let n=0;n<t.length;n+=i)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function p(e,t,i,n){if(!t.geometry)return;const o=t.geometry.coordinates,r=t.geometry.type,s=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"===r)_(o,a,i.dimensions);else if("MultiPoint"===r)for(const e of o)_(e,a,i.dimensions);else if("LineString"===r)v(o,a,s,!1,i.dimensions);else if("MultiLineString"===r){if(i.lineMetrics){for(const r of o)a=[],v(r,a,s,!1,i.dimensions),e.push(m(l,"LineString",a,t.properties,n,i.dimensions+1));return}g(o,a,s,!1,i.dimensions)}else if("Polygon"===r)g(o,a,s,!0,i.dimensions);else{if("MultiPolygon"!==r){if("GeometryCollection"===r){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,s,!0,i.dimensions),a.push(t)}}e.push(m(l,r,a,t.properties,n,i.dimensions+1))}function _(e,t,i=2){t.push(y(e[0]),b(e[1]),0);for(let n=2;n<i;n++)t.push(e[n])}function v(e,t,i,n,o=2){let r,s,a=0;for(let i=0;i<e.length;i++){const l=y(e[i][0]),d=b(e[i][1]);t.push(l,d,0);for(let n=2;n<o;n++)t.push(e[i][n]);i>0&&(a+=n?(r*d-l*s)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(d-s,2))),r=l,s=d}const l=t.length-(o+1);t[2]=1,h(t,0,l,i,o),t[l+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function g(e,t,i,n,o=2){for(let r=0;r<e.length;r++){const s=[];v(e[r],s,i,n,o),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,r,s,a){const l=(void 0===a.dimensions?2:a.dimensions)+1;if(n/=t,r>=(i/=t)&&s<n)return e;if(s<i||r>=n)return null;const d=[];for(const t of e){const e=t.geometry;let r=t.type;const s=0===o?t.minX:t.minY,c=0===o?t.maxX:t.maxY;if(s>=i&&c<n){d.push(t);continue}if(c<i||s>=n)continue;let h=[];if("Point"===r||"MultiPoint"===r)x(e,h,i,n,o,l);else if("LineString"===r)S(e,h,i,n,o,!1,a.lineMetrics,l);else if("MultiLineString"===r)M(e,h,i,n,o,!1,l);else if("Polygon"===r)M(e,h,i,n,o,!0,l);else if("MultiPolygon"===r)for(const t of e){const e=[];M(t,e,i,n,o,!0,l),e.length&&h.push(e)}if(h.length){if(a.lineMetrics&&"LineString"===r){for(const e of h)d.push(m(t.id,r,e,t.tags,t.index,l));continue}"LineString"!==r&&"MultiLineString"!==r||(1===h.length?(r="LineString",h=h[0]):r="MultiLineString"),"Point"!==r&&"MultiPoint"!==r||(r=h.length===l?"Point":"MultiPoint"),d.push(m(t.id,r,h,t.tags,t.index,l))}}return d.length?d:null}function x(e,t,i,n,o,r=3){for(let s=0;s<e.length;s+=r){const a=e[s+o];if(a>=i&&a<=n){T(t,e[s],e[s+1],e[s+2]);for(let i=3;i<r;i++)t.push(e[s+i])}}}function S(e,t,i,n,o,r,s,a=3){let l=I(e);const d=0===o?E:P;let c,h,u=e.start;for(let m=0;m<e.length-a;m+=a){const f=e[m],p=e[m+1],_=e[m+2],v=e[m+a],g=e[m+a+1],y=0===o?f:p,b=0===o?v:g;let w=!1;if(s&&(c=Math.sqrt(Math.pow(f-v,2)+Math.pow(p-g,2))),y<i){if(b>i){h=d(l,f,p,v,g,i);for(let t=3;t<a;t++){const i=e[m+t];l.push((e[m+a+t]-i)*h+i)}s&&(l.start=u+c*h)}}else if(y>n){if(b<n){h=d(l,f,p,v,g,n);for(let t=3;t<a;t++){const i=e[m+t];l.push((e[m+a+t]-i)*h+i)}s&&(l.start=u+c*h)}}else{T(l,f,p,_);for(let t=3;t<a;t++)l.push(e[m+t])}if(b<i&&y>=i){h=d(l,f,p,v,g,i);for(let t=3;t<a;t++){const i=e[m+t];l.push((e[m+a+t]-i)*h+i)}w=!0}if(b>n&&y<=n){h=d(l,f,p,v,g,n);for(let t=3;t<a;t++){const i=e[m+t];l.push((e[m+a+t]-i)*h+i)}w=!0}!r&&w&&(s&&(l.end=u+c*h),t.push(l),l=I(e)),s&&(u+=c)}let m=e.length-a;const f=e[m],p=e[m+1],_=e[m+2],v=0===o?f:p;if(v>=i&&v<=n){T(l,f,p,_);for(let t=3;t<a;t++)l.push(e[m+t])}if(m=l.length-a,r&&m>=3&&(l[m]!==l[0]||l[m+1]!==l[1])){T(l,l[0],l[1],l[2]);for(let e=3;e<a;e++)l.push(l[e])}l.length&&t.push(l)}function I(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function M(e,t,i,n,o,r,s){for(const a of e)S(a,t,i,n,o,r,!1,s)}function T(e,t,i,n){e.push(t,i,n)}function E(e,t,i,n,o,r){const s=(r-t)/(n-t);return T(e,r,i+(o-i)*s,1),s}function P(e,t,i,n,o,r){const s=(r-i)/(o-i);return T(e,t+(n-t)*s,r,1),s}function L(e,t,i=3){const n=[];for(let o=0;o<e.length;o++){const r=e[o],s=r.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=A(r.geometry,t,i);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const e of r.geometry)a.push(A(e,t,i))}else if("MultiPolygon"===s){a=[];for(const e of r.geometry){const n=[];for(const o of e)n.push(A(o,t,i));a.push(n)}}n.push(m(r.id,s,a,r.tags,r.index,i))}return n}function A(e,t,i=3){const n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(let o=0;o<e.length;o+=i){n.push(e[o]+t,e[o+1],e[o+2]);for(let t=3;t<i;t++)n.push(e[o+t])}return n}function C(e,t,i=2){if(e.transformed)return e;const n=1<<e.z,o=e.x,r=e.y;for(const s of e.features){const e=s.geometry,a=s.type;if(s.geometry=[],1===a)for(let a=0;a<e.length;a+=i)s.geometry.push(k(e,a,i,t,n,o,r));else if(2===a)s.geometry=z(e,t,n,o,r,i);else for(let a=0;a<e.length;a++)s.geometry.push(z(e[a],t,n,o,r,i))}return e.transformed=!0,e}function z(e,t,i,n,o,r=2){const s=[];for(let a=0;a<e.length;a++){const l=[];for(let s=0;s<e[a].length;s+=r)l.push(k(e[a],s,r,t,i,n,o));s.push(l)}return s}function k(e,t,i,n,o,r,s){const a=[Math.round(n*(e[t]*o-r)),Math.round(n*(e[t+1]*o-s))];for(let n=2;n<i;n++)a.push(e[t+n]);return a}function R(e,t,i,n,o){const r=t===o.maxZoom?0:o.tolerance/((1<<t)*o.extent),s={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)F(s,t,r,o);return s}function F(e,t,i,n){const o=t.geometry,r=t.type,s=n.dimensions+1;let a=[];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"===r||"MultiPoint"===r)for(let t=0;t<o.length;t+=s){a.push(o[t],o[t+1]);for(let e=3;e<s;e++)a.push(o[t+e]);e.numPoints++,e.numSimplified++}else if("LineString"===r)O(a,o,e,i,!1,!1,s);else if("MultiLineString"===r||"Polygon"===r){for(let t=0;t<o.length;t++)O(a,o[t],e,i,"Polygon"===r,0===t,s);"Polygon"===r&&a.length&&(a=[a])}else if("MultiPolygon"===r)for(let t=0;t<o.length;t++){const n=o[t],r=[];for(let t=0;t<n.length;t++)O(r,n[t],e,i,!0,0===t,s);r.length&&a.push(r)}if(a.length){let i=t.tags||null;if("LineString"===r&&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 s={geometry:a,type:"Polygon"===r||"MultiPolygon"===r?3:"LineString"===r||"MultiLineString"===r?2:1,tags:i};null!==t.id&&(s.id=t.id),n.generateIndex&&(s.index=t.index),e.features.push(s)}}function O(e,t,i,n,o,r,s=3){const a=n*n;if(n>0&&t.size<(o?a:n))return void(i.numPoints+=t.length/s);const l=[];for(let e=0;e<t.length;e+=s){if(0===n||t[e+2]>a){i.numSimplified++,l.push(t[e],t[e+1]);for(let i=3;i<s;i++)l.push(t[e+i])}i.numPoints++}o&&function(e,t,i=2){let n=0;for(let t=0,o=e.length,r=o-i;t<o;r=t,t+=i)n+=(e[t]-e[r])*(e[t+1]+e[r+1]);if(n>0===t)for(let t=0,n=e.length;t<n/2;t+=i)for(let o=0;o<i;o++){const r=e[t+o],s=n-t-(i-o);e[t+o]=e[s],e[s]=r}}(l,r,s-1),e.push(l)}const D=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,dimensions:2};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,n=t.dimensions+1;let o=e;const r=w(e,1,-1-i,i,0,-1,2,t),s=w(e,1,1-i,2+i,0,-1,2,t);return(r||s)&&(o=w(e,1,-i,1+i,0,-1,2,t)||[],r&&(o=L(r,1,n).concat(o)),s&&(o=o.concat(L(s,-1,n)))),o}(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,r,s){const a=[e,t,i,n],l=this.options,d=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),t=a.pop(),e=a.pop();const c=1<<t,h=V(t,i,n);let u=this.tiles[h];if(!u&&(d>1&&console.time("creation"),u=this.tiles[h]=R(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n}),d)){d>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!==r>>e||n!==s>>e)continue}}if(u.source=null,0===e.length)continue;d>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,c,i-m,i+p,0,u.minX,u.maxX,l),S=w(e,c,i+f,i+_,0,u.minX,u.maxX,l);e=null,x&&(v=w(x,c,n-m,n+p,1,u.minY,u.maxY,l),g=w(x,c,n+f,n+_,1,u.minY,u.maxY,l),x=null),S&&(y=w(S,c,n-m,n+p,1,u.minY,u.maxY,l),b=w(S,c,n+f,n+_,1,u.minY,u.maxY,l),S=null),d>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:r}=n;if(e<0||e>24)return null;const s=1<<e,a=V(e,t=t+s&s-1,i);if(this.tiles[a])return C(this.tiles[a],o,n.dimensions);r>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let l,d=e,c=t,h=i;for(;!l&&d>0;)d--,c>>=1,h>>=1,l=this.tiles[V(d,c,h)];return l&&l.source?(r>1&&(console.log("found parent tile z%d-%d-%d",d,c,h),console.time("drilling down")),this.splitTile(l.source,d,c,h,e,t,i),r>1&&console.timeEnd("drilling down"),this.tiles[a]?C(this.tiles[a],o,n.dimensions):null):null}}function V(e,t,i){return 32*((1<<e)*i+t)+e}var G=i(9450),H=i(7084),Z=i(6273),W=i(6490),X=i(9073);function K(e,t,i){const n=[];return e.geometry.forEach((o=>{const r=[],s=[],a=[];o.forEach((e=>{a.push(...function(e,t){const i=[];let n=[];for(let o=0;o<e.length;o++){const r=e[o];if(n.push(J(r,t)),!Q(r,t))continue;const s=e[o+1];if(!s)break;ee(r,s,t)&&(n.length>1&&i.push(n),n=[])}n.length>1&&i.push(n);return i}(e,t)),r.length&&s.push(r.length),r.push(...e)}));const l=[];for(let e=0;e<r.length;e++)for(let t=0;t<i;t++)l.push(r[e][t]);const c=H(l,s,i),h=G.Ue();for(let o=0;o<c.length;o+=3){const s=i>2?[[],[],[],[]]:[[],[],[]];for(let e=0;e<3;e++)Y(h,r[c[o+2-e]],t),s[0][e]=h[0],s[1][e]=h[1],s[2][e]=0,i>2&&(s[3][e]=h[2]);a.forEach((e=>{const t=[[],[],[]];e.forEach(((e,i)=>{t[0][i]=e[0],t[1][i]=e[1]})),(0,d.fZ)(s,t)})),n.push({tags:e.tags,id:e.id,index:e.index,type:"polygon",vertices:{x:s[0],y:s[1],cut:s[2],signed_z:s[3]}})}})),n}function q(e,t,i){const n=G.Ue();return e.geometry.map((o=>{const r=i>2?[[],[],[]]:[[],[]];return o.forEach(((e,o)=>{Y(n,e,t),r[0][o]=n[0],r[1][o]=n[1],i>2&&(r[2][o]=n[2])})),{tags:e.tags,id:e.id,index:e.index,type:"line",vertices:{x:r[0],y:r[1],z:r[2],signed_z:r[2]}}}))}function $(e,t,i){const n=G.Ue();return e.geometry.map((o=>{Y(n,o,t);const r=i>2?{x:[n[0]],y:[n[1]],z:[n[2]]}:{x:[n[0]],y:[n[1]]};return{tags:e.tags,id:e.id,index:e.index,type:"point",vertices:r}}))}function Y(e,t,i){const n=J(t,i);e[0]=n[0],e[1]=n[1],e[2]=void 0===t[2]?0:t[2]*X.C}function J(e,t){return[(0,W.uZ)(e[0]/t*Z.Bq,0,Z.Bq),(0,W.uZ)((t-e[1])/t*Z.Bq,0,Z.Bq)]}function Q(e,t){return e[0]<0||e[0]>t||e[1]<0||e[1]>t}function ee(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}var te=i(4245);const ie={maxZoom:c.f7,tolerance:3,extent:4096,buffer:1,debug:0,lineMetrics:!1,promoteId:null,generateId:!1,generateIndex:!0,indexMaxZoom:0,indexMaxPoints:1e5,dimensions:2};class ne{constructor(e){this.options=e}get geoJsonVtInstance(){var e,t,i,n,o,r;return this.geoJsonVT||(this.geoJsonVT=(o=this.options.data,r=Object.assign(Object.assign({},ie),{maxZoom:null!==(e=this.options.maxZoom)&&void 0!==e?e:ie.maxZoom,dimensions:null!==(t=this.options.dimensions)&&void 0!==t?t:ie.dimensions,extent:null!==(i=this.options.extent)&&void 0!==i?i:ie.extent,buffer:null!==(n=this.options.buffer)&&void 0!==n?n:ie.buffer}),new U(o,r))),this.geoJsonVT}fetchTile(e){var t,i;const[n,o,s]=(0,r._W)(e),a={components:[],byId:new te.g},l=this.geoJsonVtInstance.getTile(s,n,o),d=null!==(t=this.options.dimensions)&&void 0!==t?t:2,c=null!==(i=this.options.extent)&&void 0!==i?i:4096;if(!l)return Promise.resolve(a);for(const e of l.features)switch(e.type){case D:a.components=a.components.concat($(e,c,d));break;case B:a.components=a.components.concat(q(e,c,d));break;case j:a.components=a.components.concat(K(e,c,d));break;default:console.warn("unsupported type ",l)}return Promise.resolve(a)}destroy(){this.geoJsonVT=void 0}}function oe(e,t){const i={components:[],byId:new te.g};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[se(e.coordinates,t)];return e.coordinates.map((e=>se(e,t)))}(e,t);case"LineString":case"MultiLineString":return function(e,t){if("LineString"===e.type)return[ae(e.coordinates,t)];return e.coordinates.map((e=>ae(e,t)))}(e,t);case"Polygon":case"MultiPolygon":return function(e,t){if("Polygon"===e.type)return le(e.coordinates,t);return e.coordinates.reduce(((e,i)=>e.concat(le(i,t))),[])}(e,t)}}function se(e,t){const i=[0,0,0];return(0,r.a2)(i,(0,X.yq)(e),t),{type:"point",vertices:{x:[i[0]],y:[i[1]]}}}function ae(e,t){const i=[[],[]],n=[0,0,0];return e.forEach(((e,o)=>{(0,r.a2)(n,(0,X.yq)(e),t),i[0][o]=n[0],i[1][o]=n[1]})),{type:"line",vertices:{x:i[0],y:i[1]}}}function le(e,t){const i=[],n=[],o=[],s=[],a=[];e.forEach((e=>{const i=e.map((e=>((0,r.a2)(a,(0,X.yq)(e),t),[(0,W.uZ)(a[0],0,Z.Bq),(0,W.uZ)(a[1],0,Z.Bq)])));s.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 c=H(l,o);for(let e=0;e<c.length;e+=3){const t=[[],[],[]];for(let i=0;i<3;i++)t[0][i]=n[c[e+i]][0],t[1][i]=n[c[e+i]][1],t[2][i]=0;s.forEach((e=>{const i=[[],[],[]];e.forEach(((e,t)=>{i[0][t]=e[0],i[1][t]=e[1]})),(0,d.fZ)(t,i)})),i.push({type:"polygon",vertices:{x:t[0],y:t[1],cut:t[2]}})}return i}var de=i(2398),ce=i(2435);class he{constructor(e){this.tileLoader=new de.U("json",e.ignoreMissingTiles),this.options=e,this.url=e=>{const t=this.options.flipY?e:(0,r._W)(e);return(0,ce.IG)(this.options.url,{x:t[0].toString(),y:t[1].toString(),z:t[2].toString(),subdomain:(0,r.Kn)(t)})}}fetchTile(e){return this.tileLoader.fetch(e,this.url).then((t=>t.data?oe(t.data,(0,r.Bs)(e)):{components:[],byId:new te.g}))}abortTile(e){this.tileLoader.abortRequest((0,r.gx)(e))}destroy(){this.tileLoader.destroy()}}var ue=i(3194);class me{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,d.X4)(),this.tileServer="url"in t?new he(t):new ne(t)}fetchTile(e){const t=(0,r.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 he&&this.tileServer.abortTile(e)}generateTile(e,t,i,c,h,u){const m=(0,r.gx)(t),f=this.tileData[m],p=(0,r.Bs)(t),_=[],v=[],g=this.styleManager.getStyle(i),y=new l.c,b=new l.c(c);if(!g)return Promise.resolve({results:_,transferable:v});const w=new Map;if(f){let t;if(f.components.forEach(((t,i)=>{const{tileProps:r}=this.metatile,l=[];if(t.tags){const e=Object.keys(t.tags);(0,s.Qy)(this.metatile,e);for(const i of e)l[r[i]]=t.tags[i]}const c=Object.keys(this.sourceAttrs);(0,s.Qy)(this.metatile,c);for(const e of c)l[r[e]]=this.sourceAttrs[e];const m="url"in this.options&&this.options.preventInteractions,_=this.options.identifyAsDefaultSource,v=l[r.db_id]?l[r.db_id]:l[r.building_id],x=m?NaN:_?v?(0,n.IL)(v):NaN:(0,n.Ru)(t.index,this.id),S=l[r.db_parent_id];if(x&&S){const e=(0,n.nI)(x)?(0,n.Ak)(x):String(x),t=w.get(S);t?t.add(e):w.set(S,new Set([e]))}if("number"!=typeof x){const e=b.has(x);l[r.selected]=e?1:0,y.add(x),f.byId.set(x,i)}const{coords:I}=p,M=I[3],T=(0,a.o1)(h),E=(0,ue.Yi)(e.styleState,this.sourceAttrs,r,l,s.wz,p),P=this.styleManager.getLayers(g.id,r,l).filter((e=>(0,ue.FR)(e.filter,E))).filter((e=>(0,d.Y0)(t.type,e.type)));if(l[r.id]=x,l[r.tech_db_geometry_type]="line"===t.type?"polyline":t.type,"point"!==t.type&&"line"!==t.type||(void 0===l[r.db_label]&&(l[r.db_label]=NaN),void 0===l[r.db_label2]&&(l[r.db_label2]=NaN)),"line"===t.type){const e=(0,d.Sj)(t);l[r.componentDistanceStart]=0,l[r.componentDistanceEnd]=e,l[r.objectLength]=e,"number"!=typeof l[r.beginningIsCut]&&(l[r.beginningIsCut]=0),"number"!=typeof l[r.endingIsCut]&&(l[r.endingIsCut]=0)}(0,o.PA)(this.collector,g,P,E,this.metatile,M,this.id,p,T,t.vertices,void 0,u)})),t)for(const e in t)console.warn(`[GeoJsonSourceWorker] Can't render component type '${t[e]}' with layer '${e}'`)}this.collector.setGeoIds(new Uint32Array(y.toFlatArray()));const x=this.collector.getAccumulatedData();_.push({regionId:0,metatileHash:Z.L2,collectorOutput:x,styleId:g.id}),v.push(...x.transferable),this.scope.debouncedResetCollector(),this.scope.syncNewRasterSets();const S={results:_,transferable:v};return w.size&&(S.tileParentChildrenMap={tileKey:m,parentChildrenMap:w}),Promise.resolve(S)}getObjectAttributes(e,t){const i=this.tileData[t];if(i){const t=i.byId.get(e);if(void 0===t)return;const n=i.components[t];if(void 0===n)return;return n.tags}}deleteTile(e){delete this.tileData[(0,r.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 he)return this.tileServer.destroy(),this.options=Object.assign(Object.assign({},this.options),{url:e}),this.tileServer=new he(this.options),this.tileData={},Promise.resolve(!0)}else if(this.tileServer instanceof ne)return this.tileServer.destroy(),this.options=Object.assign(Object.assign({},this.options),{data:e}),this.tileServer=new ne(this.options),this.tileData={},Promise.resolve(!0);return Promise.resolve(!1)}}},9600:(e,t,i)=>{i.d(t,{Q:()=>o});let n=1;function o(){return n++}},2627:(e,t,i)=>{i.d(t,{dx:()=>d,lG:()=>m,nt:()=>f,qS:()=>h});var n=i(7731),o=i(6392),r=i(7188),s=i(6490),a=i(2435);const l={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"},d=e=>{var t;return null!==(t=l[e])&&void 0!==t?t:e},c={objectClass:"db_object_class",sublayer:"db_sublayer",db_id:"id"};function h(e){var t;return null!==(t=c[e])&&void 0!==t?t:e}const u={Class:"db_class",DisputePosition:"db_dispute_position",ObjectClass:"db_object_class",ParkingType:"db_parking_type",Sublayer:"db_sublayer",Subsublayer:"db_subsublayer",Icon:"db_icon",GeometryType:"tech_db_geometry_type",ModelType:"db_model_type",RoadSupportTypes:"tech_db_road_support_type",PoiCategory:"L1_Poi_category",RoadPart:"db_road_part"},m=e=>{var t;e.enumerationValues=Object.keys(null!==(t=e.enumerationValues)&&void 0!==t?t:{}).reduce(((t,i)=>{const n=u[i];return n&&(t[n]=e.enumerationValues[i]),t}),{})};class f{constructor(e,t,i){var n;this.id=e,this.modules=t,this.options=i,this.type="zenith",this.worker=new t.workers.parser.ZenithSource,this.sourceAttrs=(0,s.kn)(null!==(n=i.sourceAttributes)&&void 0!==n?n:{},r.so),this.objectAttributes={}}fetchTile(e,t){const{assetManager:i,map:n}=this.modules;return this.worker.fetchTile({tileTemplateUrl:this.options.tileTemplateUrl,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,dt:this.options.dt}).catch((()=>Promise.resolve())).then((o=>{if(!o)return;const{metadata:s,invalidTileKey:l}=o;return s.forEach((o=>{const s={host:this.options.tileServer,tileSet:this.options.tileSet,protocol:this.options.tileProtocol,subdomain:this.options.subdomains[0],hash:(0,r.GG)(o.metatileHash)},l=this.options.metatileTemplateUrl?(0,a.Gr)({url:this.options.metatileTemplateUrl},s):(0,a.Gr)("metatile",s);i.loadMetatile(l,o.metatileHash,o.regionId),n.emit("tileload",{tileCoords:e,regionId:o.regionId}),t.shownRegionIds.add(o.regionId)})),l&&n.emit("invalidtilekey"),s}))}generateTile(e,t,i,r,s,a={},l,d=this.id){return(0,n.mG)(this,void 0,void 0,(function*(){const n=yield this.worker.generateTile(Object.assign({styleId:i,tileInfo:(0,o.Bs)(t),pixelRatio:s,selectedIds:r,styleState:e.styleState,floorsEnabled:e.floorsEnabled,sourceAttrs:this.sourceAttrs,hoverId:l,sourceId:d,isDefaultSource:this.options.isDefaultSource,modelsPath:this.options.modelsPath,promoteAttributes:this.options.promoteAttributes,isCustomZenithSource:!this.options.isDefaultSource},a));return n.promotedAttrs&&(this.objectAttributes[(0,o.gx)(t)]=n.promotedAttrs),n}))}getObjectAttributes(e,t){var i;return null===(i=this.objectAttributes[e])||void 0===i?void 0:i[t]}generateModel(e){return this.worker.generateModel(e)}abortTileFetch(e){this.worker.abortTileRequest((0,o.gx)(e))}deleteTile(e){this.objectAttributes[(0,o.gx)(e)]=void 0,this.worker.deleteTile((0,o.gx)(e))}setAttributes(e){this.sourceAttrs=e}getAttributes(){return this.sourceAttrs}destroy(){this.worker.destroy(),this.sourceAttrs={},this.objectAttributes={}}setFeatureStateMap(e){this.worker.setFeatureStateMap(e)}setFeatureStateMapBinary(e){this.worker.setFeatureStateMapBinary(e)}}},603:(e,t,i)=>{i.d(t,{Z:()=>re});var n=i(6392),o=i(5095);class r{constructor(){this.cache=new Map,this.pendingRequests=new Map}fetch({coords:e,tileServer:t,tileSet:i,tileProtocol:r,subdomains:s,tileKey:a,appId:l,lang:d,defaultLang:c,sessionId:h,tileTemplateUrl:u,dt:m}){return new Promise((f=>{const p=(0,n.rL)(t,i,r,s,e,a,l,d,u,c,h,m),_=(0,n.gx)(e),v=(0,o.n)({url:p},((e,t)=>{let i=!1;if(this.pendingRequests.delete(_),void 0!==e||0===t.byteLength)return void 0!==e&&(console.error(e),403===e.status&&(i=!0)),this.cache.set(_,[]),void f({metadata:[],invalidTileKey:i});const o=(0,n.CJ)(t),r=(0,n.xH)(o);this.cache.set(_,o),f({metadata:r,invalidTileKey:i})}));this.pendingRequests.set(_,{xhr:v,resolve:f})}))}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))}destroy(){this.cache.clear(),this.pendingRequests.clear()}}var s=i(3487);class a extends s.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)))}}var l=i(3249),d=i(1375);function c(e){for(let t=1;t<e.length;t++)e[t]=e[t]+e[t-1]}const h={1:c,2:c,4:c,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 u{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 m(e,t,i,n){const o=t.BYTES_PER_ELEMENT;e.offset+=-e.offset&o-1;const r=new t(e.buffer,e.offset,i);return e.offset+=o*i,n&&h[o](r),r}function f(e,t,i){e.offset+=7&-e.offset;const n=new Uint32Array(e.buffer,e.offset,2*t);return e.offset+=8*t,i&&h[8](n),n}function p(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 r;if(e.offset+=4*t,i){let e=0;for(r=0;r<t;r++)e=e+n[r]>>>0,o[r]=e/1e3}else for(r=0;r<t;r++)o[r]=n[r]/1e3;return o}function _(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 r;if(e.offset+=4*t,i){let e=0;for(r=0;r<t;r++)e=e+n[r]>>>0,o[r]=(0|e)/1e3}else for(r=0;r<t;r++)o[r]=n[r]/1e3;return o}function v(e,t,i){switch(i){case 2:case 10:return m(e,Uint8Array,t);case 3:return m(e,Uint8Array,t,!0);case 4:return m(e,Uint16Array,t);case 5:return m(e,Uint16Array,t,!0);case 6:case 25:return m(e,Uint32Array,t);case 7:return m(e,Uint32Array,t,!0);case 8:case 19:return f(e,t);case 9:case 20:return f(e,t,!0);case 11:return function(e,t){let i=e.offset;const n=e.u8,o=e.buffer,r=[];for(;t--;)r.push(0|n[i++]);const s=[];for(;++t<r.length;){let e=r[t];255===e&&(e=n[i++]|n[i++]<<8|n[i++]<<16|0),s.push(new Uint8Array(o,i,e)),i+=e}return e.offset=i,s}(e,t);case 12:return function(e,t){e.offset+=3&-e.offset;let i=e.offset;const n=e.u32,o=e.buffer,r=[];for(let e=0;e<t;e++)r.push(n[i>>2]),i+=4;const s=[];for(let e=0;e<t;e++){const t=r[e];i+=7&-i,s.push(new Uint8Array(o,i,t)),i+=t}return e.offset=i,s}(e,t);case 13:return m(e,Int8Array,t);case 14:return m(e,Int8Array,t,!0);case 15:return m(e,Int16Array,t);case 16:return m(e,Int16Array,t,!0);case 17:return m(e,Int32Array,t);case 18:return m(e,Int32Array,t,!0);case 21:return p(e,t);case 22:return p(e,t,!0);case 23:return _(e,t);case 24:return _(e,t,!0);default:throw new Error("Unknown stream type "+i)}}function g(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i];return t}function y(e,t,i){return new e.constructor(e.buffer,e.byteOffset+t*e.BYTES_PER_ELEMENT,i)}var b=i(7204),w=i(5597),x=i(3672),S=i(9981),I=i(9218),M=i(3194),T=i(7609),E=i(7999),P=i(7188),L=i(6273);const A=[],C=new Int32Array(256);let z;const k=[],R=[],F=[0,0,0,0,0];let O=0,D=0,B=0,j={};function N(e,t,i,o,r,s,a,l,d=!1,c){const{styleState:h,sourceId:f,sourceAttrs:p,tileInfo:_,pixelRatio:y,selectedIds:w,floorsEnabled:x,hoverId:I,generateOnlySelectedPoi:T,generateOnlyHoveredPoi:E,modelsPath:L}=r,{data:k}=s,F=new b.c(w),B=(0,n.VV)(k);if(B.byteLength<8)return o.getAccumulatedData();A.length=0;const j=new u(B);if(1279676242!==j.readU32())return o.getAccumulatedData();const N=j.readU16();if(2!==N&&3!==N)return console.error(`Unsupported tile format version: "${N}"`),o.getAccumulatedData();j.readU16();const G=(0,S.o1)(y);return function(e){const t=e.u8;let i=e.offset,n=e.u32[i>>2];i+=4,O=n,D=i;for(;n--;)i=2*t[i++]+i,i=t[i++]+i;e.offset=i+(3&-i)}(j),function(e){const t=e.u32[e.offset>>2];e.offset+=4,z=m(e,Uint8Array,t);const i=m(e,Uint32Array,t);for(let n=0;n<t;n++){const t=z[n];A[n]=v(e,i[n],t),C[n]=0}}(j),function(e,t,i,n,o,r,s,a,l,d,c,h,u,f,p,_=!1,v,y,b,w,x){const S=Array.from(o.featureAttrs);(0,P.Qy)(c,S);const I=O,T=m(s,Int32Array,I),E=g(T),L=m(s,Uint8Array,E,!0),C=m(s,Uint8Array,g(L),!0),z=m(s,Uint8Array,E,!0),k=m(s,Uint8Array,g(z),!0),F=m(s,Uint16Array,E,!0);let D=0,B=0,j=0,N=!0;for(let m=0;m<I;m++){const g=T[m];if(Z(s,c,h),0===m){const e=A[R[1]];r.setGeoIds(e)}for(let s=0;s<g;s++){const s=L[D];s>0&&(U(h,s,C,B,c,e,_),B+=s);const m=z[D];m>0&&(V(h,m,k,j),j+=m),N=s>0||m>0;const g=(0,M.Yi)(n,p,c.tileProps,h,[],a),S=F[D];S>0&&H(e,t,i,g,o,r,S,a,l,d,c,u,f,v,y,b,w,x,N),D++}}W()}(N,e,t,h,i,o,j,_,G,F,a,l,x,f,p,d,I,T,E,L,c),o.getAccumulatedData()}function U(e,t,i,n,o,r,s=!1){for(var a,l;t--;){const t=i[n++],d=R[t],c=k[t],h=z[d];if(8===h||9===h||19===h||20===h)e[c]=(0,x.Ru)(A[d][C[d]],A[d][C[d]+1]),C[d]+=2;else{const t=A[d][C[d]];switch(c){case o.tileProps.objectLength:case o.tileProps.db_centroid_x:case o.tileProps.db_centroid_y:case o.tileProps.componentDistanceEnd:case o.tileProps.componentDistanceStart:case o.tileProps.previousPointX:case o.tileProps.previousPointY:case o.tileProps.nextPointX:case o.tileProps.nextPointY:e[c]=2===r?t*L.gt:t;break;case o.tileProps.db_label:case o.tileProps.db_label2:e[c]=(0,E.zT)(t);break;case o.tileProps.db_tiers:const i=t.byteLength/Int32Array.BYTES_PER_ELEMENT,n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getInt32(0,!0)){const t=new Array(i);for(let e=0;e<i;e++)t[e]=n.getInt32(e*Int32Array.BYTES_PER_ELEMENT,!0);e[c]=t}else e[c]=void 0;break;default:if(s&&11===h)e[c]=(0,E.zT)(t);else{const i=o.tilePropsByIndex[c];e[c]=null!==(l=null===(a=o.reverseDictionaries[i])||void 0===a?void 0:a[t])&&void 0!==l?l:t}}C[d]++}}}function V(e,t,i,n){for(;t--;){const t=i[n++];e[k[t]]=NaN}}let G=[];function H(e,t,i,n,o,r,s,a,l,d,c,h,u,m,f,p,_,v=[],g){var b;const{tileProps:S,defaultProps:E}=c,{tileAttrs:P,featureAttrs:L}=n,z=a.coords[3];if(!g&&0===G.length){for(let e=0;e<B;e++){const t=F[e];C[t]=C[t]+s}return}const k=P[S.tech_db_geometry_type],R=c.vertexProps[k];for(let t=0;t<B;t++){const i=F[t],n=null!==(b=R[t])&&void 0!==b?b:"signed_z";j[n]=X(y(A[i],C[i],s),t,e),C[i]=C[i]+s}if(void 0!==S.db_sublayer&&!Number.isNaN(P[S.db_sublayer])&&(0,T.Ty)(P[S.db_sublayer]))return;const O=P[S.id];let D="number"!=typeof O&&d.has(O);f&&(D=!0);let N=!!p;if(!N&&void 0!==m){if("number"==typeof O||!(0,x.v7)(m,O))return;N=!0}if(P[S.selected]=D?1:0,P[S.hovered]=N?1:0,"number"!=typeof O&&v.length>0){const e={};v.forEach((t=>{e[t]=P[S[t]]})),r.addPromotedObjectAttributes(O,e)}for(const e in E){const t=E[e];Number.isNaN(P[t.index])&&(P[t.index]=t.value)}if(h&&z>=I.floors.detailLevel&&P[S.db_hidden_by_plan_building_id]&&"number"!=typeof O&&r.addFloorHidingMap(O,P[S.db_hidden_by_plan_building_id]),o.featureAttrs.size>0){const e="number"!=typeof O&&o.get(O.hi,O.lo);if(e)for(const t of o.featureAttrs)o.clearAttrs=!1,L[S[t]]=e[t];else if(!1===o.clearAttrs){o.clearAttrs=!0;for(const e in S)void 0!==L[S[e]]&&(L[S[e]]=void 0)}}g&&(G=i.getLayers(t.id,S,P).filter((e=>(0,M.FR)(e.filter,n)))),(0,w.PA)(r,t,G,n,c,z,u,a,l,j,f||p,_)}function Z(e,t,i){const n=Object.keys(t.tileProps).length,o=e.u8;let r,s,a=D;for(s=1;s<n;s++)i[s]=NaN;for(r=o[a++],s=0;s<r;s++)k[s]=o[a++],R[s]=o[a++];for(r=o[a++],s=0;s<r;s++)F[s]=o[a++];B=r,D=a,W()}function W(){j={}}function X(e,t,i){if(2===i&&t<3&&e instanceof Uint16Array)for(let t=0;t<e.length;t++)e[t]*=L.gt;return e}var K=i(9450),q=i(127),$=i(1678),Y=i(4922),J=i(4091),Q=i(8183);const ee=[[0],[0],[0]],te=[];function ie(e,t,i,n,o,r,s,a,l){const{matrix:d,offset:c,id:h,selected:m}=r,f=new u(o),p=[];if(!e)return{objects:n.getAccumulatedData(),textures:p};if(1296191066!==f.readU32()||1!==f.readU16())return{objects:n.getAccumulatedData(),textures:[]};f.readU16();const _=f.readU32();for(let e=0;e<_;e++)p.push(f.readU8Vector());const{tileProps:v}=s,g=[],y=Object.keys(v).length;for(let e=0;e<y;e++)g[e]=NaN;if(g[v.db_sublayer]="Building_model",g[v.id]=h,g[v.selected]=m?1:0,g[v.db_region]=a,l.featureAttrs.size>0){const e=Array.from(l.featureAttrs);(0,P.Qy)(s,e)}const b=[],x="number"!=typeof h&&l.get(h.hi,h.lo);if(x)for(const e of l.featureAttrs)l.clearAttrs=!1,b[v[e]]=x[e];else if(!1===l.clearAttrs){l.clearAttrs=!0;for(const e in v)void 0!==b[v[e]]&&(b[v[e]]=void 0)}n.setGeoIds(new Uint32Array([h.lo,h.hi]));const S=f.offset,I=(0,M.Yi)(i,P.i4,v,g,b);return t.getLayers(e.id,v,g).filter((e=>(0,M.FR)(e.filter,I))).forEach((t=>{if("buildingModel"!==t.type)return;(0,w.Eu)(t,I);(0,M.FR)(t.filter,I)&&(f.offset=S,function(e,t,i,n,o,r,s){const a=o.readU32();for(let l=0;l<a;l++){const a=o.readU32(),l=K.al(o.readF32(),o.readF32(),o.readF32()),d=K.al(o.readF32(),o.readF32(),o.readF32()),c=K.lu(K.Ue(),d,l),h=[];q.Iu(h,r,l),q.bA(h,h,c),h[12]+=s[0],h[13]+=s[1];const u=o.readU16Vector(5),m=o.readU32();for(let r=0;r<m;r++){const r=1===o.readU32()?L.uC:L.Fg,s=o.readU16Vector();do{$.X.processSubmesh(e.id,t,i,n,u,s,r,a,h)}while(n.isOverloaded())}const f=o.readU16Vector();do{$.X.processOuterEdge(e.id,t,i,n,u,f,h)}while(n.isOverloaded());const p=(0,J.qt)(ne(u)),_=(0,Q.y)(p);for(let t=0;t<p.length-2;t++){for(let e=0;e<3;e++){const i=oe(t+e,p.length);ee[0][e]=p[i][0],ee[1][e]=p[i][1],ee[2][e]=0,te[e]=_[i]}do{Y._.generateFloorsBottomFill(n,e.id,ee,te,$.d,h)}while(n.isOverloaded())}}}(e,t,I,n,f,d,c))})),{objects:n.getAccumulatedData(),textures:p}}function ne(e){const t=[];for(let i=0;i<e.length;i+=5)t.push([e[i],e[i+1]]);return t}function oe(e,t){return 0===e?0:e%2?(e+1)/2:t-e/2}class re{constructor(e){this.scope=e,this.tileLoader=new r,this.tileAttrs=[],this.models={},this.featureStateMap=new a}fetchTile(e){return this.tileLoader.fetch(e)}abortTileRequest(e){this.tileLoader.abortRequest(e)}generateTile(e){const{styleManager:t,collector:i,metatiles:o}=this.scope,{tileInfo:r,promoteAttributes:s,isCustomZenithSource:a}=e,c=(0,n.gx)(r.coords),h=this.tileLoader.get(c),u=[],m=[],f={};return h.forEach((n=>{const{regionId:r,metatileHash:c}=n,h=this.scope.styleManager.getStyle(e.styleId);if(!h)return;if(e.areTileBoundsVisible&&e.isDefaultSource){const n=t.getStyle(l.jf).layers.find((e=>"debug-tile-bounds"===e.id));(0,d.cX)(i,n,e.styleState)}const p=N(h,t,this.featureStateMap,i,e,n,o[c],this.tileAttrs,a,s);Object.assign(f,p.promotedObjectAttributes),u.push({regionId:r,metatileHash:c,collectorOutput:p,styleId:h.id}),m.push(...p.transferable)})),this.scope.resetCollector(),this.scope.syncRasterSets(),Promise.resolve({results:u,transferable:m,promotedAttrs:Object.keys(f).length>0?f:void 0})}deleteTile(e){this.tileLoader.delete(e)}setFeatureStateMap(e){this.featureStateMap=this.buildFeatureState(e)}setFeatureStateMapBinary(e){this.featureStateMap=this.buildFeatureStateFromBinary(e)}generateModel(e){const{regionId:t,metatileHash:i,styleId:n,url:r,id:s}=e,{styleManager:a}=this.scope,l=(0,x.Ak)(s);return new Promise((s=>{const d=this.models[l];(d?Promise.resolve(d):new Promise((e=>{(0,o.n)({url:r},((t,i)=>{if(t||0===i.byteLength){const t=this.models[l]=new ArrayBuffer(0);e(t)}else this.models[l]=i,e(i)}))}))).then((o=>{if(0===o.byteLength)return void s({objects:this.scope.collector.getAccumulatedData(),textures:{isBitmap:!1,data:[]}});const r=this.scope.styleManager.getStyle(n);if(!r)return void s({objects:this.scope.collector.getAccumulatedData(),textures:{isBitmap:!1,data:[]}});const{objects:l,textures:d}=ie(r,a,e.styleState,this.scope.collector,o,e,this.scope.metatiles[i],t,this.featureStateMap);if(this.scope.createImageBitmap){const e=d.map((e=>{const t=new Blob([e],{type:"image/png"});return createImageBitmap(t)}));Promise.all(e).then((e=>{s({objects:l,textures:{isBitmap:!0,data:e},transferable:[...l.transferable,...e]}),this.scope.resetCollector()}))}else s({objects:l,textures:{isBitmap:!1,data:d},transferable:[...l.transferable,o]}),this.scope.resetCollector()}))}))}destroy(){this.tileLoader.destroy(),this.tileAttrs=[],this.models={}}buildFeatureState(e){const t=new a;for(const i in e){const n=(0,x.IL)(i);t.set(n.hi,n.lo,e[i])}return t}buildFeatureStateFromBinary(e){return function(e){const t=new a,{attributes:i,size:n}=e,o={stride:i.id.stride,view:new Uint32Array(i.id.buffer,i.id.offset)},r=[];for(const t in e.attributes)if("id"!==t){const{stride:i,buffer:n,offset:o}=e.attributes[t];r.push({name:t,stride:i,view:new Float32Array(n,o)})}for(let e=0;e<n;e++){const i=o.view[e*o.stride/4],n=o.view[e*o.stride/4+1],s={};for(const t of r){const i=t.view[e*t.stride/4];s[t.name]=Number.isNaN(i)?null:i}t.set(n,i,s)}return t}(e)}}},199:(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(3754).n3,iconLabelingMargin:{leftRight:6,topBottom:6}},filter:["all",["match",["get","db_sublayer"],["Commercial_poi_default","Commercial_poi_city","Commercial_poi_premium"],!0,!1],["any",["==",["in",["get","db_building_id"],["global","_activeFloorBuildingIds"]],!1],["in",["get","db_plan_id"],["global","_activeFloorIds"]]]]}]},7436:(e,t,i)=>{i.d(t,{h:()=>c});var n=i(7464);function o(e){return"boolean"!=typeof e&&"attrs"===e.type}function r(e){return"boolean"!=typeof e&&"unextractable"===e.type}function s(e){if(!(0,n.Uu)(e))return[Boolean(e)];let t=[];const i=[];switch(e.type){case"all":const l=e.array.map(s);for(const e of l){const n=[];for(const t of e){if(!1===t)return[!1];o(t)?n.push(t):r(t)&&i.push(t)}n.length>0&&(t=0===t.length?n:a(t,n))}break;case"match":if(!(0,n.vB)(e.input))return[{type:"unextractable",exp:e}];if("precompute"===e.input.type)return[{type:"unextractable",exp:e}];const d=e.input.property,c=e.defaultOutput;for(const n of e.cases){const e=s(n.output),l=[];n.values.forEach((e=>{l.push({type:"attrs",attrs:{[d]:e}})}));for(const n of e)if(o(n))for(const e of a([n],l))t.push(e);else if(r(n)){i.push(n);for(const e of l)t.push(e)}else if(!0===n&&!c)for(const e of l)t.push(e)}break;case"==":{let i,o;if((0,n.vB)(e.leftValue)&&(0,n.HW)(e.rightValue))i=e.leftValue.property,o=e.rightValue;else{if(!(0,n.vB)(e.rightValue)||!(0,n.HW)(e.leftValue))return[{type:"unextractable",exp:e}];i=e.rightValue.property,o=e.leftValue}t.push({type:"attrs",attrs:{[i]:o}});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}var l=i(3672);class d{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,r)=>{if(this.traverseIterations+=1,!o)return;for(const e of o.leafs)i.push(e);const s=this.orderedKeys[r];if(!s)return;const a=t[e[s]],d=(0,l.nI)(a)?(0,l.Ak)(a):a;void 0!==d?(n(o.children[d],r+1),n(o.novalue,r+1)):n(o.novalue,r+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=s(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=s(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 r=this.tree;for(let e=0;e<=this.orderedKeys.length;e++){if(n===i.size){null==r||r.leafs.push(t);break}const s=this.orderedKeys[e],a=this.orderedKeys[e+1]||"";if(r||(r=this.makeTreeNode(s),null===this.tree&&(this.tree=r)),i.has(s)){const e=o[s];r.children[e]||(r.children[e]=this.makeTreeNode(a)),r=r.children[e],n+=1}else r.novalue||(r.novalue=this.makeTreeNode(a)),r=r.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 d;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):[]}}},4389:(e,t,i)=>{i.d(t,{l:()=>f});var n=i(6273),o=i(378),r=i(9090),s=i(8352),a=i(5600),l=i(159),d=i(2702);const c=o.Ue(),h=o.Ue(),u={type:l.SP.Entrance,offsetMultiplier:18,cDist:0,oLen:0,sLen:0,px:[],py:[],count:0,localID:0};function m(e,t,i,o){return u.px=e.x,u.py=e.y,u.oLen=i/n.Bq,u.count=t,u.localID=o,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 Int8Array(t,8),e.views.arrowExtender=new Int8Array(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)=>(0,d.v)([e,t.innerId,i>2?1:0],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],isLongArrow:e[2],tileData:e.slice(3)})}},generate:(e,t,i,n,o)=>{const r=o.x,a=o.y,d=o.x.length,c=function(e,t,i){let n=0;for(let o=1;o<i;o++){const i=e[o]-e[o-1],r=t[o]-t[o-1];n+=Math.sqrt(i*i+r*r)}return n}(r,a,d),h=e.getBucket(i.type,"stroke",f.sinks.stroke.packObjectAttributes(t,i,d,n),f.sinks.stroke.binder),u=e.idIndexer.getIndex({id:n.tileAttrs[n.tileProps.id],styleId:t,layer:i,sublayer:n.tileAttrs[n.tileProps.db_sublayer]}),_=m(o,d,c,u);(0,s.W)(o.x,o.y,d,l.kU.Butt,l.kU.Butt,0,0,0,0,_,h);let v=0;p(h,l.gD.StartBorder,r[0],a[0],r[1],a[1],0,0,v,c,u);for(let e=0;e<d-1;e++){if(0!==e){const t=r[e]-r[e-1],i=a[e]-a[e-1];v+=Math.sqrt(t*t+i*i)}p(h,l.gD.Arrow,r[e],a[e],r[e+1],a[e+1],-1,0,v,c,u)}}});function p(e,t,i,n,o,r,s,a,l,d,c){!function(e,t,i,n,o,r,s){const{elements:a,indices:l}=e,{buffer:d,offset:c}=l,h=a.offset;d[c]=h+t,d[c+1]=h+i,d[c+2]=h+n,d[c+3]=h+o,d[c+4]=h+r,d[c+5]=h+s,l.offset=c+6}(e,1,2,0,0,2,3),_(e,t,i,n,o,r,s,a,-1,-1,l,d,!0,c),_(e,t,i,n,o,r,s,a,1,-1,l,d,!1,c),_(e,t,i,n,o,r,s,a,1,1,l,d,!1,c),_(e,t,i,n,o,r,s,a,-1,1,l,d,!0,c)}function _(e,t,i,o,s,a,l,d,u,m,f,p,_,v){const g=e.elements,y=g.stride*g.offset,b=y>>1,w=b>>1;(0,r.uI)(c,i,o,s,a),(0,r.fN)(h,c),e.views.position[b]=n.jO+i,e.views.position[b+1]=n.jO+o,e.views.segmentEnd[b]=n.jO+s,e.views.segmentEnd[b+1]=n.jO+a,e.views.texExtender[y]=(0,r.Tz)(h[0]*m*(_?-1:1)*n.Gt),e.views.texExtender[y+1]=(0,r.Tz)(h[1]*m*(_?-1:1)*n.Gt),e.views.arrowExtender[y]=(0,r.Tz)(u*n.Gt),e.views.arrowExtender[y+1]=(0,r.Tz)(m*n.Gt);const x=u+l,S=m+d,I=c[0]*x+h[0]*S,M=c[1]*x+h[1]*S;e.views.extender[b]=Math.round(I*n.Gt*127),e.views.extender[b+1]=Math.round(M*n.Gt*127),e.views.direction[b]=Math.round(127*c[0]),e.views.direction[b+1]=Math.round(127*c[1]),e.views.vertexDistance[w]=f/n._H,e.views.objectLength[w]=p/n._H,e.views.type[w]=t,e.views.localID[w]=v,e.elements.offset++}},1678:(e,t,i)=>{i.d(t,{X:()=>d,d:()=>l});var n=i(5600),o=i(2682),r=i(3672),s=i(2702),a=i(6273);const l=[a._H/2,a._H/2],d=(0,n.D)({symbol:"buildingModel",sinks:{fill:{stride:24,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),e.views.labelingTextureID=new Uint32Array(t,20)},packObjectAttributes:(e,t,i,n,o,r)=>(0,s.v)([e,t.innerId,i,o,n],t,r),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],texture:e[2],id:Number.isNaN(e[3])?void 0:(0,r.Ak)(e[3]),matrix:e[4],tileData:e.slice(5)})},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)=>(0,s.v)([e,t.innerId,n,i],t,o),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],id:Number.isNaN(e[2])?void 0:(0,r.Ak)(e[2]),matrix:e[3],tileData:e.slice(4)})}},processSubmesh(e,t,i,n,o,r,s,a,l){const{tileProps:h,tileAttrs:u}=i,m=u[h.id],f=n.idIndexer.getIndex({id:m,styleId:e,layer:t,sublayer:u[h.db_sublayer]}),p=n.buildingPointIndexer.getIndex(m),_=n.getBucket(t.type,"fill",d.sinks.fill.packObjectAttributes(e,t,a,l,m,i),d.sinks.fill.binder,s);!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}(_,r);for(let e=0;e<o.length;e++)c(_,o,e,f,p)},processOuterEdge(e,t,i,n,r,s,a){const{tileProps:c,tileAttrs:h}=i,u=h[c.id],m=n.getBucket(t.type,"stroke",d.sinks.stroke.packObjectAttributes(e,t,a,u,i),d.sinks.stroke.binder);for(let e=0;e<s.length;e+=2){const t=5*s[e],i=5*s[e+1];(0,o.n)(m,r[t],r[t+1],r[t+2],r[i],r[i+1],r[i+2],l,!0)}}});function c(e,t,i,n,o){const r=e.elements.offset,s=d.sinks.fill.stride,a=5*i,c=r*(s/e.views.position.BYTES_PER_ELEMENT),h=r*(s/e.views.localID.BYTES_PER_ELEMENT);e.views.position[c]=t[a],e.views.position[c+1]=t[a+1],e.views.position[c+2]=t[a+2],e.views.texCoords[c]=t[a+3],e.views.texCoords[c+1]=t[a+4],e.views.localID[h]=n,e.views.demPosition[c]=l[0]/8,e.views.demPosition[c+1]=l[1]/8,e.views.labelingTextureID[h]=o,e.elements.offset++}},871:(e,t,i)=>{i.d(t,{p:()=>s});var n=i(5600),o=i(2702),r=i(6273);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)=>(0,o.v)([e,t.innerId],t,i),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generate(e,t,i,n,o){const r=e.getBucket(i.type,"fill",s.sinks.fill.packObjectAttributes(t,i,n),s.sinks.fill.binder),l=e.idIndexer.getIndex({id:n.tileAttrs[n.tileProps.id],styleId:t,layer:i,sublayer:n.tileAttrs[n.tileProps.db_sublayer]}),d=o.x[0],c=o.y[0];!function(e,t,i,n,o,r,s){const{elements:a,indices:l}=e,{buffer:d,offset:c}=l,h=a.offset;d[c]=h+t,d[c+1]=h+i,d[c+2]=h+n,d[c+3]=h+o,d[c+4]=h+r,d[c+5]=h+s,l.offset=c+6}(r,0,2,1,0,3,2),a(r,d,c,-1,-1,l),a(r,d,c,-1,1,l),a(r,d,c,1,1,l),a(r,d,c,1,-1,l)}});function a(e,t,i,n,o,s){const a=e.elements.offset*e.elements.stride>>1,l=a>>1;e.views.position[a]=r.jO+t,e.views.position[a+1]=r.jO+i,e.views.extender[a]=n,e.views.extender[a+1]=o,e.views.localID[l]=s,e.elements.offset++}},3097:(e,t,i)=>{i.d(t,{L:()=>u});var n=i(8352),o=i(159),r=i(5600),s=i(2702),a=i(6273),l=i(6659),d=i(3194);const c={type:o.SP.Striped,cDist:0,oLen:0,sLen:0,localID:0,offsetMultiplier:14,px:[],py:[],count:0};function h(e,t,i){return c.cDist=e,c.oLen=t,c.localID=i,c}const u=(0,r.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 Int8Array(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)=>(0,s.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})}},generate(e,t,i,r,s,c){const m=(0,l.I)((0,d.FR)(i.style.geometryModifier,r),s,c,r);if(null===m)return;const{tileAttrs:f,tileProps:p}=r,_=(0,d.FR)(i.ignoreTier,r)?null:r.tileAttrs[p.db_tiers],v=e.getBucket(i.type,"stroke",u.sinks.stroke.packObjectAttributes(t,i,_,r),u.sinks.stroke.binder),g=e.idIndexer.getIndex({id:f[p.id],styleId:t,layer:i,sublayer:f[p.db_sublayer]}),y=h(f[p.componentDistanceStart]/a.Bq,f[p.objectLength]/a.Bq,g),b=!Number.isNaN(f[p.beginningIsCut])&&0!==f[p.beginningIsCut],w=!Number.isNaN(f[p.endingIsCut])&&0!==f[p.endingIsCut];(0,n.W)(m.x,m.y,m.x.length,b?o.kU.TileCut:o.kU.Butt,w?o.kU.TileCut:o.kU.Butt,f[p.previousPointX],f[p.previousPointY],f[p.nextPointX],f[p.nextPointY],y,v)}})},4922:(e,t,i)=>{i.d(t,{_:()=>l});var n=i(5600),o=i(3698),r=i(6273),s=i(132);const a={stride:4,binder:(e,t)=>{},packObjectAttributes:(e,t)=>[e,t],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(3)})},l=(0,n.D)({symbol:"dem",sinks:{mesh:a,ground:a,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)})},flatBottom:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.demPosition=new Int16Array(t,4),e.views.extender=new Int8Array(t,8)},packObjectAttributes:(e,t,i)=>i?[e,t,i]:[e,t],unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],matrix:e[2]?e[2]:void 0,tileData:e.slice(3)})}},generateElevation(e,t,i,n,s){const a=new Uint16Array(t.reduce(((e,t)=>{const[i,n,s,a]=t;return e.push(r.jO+i*r.Bq,r.jO+n*r.Bq,(0,o.Bb)(s),(0,o.Bb)(a)),e}),[]));return{symbol:l.symbol,sink:"elevation",buffer:a.buffer,generatedObjects:[{attributes:l.sinks.elevation.packObjectAttributes(i,n,s),drawMode:r.Fg,rangeStart:0,rangeEnd:a.buffer.byteLength}]}},generateHillshade(e,t,i,n){const s=new Uint16Array(t.reduce(((e,t)=>{const[i,n,s,a]=t;return e.push(i*r.Bq,n*r.Bq,(0,o.Bb)(s),(0,o.Bb)(a)),e}),[]));return{symbol:l.symbol,sink:"hillshade",buffer:s.buffer,generatedObjects:[{drawMode:r.Fg,attributes:l.sinks.hillshade.packObjectAttributes(i,n),rangeStart:0,rangeEnd:s.buffer.byteLength}]}},generateFloorsBottomFill(e,t,i,n,o,r){const a=i[0],h=i[1],u=i[0].length,m=l.sinks.flatBottom.packObjectAttributes(t,s.he,r);!function(e,t,i,n,o,r,s){let a=e.elements.offset;const l=a;if(t<3)return;d(e,a++,i[0],n[0],r,o[0],s),d(e,a++,i[1],n[1],r,o[1],s);for(let h=2;h<t;h++)c(e,l,h),d(e,a++,i[h],n[h],r,o[h],s);e.elements.offset=a}(e.getBucket("dem","flatBottom",m,l.sinks.flatBottom.binder),u,a,h,n,o,!!r)}});function d(e,t,i,n,o,s,a){const l=t*(e.elements.stride/e.views.position.BYTES_PER_ELEMENT),d=t*(e.elements.stride/e.views.extender.BYTES_PER_ELEMENT);e.views.position[l]=a?i:r.jO+i,e.views.position[l+1]=a?n:r.jO+n,e.views.demPosition[l]=(a?o[0]:r.jO+o[0])/8,e.views.demPosition[l+1]=(a?o[1]:r.jO+o[1])/8,e.views.extender[d]=127*s[0],e.views.extender[d+1]=127*s[1]}function c(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}},6659:(e,t,i)=>{i.d(t,{I:()=>h});var n=i(378),o=i(9090);const r={x:0,y:1};function s(e,t){for(const i in e){const n=r[i];void 0!==n?e[i].push(t[n]):e[i].push(NaN)}}var a=i(6392),l=i(6273),d=i(9073);function c(e,t,i,r){if(isNaN(e.step)||isNaN(e.width))return i;const{tileProps:c,tileAttrs:h}=r,u=(0,a.iq)(t,[0,0]),m=l.Bq/(0,a.aq)(t.coords[2])*d.C*u;let f=e.step*m;if(isNaN(f)&&(f=0),0===f)return i;const p=e.width*m,_={},v=i.x,g=i.y,y=v.length;for(const e in i)_[e]=[];let b=0;const w=[b];for(let e=1;e<y;e++)b+=n.TK([v[e-1],g[e-1]],[v[e],g[e]]),w.push(b);const x=n.Ue(),S=n.Ue(),I=[0,0],M=Math.abs(b/Math.trunc(b/f)),T=[v[0],g[0]];let E=(e.stopLines?1:-1)*Math.sign(e.width),P=0,L=0;for(s(_,T),e.stopLines&&!h[c.beginningIsCut]&&((0,o.uI)(x,v[L],g[L],v[L+1],g[L+1]),(0,o.fN)(S,x),n.bA(I,S,E*p),n.IH(T,T,I),s(_,T),P+=M/2,E=-E);P<=b;){for(;P>w[L+1];)L++;if((0,o.uI)(x,v[L],g[L],v[L+1],g[L+1]),(0,o.fN)(S,x),E>0)n.bA(I,S,E*p),n.IH(T,T,I),n.bA(I,x,M/2),n.IH(T,T,I),s(_,T);else{const e=Math.min(1,(P-w[L])/(w[L+1]-w[L]));n.t7(T,[v[L],g[L]],[v[L+1],g[L+1]],e),s(_,T)}E=-E,P+=M/2}return e.stopLines&&!h[c.endingIsCut]&&(n.bA(I,S,E*p),n.IH(T,T,I),s(_,T)),_}function h(e,t,i,n){if(!(o=e,o&&Array.isArray(o)&&0!==e.length))return i;var o;let r=function(e){const t={};for(const i in e)e[i]&&(t[i]=Array.from(e[i]));return t}(i);for(const i of e){if("object"!=typeof i||!i)return console.warn(`Wrong value ${i} in modifiers list.`),null;if(!("type"in i))return console.warn(`Wrong value ${i} in modifiers list.`),null;if("zigzag-modifier"!==i.type)return console.warn(`Expression with type ${i.type} cannot be used as geometry modifier.`),null;if(r=c(i,t,r,n),null===r)return null}return r}},7407:(e,t,i)=>{i.d(t,{m:()=>E});var n=i(378),o=i(9450),r=i(351),s=i(127),a=i(5600),l=i(2702),d=i(3194),c=i(6392),h=i(3741),u=i(9073),m=i(2618),f=i(7966),p=i(8290),_=i(6490),v=i(9865),g=i(7609),y=i(7464);const b=[0,0,0],w=new Array(16),x=new Array(9),S=[0,0,0],I=[0,0,0],M=[0,0,0],T=[0,0,0],E=(0,a.D)({symbol:"gltfModel",sinks:{fill:{stride:0,binder:(e,t)=>{},packObjectAttributes:(e,t,i)=>(0,l.v)([e,t.innerId],t,i),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)})}},generateInstanced(e,t,i,n,o,r,s,a){var l,u;const _=(0,d.FR)(i.style.linkedIds,n),b=""===_?[]:(0,v.l)(_),w=i.style.modelSrc,x=(0,d.EG)(w,n,i,!0).reduce(((e,t,i)=>null!==t?(e.push(t),e):(e.push(0===i?t:e[i-1]),e)),[]).map((e=>null===e?"":e)).map((i=>{let n=t.modelIndex[i];return void 0===n&&(i=(0,f.mN)(i,null!=a?a:"",r.coords),n=e.addUsedModelByUrl(i)),e.addUsedModel(n),n})),S=[];if(1===x.length)S.push(0);else if(x.length>1){if(!(0,y.Uu)(w)||"step"!==w.type)return void console.error(`Only step-expression is allowed as 'modelSrc' style property depending on zoom. Models won't be displayed for layer ${i.id}`);w.steps.forEach((({key:e})=>{S.push(e)}))}const{tileProps:I,tileAttrs:M}=n,T=null===(l=i.interactive)||void 0===l||l;let E=m.gl;M[I.id]&&!M[I.hovered]&&T&&(E=e.idIndexer.getIndex({id:M[I.id],styleId:t.id,layer:i,sublayer:M[I.db_sublayer]}));let L=-1;M[I.id]&&(L=e.buildingPointIndexer.getIndex(M[I.id]));const A=(0,g.M7)(M[I.db_sublayer])?1:0,C=null!==(u=M[I.building_id])&&void 0!==u?u:"-1",z=e.getBucket("instances","instances",p.E.sinks.instances.packObjectAttributes(t.id,i,x,S,s,n,A,A?(0,c.gQ)(o.x[0],o.y[0],r):void 0),p.E.sinks.instances.binder),k=z.meta;let R;k?k.linkedIds instanceof Array?k.linkedIds.push(...b):k.linkedIds=b:z.meta={linkedIds:b,modelsPath:null!=a?a:"",buildingId:C};const F=function(e,t){const i=e[t.tileProps.direction];if(void 0===i)return null;if(Array.isArray(i))return i;if("Point"===i.type)return i.coordinates;return null}(M,n);if(F){const e=o.x[0],t=o.y[0],i=[0,0,0];(0,c.Z$)(i,[e,t],r),R=[i,(0,h.projectGeoToMap)(F)]}for(let e=0;e<o.x.length;e++)P(z,o.x[e],o.y[e],0,i,n,R,E,L,r)}});function P(e,t,i,a,l,h,m,f,v,g){o.t8(b,t,i,a);const y=(0,c.iq)(g,b)*u.C;s.yR(w),o.t8(I,0,0,0),L((0,d.FR)(l.style.rotation,h),I),o.t8(S,1,1,1),L((0,d.FR)(l.style.scale,h),S),s.jI(w,w,(0,_.Id)(I[2])),s.uD(w,w,(0,_.Id)(I[1])),s.lM(w,w,(0,_.Id)(I[0])),s.bA(w,w,S),m?function(e,t,i){n.lu(T,i,t),s.jI(e,e,Math.atan2(T[1],T[0]));const r=n.kE(T);o.t8(S,r,r,r),s.bA(e,e,S)}(w,m[0],m[1]):(o.t8(S,y,y,y),s.bA(w,w,S)),s.lM(w,w,Math.PI/2),r.xO(x,w),o.t8(M,0,0,0),L((0,d.FR)(l.style.offset,h),M),o.bA(M,M,y),function(e,t,i){(0,c.Z$)(e,e,i),o.IH(e,e,t),(0,c.a2)(e,e,i)}(b,M,g),(0,p.n)(e,b[0],b[1],b[2],x,f,v)}function L(e,t){const i=t;"number"==typeof e?i.fill(e):Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]&&"number"==typeof e[2]&&(i[0]=e[0],i[1]=e[1],i[2]=e[2])}},749:(e,t,i)=>{i.d(t,{B:()=>s});var n=i(5600),o=i(3194),r=i(6273);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.innerId,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 a=n.x,c=n.y,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<a.length;e++)d(u,0,1,2,2,1,3),l(u,a[e],c[e],-1,-1,h),l(u,a[e],c[e],1,-1,h),l(u,a[e],c[e],-1,1,h),l(u,a[e],c[e],1,1,h)},generateTexture(e,t,i,n,o){const r=[-1,1,1,-1],l=[-1,-1,1,1],d=e.getBucket(i.type,"fill",s.sinks.fill.packObjectAttributes(t,i,n,o),s.sinks.fill.binder);let c=d.elements.offset;!function(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}(d.indices,c,0,1,2,0,2,3),a(d,c++,r[0],l[0]),a(d,c++,r[1],l[1]),a(d,c++,r[2],l[2]),a(d,c++,r[3],l[3]),d.elements.offset=c}});function a(e,t,i,n){const o=2*t;e.views.position[o]=i,e.views.position[o+1]=n}function l(e,t,i,n,o,s){const a=e.elements.offset*e.elements.stride,l=a>>1,d=l>>1;e.views.position[l]=r.jO+t,e.views.position[l+1]=r.jO+i,e.views.weight[d]=s,e.views.widen[a]=n,e.views.widen[a+1]=o,e.elements.offset++}function d(e,t,i,n,o,r,s){const{elements:a,indices:l}=e,{buffer:d,offset:c}=l,h=a.offset;d[c]=h+t,d[c+1]=h+i,d[c+2]=h+n,d[c+3]=h+o,d[c+4]=h+r,d[c+5]=h+s,l.offset=c+6}},143:(e,t,i)=>{function n(e,t){return 0===e?0:Math.min(2*e-1,2*(t-e))}i.d(t,{X:()=>n})},8183:(e,t,i)=>{i.d(t,{y:()=>s});var n=i(378),o=i(9090),r=i(4091);function s(e){const t=[],i=(0,r.bu)(e),s=n.I6(e[0],e[e.length-1]),a=s?e.length-1:e.length;for(let n=a-1,r=0,s=1;r<a;r++,n=r-1,s=(r+1)%a){const a=[];(0,o.tG)(a,e[n],e[r],e[s],i),t.push(a)}return s&&t.push(t[0]),t}},4999:(e,t,i)=>{i.d(t,{$Y:()=>d,MD:()=>h,Uu:()=>u,k8:()=>m});var n=i(9218),o=i(7840),r=i(6273),s=i(9090),a=i(6392);const l=[0,0];function d(e,t,i,r,s,a,d){let{textLineHeight:c,textLetterSpacing:h}=s.style;a===o.bR.Icon&&(c=s.style.iconTextLineHeight,h=s.style.iconTextLetterSpacing);const{identifyPoiLabelIndex:u,labelingTextureIndex:m}=t,{lines:_,maxWidth:v}=r,g=c*n.fonts.baseSize;let y=f(1,g,_.length);for(let t=0;t<_.length;t++){const o=_[t].width;let r=0;r=-o/2,l[0]=r,l[1]=y;const s=_[t].glyphs;for(let t=0;t<s.length;t++){const o=s[t];void 0!==o.bitmap&&p(e[o.range],i,l,o,u,m,d),l[0]+=o.advance+n.fonts.baseSize*h}y-=g}}const c=[0,0];function h(e,t,i,o,s,a){const{lines:l,maxWidth:d}=i;if(!l.length)return c[0]=0,c[1]=0,c;const{textLineHeight:h}=o.style,u=h*n.fonts.baseSize,m=-d/2,p=f(1,u,l.length),_=d/2,g=p-(l.length-1)*u;c[0]=s*(m+_)/2,c[1]=s*(p+g)/2;const y=s*r.Jv/2,w=c[0]-y,x=c[0]+y,S=c[1]+y,I=c[1]-y,M=e.elements.offset;return b(e.indices,M,1,0,3,2,3,0),v(e,t,w,S,a),v(e,t,x,S,a),v(e,t,w,I,a),v(e,t,x,I,a),c}function u(e,t,i,n,o,r,s){const a=i[1]+n.top,l=i[0]+n.left,d=a-n.height,c=l+n.width,h=Math.sin(o),u=Math.cos(o),m=l*u-a*h,f=l*h+a*u,p=c*u-a*h,_=c*h+a*u,v=l*u-d*h,y=l*h+d*u,w=c*u-d*h,x=c*h+d*u,S=e.elements.offset;g(e,t,m,f,n.texLeft,n.texTop,r,s),g(e,t,p,_,n.texRight,n.texTop,r,s),g(e,t,v,y,n.texLeft,n.texBottom,r,s),g(e,t,w,x,n.texRight,n.texBottom,r,s),b(e.indices,S,1,0,3,2,3,0)}function m(e,t,i){const n=e.elements.offset,o=(0,s.Tz)(Math.cos(i)),r=(0,s.Tz)(Math.sin(i));y(e,t,o,r,-1,-1),y(e,t,o,r,1,-1),y(e,t,o,r,1,1),y(e,t,o,r,-1,1),b(e.indices,n,0,1,2,2,3,0)}function f(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}function p(e,t,i,n,o,r,s){const a=i[1]+n.top,l=i[0]+n.left,d=a-n.height,c=l+n.width,[h,u]=s,m=e.elements.offset;_(e,t,l,a,n.texLeft,n.texTop,h,u,o,r),_(e,t,c,a,n.texRight,n.texTop,h,u,o,r),_(e,t,l,d,n.texLeft,n.texBottom,h,u,o,r),_(e,t,c,d,n.texRight,n.texBottom,h,u,o,r),b(e.indices,m,1,0,3,2,3,0)}function _(e,t,i,n,o,s,l,d,c,h){const u=e.elements,m=u.stride*u.offset>>1,f=m>>1;e.views.position[m]=r.jO+t[0],e.views.position[m+1]=r.jO+t[1],e.views.position[m+2]=(0,a.VW)(t[2]),e.views.cornerOffset[m]=i,e.views.cornerOffset[m+1]=n,e.views.checkPointOffset[m]=l,e.views.checkPointOffset[m+1]=d,e.views.texCoords[m]=o,e.views.texCoords[m+1]=s,e.views.localID[f]=c,e.views.labelingTextureID[f]=h,u.offset++}function v(e,t,i,n,o){const s=e.elements,l=s.stride*s.offset>>1;e.views.position[l]=r.jO+t[0],e.views.position[l+1]=r.jO+t[1],e.views.position[l+2]=(0,a.VW)(t[2]),e.views.cornerOffset[l]=i,e.views.cornerOffset[l+1]=n,e.views.labelingTextureID[l>>1]=o,s.offset++}function g(e,t,i,n,o,s,l,d){const c=e.elements;let h=c.stride*c.offset>>1;e.views.position[h]=r.jO+t[0],e.views.position[h+1]=r.jO+t[1],e.views.position[h+2]=(0,a.VW)(t[2]),e.views.texCoords[h]=o,e.views.texCoords[h+1]=s,h>>=1,e.views.cornerOffset[h]=i,e.views.cornerOffset[h+1]=n,e.views.styleZoomLimits[h]=l,e.views.styleZoomLimits[h+1]=d,c.offset++}function y(e,t,i,n,o,s){const a=e.elements.stride*e.elements.offset,l=a/e.views.position.BYTES_PER_ELEMENT,d=a/e.views.direction.BYTES_PER_ELEMENT;e.views.position[l]=r.jO+t[0],e.views.position[l+1]=r.jO+t[1],e.views.direction[d]=i,e.views.direction[d+1]=n,e.views.widenDirection[d]=o,e.views.widenDirection[d+1]=s,e.elements.offset++}function b(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}},159:(e,t,i)=>{var n,o,r;i.d(t,{SP:()=>n,gD:()=>o,kU:()=>r}),function(e){e[e.Striped=1]="Striped",e[e.Entrance=2]="Entrance",e[e.Patterned=3]="Patterned"}(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.Butt=1]="Butt",e[e.Round=2]="Round"}(r||(r={}))},8352:(e,t,i)=>{i.d(t,{W:()=>w});var n=i(9090),o=i(159),r=i(6273);const s=-1,a=[.5,.5],l=[.5,.5],d=[.5,.5],c=[.5,.5],h=[0,0],u=[0,0];let m,f,p,_=0,v=0,g=0,y=0;const b={x:0,y:0,xn2:0,yn2:0,xn1:0,yn1:0,patternedLine:!1,noTurn:!0,leftTurn:!1,sharpTurn:!1,reverseTurn:!1,extender:[.5,.5],faExtender:[.5,.5],saExtender:[.5,.5]};function w(e,t,i,l,c,h,b,w,S,L,C,z=!1){let k,R,F,O,D,B,j,N,U,V;if(0!==i)if(p=L,f=C,m=f.indices,v=f.elements.offset,_=0,g=0,y=0,u[0]=e[0],u[1]=t[0],1===i)k=e[0],R=t[0],V=0,A(m,v,0,2,1,1,2,3),P(f,p,0,k,R,1,-1,1,-1,V,!1,s),P(f,p,0,k,R,-1,-1,-1,-1,V,!1,1),P(f,p,0,k,R,1,1,1,1,V,!1,s),P(f,p,0,k,R,-1,1,-1,1,V,!1,1),_+=4;else{switch(F=e[0],O=t[0],D=e[1],B=t[1],V=z?p.cDist:0,l){case o.kU.TileCut:(0,n.AE)(a,F,O,h,b),(0,n.AE)(d,D,B,F,O),U=x(D,B,a[0],a[1],d[0],d[1],z),U.noTurn?M(F,O,d[0],d[1],V):I(0,F,O,a[0],a[1],d[0],d[1],V,z);break;case o.kU.Butt:case o.kU.Round:(0,n.AE)(d,D,B,F,O),M(F,O,d[0],d[1],V),l===o.kU.Round&&I(0,F,O,d[0],d[1],d[0],d[1],V,z);break;default:throw new Error("LoftedLine: unknown Ending Type")}const s=i-1;for(let i=1;i<s;i++){F=e[i-1],O=t[i-1],D=e[i],B=t[i],j=e[i+1],N=t[i+1],u[0]=F,u[1]=O;const o=D-F,s=B-O;V+=Math.sqrt(o*o+s*s)/r.Bq,(0,n.AE)(a,D,B,F,O),(0,n.AE)(d,j,N,D,B),I(i,D,B,a[0],a[1],d[0],d[1],V,z)}F=e[i-2],O=t[i-2],D=e[s],B=t[s];const m=D-F,f=B-O;switch(V+=Math.sqrt(m*m+f*f)/r.Bq,c){case o.kU.TileCut:(0,n.AE)(a,D,B,F,O),(0,n.AE)(d,w,S,D,B),U=x(D,B,a[0],a[1],d[0],d[1],z),U.noTurn?T(s,D,B,d[0],d[1],V):E(s,V,U);break;case o.kU.Butt:case o.kU.Round:(0,n.AE)(d,D,B,F,O),T(s,D,B,d[0],d[1],V),c===o.kU.Round&&I(s,D,B,d[0],d[1],-d[0],-d[1],V,z);break;default:throw new Error("LoftedLine: unknown Ending Type")}}}function x(e,t,i,o,r,s,a){const d=function(e,t,i,n,o,r,s){const a=b;a.x=e,a.y=t,a.xn2=i,a.yn2=n,a.xn1=o,a.yn1=r,a.patternedLine=s;const l=i*o+n*r;return a.noTurn=l>.9999,a.leftTurn=i*-r+n*o<0,a.sharpTurn=l<0,a.reverseTurn=l<-.9999,a}(e,t,i,o,r,s,a);if(d.noTurn||d.reverseTurn)d.extender[0]=0,d.extender[1]=0,d.faExtender[0]=0,d.faExtender[1]=0,d.saExtender[0]=0,d.saExtender[1]=0;else{(0,n.ax)(l,i,o,r,s);const e=l[0],t=l[1];d.extender[0]=e,d.extender[1]=t,d.faExtender[0]=e-2*i,d.faExtender[1]=t-2*o,d.saExtender[0]=e-2*r,d.saExtender[1]=t-2*s}return d}function S(e,t,i,o,r,s,a,d,c){(0,n.ax)(l,o,r,s,a);o*-a+r*s<0?P(f,p,e,t,i,-l[0],-l[1],-l[0],-l[1],d,!1,c):P(f,p,e,t,i,l[0],l[1],l[0],l[1],d,!1,c),_++}function I(e,t,i,o,r,a,l,d,h){const u=x(t,i,o,r,a,l,h);E(e,d,u),function(e,t,i){if(i.noTurn)return;const o=i.sharpTurn?2:1;let r,a;i.reverseTurn||i.patternedLine&&i.sharpTurn?(r=y,a=g):i.leftTurn?(r=g,a=_+o):(r=_+o,a=y);const l=_;if(L(m,v,g,y,l),i.sharpTurn){const e=_+1;i.leftTurn?A(m,v,l,e,r,r,e,a):A(m,v,l,a,e,e,a,r)}else i.leftTurn,L(m,v,l,a,r);const d=i.leftTurn?1: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),S(e,i.x,i.y,i.xn2,i.yn2,c[0],c[1],t,d),S(e,i.x,i.y,c[0],c[1],i.xn1,i.yn1,t,d)):S(e,i.x,i.y,i.xn2,i.yn2,i.xn1,i.yn1,t,d);i.reverseTurn||(i.leftTurn?P(f,p,e,i.x,i.y,-i.xn1,-i.yn1,-i.xn1,-i.yn1,t,!1,d):P(f,p,e,i.x,i.y,i.xn1,i.yn1,i.xn1,i.yn1,t,!1,d),_++);y=a,g=r}(e,d,u),function(e,t,i){if(i.noTurn||i.reverseTurn)return;const n=_+1,o=_;if(i.patternedLine&&i.sharpTurn)return P(f,p,e,i.x,i.y,i.xn2,i.yn2,i.xn2,i.yn2,t,!1,1),P(f,p,e,i.x,i.y,-i.xn2,-i.yn2,-i.xn2,-i.yn2,t,!1,s),_+=2,y=o,void(g=n);i.leftTurn?(P(f,p,e,i.x,i.y,-i.xn1,-i.yn1,i.saExtender[0],i.saExtender[1],t,!1,1),P(f,p,e,i.x,i.y,i.xn1,i.yn1,i.extender[0],i.extender[1],t,!1,s)):(P(f,p,e,i.x,i.y,-i.xn1,-i.yn1,-i.extender[0],-i.extender[1],t,!1,1),P(f,p,e,i.x,i.y,i.xn1,i.yn1,-i.saExtender[0],-i.saExtender[1],t,!1,s));_+=2,i.leftTurn?A(m,v,y,o,g,g,o,n):A(m,v,g,y,n,n,y,o);y=o,g=n}(e,d,u)}function M(e,t,i,n,o){P(f,p,0,e,t,-i,-n,-i,-n,o,!1,1),P(f,p,0,e,t,i,n,i,n,o,!1,s),_+=2,g=1,y=0}function T(e,t,i,n,o,r){const a=_+1,l=_;P(f,p,e,t,i,-n,-o,-n,-o,r,!1,1),P(f,p,e,t,i,n,o,n,o,r,!1,s),_+=2,A(m,v,y,l,g,g,l,a),g=a,y=l}function E(e,t,i){if(i.noTurn)return;const n=_+1,o=_;if(i.reverseTurn||i.patternedLine&&i.sharpTurn?(P(f,p,e,i.x,i.y,-i.xn2,-i.yn2,-i.xn2,-i.yn2,t,!1,1),P(f,p,e,i.x,i.y,i.xn2,i.yn2,i.xn2,i.yn2,t,!1,s)):i.leftTurn?(P(f,p,e,i.x,i.y,-i.xn2,-i.yn2,i.faExtender[0],i.faExtender[1],t,!0,1),P(f,p,e,i.x,i.y,i.xn2,i.yn2,i.extender[0],i.extender[1],t,!0,s)):(P(f,p,e,i.x,i.y,-i.xn2,-i.yn2,-i.extender[0],-i.extender[1],t,!0,1),P(f,p,e,i.x,i.y,i.xn2,i.yn2,-i.faExtender[0],-i.faExtender[1],t,!0,s)),_+=2,A(m,v,y,o,g,g,o,n),y=o,g=n,!i.patternedLine&&!i.reverseTurn){const r=_+1,s=_;i.leftTurn?(P(f,p,e,i.x,i.y,-i.xn2,-i.yn2,-i.xn2,-i.yn2,t,!1,0),P(f,p,e,i.x,i.y,0,0,0,0,t,!1,0),A(m,v,n,o,r,r,o,s)):(P(f,p,e,i.x,i.y,0,0,0,0,t,!1,0),P(f,p,e,i.x,i.y,i.xn2,i.yn2,i.xn2,i.yn2,t,!1,0),A(m,v,o,s,n,n,s,r)),_+=2,y=s,g=r}}function P(e,t,i,s,a,l,d,c,u,m,f,p){const _=e.elements.offset*t.offsetMultiplier,v=_>>1,g=_<<1;if(e.views.position[_]=r.jO+s,e.views.position[_+1]=r.jO+a,e.views.extender[_]=Math.floor(c*r.Gt*127+.5),e.views.extender[_+1]=Math.floor(u*r.Gt*127+.5),t.type===o.SP.Patterned){const t=1e-5;e.views.texture[v]=(t+m)*Math.sign(p)}else if(t.type===o.SP.Striped){const i=e;i.views.texExtender[g]=(0,n.Tz)(l*r.Gt),i.views.texExtender[g+1]=(0,n.Tz)(d*r.Gt),i.views.vertexDistance[v]=m,i.views.objectLength[v]=t.oLen,"componentDistance"in e.views&&(e.views.componentDistance[v]=t.cDist)}else if(t.type===o.SP.Entrance){const s=e,{px:a,py:c,count:u}=t,p=0===i,y=i===u-1,b=p?i:i-1,w=p?i+1:i;(0,n.uI)(h,a[b],c[b],a[w],c[w]),s.views.direction[_]=Math.round(127*h[0]),s.views.direction[_+1]=Math.round(127*h[1]),s.views.type[v]=y?o.gD.LineEnding:o.gD.Line,s.views.texExtender[g]=(0,n.Tz)(l*(f||y?-1:1)*r.Gt),s.views.texExtender[g+1]=(0,n.Tz)(d*(f||y?-1:1)*r.Gt),s.views.vertexDistance[v]=m,s.views.objectLength[v]=t.oLen}e.views.localID[v]=t.localID,e.elements.offset++}function L(e,t,i,n,o){const r=e.buffer,s=e.offset;r[s]=t+i,r[s+1]=t+n,r[s+2]=t+o,e.offset=s+3}function A(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}},2682:(e,t,i)=>{i.d(t,{n:()=>d});var n=i(9450),o=i(6273),r=i(6392);const s=n.Ue(),a=n.Ue(),l=n.Ue();function d(e,t,i,o,r,d,h,u,m,f,p){n.t8(s,t,i,o),n.t8(a,r,d,h),n.lu(l,a,s),n.fS(a,s)||(n.Fv(l,l),n.bA(l,l,127)),function(e,t,i,n,o,r,s){const a=e.indices.buffer,l=e.indices.offset,d=e.elements.offset;a[l]=d+t,a[l+1]=d+i,a[l+2]=d+n,a[l+3]=d+o,a[l+4]=d+r,a[l+5]=d+s,e.indices.offset=l+6}(e,0,1,3,3,1,2),c(e,s,l,1,u,m,f),c(e,s,l,-1,u,m,f),c(e,a,l,-1,u,m,p),c(e,a,l,1,u,m,p)}function c(e,t,i,n,s,a,l){const d=e.elements.offset*e.elements.stride,c=d/e.views.position.BYTES_PER_ELEMENT;if(e.views.position[c]=a?t[0]:o.jO+t[0],e.views.position[c+1]=a?t[1]:o.jO+t[1],"z"in e.views){const i=d/e.views.z.BYTES_PER_ELEMENT;e.views.z[i]=t[2]}else e.views.position[c+2]=a?t[2]:(0,r.VW)(t[2]);if(e.views.directionDistance[d]=i[0],e.views.directionDistance[d+1]=i[1],e.views.directionDistance[d+2]=i[2],e.views.directionDistance[d+3]=n,"demPosition"in e.views){const i=d/e.views.demPosition.BYTES_PER_ELEMENT;s=null!=s?s:t,e.views.demPosition[i]=(a?s[0]:o.jO+s[0])/8,e.views.demPosition[i+1]=(a?s[1]:o.jO+s[1])/8}"absHeight"in e.views&&void 0!==l&&(e.views.absHeight[d/e.views.absHeight.BYTES_PER_ELEMENT]=l),e.elements.offset++}},6563:(e,t,i)=>{i.d(t,{e:()=>g});var n=i(6273),o=i(378),r=i(6490),s=i(9090),a=i(159);const l=o.Ue(),d=o.Ue(),c=o.Ue(),h=o.Ue(),u=o.Ue(),m=o.Ue(),f=o.Ue(),p=o.Ue();let _=0,v=0;function g(e,t,i,n,o,r,d,c,h){if(!(n<2)){if((0,s.uI)(l,t[0],i[0],t[1],i[1]),_=0,o===a.kU.Round){const n=void 0!==c?c[0]:0,o=void 0!==h?h[0]:0;b(e,t[0],i[0],-l[0],-l[1],n,o,d)}for(let o=1;o<n;o++)y(e,t,i,o,n,d,c,h);if(r===a.kU.Round){const o=void 0!==c?c[n-1]:0,r=void 0!==h?h[n-1]:0;b(e,t[n-1],i[n-1],l[0],l[1],o,r,d)}}}function y(e,t,i,a,g,y,x,S){const I=a===g-1;if(o.t8(u,t[a-1],i[a-1]),o.t8(m,t[a],i[a]),void 0!==x&&void 0!==S?(o.t8(c,x[a-1],S[a-1]),o.t8(h,x[a],S[a])):(o.t8(c,0,0),o.t8(h,0,0)),(0,s.fN)(p,l),I)v=0;else{o.t8(f,t[a+1],i[a+1]),(0,s.uI)(d,m[0],m[1],f[0],f[1]);const n=(0,r.uZ)(o.AK(l,d),-1,1);if(n<=0)v=0,b(e,m[0],m[1],l[0],l[1],h[0],h[1],y);else{const e=Math.sqrt((1-n)/(1+n)),t=(0,r.Xx)(o.AK(p,d));v=e*t}}!function(e,t,i,n,o,r,s){const a=e.indices.buffer,l=e.indices.offset,d=e.elements.offset;a[l]=d+t,a[l+1]=d+i,a[l+2]=d+n,a[l+3]=d+o,a[l+4]=d+r,a[l+5]=d+s,e.indices.offset=l+6}(e,0,1,3,3,1,2);const M=p[0]*n.Gt,T=p[1]*n.Gt;w(e,u[0],u[1],(p[0]+l[0]*_)*n.Gt,(p[1]+l[1]*_)*n.Gt,M,T,c[0],c[1],y),w(e,u[0],u[1],(-p[0]-l[0]*_)*n.Gt,(-p[1]-l[1]*_)*n.Gt,-M,-T,c[0],c[1],y),w(e,m[0],m[1],(-p[0]+l[0]*v)*n.Gt,(-p[1]+l[1]*v)*n.Gt,-M,-T,h[0],h[1],y),w(e,m[0],m[1],(p[0]-l[0]*v)*n.Gt,(p[1]-l[1]*v)*n.Gt,M,T,h[0],h[1],y),I||(o.JG(l,d),_=v)}function b(e,t,i,n,o,r,s,a){!function(e,t,i,n){const o=e.indices.buffer,r=e.indices.offset,s=e.elements.offset;o[r]=s+t,o[r+1]=s+i,o[r+2]=s+n,e.indices.offset=r+3}(e,0,1,2);const l=.01*-n,d=.01*-o;w(e,t,i,n+l,o+d,n,o,r,s,a),w(e,t,i,-o+l,n+d,-o,n,r,s,a),w(e,t,i,o+l,-n+d,o,-n,r,s,a)}function w(e,t,i,o,r,s,a,l,d,c){const h=e.elements.offset*e.elements.stride,u=h>>1,m=h>>2;e.views.position[u]=n.jO+t,e.views.position[u+1]=n.jO+i,e.views.extender[h]=127*o,e.views.extender[h+1]=127*r,e.views.normal[h]=127*s,e.views.normal[h+1]=127*a,"shift"in e.views&&(e.views.shift[m]=l,e.views.shift[m+1]=d),"localID"in e.views&&(e.views.localID[m]=c),e.elements.offset++}},3376:(e,t,i)=>{i.d(t,{AN:()=>l,y:()=>a});var n=i(7464),o=i(3194),r=i(309),s=i(9981);function a(e){const t=[];return e.forEach(((e,i)=>{const n=e.length;if(e.length){t[i]=[e[0]];for(let o=1;o<n-1;o+=2)t[i][o]=e[o+1],t[i][o+1]=e[o];n%2==0&&(t[i][n-1]=e[n-1])}})),t}function l(e,t,i,a,l){const d=(0,s.fL)(l);(0,o.EG)(a.textureImage).forEach((o=>{if(!o.length)return;const s=i.byKey[(0,n.FD)(o)];if(!s)return void console.error(`Not found raster set with texture ${o}`);if(!s.isSvg)return;const l=function(e){if((0,n.Uu)(e))return"step"===e.type?e.steps.map((e=>Array.isArray(e.value)||"number"==typeof e.value?e.value:"literalArray"===e.value.type?e.value.array:(console.warn("textureSize only supports shallow step expression"),[0]))):"literalArray"===e.type?[(0,n.pV)(e)]:((0,r.cM)(`Unsupported texture size expression of type "${e.type}". Can't resovle.`),[0]);return[e]}(a.textureSize);l.forEach((i=>{const[n,o]=Array.isArray(i)?i:[i,i];e.atlasPacker.packSvg(s,[{w:n,h:o}],d),s.rasters.forEach((i=>e.atlasPacker.addRastersToLoad(t,i)))}))}))}},8308:(e,t,i)=>{i.d(t,{C:()=>d,b:()=>c});var n=i(143),o=i(9090),r=i(6392),s=i(6273);const a=[.5,.5],l=[.5,.5];function d(e,t,i,r,s,a){let d=e.elements.offset;const c=(0,n.X)(t-1,t);let h=i[c],_=r[c],v=s?s[c]:0;const g=d;for(let c=0;c<t;c++){const b=(0,n.X)(c,t),w=c===t-1,x=i[b],S=r[b],I=s?s[b]:w?0:1;0!==v&&((0,o.uI)(l,h,_,x,S),y(e,d,I,w?g:d+4),m(e,d,h,_,x,S),a?u(e,d,a[0],a[1],a[0],a[1]):u(e,d,h,_,x,S),(0,o.af)(l),f(e,d,l),p(e,d,l),d+=4),h=x,_=S,v=I}e.elements.offset=d}function c(e,t,i,r,s,d,c){let u=e.elements.offset;const m=(0,n.X)(t-2,t),f=(0,n.X)(t-1,t);let p=i[f],b=r[f],w=s?s[m]:1,x=s?s[f]:0;(0,o.AE)(a,i[m],r[m],p,b);let S=a[0],I=a[1];for(let m=0;m<t;m++){const f=(0,n.X)(m,t),M=m===t-1,T=i[f],E=r[f],P=s?s[f]:M?0:1;(0,o.uI)(l,p,b,T,E);const L=l[1],A=-l[0];0!==w&&(0===x?(a[0]=S,a[1]=I):h(a,S,I,L,A),(0,o.m2)(l,S,I,a[0],a[1]),y(e,u,0,0),_(e,u,p,b,d,null!=c?c:[p,b]),v(e,u,(0,o.af)(a),(0,o.af)(l)),g(e,u),u+=4),p=T,b=E,w=x,x=P,S=L,I=A}e.elements.offset=u}function h(e,t,i,n,o){let r,s,a;t*n+i*o>0?(r=t+n,s=i+o,a=1/Math.sqrt(r*r+s*s),e[0]=r*a,e[1]=s*a):(r=o-i,s=t-n,0!==r&&0!==s?(a=1/Math.sqrt(r*r+s*s),e[0]=r*a,e[1]=s*a):(e[0]=0,e[1]=0))}function u(e,t,i,n,o,r){const a=e.views.demPosition,l=e.elements.stride/a.BYTES_PER_ELEMENT;t*=l,i=(i+s.jO)/8,n=(n+s.jO)/8,o=(o+s.jO)/8,r=(r+s.jO)/8,a[t]=i,a[t+1]=n,a[t+=l]=i,a[t+1]=n,a[t+=l]=o,a[t+1]=r,a[t+=l]=o,a[t+1]=r}function m(e,t,i,n,o,r){const{position:a,distance:l}=e.views,d=e.elements.stride/a.BYTES_PER_ELEMENT;a[t*=d]=s.jO+i,a[t+1]=s.jO+n,a[t+2]=0,l[t]=0,a[t+=d]=s.jO+i,a[t+1]=s.jO+n,a[t+2]=0,l[t]=-32767,a[t+=d]=s.jO+o,a[t+1]=s.jO+r,a[t+2]=0,l[t]=-32767,a[t+=d]=s.jO+o,a[t+1]=s.jO+r,a[t+2]=0,l[t]=0}function f(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[0],e.views.normals[t+1]=i[1],e.views.normals[t+2]=0,e.views.normals[t+3]=0,t+=n}function p(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[0],e.views.direction[t+1]=i[1],e.views.direction[t+2]=0,e.views.direction[t+3]=0,t+=n}function _(e,t,i,n,o,a){const l=e.elements.stride/e.views.position.BYTES_PER_ELEMENT;t*=l,e.views.position[t]=s.jO+i,e.views.position[t+1]=s.jO+n,e.views.position[t+2]=0,e.views.distance[t]=32767,e.views.demPosition[t]=(s.jO+a[0])/8,e.views.demPosition[t+1]=(s.jO+a[1])/8,t+=l,e.views.position[t]=s.jO+i,e.views.position[t+1]=s.jO+n,e.views.position[t+2]=0,e.views.distance[t]=-32767,e.views.demPosition[t]=(s.jO+a[0])/8,e.views.demPosition[t+1]=(s.jO+a[1])/8,t+=l,e.views.position[t]=s.jO+i,e.views.position[t+1]=s.jO+n,e.views.position[t+2]=(0,r.VW)(o),e.views.distance[t]=-32767,e.views.demPosition[t]=(s.jO+a[0])/8,e.views.demPosition[t+1]=(s.jO+a[1])/8,t+=l,e.views.position[t]=s.jO+i,e.views.position[t+1]=s.jO+n,e.views.position[t+2]=(0,r.VW)(o),e.views.distance[t]=32767,e.views.demPosition[t]=(s.jO+a[0])/8,e.views.demPosition[t+1]=(s.jO+a[1])/8}function v(e,t,i,n){const o=e.elements.stride/e.views.normals.BYTES_PER_ELEMENT;t*=o;for(let r=0;r<4;r++)e.views.normals[t]=i[0],e.views.normals[t+1]=i[1],e.views.normals[t+2]=n[0],e.views.normals[t+3]=n[1],t+=o}function g(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+2]=127,t+=i}function y(e,t,i,n){const o=e.indices.buffer;let r=e.indices.offset;o[r++]=t,o[r++]=t+1,o[r++]=t+3,o[r++]=t+3,o[r++]=t+1,o[r++]=t+2,0!==i&&(o[r++]=t+2,o[r++]=n+1,o[r++]=n+0),e.indices.offset=r}},1558:(e,t,i)=>{i.d(t,{y:()=>s});var n=i(6392),o=i(143),r=i(6273);function s(e,t,i,n,r,s,h,u,m){let f=e.elements.offset;for(let p=0;p<t;p++){const _=(0,o.X)(p,t),v=p===t-1;if(r&&1===r[_]||!r&&!v){const r=i[_],v=n[_],g=(p+1)%t,y=(0,o.X)(g,t),b=i[y],w=n[y];c(e,f),a(e,f,r,v,b,w,s),m?l(e,f,m[0],m[1],m[0],m[1]):l(e,f,r,v,b,w),void 0!==h&&"localID"in e.views&&void 0!==e.views.localID&&d(e.views.localID,f,h,e.elements.stride),void 0!==u&&"labelingTextureID"in e.views&&void 0!==e.views.labelingTextureID&&d(e.views.labelingTextureID,f,u,e.elements.stride),f+=4}}e.elements.offset=f}function a(e,t,i,o,s,a,l){const d=e.views.position,c=e.elements.stride/d.BYTES_PER_ELEMENT;d[t*=c]=r.jO+i,d[t+1]=r.jO+o,d[t+2]=0,d[t+=c]=r.jO+i,d[t+1]=r.jO+o,d[t+2]=(0,n.VW)(l),d[t+=c]=r.jO+s,d[t+1]=r.jO+a,d[t+2]=0,d[t+=c]=r.jO+s,d[t+1]=r.jO+a,d[t+2]=(0,n.VW)(l)}function l(e,t,i,n,o,s){const a=e.views.demPosition,l=e.elements.stride/a.BYTES_PER_ELEMENT;t*=l,i=(i+r.jO)/8,n=(n+r.jO)/8,o=(o+r.jO)/8,s=(s+r.jO)/8,a[t]=i,a[t+1]=n,a[t+=l]=i,a[t+1]=n,a[t+=l]=o,a[t+1]=s,a[t+=l]=o,a[t+1]=s}function d(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 c(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}},5597:(e,t,i)=>{i.d(t,{jh:()=>ne,PA:()=>he,XI:()=>se,kF:()=>ae,Pn:()=>me,SV:()=>ue,Eu:()=>ce,vP:()=>de});var n=i(8009),o=i(5600),r=i(6563),s=i(2702),a=i(159),l=i(3194);const d=(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)=>(0,s.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,o){const{tileAttrs:s,tileProps:c}=n,h=!Number.isNaN(s[c.beginningIsCut])&&0!==s[c.beginningIsCut],u=!Number.isNaN(s[c.endingIsCut])&&0!==s[c.endingIsCut],m=(0,l.FR)(i.ignoreTier,n)?null:n.tileAttrs[c.db_tiers],f=e.getBucket(i.type,"solid",d.sinks.solid.packObjectAttributes(t,i,m,n),d.sinks.solid.binder);(0,r.e)(f,o.x,o.y,o.x.length,h?a.kU.TileCut:a.kU.Round,u?a.kU.TileCut:a.kU.Round,0,o.normal_x,o.normal_y)}});var c=i(5970),h=i(3097),u=i(1678),m=i(4389),f=i(871),p=i(6195),_=i(6263),v=i(2097),g=i(6392),y=i(9073),b=i(4999),w=i(9218),x=i(6490),S=i(6273),I=i(7293);const M=[0,0,0],T=[0,0],E=(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,o,r)=>(0,s.L)([e.styleId,e.layer.innerId,t,i,n,o],r),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],range:e[3],fontIndex:e[4],tiers:e[5],tileData:e.slice(6)})}},processElement(e,t,i,n,o,r,s){var a;const{label:d,anchorPosition:c,anchorSegmentIndex:h,halfLabelWidth:u,layer:m}=i;if("labelLine"!==m.type)return;const{axis:f}=d,{center:p,styleZoom:_}=r,v=(0,l.bs)(_,r.styleState,!1,d.tileData),P=(0,l.Q9)(m.style.textFont,v),L=null!==(a=e.fontNameToIndex[P])&&void 0!==a?a:e.fontNameToIndex[S.Uo],A={},C=(0,l.FR)(m.ignoreTier,v)?null:d.tiers;for(const e of d.ranges)A[e]=t.getBucket("labelLine","raster",E.sinks.raster.packObjectAttributes(d,n,e,L,null!=C?C:null,(0,I.u)(d.tileData,m)),E.sinks.raster.binder);const z=d.textMetrics.lines[0],k=(0,l.vn)(m.style.textFontSize,v)/w.fonts.baseSize,R=z.glyphs,F=function(e,t,i,n){const o=e.interpolate(t-i,e.getSegmentIndex(t-i)),r=e.interpolate(t+i,e.getSegmentIndex(t+i)),s=Math.atan2(r[1]-o[1],r[0]-o[0])-n;return Math.cos(s)<0}(f,c,u,r.rotation);T[0]=-z.width/2,T[1]=0;for(let e=0;e<R.length;e++){const t=R[e],n=(T[0]+t.left+t.width/2)*k*(F?-1:1),o=(0,x.Xx)(n)||1;let r=-1/0,a=1/0;for(let e=h;e>=1&&e<f.vertexCount&&!(a<i.overflowStyleZoom);e+=o,a=r){const l=1===o?e:e-1;r=(0,y.X$)((0,y.to)(n,f.lengths[l]-c),p);const d=f.interpolate(c,e);(0,g.a2)(M,d,s),(0,g.hm)(M)&&void 0!==t.bitmap&&(0,b.Uu)(A[t.range],M,T,t,d[3]+(F?Math.PI:0),Math.max(r,i.overflowStyleZoom),a)}T[0]+=t.advance+w.fonts.baseSize*m.style.textLetterSpacing}},getLabelingInfo(){}});const P=[0,0,0],L=(0,o.D)({symbol:"oneWayLine",sinks:{raster:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.direction=new Int8Array(t,8),e.views.widenDirection=new Int8Array(t,10)},packObjectAttributes:(e,t,i)=>(0,s.L)([e.styleId,e.layer.innerId,t,i],e.tileData),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],tiers:e[3],tileData:e.slice(4)})}},processElement(e,t,i,n,o,r,s){var a;const{label:l,anchorWorld:d}=i;if((0,g.a2)(P,d,s),!(0,g.hm)(P))return;const c=t.getBucket("oneWayLine","raster",L.sinks.raster.packObjectAttributes(l,n,null!==(a=l.tiers)&&void 0!==a?a:null),L.sinks.raster.binder);(0,b.k8)(c,P,d[3])},getLabelingInfo(){}});var A=i(7840),C=i(749),z=i(4922),k=i(4333),R=i(6201);const F=(e,t,i,n,o,r,s)=>{const a={type:R.R2.Line,styleId:t,layerId:i.innerId,sourceId:o,tileCoords:n,id:r.tileAttrs[r.tileProps.id],componentDistanceStart:(0,R.hs)(r.tileAttrs[r.tileProps.componentDistanceStart],0),componentDistanceEnd:(0,R.hs)(r.tileAttrs[r.tileProps.componentDistanceEnd],0),objectLength:(0,R.hs)(r.tileAttrs[r.tileProps.objectLength],0),labelPriority:(0,R.hs)(r.tileAttrs[r.tileProps.db_label_priority],0),styleIconPriority:(0,l.vn)(i.style.textPriority,r),styleTextPriority:(0,l.vn)(i.style.textPriority,r),vertices:[s.x,s.y],tileData:[...r.tileData],tiers:(0,l.FR)(i.ignoreTier,r)?void 0:r.tileAttrs[r.tileProps.db_tiers]};e.addLabel(a)},O=(e,t,i,n,o,r,s)=>{const{tileProps:a,tileAttrs:d}=r,c=(0,l.FR)(i.ignoreTier,r)?null:d[a.db_tiers],h={type:R.R2.OneWayLine,styleId:t,layerId:i.innerId,sourceId:o,tileCoords:n,id:r.tileAttrs[r.tileProps.id],componentDistanceStart:(0,R.hs)(r.tileAttrs[r.tileProps.componentDistanceStart],0),componentDistanceEnd:(0,R.hs)(r.tileAttrs[r.tileProps.componentDistanceEnd],0),objectLength:(0,R.hs)(r.tileAttrs[r.tileProps.objectLength],0),labelPriority:(0,R.hs)(r.tileAttrs[r.tileProps.db_label_priority],0),styleIconPriority:(0,l.vn)(i.style.priority,r),styleTextPriority:0,vertices:[s.x,s.y],tileData:[...r.tileData],tiers:c};e.addLabel(h)};var D=i(7407),B=i(8965),j=i(1573),N=i(3642),U=i(3698),V=i(9981),G=i(7464),H=i(5549);const Z=(0,o.D)({symbol:"metricPoint",sinks:{fill:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.texCoords=new Uint16Array(t,4)},packObjectAttributes:function(e,t,i,n){return(0,s.v)([e,t.innerId,i],t,n)},unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,o,r,s){!function(e,t,i,n,o){const{rasterSets:r}=t,s=(0,V.fL)(n);(0,l.EG)(i.style.iconImage).forEach((n=>{if(!n.length)return;const a=r.byKey[(0,G.FD)(n)];if(!a)return void console.error(`Not found raster set with texture ${n}`);if(!a.isSvg)return;const d=(0,l.vn)(i.style.width,o),c=(0,l.vn)(i.style.height,o),h=(0,H.N5)(d,c),u=d*h,m=c*h;e.atlasPacker.packSvg(a,[{w:u,h:m}],s),a.rasters.forEach((i=>e.atlasPacker.addRastersToLoad(t.id,i)))}))}(e,n,o,i,r);const a=(0,l.vn)(o.style.width,r),d=(0,l.vn)(o.style.height,r),c=(0,l.vn)(o.style.rotation,r),[h,u]=(0,H.DR)([t.x,t.y],a,d,c,s),m=(0,l.FR)(o.ignoreTier,r)?null:r.tileAttrs[r.tileProps.db_tiers],f=e.getBucket("metricPoint","fill",Z.sinks.fill.packObjectAttributes(n.id,o,m,r),Z.sinks.fill.binder);let p=f.elements.offset;!function(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}(f.indices,p,0,1,2,0,2,3),W(f,p++,h[0],u[0],0,0),W(f,p++,h[1],u[1],1,0),W(f,p++,h[2],u[2],1,1),W(f,p++,h[3],u[3],0,1),f.elements.offset=p}});function W(e,t,i,n,o,r){t*=4,e.views.position[t]=S.jO+i,e.views.position[t+1]=S.jO+n,e.views.texCoords[t]=(0,U.Bb)(o),e.views.texCoords[t+1]=(0,U.Bb)(r)}var X=i(8290),K=i(378),q=i(9450),$=i(127),Y=i(3672),J=i(9090);const Q=[0,0,0],ee=[0,0,0],te=new Float64Array(16),ie=(0,o.D)({symbol:"tunnel",sinks:{},generate(e,t,i,n,o,r,s,a){var l,d,c;const{tileProps:h,tileAttrs:u}=n,m=null===(l=u[h.db_tiers])||void 0===l?void 0:l[0];if("70030076221371399"!==(0,Y.Ak)(u[h.id]))return;if(!m)return;const f=t.id;K.t8(Q,0,0);const p=(0,g.iq)(r,Q)*y.C,_=S.Bq/r.size*p,v=1/(S.Bq/r.size),b=u[h.objectLength],w=null!==(d=u[h.componentDistanceStart])&&void 0!==d?d:0,I=null!==(c=u[h.componentDistanceEnd])&&void 0!==c?c:0,M=0===w?0:-5,T=I===b?0:-5;if(Number.isNaN(b)||Number.isNaN(w)||0===b)return void 0;const E=175+68*w/b,P=175+68*I/b,L=3.5*_,A=5*_,C=[];let z=0;for(let e=0;e<o.x.length;e++){const t=[o.x[e],o.y[e],0];e>0&&(z+=K.TK(t,C[e-1]),t[2]=z),C.push(t)}const k=function(e){let t=0;for(let i=0;i<e.length-1;i++)t+=K.TE(e[i],e[i+1]);return t}(C),R=(0,j.tS)(C);C.forEach((e=>{const t=e[2]/k;e[2]=(M+t*(T-M))*p,e[5]=(E+t*(P-E))*p}));const F=B.j.sinks.stroke.packObjectAttributes(f,i,B.z.side,!0,n),O=(0,j.$V)(C,R,L),D=(0,j.$V)(C,R,-L),U=(0,j.kF)(O,D),V=(0,j.$V)(C,R,A),G=V.map((e=>{const t=e.slice();return t[2]=Math.max(0,t[2]),t}));B.j.generate(e,f,i,B.z.side,n,(0,j.In)((0,j.kF)(V,G)),r,s,a,void 0,!0);const H=(0,j.$V)(C,R,-A),Z=H.map((e=>{const t=e.slice();return t[2]=Math.max(0,t[2]),t}));B.j.generate(e,f,i,B.z.side,n,(0,j.In)((0,j.kF)(Z,H)),r,s,a,void 0,!0),0!==C[0][2]&&0!==C[C.length-1][2]&&B.j.generate(e,f,i,B.z.side,n,(0,j.In)((0,j.kF)(G,Z)),r,s,a,void 0,!0);do{N._.generate(e,f,i,n,(0,j.In)(U),m,r,void 0)}while(e.isOverloaded());for(let t=1;t<C.length;t++){const o=[],l=[],d=C[t-1],c=C[t],h=R[t-1],u=R[t];for(let e=0;e<=181;e+=15){const t=(0,x.Id)(e),i=d.slice();q.t8(Q,h[0],h[1],0),q.bA(Q,Q,L),(0,J.fN)(ee,Q),$.Us(te,-t,ee),q.fF(Q,Q,te),Q[2]*=v,q.IH(i,i,Q),o.push(i);const n=c.slice();q.t8(Q,u[0],u[1],0),q.bA(Q,Q,L),(0,J.fN)(ee,Q),$.Us(te,-t,ee),q.fF(Q,Q,te),Q[2]*=v,q.IH(n,n,Q),l.push(n)}const m=(0,j.kF)(o,l);if(B.j.generate(e,f,i,B.z.side,n,(0,j.In)(m),r,s,a,void 0,!1),1===t&&0===C[0][2]){(0,j.m5)(e,F,o);const t=C[0].slice(),l=C[0].slice(),d=R[0].slice(),c=R[0].slice();K.bA(d,d,A),K.bA(c,c,-A),K.IH(t,t,d),K.IH(l,l,c);const h=t.slice(),u=l.slice();h[2]+=A*v,u[2]+=A*v;const m=[t];for(let e=0;e<5;e++)m.push(h);for(let e=0;e<5;e++)m.push(u);m.push(l),(0,j.m5)(e,F,m),B.j.generate(e,f,i,B.z.side,n,(0,j.In)((0,j.kF)(m,o)),r,s,a,void 0,!1)}else if(t===C.length-1&&0===C[C.length-1][2]){(0,j.m5)(e,F,l);const t=C[C.length-1].slice(),o=C[C.length-1].slice(),d=R[C.length-1].slice(),c=R[C.length-1].slice();K.bA(d,d,A),K.bA(c,c,-A),K.IH(t,t,d),K.IH(o,o,c);const h=t.slice(),u=o.slice();h[2]+=A*v,u[2]+=A*v;const m=[t];for(let e=0;e<5;e++)m.push(h);for(let e=0;e<5;e++)m.push(u);m.push(o),(0,j.m5)(e,F,m),B.j.generate(e,f,i,B.z.side,n,(0,j.In)((0,j.kF)(l,m)),r,s,a,void 0,!1)}}if(0===C[0][2]||0===C[C.length-1][2]){const t=(0,j.$V)(C,R,A),o=(0,j.$V)(C,R,-A),l=t.map((e=>{const t=e.slice();return t[2]=Math.max(0,t[2]+A*v),t})),d=o.map((e=>{const t=e.slice();return t[2]=Math.max(0,t[2]+A*v),t}));t.forEach((e=>{e[2]=Math.max(0,e[2])})),o.forEach((e=>{e[2]=Math.max(0,e[2])}));const c=(0,j.kF)(t,l),h=(0,j.kF)(d,o);(0,j.m5)(e,F,t),(0,j.m5)(e,F,o),(0,j.m5)(e,F,l),(0,j.m5)(e,F,d),B.j.generate(e,f,i,B.z.side,n,(0,j.In)(c),r,s,a,void 0,!1),B.j.generate(e,f,i,B.z.side,n,(0,j.In)(h),r,s,a,void 0,!1);const u=(0,j.kF)(l,d);B.j.generate(e,f,i,B.z.top,n,(0,j.In)(u),r,s,a,void 0,!1)}}});var ne,oe=i(173),re=i(3024);function se({collector:e,generator:t,args:i}){do{t(e,...i)}while(e.isOverloaded())}!function(e){e[e.none=0]="none",e[e.fadeIn=1]="fadeIn",e[e.fadeOut=-1]="fadeOut"}(ne||(ne={}));const ae={arrow:m.l,line:n.z,polygon:v.a,embankment:B.j,metricPoint:Z,labelLine:E,lineExtrusion:p.Q,polygonExtrusion:c.p,oneWayLine:L,dashedLine:h.L,shiftedLine:d,circle:f.p,buildingModel:u.X,gltfModel:D.m,point:A.uF,raster:_.h,heatmap:C.B,dem:z._,mesh:B.j,mapMesh:N._,overpass:j.tw,tunnel:ie,instances:X.E},le={labelLine:E,oneWayLine:L,point:A.uF};function de(e,t){const i=ae[e];return i?i.sinks[t].stride:0}function ce(e,t){e.precomputes.forEach(((e,i)=>{t.tileData[i]=(0,l.FR)(e.expr,t)}))}function he(e,t,i,o,r,s,a,u,f,_,g,y){i.forEach((i=>{if((0,oe.b8)(o,[_.x[0],_.y[0]]),(void 0===s||!(i.maxzoom<=s||i.minzoom>=s+1&&s!==w.tiles.maxDetailLevel))&&(!o.tileProps.hovered||Number.isNaN(o.tileAttrs[o.tileProps.hovered])||1!==o.tileAttrs[o.tileProps.hovered]||"polygon"===i.type||"polygonExtrusion"===i.type||"point"===i.type)){ce(i,o);do{switch(i.type){case"line":const s=(0,l.FR)(i.style.pattern,o);s&&s[0]!==re.y.None?n.z.generatePatterned(e,t.id,i,o,u,_):n.z.generate(e,t.id,i,o,u,_);break;case"dashedLine":h.L.generate(e,t.id,i,o,u,_);break;case"shiftedLine":d.generate(e,t.id,i,o,_);break;case"polygon":v.a.generate(e,t.id,i,o,_,f,t.rasterSets);break;case"embankment":B.j.generate(e,t.id,i,B.z.top,o,_,u,f,t.rasterSets,void 0,!1);break;case"metricPoint":Z.generate(e,_,f,t,i,o,u);break;case"polygonExtrusion":c.p.generate(e,t.id,i,o,_,!0);break;case"labelLine":F(e,t.id,i,u.coords,a,o,_);break;case"oneWayLine":O(e,t.id,i,u.coords,a,o,_);break;case"point":(0,k.p)(e,t,i,o,r,u.coords,a,_,f,g,void 0);break;case"lineExtrusion":p.Q.generate(e,t.id,i,o,_);break;case"arrow":m.l.generate(e,t.id,i,o,_);break;case"heatmap":C.B.generate(e,t.id,i,_,o);break;case"gltfModel":D.m.generateInstanced(e,t,i,o,_,u,a,y);break;case"overpass":j.tw.generate(e,t,i,o,_,u,f,t.rasterSets);break;case"tunnel":ie.generate(e,t,i,o,_,u,f,t.rasterSets)}}while(e.isOverloaded())}}))}function ue(e,t,i,n,o,r,s,a){const l=le[t.type];if(l)do{l.processElement(e,i,n,o,r,s,a)}while(i.isOverloaded())}function me(e,t,i,n,o,r,s){const a=le[n.type];a&&a.getLabelingInfo(e,t,i,o,r,s)}},8290:(e,t,i)=>{i.d(t,{E:()=>a,n:()=>l});var n=i(5600),o=i(2702),r=i(6273),s=i(6392);const a=(0,n.D)({symbol:"instances",sinks:{instances:{stride:52,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.matrix=new Float32Array(t,8),e.views.localID=new Uint32Array(t,44),e.views.labelingTextureID=new Uint32Array(t,48)},packObjectAttributes:(e,t,i,n,r,s,a,l=[])=>(0,o.v)([e,t.innerId,i,l,a,r,n],t,s),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],modelIndices:e[2],lngLat:e[3],isCommModel:e[4],sourceId:e[5],modelZooms:e[6],tileData:e.slice(7)})}}});function l(e,t,i,n,o,l,d){const c=e.elements.offset*a.sinks.instances.stride,h=e.views,u=c/h.position.BYTES_PER_ELEMENT;h.position[u]=r.jO+t,h.position[u+1]=r.jO+i,h.position[u+2]=(0,s.VW)(n),h.matrix.set(o,c/h.matrix.BYTES_PER_ELEMENT),h.localID[c/h.localID.BYTES_PER_ELEMENT]=l,h.labelingTextureID[c/h.labelingTextureID.BYTES_PER_ELEMENT]=d;const m=e.indices;m.buffer[m.offset]=e.elements.offset,m.offset++,e.elements.offset++}},8009:(e,t,i)=>{i.d(t,{z:()=>h});var n=i(5600),o=i(6563),r=i(2702),s=i(6659),a=i(3194),l=i(159),d=i(6273),c=i(8352);const h=(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)=>(0,r.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})},patterned:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.extender=new Int16Array(t,4),e.views.texture=new Float32Array(t,8),e.views.localID=new Uint32Array(t,12)},packObjectAttributes:(e,t,i,n)=>(0,r.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,r,d){const c=(0,s.I)((0,a.FR)(i.style.geometryModifier,n),r,d,n);if(null===c)return;const{tileAttrs:u,tileProps:m}=n,p=e.idIndexer.getIndex({id:u[m.id],styleId:t,layer:i,sublayer:u[m.db_sublayer]}),_=(0,a.FR)(i.ignoreTier,n)?null:n.tileAttrs[m.db_tiers],v=e.getBucket(i.type,"solid",h.sinks.solid.packObjectAttributes(t,i,_,n),h.sinks.solid.binder),g=!Number.isNaN(u[m.beginningIsCut])&&0!==u[m.beginningIsCut],y=!Number.isNaN(u[m.endingIsCut])&&0!==u[m.endingIsCut],b=(0,a.Q9)(i.style.startCap,n),w=(0,a.Q9)(i.style.endCap,n);(0,o.e)(v,c.x,c.y,c.x.length,g?l.kU.TileCut:f(b),y?l.kU.TileCut:f(w),p)},generatePatterned(e,t,i,n,o,r){const u=(0,s.I)((0,a.FR)(i.style.geometryModifier,n),o,r,n);if(null===u)return;const{tileAttrs:p,tileProps:_}=n,v=(0,a.FR)(i.ignoreTier,n)?null:n.tileAttrs[_.db_tiers],g=e.getBucket("line","patterned",h.sinks.patterned.packObjectAttributes(t,i,v,n),h.sinks.patterned.binder),y=e.idIndexer.getIndex({id:p[_.id],styleId:t,layer:i,sublayer:p[_.db_sublayer]}),b=m(p[_.componentDistanceStart]/d.Bq,p[_.componentDistanceEnd]/d.Bq,p[_.objectLength]/d.Bq,y),w=!Number.isNaN(p[_.beginningIsCut])&&0!==p[_.beginningIsCut],x=!Number.isNaN(p[_.endingIsCut])&&0!==p[_.endingIsCut],S=(0,a.Q9)(i.style.startCap,n),I=(0,a.Q9)(i.style.endCap,n);(0,c.W)(u.x,u.y,u.x.length,w?l.kU.TileCut:f(S),x?l.kU.TileCut:f(I),p[_.previousPointX],p[_.previousPointY],p[_.nextPointX],p[_.nextPointY],b,g,!0)}}),u={type:l.SP.Patterned,cDist:0,sLen:0,oLen:0,localID:0,offsetMultiplier:8,px:[],py:[],count:0};function m(e,t,i,n){return u.cDist=e,u.sLen=t-e,u.oLen=i,u.localID=n,u}function f(e){switch(e){case"round":return l.kU.Round;case"tilecut":return l.kU.TileCut;default:return l.kU.Butt}}},6195:(e,t,i)=>{i.d(t,{Q:()=>v});var n=i(5600),o=i(378),r=i(1558),s=i(2682),a=i(8308),l=i(2702),d=i(6392);const c=o.Ue(),h=o.Ue(),u=o.Ue(),m=o.Ue(),f=(e,t,i)=>(0,l.v)([e,t.innerId],t,i),p=e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)}),_=(0,d.d1)(1),v=(0,n.D)({symbol:"lineExtrusion",sinks:{fill:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.demPosition=new Int16Array(t,8)},packObjectAttributes:f,unpackObjectAttributes:p},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:f,unpackObjectAttributes:p},sideStroke:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.distance=new Int16Array(t,6),e.views.normals=new Int8Array(t,8),e.views.direction=new Int8Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:f,unpackObjectAttributes:p}},generate(e,t,i,n,l){const d=l.x,f=l.y,p=d.length,g=e.getBucket(i.type,"fill",v.sinks.fill.packObjectAttributes(t,i,n),v.sinks.fill.binder),y=e.getBucket(i.type,"topStroke",v.sinks.topStroke.packObjectAttributes(t,i,n),v.sinks.topStroke.binder),b=e.getBucket(i.type,"sideStroke",v.sinks.sideStroke.packObjectAttributes(t,i,n),v.sinks.sideStroke.binder);for(let e=0;e<p-1;e++){const t=d[e],i=f[e],n=d[e+1],l=f[e+1];o.t8(c,t,n),o.t8(h,i,l),o.t8(u,n,t),o.t8(m,l,i),(0,r.y)(g,2,c,h,void 0,_),(0,s.n)(y,t,i,_,n,l,_),(0,a.C)(b,2,c,h,void 0),(0,a.C)(b,2,u,m,void 0),(0,a.b)(b,2,c,h,void 0,_)}o.t8(c,d[p-1],d[0]),o.t8(h,f[p-1],f[0]),(0,a.b)(b,2,c,h,void 0,_)}})},3642:(e,t,i)=>{i.d(t,{_:()=>u});var n=i(9450),o=i(5600),r=i(2702),s=i(6273),a=i(9090);const l=[0,0,0],d=[0,0,0],c=[0,0,0],h=[0,0,0],u=(0,o.D)({symbol:"mapMesh",sinks:{fill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.z=new Float32Array(t,4),e.views.extender=new Int16Array(t,8),e.views.normal=new Int8Array(t,12),e.views.gradient=new Int8Array(t,15),e.views.demPosition=new Int16Array(t,16),e.views.absHeight=new Float32Array(t,16)},packObjectAttributes:(e,t,i,n,o)=>(0,r.v)([e,t.innerId,i,n],t,o),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],meshTier:e[2],absHeight:e[3],tileData:e.slice(4)})}},generate(e,t,i,o,r,p,_,v){var g;const y=r.x,b=r.y,w=null!==(g=r.signed_z)&&void 0!==g?g:[],x=r.gradient,S=r.abs_height,I=y.length,M=null==v?void 0:v[0],T=null==v?void 0:v[1];if(I<3)return;const E=s.Bq/_.size,P=e.getBucket("mapMesh","fill",u.sinks.fill.packObjectAttributes(t,i,p,!!S,o),u.sinks.fill.binder),L=P.indices.buffer;let A=P.indices.offset;const C=P.elements.offset;for(let e=2;e<I;e++){const t=!(e%2),i=t?e-2:e-1,o=t?e-1:e-2;m(L,A,C,3*(e-2)+2),n.t8(c,y[i],b[i],w[i]*E),n.t8(d,y[o],b[o],w[o]*E),n.t8(l,y[e],b[e],w[e]*E),(0,a.Cb)(h,c,d,l),f(P,y[i],b[i],w[i],null==x?void 0:x[i],null==S?void 0:S[i],h,M,T),f(P,y[o],b[o],w[o],null==x?void 0:x[o],null==S?void 0:S[o],h,M,T),f(P,y[e],b[e],w[e],null==x?void 0:x[e],null==S?void 0:S[e],h,M,T),A+=3}P.indices.offset=A}});function m(e,t,i,n){e[t]=i+n-2,e[t+1]=i+n-1,e[t+2]=i+n}function f(e,t,i,n,o,r,l,d=t,c=i){const h=e.elements.offset*e.elements.stride,u=h/e.views.position.BYTES_PER_ELEMENT,m=h/e.views.normal.BYTES_PER_ELEMENT,f=h/e.views.demPosition.BYTES_PER_ELEMENT;e.views.position[u]=s.jO+t,e.views.position[u+1]=s.jO+i,e.views.z[h/e.views.z.BYTES_PER_ELEMENT]=n,e.views.normal[m]=(0,a.Tz)(l[0]),e.views.normal[m+1]=(0,a.Tz)(l[1]),e.views.normal[m+2]=(0,a.Tz)(l[2]),e.views.gradient[h/e.views.gradient.BYTES_PER_ELEMENT]=null!=o?o:0,e.views.demPosition[f]=(s.jO+d)/8,e.views.demPosition[f+1]=(s.jO+c)/8,void 0!==r&&(e.views.absHeight[h/e.views.absHeight.BYTES_PER_ELEMENT]=r),e.elements.offset++}},8965:(e,t,i)=>{i.d(t,{j:()=>v,z:()=>n});var n,o=i(9450),r=i(2702),s=i(5600),a=i(2618),l=i(6273),d=i(9090),c=i(3376);!function(e){e[e.side=0]="side",e[e.top=1]="top",e[e.bottom=2]="bottom"}(n||(n={}));const h=[0,0,0],u=[0,0,0],m=[0,0,0],f=[0,0,0],p=(e,t,i,n,o)=>(0,r.v)([e,t.innerId,i,n],t,o),_=e=>({styleId:e[0],layerId:e[1],side:e[2],absHeight:e[3],tileData:e.slice(4)}),v=(0,s.D)({symbol:"mesh",sinks:{fill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.z=new Float32Array(t,4),e.views.normal=new Int8Array(t,8),e.views.gradient=new Int8Array(t,11),e.views.localID=new Uint32Array(t,12),e.views.demPosition=new Int16Array(t,16),e.views.absHeight=new Float32Array(t,16)},packObjectAttributes:p,unpackObjectAttributes:_},inverse:{stride:12,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.z=new Float32Array(t,4),e.views.demPosition=new Int16Array(t,8),e.views.absHeight=new Float32Array(t,8)},packObjectAttributes:(e,t,i,n)=>(0,r.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],absHeight:e[2],tileData:e.slice(3)})},stroke:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.z=new Float32Array(t,4),e.views.directionDistance=new Int8Array(t,8),e.views.demPosition=new Int16Array(t,12),e.views.absHeight=new Float32Array(t,12)},packObjectAttributes:p,unpackObjectAttributes:_}},generate(e,t,i,n,r,s,p,_,b,w,x=!1){var S,I,M;const T=s.x,E=s.y,P=s.signed_z,L=s.gradient,A=s.abs_height,C=T.length,z=r.tileAttrs[r.tileProps.hovered],k=r.tileAttrs[r.tileProps.id],R=z?a.gl:e.idIndexer.getIndex({id:k,styleId:t,layer:i,sublayer:r.tileAttrs[r.tileProps.db_sublayer]});"embankment"===i.type&&b&&(0,c.AN)(e,t,b,i.style,_);const F=x?e.getBucket("mesh","inverse",v.sinks.inverse.packObjectAttributes(t,i,void 0!==A,r),v.sinks.inverse.binder):e.getBucket("mesh","fill",v.sinks.fill.packObjectAttributes(t,i,n,void 0!==A,r),v.sinks.fill.binder);for(let e=0;e<C-2;e++){const t=!(e%2);y(F);const i=t?e+1:e+2,n=t?e+2:e+1,r=l.Bq/p.size;o.t8(h,T[e],E[e],(null!==(S=null==P?void 0:P[e])&&void 0!==S?S:0)*r),o.t8(u,T[i],E[i],(null!==(I=null==P?void 0:P[i])&&void 0!==I?I:0)*r),o.t8(m,T[n],E[n],(null!==(M=null==P?void 0:P[n])&&void 0!==M?M:0)*r),(0,d.Cb)(f,h,u,m),h[2]/=r,u[2]/=r,m[2]/=r,g(F,h,f,null==L?void 0:L[e],R,w,A?A[e]:void 0),g(F,u,f,null==L?void 0:L[i],R,w,A?A[i]:void 0),g(F,m,f,null==L?void 0:L[n],R,w,A?A[n]:void 0)}}});function g(e,t,i,n,o,r,s){var a,c;const h=e.elements.stride*e.elements.offset,u=h/e.views.position.BYTES_PER_ELEMENT;e.views.position[u]=l.jO+t[0],e.views.position[u+1]=l.jO+t[1],e.views.z[h/e.views.z.BYTES_PER_ELEMENT]=t[2];const m=h/e.views.demPosition.BYTES_PER_ELEMENT;if(e.views.demPosition[m]=((null!==(a=null==r?void 0:r[0])&&void 0!==a?a:t[0])+l.jO)/8,e.views.demPosition[m+1]=((null!==(c=null==r?void 0:r[1])&&void 0!==c?c:t[1])+l.jO)/8,void 0!==s&&(e.views.absHeight[h/e.views.absHeight.BYTES_PER_ELEMENT]=s),"normal"in e.views){const t=h/e.views.normal.BYTES_PER_ELEMENT,r=h/e.views.localID.BYTES_PER_ELEMENT,s=h/e.views.gradient.BYTES_PER_ELEMENT;e.views.normal[t]=(0,d.Tz)(i[0]),e.views.normal[t+1]=(0,d.Tz)(i[1]),e.views.normal[t+2]=(0,d.Tz)(i[2]),e.views.gradient[s]=null!=n?n:0,e.views.localID[r]=o}e.elements.offset++}function y(e){const t=e.indices.buffer,i=e.indices.offset,n=e.elements.offset;t[i]=n,t[i+1]=n+1,t[i+2]=n+2,e.indices.offset+=3}},5549:(e,t,i)=>{i.d(t,{DR:()=>s,N5:()=>a});var n=i(6392),o=i(3741),r=i(6490);function s(e,t,i,s,a){const l=[e[0][0],e[1][0]],d=(0,r.Id)(90+s),c=[];(0,n.Z$)(c,l,a);const h=(0,o.projectMapToGeo)(c),u=(0,o.geoToMapDistance)(h,t),m=(0,o.geoToMapDistance)(h,i),f=Math.sqrt(Math.pow(u,2)+Math.pow(m,2))/2,p=Math.atan(u/-m)+Math.PI+d,_=f*Math.cos(p),v=f*Math.sin(p),g=Math.atan(-u/-m)+Math.PI+d,y=f*Math.cos(g),b=f*Math.sin(g),w=Math.atan(-u/m)+2*Math.PI+d,x=f*Math.cos(w),S=f*Math.sin(w),I=Math.atan(u/m)+d,M=f*Math.cos(I),T=f*Math.sin(I),E=[],P=[],L=[],A=[];return(0,n.a2)(E,[c[0]+_,c[1]+v],a),(0,n.a2)(P,[c[0]+y,c[1]+b],a),(0,n.a2)(L,[c[0]+x,c[1]+S],a),(0,n.a2)(A,[c[0]+M,c[1]+T],a),[[E[0],P[0],L[0],A[0]],[E[1],P[1],L[1],A[1]]]}function a(e,t){const i=Math.max(e,t);return 32*i>512?512/i:32}},1573:(e,t,i)=>{i.d(t,{$V:()=>C,In:()=>R,bg:()=>E,kF:()=>k,m5:()=>z,tS:()=>L,tw:()=>P});var n=i(378),o=i(9450),r=i(5600),s=i(3376),a=i(9073),l=i(3642),d=i(2682),c=i(8965),h=i(6392),u=i(9090),m=i(6490),f=i(6273),p=i(3194),_=i(2097),v=i(2618),g=i(143);const y=[0,0,0],b=[0,0,0],w=[0,0,0],x=[0,0,0],S=[0,0,0],I=[0,0,0];let M=0,T=0;const E=(e,t)=>e<0||t<0?Math.floor(Math.min(e,t)):Math.ceil(Math.max(e,t)),P=(0,r.D)({symbol:"overpass",sinks:{},generate(e,t,i,r,d,u,m,g){var y,b,w,S;const M=d.signed_z;if(!M)return;const T=r.tileAttrs[r.tileProps.db_road_part],E=r.tileAttrs[r.tileProps.tech_db_geometry_type],P=null===(y=r.tileAttrs[r.tileProps.db_tiers])||void 0===y?void 0:y[0];if("border_flat"===T||"roadbed_flat"===T)return;const A=r.tileProps,O=r.tileAttrs.slice();O[A.id]=v.gl,O[A.db_tiers]=void 0;const D=t.id,B=d.x.length,j=d.x,N=d.y,U=null!==(b=d.cut)&&void 0!==b?b:[];n.t8(x,0,0);const V=(0,h.iq)(u,x)*a.C,G=f.Bq/u.size*V,H=Math.max((0,p.vn)(i.style.borderWidth,r,0),0)*G,Z=Math.max((0,p.vn)(i.style.thickness,r,0),0)*V,W=H>0?Math.max(-Z,(0,p.vn)(i.style.borderHeight,r,0)*V):0;if("polygon"===E){if(void 0===P)return;const t=[j,N,U,M,new Int8Array(B)],n="roadbed_tunnel_descent"===T,o="roadbed_tunnel"===T||n;l._.generate(e,D,i,r,R(t),P,u,void 0);const a=(0,s.y)(t);for(let e=0;e<a[3].length;e++)a[3][e]-=Z;a[4].forEach(((e,t,i)=>i[t]=0)),c.j.generate(e,D,i,c.z.bottom,r,R(a),u,m,g,void 0,o);const d=[];for(let e=0;e<P;e++)d.push(e);const h=e.getBucket("polygon","shadow",_.a.sinks.shadow.packObjectAttributes(D,i,d,r),_.a.sinks.shadow.binder);if((0,_.d)(h,t[0].length,t[0],t[1],v.gl),o&&!n){const n=t.slice();n[3]=new Array(t[0].length).fill(0),c.j.generate(e,D,i,c.z.top,r,R(n),u,m,g,void 0,!0)}}else if("polyline"===E){const t=c.j.sinks.stroke.packObjectAttributes(D,i,c.z.top,!1,r),n=c.j.sinks.stroke.packObjectAttributes(D,i,c.z.side,!1,r),a=c.j.sinks.stroke.packObjectAttributes(D,i,c.z.bottom,!1,r),l=function(e){var t,i,n,o;const r=[],s=e.x.length;for(let a=0;a<s;a++)r.push([e.x[a],e.y[a],null!==(i=null===(t=e.signed_z)||void 0===t?void 0:t[a])&&void 0!==i?i:0,null!==(o=null===(n=e.cut)||void 0===n?void 0:n[a])&&void 0!==o?o:0,0]);return r}({x:j,y:N,cut:U,signed_z:M});if("arch_tunnel"===T){const s=Math.max(W,0),d=L(l),h=(K=H,X=(X=l).map((e=>e.slice())),o.lu(I,X[0],X[1]),o.Fv(I,I),o.bA(I,I,K),o.IH(X[0],X[0],I),o.lu(I,X[X.length-1],X[X.length-2]),o.Fv(I,I),o.bA(I,I,K),o.IH(X[X.length-1],X[X.length-1],I),X),f=l.map((e=>{const t=e.slice();return t[2]=-200,t[4]=0,t}));z(e,a,f);const p=C(h,d,H).map((e=>(e[2]=s,e[4]=1,e))),_=h.map((e=>{const t=e.slice();return t[2]=s,t[4]=1,t})),v=k(p,_);do{c.j.generate(e,D,i,c.z.top,r,R(v),u,m,g,void 0,!s)}while(e.isOverloaded());const y=l.map((e=>{const t=e.slice();return t[2]=s,t[4]=1,t}));z(e,t,y);const b=k(y,f);do{c.j.generate(e,D,i,c.z.side,r,R(b),u,m,g)}while(e.isOverloaded());if(s){const o=C(h,d,H).map((e=>(e[2]=0,e[4]=0,e)));z(e,a,o),z(e,t,p);const s=k(o,p);do{c.j.generate(e,D,i,c.z.side,r,R(s),u,m,g,void 0,!1)}while(e.isOverloaded());const l=h.map((e=>{const t=e.slice();return t[2]=0,t[4]=0,t})),f=k([_[0],l[0]],[p[0],o[0]]);do{c.j.generate(e,D,i,c.z.side,r,R(f),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[_[0],p[0]]),z(e,n,[p[0],o[0]]),z(e,a,[o[0],l[0]]);const v=_.length-1,y=k([l[v],_[v]],[o[v],p[v]]);do{c.j.generate(e,D,i,c.z.side,r,R(y),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[_[v],p[v]]),z(e,n,[p[v],o[v]]),z(e,a,[o[v],l[v]])}}else if("border_overpass"===T){const o=[O[A.previousPointX],O[A.previousPointY],null!==(w=M[0])&&void 0!==w?w:0,0],s=!!O[A.beginningIsCut]&&F(l[1],l[0],o);s&&l.splice(0,0,o);const d=l.length-1,h=[O[A.nextPointX],O[A.nextPointY],null!==(S=M[M.length-1])&&void 0!==S?S:0,0],f=!!O[A.endingIsCut]&&F(l[d-1],l[d],h);f&&l.push(h);const p=L(l);s&&(p.shift(),l.shift()),f&&(p.pop(),l.pop());const _=l.map((e=>{const t=e.slice();return t[2]=Math.max(t[2]-Z,0),t[4]=0,t}));z(e,n,l);const v=C(l,p,H).map((e=>{const t=e.slice();return t[2]=Math.max(e[2]-Z,0),t[4]=0,t})),y=C(l,p,H).map((e=>{const t=e.slice();return t[2]=Math.max(e[2]+W,0),t[4]=1,t})),b=l.map((e=>{const t=e.slice();return W>0&&(t[2]=Math.max(t[2]+W,0)),t[4]=1,t}));if(W>0){z(e,t,b);const n=k(b,l.map((e=>{const t=e.slice();return t[4]=0,t})));do{c.j.generate(e,D,i,c.z.side,r,R(n),u,m,g)}while(e.isOverloaded())}z(e,a,v),z(e,t,y);const x=k(y,b);do{c.j.generate(e,D,i,c.z.top,r,R(x),u,m,g)}while(e.isOverloaded());const I=k(_,v);do{c.j.generate(e,D,i,c.z.bottom,r,R(I),u,m,g,void 0,!1)}while(e.isOverloaded());const T=k(v,y);do{c.j.generate(e,D,i,c.z.side,r,R(T),u,m,g,void 0,!1)}while(e.isOverloaded());if(0===M[0]){const o=k([b[0],_[0]],[y[0],v[0]]);do{c.j.generate(e,D,i,c.z.side,r,R(o),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[y[0],b[0]]),z(e,n,[b[0],_[0]]),z(e,n,[v[0],y[0]]),z(e,a,[_[0],v[0]])}if(0===M[M.length-1]){const o=_.length-1,s=k([_[o],b[o]],[v[o],y[o]]);do{c.j.generate(e,D,i,c.z.side,r,R(s),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[b[o],y[o]]),z(e,n,[_[o],b[o]]),z(e,n,[y[o],v[o]]),z(e,a,[v[o],_[o]])}}else{const o=L(l),d="border_tunnel_descent"===T,h="border_tunnel"===T||d,f=h?Math.max(W,0):W,p=l.map((e=>{const t=e.slice();return t[2]-=Z,d?t[2]=0:h&&(t[2]=Math.max(t[2],0)),t[4]=0,t})),_=C(l,o,H).map((e=>(e[2]-=Z,d&&(e[2]=0),e[4]=0,e))),v=C(l,o,H).map((e=>(e[2]+=f,d?e[2]=f:h&&(e[2]=Math.max(e[2],0)),e[4]=1,e))),y=l.map((e=>{const t=e.slice();return t[2]+=f,d?t[2]=f:h&&(t[2]=Math.max(t[2],0)),t[4]=1,t}));if(h){d&&z(e,t,y);const n=k(y,l.map((e=>{const t=e.slice();return t[4]=0,t})));do{c.j.generate(e,D,i,c.z.side,r,R(n),u,m,g)}while(e.isOverloaded());const o=y.map((e=>{const t=e.slice();return t[2]=Math.min(e[2],0),t})),a=(0,s.y)(k(o,l));do{c.j.generate(e,D,i,c.z.side,r,R(a),u,m,g,void 0,!0)}while(e.isOverloaded())}if(W>0){h&&!d||(z(e,a,_),z(e,t,v));const n=k(v,y);do{c.j.generate(e,D,i,c.z.top,r,R(n),u,m,g,void 0,h&&!d)}while(e.isOverloaded())}if(!h||d){const o=k(p,_);do{c.j.generate(e,D,i,c.z.bottom,r,R(o),u,m,g,void 0,!1)}while(e.isOverloaded());const s=k(_,v);do{c.j.generate(e,D,i,c.z.side,r,R(s),u,m,g,void 0,!1)}while(e.isOverloaded());if(0===M[0]){const o=k([y[0],p[0]],[v[0],_[0]]);do{c.j.generate(e,D,i,c.z.side,r,R(o),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[v[0],y[0]]),z(e,n,[y[0],p[0]]),z(e,n,[_[0],v[0]]),z(e,a,[p[0],_[0]])}if(0===M[M.length-1]){const o=p.length-1,s=k([p[o],y[o]],[_[o],v[o]]);do{c.j.generate(e,D,i,c.z.side,r,R(s),u,m,g,void 0,!1)}while(e.isOverloaded());z(e,t,[y[o],v[o]]),z(e,n,[p[o],y[o]]),z(e,n,[v[o],_[o]]),z(e,a,[_[o],p[o]])}}}}var X,K}});function L(e){const t=[];(0,u.uI)(y,e[0][0],e[0][1],e[1][0],e[1][1]),M=0;for(let i=1;i<e.length;i++)A(t,e,i);return t}function A(e,t,i){const o=i===t.length-1;if(n.t8(w,t[i-1][0],t[i-1][1]),n.t8(x,t[i][0],t[i][1]),(0,u.IB)(I,y),o)T=0;else{n.t8(S,t[i+1][0],t[i+1][1]),(0,u.uI)(b,x[0],x[1],S[0],S[1]);const e=(0,m.uZ)(n.AK(y,b),-1,1),o=Math.sqrt((1-e)/(1+e)),r=(0,m.Xx)(n.AK(I,b));T=o*r}let r=I[0]+y[0]*M,s=I[1]+y[1]*M;e.push([r,s]),o&&(r=I[0]+y[0]*T,s=I[1]+y[1]*T,e.push([r,s])),o||(n.JG(y,b),M=T)}function C(e,t,i){const o=[];for(let r=0;r<e.length;r++){const s=e[r].slice();n.JG(I,t[r]),n.bA(I,I,i),n.IH(s,s,I),o.push(s)}return o}function z(e,t,i){do{const n=e.getBucket("mesh","stroke",t,c.j.sinks.stroke.binder),o=i.length;for(let e=0;e<o-1;e++){const t=e+1;(0,d.n)(n,i[e][0],i[e][1],i[e][2],i[t][0],i[t][1],i[t][2],void 0,!1,i[e][5],i[t][5])}}while(e.isOverloaded())}function k(e,t){return function(e){var t,i;const n=e.length,o=[[],[],[],[],[]];void 0!==e[0][5]&&o.push([]);for(let r=0;r<n;r++){const s=(0,g.X)(r,n),a=e[r];o[0][s]=a[0],o[1][s]=a[1],o[2][s]=a[3],o[3][s]=a[2],o[4][s]=null!==(t=a[4])&&void 0!==t?t:0,o[5]&&(o[5][s]=null!==(i=a[5])&&void 0!==i?i:0)}return o}([e[0]].concat(e,t.slice().reverse()))}function R(e){return{x:e[0],y:e[1],cut:e[2],signed_z:e[3],gradient:e[4],abs_height:e[5]}}const F=function(){const e=Math.cos((0,m.Id)(1));return(t,i,o)=>(n.lu(y,i,t),n.Fv(y,y),n.lu(b,i,o),n.Fv(b,b),n.AK(y,b)<=e)}()},7840:(e,t,i)=>{i.d(t,{bR:()=>A,uF:()=>j,GN:()=>V,vg:()=>U,qp:()=>N});var n=i(3698),o=i(6273);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:s(e)}}function s(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,r)=>(t+o+n*(0===r?-1:r===e.coords.length-1?1:0))/i))}function l(e,t){const{stretchSize:i,fixSize:n}=d(e),{coords:o,isOddStretchable:r}=e,s=t<n?n:t,a=[o[0]];for(let e=1;e<o.length;e++){const t=o[e-1],l=o[e],d=e%2==(r?1:0),c=a[a.length-1];d?a.push(Math.round((s-n)*(l-t)/i)+c):a.push(c+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 c(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}var h=i(6392);function u(e,t,i,n,s,d,h,u,m){const f=function(e,t,i=[],n=[]){return{x:r(i,e),y:r(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,r=0){return[c(l(e.x,t),n,o),c(l(e.y,i),n,r)]}(f,n,s,o.CW,d,h);e.set(_,p)}const m=[0,0];function f(e,t,i,r,s,a,l,d,c,u,m,f,p,_){let v=16*e.elements.offset;e.views.position[v]=o.jO+t,e.views.position[v+1]=o.jO+i,e.views.position[v+2]=(0,h.VW)(r),e.views.cornerOffset[v]=s,e.views.cornerOffset[v+1]=-a,e.views.checkPointOffset[v]=c,e.views.checkPointOffset[v+1]=u,e.views.texCoords[v]=(0,n.Bb)(l),e.views.texCoords[v+1]=(0,n.Bb)(d),e.views.scales[v]=(0,n.KF)(m),e.views.scales[v+1]=(0,n.wj)(f),v>>=1,e.views.localID[v]=p,e.views.labelingTextureID[v]=_,e.elements.offset++}function p(e,t,i,n,r,s,a){const l=e.elements,d=l.stride*l.offset>>1;e.views.position[d]=o.jO+t,e.views.position[d+1]=o.jO+i,e.views.position[d+2]=(0,h.VW)(n),e.views.cornerOffset[d]=r,e.views.cornerOffset[d+1]=-s,e.views.labelingTextureID[d>>1]=a,l.offset++}function _(e,t,i,n,o,r,s){const{elements:a,indices:l}=e,{buffer:d,offset:c}=l,h=a.offset;d[c]=h+t,d[c+1]=h+i,d[c+2]=h+n,d[c+3]=h+o,d[c+4]=h+r,d[c+5]=h+s,l.offset=c+6}var v=i(4999),g=i(5317),y=i(9218),b=i(7464),w=i(3194);function x(e,t,i,n,o,r){if(!e||o&&!r)return[0,0];if(!r)return[e.w/t,e.h/t];const s=M(i,n,r),a=(0,b.pV)(i.style.iconTextPadding);return[a[3]+a[1]+s[0],a[0]+a[2]+s[1]]}function S(e,t,i){return T((0,w.vn)(e.style.textFontSize,t),e.style.textLineHeight,i)}function I(e,t,i){return T((0,w.vn)(e.style.textFontSize2,t),e.style.textLineHeight,i)}function M(e,t,i){return T((0,w.vn)(e.style.iconTextFontSize,t),e.style.iconTextLineHeight,i)}function T(e,t,i){return[e/y.fonts.baseSize*i.maxWidth,e*t*i.lines.length]}function E(e,t,i){var n,o;const r=null!==(n=i[0])&&void 0!==n?n:0,s=null!==(o=i[1])&&void 0!==o?o:0;return[(.5-e.anchorX)*t[0]+r,(.5-e.anchorY)*t[1]+s]}function P(e,t,i,n,o){var r,s,a,l;const d=null!==(r=i[0])&&void 0!==r?r:.5,c=null!==(s=i[1])&&void 0!==s?s:.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-d*t[0]-n[3]+h,e[1]/2-c*t[1]-n[0]+u]}function L(e,t,i,n,o){const r=t[0],s=t[1],a=i[0],l=i[1];let d=0,c=0;const h=l/2+s/2,u=l/2-s/2,m=-h,f=-u,p=a/2+r/2,_=a/2-r/2,v=-p,g=-_;switch(e){case"bottomCenter":c=h+o;break;case"rightCenter":d=p+o;break;case"topCenter":c=m-o;break;case"leftCenter":d=v-o;break;case"bottomRight":d=_,c=h+o;break;case"topRight":d=_,c=m-o;break;case"bottomLeft":d=g,c=h+o;break;case"rightBottom":d=p+o,c=f;break;case"rightTop":d=p+o,c=u;break;case"topLeft":d=g,c=m-o;break;case"leftTop":d=v-o,c=u;break;case"leftBottom":d=v-o,c=f}return[d+n[0],c+n[1]]}var A,C=i(5600),z=i(2153),k=i(7486),R=i(2702),F=i(1959),O=i(7293);!function(e){e[e.Icon=0]="Icon",e[e.First=1]="First",e[e.Second=2]="Second"}(A||(A={}));const D=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}},B=[0,0,0],j=(0,C.D)({symbol:"point",sinks:{raster:{stride:32,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.cornerOffset=new Int16Array(t,8),e.views.checkPointOffset=new Int16Array(t,12),e.views.texCoords=new Uint16Array(t,16),e.views.scales=new Int16Array(t,20),e.views.localID=new Uint32Array(t,24),e.views.labelingTextureID=new Uint32Array(t,28)},packObjectAttributes:(e,t,i,n)=>(0,R.L)([e.styleId,e.layer.innerId,t,i],n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],animDirection:e[2],atlasIndex:e[3],tileData:e.slice(4)})},text:{stride:28,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.cornerOffset=new Int16Array(t,8),e.views.checkPointOffset=new Int16Array(t,12),e.views.texCoords=new Uint16Array(t,16),e.views.localID=new Uint32Array(t,20),e.views.labelingTextureID=new Uint32Array(t,24)},packObjectAttributes:(e,t,i,n,o,r,s)=>(0,R.L)([e.styleId,e.layer.innerId,t,i,n[0],-n[1],o,r],s),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)})},labelingTexture:{stride:16,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.cornerOffset=new Int16Array(t,8),e.views.labelingTextureID=new Uint32Array(t,12)},packObjectAttributes:(e,t=[0,0])=>(0,R.L)([e.styleId,e.layer.innerId,t[0],-t[1]],[]),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],offsetX:e[2],offsetY:e[3],tileData:e.slice(4)})}},processElement(e,t,i,n,r,s,a){const{layer:l,label:d}=i;if("point"!==l.type)return;const c=(0,w.bs)(s.styleZoom,s.styleState,!0,d.tileData),u=G(c,e,r,d),m=e.icons[(0,w.Q9)(l.style.iconImage,c)],f=(0,F.x)(m),p=x(u,r,l,c,f,d.iconTextMetrics),_=(0,b.pV)(l.style.iconTextOffset),v=(0,b.pV)(l.style.iconTextPadding);let g,y=[0,0];if(u)if(d.iconTextMetrics){const e=(0,b.pV)(l.style.iconTextAnchor);g=M(l,c,d.iconTextMetrics),y=P(p,g,e,v,_)}else{y=E(u,p,(0,b.pV)(l.style.iconOffset))}if((0,h.a2)(B,i.anchorWorld,a),(0,h.hm)(B))switch(i.type){case z.Dl.Icon:if(!u||f&&!d.iconTextMetrics)return;const a=f?m.stretchX:void 0,c=f?m.stretchY:void 0;if(V(t,d,B,n,u,p[0]*r,p[1]*r,y[0]*r,y[1]*r,r,null==a?void 0:a.map((([e,t])=>[e*r,t*r])),null==c?void 0:c.map((([e,t])=>[e*r,t*r]))),!g)return;const h=(0,b.pV)(l.style.iconTextAnchor);return void function(e,t,i,n,r,s,a,l,d){var c;const{iconTextMetrics:h}=i;if(!h||!l.style.iconTextFont)return;const u=(0,w.bs)(r.styleZoom,r.styleState,!1,i.tileData),m=(0,w.Q9)(l.style.iconTextFont,u),f=null!==(c=e.fontNameToIndex[m])&&void 0!==c?c:e.fontNameToIndex[o.Uo];N(t,i,A.Icon,h,n,s,a,l,f,d)}(e,t,i.label,B,s,n,function(e,t,i){var n,o,r,s;const a=null!==(n=t[0])&&void 0!==n?n:.5,l=null!==(o=t[1])&&void 0!==o?o:.5,d=null!==(r=i[0])&&void 0!==r?r:0,c=null!==(s=i[1])&&void 0!==s?s:0;return[(.5-a)*e[0]+d,(.5-l)*e[1]+c]}(g,h,_),l,r);case z.Dl.PoiText:return void function(e,t,i,n,r,s,a,l,d,c){var h;const{label:u}=i,{textMetrics:m}=u,f=(0,w.bs)(s.styleZoom,s.styleState,!1,u.tileData),p=(0,w.Q9)(d.style.textFont,f);if(!p.length)return;const _=S(d,f,m),v=null!==(h=e.fontNameToIndex[p])&&void 0!==h?h:e.fontNameToIndex[o.Uo],g=i.parent?(0,w.uA)(d.style.textPlacement,f):"centerCenter",y=(0,w.vn)(d.style.textOffset,f),b=L(g,r,_,l,y);N(t,u,A.First,u.textMetrics,n,a,b,d,v,c)}(e,t,i,B,p,s,n,y,l,r);case z.Dl.PoiText2:return void function(e,t,i,n,r,s,a,l,d,c){var h,u;const{label:m}=i,{textMetrics:f,textMetrics2:p}=m;if(!p||!d.style.textFont2)return;const _=(0,w.bs)(s.styleZoom,s.styleState,!1,m.tileData),v=S(d,_,f),g=I(d,_,p),y=(0,w.vn)(d.style.textOffset,_),b=(0,w.vn)(null!==(h=d.style.textOffset2)&&void 0!==h?h:0,_,0),x=(0,w.Q9)(d.style.textFont2,_),M=null!==(u=e.fontNameToIndex[x])&&void 0!==u?u:e.fontNameToIndex[o.Uo],T=L((0,w.uA)(d.style.textPlacement,_),r,[g[0],v[1]],l,y);T[1]+=(v[1]+g[1])/2+b,N(t,m,A.Second,p,n,a,T,d,M,c)}(e,t,i,B,p,s,n,y,l,r)}},getLabelingInfo(e,t,i,n,o,r){const{layer:s}=e;if("point"!==s.type)return;e.labelingElements.length=0;const a=(0,w.bs)(n.styleZoom,n.styleState,!0,e.tileData),l=G(a,i,r,e),d=i.icons[(0,w.Q9)(s.style.iconImage,a)],c=(0,F.x)(d),h=x(l,r,s,a,c,e.iconTextMetrics);let u,m=[0,0];if(l&&(!c||e.iconTextMetrics)){if(e.iconTextMetrics){const t=(0,b.pV)(s.style.iconTextAnchor),i=(0,b.pV)(s.style.iconTextOffset),n=(0,b.pV)(s.style.iconTextPadding);u=M(s,a,e.iconTextMetrics),m=P(h,u,t,n,i)}else{m=E(l,h,(0,b.pV)(s.style.iconOffset))}const r=new g.x(e,z.Dl.Icon,t,n.buildingHeight,o,i);r.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(r)}const f=(0,w.Q9)(s.style.textFont,a);e.label.length>0&&f.length&&(function(e,t,i,n,o,r,s,a){const{textMetrics:l}=e;if(!l)return;const d=(0,w.bs)(o.styleZoom,o.styleState,!1,e.tileData),c=(0,w.vn)(a.style.textOffset,d),h=S(a,d,l),u=new g.x(e,z.Dl.PoiText,t,o.buildingHeight,r,i);e.labelingElements.length>0&&(u.parent=e.labelingElements[0]);const m=L(u.parent?(0,w.uA)(a.style.textPlacement,d):"centerCenter",n,h,s,c);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,s),e.label2&&function(e,t,i,n,o,r,s,a){var l;const{textMetrics:d,textMetrics2:c}=e;if(!c)return;const h=(0,w.bs)(o.styleZoom,o.styleState,!1,e.tileData),u=S(a,h,d),m=I(a,h,c),f=(0,w.vn)(a.style.textOffset,h),p=(0,w.vn)(null!==(l=a.style.textOffset2)&&void 0!==l?l:0,h,0),_=new g.x(e,z.Dl.PoiText2,t,o.buildingHeight,r,i);e.labelingElements.length>1?(_.parent=e.labelingElements[0],_.firstLabel=e.labelingElements[1]):e.labelingElements.length>0&&(_.parent=e.labelingElements[0],_.firstLabel=e.labelingElements[0]);const v=L((0,w.uA)(a.style.textPlacement,h),n,[m[0],u[1]],s,f);v[1]+=(u[1]+m[1])/2+p,_.boxes.push([v[0]-m[0]/2,v[1]-m[1]/2,v[0]+m[0]/2,v[1]+m[1]/2]),e.labelingElements.push(_)}(e,t,i,h,n,o,m,s))}});function N(e,t,i,n,o,r,s,a,l,d){if(i===A.First&&1===t.labelingElements.length){const i=e.getBucket("point","labelingTexture",j.sinks.labelingTexture.packObjectAttributes(t),j.sinks.labelingTexture.binder);t.checkPointOffset=(0,v.MD)(i,o,n,a,d,t.labelingTextureIndex)}const c={};for(const n of t.ranges)c[n]=e.getBucket("point","text",j.sinks.text.packObjectAttributes(t,r,n,s,i,l,(0,O.u)(t.tileData,a)),j.sinks.text.binder);(0,v.$Y)(c,t,o,n,a,i,t.checkPointOffset)}function U(e,t,i,n,o,r){return V(e,t,i,n,o,o.w,o.h,o.w*(.5-o.anchorX),o.h*(.5-o.anchorY),r,void 0,void 0)}function V(e,t,i,n,r,s,a,l,d,c,h,v){if(s<=0||a<=0)return;const g=t.layer;if("point"!==g.type)return;u(D,y.atlasSize,r,s,a,l,d,h,v),e.atlasPacker.addRastersToLoad(t.styleId,r);const b=e.getBucket("point","labelingTexture",j.sinks.labelingTexture.packObjectAttributes(t),j.sinks.labelingTexture.binder);t.checkPointOffset=function(e,t,i,n,r,s,a){const{stretchedX:l,stretchedY:d}=n,c=Math.ceil((l[l.length-1]-l[0])/2),h=Math.ceil((d[d.length-1]-d[0])/2),u=s*o.Jv/2;m[0]=l[0]+c,m[1]=d[0]+h;const f=m[0]-u,v=m[0]+u,g=m[1]-u,y=m[1]+u;return _(r,0,2,1,1,2,3),p(r,e,t,i,f,g,a),p(r,e,t,i,v,g,a),p(r,e,t,i,f,y,a),p(r,e,t,i,v,y,a),m}(i[0],i[1],i[2],D,b,c,t.labelingTextureIndex);const w=e.getBucket("point","raster",j.sinks.raster.packObjectAttributes(t,n,r.atlasIndex,(0,O.u)(t.tileData,g)),j.sinks.raster.binder);!function(e,t,i,n,r,s,a,l,d,c){const{textureX:h,textureY:u,stretchedX:m,stretchedY:p,countX:v,countY:g}=n,y=s!==-1/0?s:o.vL,b=a!==1/0?a:o.Fv,[w,x]=c;for(let n=0;n<v-1;n++){const o=h[n],s=h[n+1],a=m[n],c=m[n+1];for(let n=0;n<g-1;n++){const h=u[n],m=u[n+1],v=p[n],g=p[n+1];_(r,0,2,1,1,2,3),f(r,e,t,i,a,v,o,h,w,x,y,b,l,d),f(r,e,t,i,c,v,s,h,w,x,y,b,l,d),f(r,e,t,i,a,g,o,m,w,x,y,b,l,d),f(r,e,t,i,c,g,s,m,w,x,y,b,l,d)}}}(i[0],i[1],i[2],D,w,-1/0,1/0,t.identifyIndex,t.labelingTextureIndex,t.checkPointOffset)}function G(e,t,i,n){const{rasterSets:o}=t,{layer:r}=n;if("point"!==r.type)return;let s;if(n.pointType===z.a_.Commercial||n.pointType===z.a_.CommercialCity||n.pointType===z.a_.CommercialPremium||n.pointType===z.a_.Landmark)s=o.byKey[(0,b.zV)(n.idLo,n.idHi)];else{const t=(0,w.Q9)(r.style.iconImage,e);if(t.length){const e=(0,b.pV)(r.style.iconAnchor);s=o.byKey[(0,b.PR)(t,e[0],e[1])]}}if(s){const t=(0,w.vn)(r.style.iconWidth,e),n=(0,k.Bl)(s.rasters,t*i,!0);if(void 0!==n)return s.rasters[n]}}},2097:(e,t,i)=>{i.d(t,{a:()=>p,d:()=>_});var n=i(5600),o=i(3672),r=i(143),s=i(2682),a=i(2618),l=i(2702),d=i(6273),c=i(8450),h=i(3376),u=i(3194);function m(e,t,i,n){return(0,l.v)([e,t.innerId,i],t,n)}const f=e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)}),p=(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:m,unpackObjectAttributes:f},stroke:{stride:8,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.directionDistance=new Int8Array(t,4)},packObjectAttributes:m,unpackObjectAttributes:f},shadow:{stride:4,binder:(e,t)=>{e.views.position=new Uint16Array(t)},packObjectAttributes:(e,t,i,n)=>(0,l.v)([e,t.innerId,i],t,n),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],tiers:e[2],tileData:e.slice(3)})}},generate(e,t,i,n,l,d,m,f){const{tileAttrs:v,tileProps:g}=n,y=l.x,b=l.y,w=l.cut;(0,c.nc)(i)&&m&&(0,h.AN)(e,t,m,i.style,d);const x=v[g.id],S="number"==typeof x?String(x):(0,o.Ak)(x),I=v[g.hovered]?a.gl:e.idIndexer.getIndex({id:x,styleId:t,layer:i,sublayer:v[g.db_sublayer],floorId:f}),M="polygon"!==i.type||(0,u.FR)(i.ignoreTier,n)?null:n.tileAttrs[n.tileProps.db_tiers],T=e.getBucket("polygon","fill",p.sinks.fill.packObjectAttributes(t,i,M,n),p.sinks.fill.binder),E=T.indices.offset;_(T,y.length,y,b,I),T.buildingsData[E]={buildingId:S,size:T.indices.offset-E};const P=e.getBucket("polygon","stroke",p.sinks.stroke.packObjectAttributes(t,i,M,n),p.sinks.stroke.binder);if(w){const e=P.indices.offset;!function(e,t,i,n,o){for(let a=0;a<t;a++){const l=(0,r.X)(a,t);if(1===o[l]){const o=(0,r.X)((a+1)%t,t);(0,s.n)(e,i[l],n[l],0,i[o],n[o],0)}}}(P,y.length,y,b,w),P.buildingsData[e]={buildingId:S,size:P.indices.offset-e}}}});function _(e,t,i,n,o){const r=e.indices.buffer;let s=e.indices.offset,a=e.elements.offset;const l=a;v(e,a++,i[0],n[0],o),v(e,a++,i[1],n[1],o);for(let d=2;d<t;d++)g(r,s,l,d),v(e,a++,i[d],n[d],o),s+=3;e.elements.offset=a,e.indices.offset=s}function v(e,t,i,n,o){t=t*e.elements.stride/e.views.position.BYTES_PER_ELEMENT,e.views.position[t]=d.jO+i,e.views.position[t+1]=d.jO+n,t>>=1,"localID"in e.views&&(e.views.localID[t]=o)}function g(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)}},5970:(e,t,i)=>{i.d(t,{p:()=>y});var n=i(143),o=i(3672),r=i(6392),s=i(5600),a=i(1558),l=i(8308),d=i(2682),c=i(2618),h=i(3194),u=i(2702),m=i(8194),f=i(6273),p=i(9073);const _=f.Bq/2,v=(e,t,i)=>(0,u.v)([e,t.innerId],t,i),g=e=>({styleId:e[0],layerId:e[1],tileData:e.slice(2)}),y=(0,s.D)({symbol:"polygonExtrusion",sinks:{sideFill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.localID=new Uint32Array(t,8),e.views.demPosition=new Int16Array(t,12),e.views.labelingTextureID=new Uint32Array(t,16)},packObjectAttributes:v,unpackObjectAttributes:g},topFill:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.localID=new Uint32Array(t,8),e.views.demPosition=new Int16Array(t,12),e.views.labelingTextureID=new Uint32Array(t,16)},packObjectAttributes:v,unpackObjectAttributes:g},sideStroke:{stride:20,binder:(e,t)=>{e.views.position=new Uint16Array(t),e.views.distance=new Int16Array(t,6),e.views.normals=new Int8Array(t,8),e.views.direction=new Int8Array(t,12),e.views.demPosition=new Int16Array(t,16)},packObjectAttributes:v,unpackObjectAttributes:g},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:v,unpackObjectAttributes:g}},generate(e,t,i,s,u,_,g,I,M){var T;const E=u.x,P=u.y,L=null!==(T=u.cut)&&void 0!==T?T:[],A=E.length,C=s.tileAttrs[s.tileProps.id],z="number"==typeof C?String(C):(0,o.Ak)(C);g||(g=s.tileProps.db_centroid_x&&s.tileProps.db_centroid_y&&!Number.isNaN(s.tileAttrs[s.tileProps.db_centroid_x])&&!Number.isNaN(s.tileAttrs[s.tileProps.db_centroid_y])?[s.tileAttrs[s.tileProps.db_centroid_x],s.tileAttrs[s.tileProps.db_centroid_y]]:function(e,t,i){let o,r=Math.pow(f.Bq,2);const s=e.length,a=m.Ue();for(let l=0;l<s;l++){o||m.aM(a,[e[l],t[l]]);const d=(0,n.X)(l,s);if(0===i[d]){const i=[e[d],t[d]],a=(0,n.X)((l+1)%s,s),c=[e[a],t[a]];if(S(i)){const e=x(i);e<r&&(o=i,r=e);const t=x(c);t<r&&(o=c,r=t)}else o=[(e[d]+e[a])/2,(t[d]+t[a])/2]}}o||(o=[],m.be(o,a));return o}(E,P,L));const k=s.tileAttrs[s.tileProps.hovered],R=(0,h.FR)(i.style.height,s),F=s.tileInfo?(0,r.iq)(s.tileInfo,[0,0]):1,O=R*p.C*F,D=k?c.gl:e.idIndexer.getIndex({id:C,styleId:t,layer:i,sublayer:s.tileAttrs[s.tileProps.db_sublayer],floorId:I}),B=e.buildingPointIndexer.getIndex(null!=M?M:C),j=v(t,i,s);if(O>0){const t=e.getBucket("polygonExtrusion","sideFill",j,y.sinks.sideFill.binder);let i=t.indices.offset;(0,a.y)(t,A,E,P,L,O,D,B,g),t.buildingsData[i]={buildingId:z,size:t.indices.offset-i};const n=e.getBucket("polygonExtrusion","sideStroke",j,y.sinks.sideStroke.binder);_&&(i=n.indices.offset,(0,l.C)(n,A,E,P,L,g),(0,l.b)(n,A,E,P,L,O,g),n.buildingsData[i]={buildingId:z,size:n.indices.offset-i})}const N=e.getBucket("polygonExtrusion","topFill",j,y.sinks.topFill.binder);let U=N.indices.offset;!function(e,t,i,n,o,r,s,a){let l=e.elements.offset;const d=l;b(e,l++,i[0],n[0],o,r,s,a),b(e,l++,i[1],n[1],o,r,s,a);for(let c=2;c<t;c++)w(e,d,c),b(e,l++,i[c],n[c],o,r,s,a);e.elements.offset=l}(N,A,E,P,O,D,B,g),N.buildingsData[U]={buildingId:z,size:N.indices.offset-U};const V=e.getBucket("polygonExtrusion","topStroke",j,y.sinks.topStroke.binder);U=V.indices.offset,function(e,t,i,o,r,s,a){for(let l=0;l<t;l++){const c=(0,n.X)(l,t);if(r&&1===r[c]){const r=(0,n.X)((l+1)%t,t);(0,d.n)(e,i[c],o[c],s,i[r],o[r],s,a)}}}(V,A,E,P,L,O,g),V.buildingsData[U]={buildingId:z,size:V.indices.offset-U}}});function b(e,t,i,n,o,s,a,l){const d=e.elements.stride,c=t*(d/e.views.position.BYTES_PER_ELEMENT);e.views.position[c]=f.jO+i,e.views.position[c+1]=f.jO+n,e.views.position[c+2]=(0,r.VW)(o),e.views.position[c+3]=1,e.views.demPosition[c]=(f.jO+l[0])/8,e.views.demPosition[c+1]=(f.jO+l[1])/8;const h=t*(d/e.views.localID.BYTES_PER_ELEMENT);e.views.localID[h]=s,e.views.labelingTextureID[h]=a}function w(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 x(e){return Math.pow(_-Math.abs(e[0]-_),2)+Math.pow(_-Math.abs(e[1]-_),2)}function S(e){return 0===e[0]||e[0]===f.Bq||0===e[1]||e[1]===f.Bq}},6201:(e,t,i)=>{i.d(t,{It:()=>s,R2:()=>n,hs:()=>r});var n,o=i(3194);function r(e,t){return Number.isNaN(e)?t:e}function s(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={}))},4333:(e,t,i)=>{i.d(t,{p:()=>p});var n=i(7609),o=i(9218),r=i(7486),s=i(7464),a=i(9981),l=i(3194),d=i(2618),c=i(2153),h=i(6201),u=i(1959),m=i(6392),f=i(9073);const p=(e,t,i,p,_,v,g,y,b,w,x)=>{var S;const{tileProps:I,tileAttrs:M}=p;if(function(e,t,i,d,c,h,m){const{rasterSets:f,icons:p}=t,_=(0,a.fL)(h),v=(0,l.EG)(i.style.iconWidth),g=(0,n.Ty)(c[d.db_sublayer]),y=(0,n.Cz)(c[d.db_sublayer]),b=(0,s.pV)(i.style.iconAnchor);if(g||y){if(m)return;const i=g?o.commercialPoi.rasterSizes:o.landmarkRasterSizes,n=(0,r.rA)(c[d.id],i,c[d.db_region],b,d.url_src?c[d.url_src]:void 0);e.atlasPacker.addNewRasterSet(t.id,n),e.atlasPacker.pack(n,v,_)}else(0,l.EG)(i.style.iconImage).forEach((i=>{if(!i.length)return;const n=f.byKey[(0,s.PR)(i,b[0],b[1])];if(!n)return void console.error(`Not found raster set with image ${i}, anchorX: ${b[0]}, anchorY: ${b[1]}`);if(!n.isSvg)return;const o=p[i],r=o&&(0,u.x)(o)?[{w:o.width,h:o.height}]:v.map((e=>({w:e,h:e})));e.atlasPacker.packSvg(n,r,_),m&&n.rasters.forEach((i=>e.atlasPacker.addRastersToLoad(t.id,i)))}))}(e,t,i,I,M,b,w),w)return;let T=c.a_.Common;const E=M[I.db_sublayer];(0,n.wu)(E)?T=c.a_.CommercialCity:(0,n.CE)(E)?T=c.a_.CommercialPremium:(0,n.Ty)(E)?T=c.a_.Commercial:(0,n.Cz)(E)&&(T=c.a_.Landmark);const P=1===y.x.length?c._r.Point:c._r.Line;let L,A=[];if(P===c._r.Point){if(p&&i.style.allowElevation){const e=(0,l.vn)(i.style.elevation,p);if(Number.isNaN(e))void 0!==y.z&&(y.z=[(0,m.d1)(y.z[0])]);else{const t=e*f.C*(0,m.iq)((0,m.Bs)(v),[y.x[0],y.y[0]]);y.z=[t]}}A=[[y.x[0]],[y.y[0]],void 0!==y.z?[y.z[0]]:[0]],L=[0,0,0],(0,m.Z$)(L,[A[0][0],A[1][0],A[2][0]],(0,m.Bs)(v))}else A=[y.x,y.y];const C=M[I.id];let z=d.gl,k=d.gl;Number.isNaN(C)||(z=e.idIndexer.getIndex({id:C,styleId:t.id,layer:i,sublayer:E,objectClass:M[I.db_object_class],instanceId:0,metatile:_,center:L,floorId:x}),k=e.idIndexer.getIndex({id:C,styleId:t.id,layer:i,sublayer:E,objectClass:M[I.db_object_class],instanceId:1,metatile:_,center:L,floorId:x}));const R=null!==(S=M[I.db_point_building_id])&&void 0!==S?S:NaN,F=e.buildingPointIndexer.getIndex(R),O={type:h.R2.Point,pointType:T,geometryType:P,styleId:t.id,layerId:i.innerId,sourceId:g,tileCoords:v,id:M[I.id],identifyIndex:z,identifyPoiLabelIndex:k,labelingTextureIndex:F,labelPriority:(0,h.hs)(M[I.db_label_priority],0),label2Priority:(0,h.hs)(M[I.db_label2_priority],0),styleIconPriority:(0,l.vn)(i.style.iconPriority,p),styleTextPriority:(0,l.vn)(i.style.textPriority,p),iconPriority:(0,h.hs)(M[I.db_icon_priority],0),hovered:(0,h.hs)(M[I.hovered],0),componentDistanceStart:(0,h.hs)(M[I.componentDistanceStart],0),componentDistanceEnd:(0,h.hs)(M[I.componentDistanceEnd],0),objectLength:(0,h.hs)(M[I.objectLength],0),vertices:A,demElevation:NaN,tileData:[...p.tileData]};e.addLabel(O)}},6263:(e,t,i)=>{i.d(t,{h:()=>a});var n=i(5600),o=i(3698),r=i(6273),s=i(2702);const a=(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,n,o)=>(0,s.v)([e,t.innerId,n,o],t,i),unpackObjectAttributes:e=>({styleId:e[0],layerId:e[1],textureIndex:e[2],tiers:e[3],tileData:e.slice(4)})}},generate(e,t,i,n,o,r,s){const d=t.x,c=t.y,h=e.getBucket(o.type,"fill",a.sinks.fill.packObjectAttributes(i,o,n,r,s),a.sinks.fill.binder);let u=h.elements.offset;!function(e,t,i,n,o,r,s,a){const l=e.buffer,d=e.offset;l[d]=t+i,l[d+1]=t+n,l[d+2]=t+o,l[d+3]=t+r,l[d+4]=t+s,l[d+5]=t+a,e.offset=d+6}(h.indices,u,0,1,2,2,1,3),l(h,u++,d[0],c[0],0,1),l(h,u++,d[1],c[1],1,1),l(h,u++,d[2],c[2],0,0),l(h,u++,d[3],c[3],1,0),h.elements.offset=u}});function l(e,t,i,n,s,a){t*=4,e.views.position[t]=r.jO+i,e.views.position[t+1]=r.jO+n,e.views.txtrCoords[t]=(0,o.Bb)(s),e.views.txtrCoords[t+1]=(0,o.Bb)(a)}},1315:(e,t,i)=>{i.d(t,{OB:()=>s,fe:()=>o,lL:()=>r,s$:()=>a});var n=i(127);function o(e,t,i){n.U_(e,t);const o=n.d9(i);o[12]+=e[12],o[13]+=e[13],n.dC(e,e,o)}function r(e,t,i){var n;e.linked||(e.linked={});const o=t.vao.copy();for(const t in e.vao)o.setAttribute(t,e.vao[t]);"gltfModel"===(null==i?void 0:i.type)&&void 0!==i.style.colorTextureUvIndex&&(null===(n=t.meta)||void 0===n?void 0:n.availableTextureCoords)&&t.meta.availableTextureCoords[i.style.colorTextureUvIndex]&&o.setAttributesAliases({texcoord_color:`texcoord_${i.style.colorTextureUvIndex}`}),e.linked[t.id]={vao:o,transformMatrix:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}function s(e){return"instances"===e.symbol}const a=(e,t)=>{if(Number.isNaN(e))return;const i=t.assetManager.getModel(e);if(void 0===i)return;const n=i.objects;return 0!==n.length?n:void 0}},6757:(e,t,i)=>{i.d(t,{B:()=>h});var n=i(4265),o=i(878),r=i(4713),s=i(5597),a=i(6874),l=i(8290),d=i(1315),c=i(1634);function h(e,t,i,n,o){const r=[],s=[],a=[],l=[],d=[];for(let c=0;c<t.length;c++){const h=t[c];"instances"===h.symbol?u(e,i,h,r,s,a,l,d):m(e,i,h,r,s,a,l,d,n,o)}return{buffers:r,objects:s,identifyObjects:a,depthTestObjects:l,shadowObjects:d}}function u(e,t,i,n,c,h,u,m){const{symbol:f,sink:p,generatedObjects:_,buffer:v}=i;if(void 0===e.symbolSettingsList[f])return;const g=e.symbolSettingsList.instances.instances,{buffers:y,objectVaos:b}=function(e,t,i,n){const o=[],s=[];for(const a of n){const n=new DataView(i,a.rangeStart,a.rangeEnd-a.rangeStart),l=new r.l(n);l.drawType=r.l.StaticDraw,l.prepare(e.getRenderingContext());const d=[];t.forEach((e=>{d.push(e.vaoAttributesCreator(l))})),o.push(l),s.push(d)}return{buffers:o,objectVaos:s}}(e,g,v,_);for(const e of y)n.push(e);for(let e=0;e<_.length;e++){const{rangeStart:i,rangeEnd:n,attributes:r,drawMode:v,meta:y}=_[e],w=l.E.sinks.instances.unpackObjectAttributes(r);for(let l=0;l<g.length;l++){const _=g[l],x=_.uniformSet||"fill",S={id:(0,a.f)(),type:o.H.Tile,layerSettings:_,stride:(0,s.vP)(f,p),rangeStart:0,rangeEnd:n-i,attributes:w,attributesHash:JSON.stringify(r)+"_"+x+"_"+t.detailLevel,vao:b[e][l],drawMode:v,tile:t,symbol:f,sink:p,meta:y,getInstanceTileObjects:d.s$,canRender:!0};_.identify?h.push(S):_.depthTest?u.push(S):_.shadow?m.push(S):c.push(S)}}}function m(e,t,i,l,d,h,u,m,p,_){const{symbol:v,sink:g,generatedObjects:y,buffer:b}=i,w=e.symbolSettingsList[v];if(void 0===w)return;const x=w[g];if(void 0===x)return;const S=(0,s.vP)(v,g),I=b.byteLength/S,M=new Uint8Array(new Array(I).fill(1)),{buffer:T,vaos:E}=function(e,t,i,n){const o=new r.l(i);o.drawType=r.l.StaticDraw,o.prepare(e.getRenderingContext());const s=[],a=new c.K(new r.l(n,void 0,!1,!0),{itemSize:1,dataType:r.l.UnsignedByte});return t.forEach((t=>{const i=e.getShaderProgram(t.programName),n=t.vaoCreator(o,i);t.needsVisibilityBuffer&&n.setAttribute("a_float_visibility",a),s.push(n)})),{buffer:o,vaos:s}}(e,x,b,M);l.push(T);for(let e=0;e<y.length;e++){const{rangeStart:i,rangeEnd:r,attributes:l,drawMode:c,meta:b,objectsData:w}=y[e],I=s.kF[v].sinks[g].unpackObjectAttributes(l),M=[];for(let e=0;e<x.length;e++){const n=x[e],s=n.uniformSet||"fill",f=E[e],p={id:(0,a.f)(),type:o.H.Tile,layerSettings:n,stride:S,rangeStart:i,rangeEnd:r,attributes:I,attributesHash:JSON.stringify(l)+"_"+s+"_"+t.detailLevel,vao:f,drawMode:c,tile:t,symbol:v,sink:g,meta:b,canRender:!0};n.identify?h.push(p):n.depthTest?u.push(p):n.shadow?m.push(p):d.push(p),n.needsVisibilityBuffer&&M.push(f)}M.length>0&&w&&p&&_&&t instanceof n.W&&f(w,t,M,p,_)}}function f(e,t,i,n,o){const r=t.objectsMap;for(const t in e){const s=e[t];let a=r[t];a||(a=new Map,r[t]=a);let l=a.get(i);l||(l=[],a.set(i,l));for(const e of s)l.push(e);(n.hiddenObjects.other.has(t)||o.floorManager.isObjectHidden(t))&&n.objectsIdsToUpdate.add(t)}}},4847:(e,t,i)=>{i.d(t,{g:()=>s});var n=i(7188),o=i(6273),r=i(6490);class s{constructor(){this.dictionaries={},this.reverseDictionaries={},this.version="",this.defaultProps={},this.tileProps=n.Dz,this.tilePropsByIndex=(0,r.l4)(n.Dz),this.hash=o.DL,this.vertexProps={}}}},4288:(e,t,i)=>{i.d(t,{r:()=>f});var n=i(462),o=i(4635),r=i(6392);function s(e,t,i,n,o,s){const c={},m=new Set;for(const u of t){const t=e[u];if(d(t)){h(c,t),s.matched++;continue}const f=a(t,e,1)||a(t,e,-1);if(f){s.shifted++,h(c,f);continue}const p=l(t,e,i,n,o);if(p){s.parent++,h(c,p),m.add(p);continue}const _=(0,r.aM)(e,t);for(const e of _)s.children++,h(c,e)}return function(e,t,i){for(const n of t){const t=(0,r.aM)(i,n);for(const i of t)u(e,i)}}(c,m,e),c}function a(e,t,i){const{coords:n}=e;return t[(0,r.gx)([n[0],n[1],n[2],n[3]+i])]}function l(e,t,i,n,o){for(let s=e.detailLevel-1;s>=n;s--){const n=(0,r.xG)(t,e,s,o);if(n&&c(n,i))return n}const s=n;for(let n=e.zoomLevel;n>=s;n--){const o=(0,r.xG)(t,e,e.detailLevel,n);if(o&&c(o,i))return o}return null}function d(e){const t=e.currentMod;return void 0!==t&&t.ready}function c(e,t){const i=e.currentMod;return void 0!==i&&void 0!==t[i.key]}function h(e,t){const i=t.currentMod;void 0!==i&&(e[i.key]=i)}function u(e,t){const i=t.currentMod;void 0!==i&&delete e[i.key]}var m=i(9833);function f(e,t,i){p(e,t,i),_(e),v(e);for(const t in e.displayedMods)e.tileModsCache.get(t);g(e),y(e)}function p(e,t,i){for(const n in e.tiles)(0,m.qC)(e.tiles[n],e.tileModsCache,t,i)}function _(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));case n.W.GlobalWaiting:}}function v(e){const{tiles:t,viewportTiles:i,displayedMods:n,minZoomLevel:o,maxZoomLevel:r,displayStats:a}=e;e.displayedMods=s(t,i,n,o,r,a)}function g({tiles:e,displayedMods:t,viewportTiles:i}){for(const n in e){if(i.includes(n))continue;const o=e[n],r=o.currentMod;r&&!t[r.key]&&(0,m.U9)(o)}}function y(e){switch(e.zoomDirection){case n.Y.ZoomingIn:(e.zoomLevel<=e.zoomStartZoom||b(e))&&(e.zoomDirection=n.Y.Stationary,e.zoomStartZoom=e.zoomLevel);break;case n.Y.ZoomingOut:(e.zoomLevel>=e.zoomStartZoom||b(e))&&(e.zoomDirection=n.Y.Stationary,e.zoomStartZoom=e.zoomLevel)}}function b(e){const{tiles:t,viewportTiles:i,displayedMods:n}=e;for(let e=0;e<i.length;e++){const o=t[i[e]],r=(0,m.hW)(o);if(!r)return!1;if(void 0===n[r.key])return!1}return!0}},1285:(e,t,i)=>{i.d(t,{I2:()=>d,TZ:()=>l,YY:()=>s,bj:()=>a,cA:()=>c});var n=i(462),o=i(4635),r=i(9833);function s(e,t,i,s){var a;i.selectedIds=s,i.tilesAppearance=n.W.WaitingLayer,(0,o.eh)(i);for(const n in i.tiles){const o=i.tiles[n];(0,r.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 s=i.tiles[o];(0,r.IF)(e,t,s,i.sourceId,n)}e.labeler.disableThrottleUpdateOnce()}}function l(e,t){e.styleState=t,(0,o.eh)(e)}function d(e,t,i,r){e.tilesAppearance=r?n.W.ByOne:n.W.GlobalWaiting,e.styleId=t,e.styleRevision=i,(0,o.eh)(e)}function c(e){e.tilesAppearance=n.W.ByOne,(0,o.TQ)(e)}},9311:(e,t,i)=>{i.d(t,{o:()=>l});var n=i(462),o=i(6490),r=i(6392),s=i(9218),a=i(4635);function l(e,t){d(e,t.styleZoom,t.zoom),c(e,t),h(e),(0,a.eh)(e)}function d(e,t,i){const o=(0,a.uk)(e.type,i,t),r=o-e.zoomLevel;e.zoomDirection===n.Y.Stationary&&(r>0?(e.zoomDirection=n.Y.ZoomingIn,e.zoomStartZoom=e.zoomLevel):r<0&&(e.zoomDirection=n.Y.ZoomingOut,e.zoomStartZoom=e.zoomLevel)),e.zoomLevel=o}function c(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,r.b5)(t,i,e.minZoomLevel,n,e.viewportPadding,e.maxZoomLevel,e.requestOddTiles).map(r.gx)}function h(e){const t=Math.round((Object.keys(e.displayedMods).length+e.viewportTiles.length)*s.tiles.cacheRatio);e.tileModsCacheMaxCount<t&&(e.tileModsCacheMaxCount=t),t>e.tileModsCacheMaxCount/2&&e.tileModsCache.setSize(t)}},4635:(e,t,i)=>{i.d(t,{HM:()=>_,Rh:()=>x,TQ:()=>w,aq:()=>b,d1:()=>y,e:()=>p,eh:()=>h,ej:()=>u,lH:()=>f,uk:()=>g,w1:()=>m,y7:()=>v});var n=i(6490),o=i(9833),r=i(6392),s=i(3429),a=i(462),l=i(1683),d=i(9218),c=i(647);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 s=e.tiles[n];s||(s=e.tiles[n]=(0,o.Tp)(e.type,(0,r.cL)(n),e.sourceId,e.tileLayerId));const a=new c.l(e.selectedIds,e.styleState,s.revision,e.styleId,e.styleRevision);(0,o.a7)(s,a,e.tileModsCache)}}function u(e,t){for(let i=0;i<t.length;i++){const n=e[t[i]],r=(0,o.hW)(n);if(!r||!r.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 r in e.tiles){const s=e.tiles[r];!(0,o.LC)(s)||t.has(r)||e.zoomDirection!==a.Y.Stationary||i.has(s)||n.push(s)}return n}function v(e,t,i,n,o,r,d,c,h,u=0,m=!1){return{type:e,sourceId:t,tileLayerId:i,styleId:h.handyStyleId,styleRevision:c.styleManager.getStyleRevision(h.handyStyleId),styleState:h.styleState,minZoomLevel:n,maxZoomLevel:o,minDetailLevel:r,maxDetailLevel:d,tiles:{},viewportTiles:[],zoomLevel:g(e,h.zoom,h.styleZoom),zoomDirection:a.Y.Stationary,zoomStartZoom:0,tileModsCache:new s.L(0,((e,t)=>{c.labeler.removeLabels(t.labelsKey),(0,l.Bp)(t,h)})),tileModsCacheMaxCount:0,selectedIds:[],displayedMods:{},tilesAppearance:a.W.ByOne,mapState:h,stopLabelAnimation:!1,viewportPadding:u,displayStats:{matched:0,shifted:0,parent:0,children:0},requestOddTiles:m}}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,s=!1){const{tileManager:a,renderer:l}=e,c=i.displayedMods,h=(0,n.$X)(c,o);h.forEach((e=>{if(void 0!==e.objects){let i=!s;for(const t in o)if((0,r.HL)(e.tile,o[t].tile)){i=!1;break}e.objects.forEach((e=>{a.addObject(e),i&&e.startTicker(t,d.tileAnimation.type,d.tileAnimation.time,0,1)}))}}));const u=(0,n.$X)(o,c);u.forEach((e=>{var t;void 0!==e.objects&&(e.objects.forEach((e=>{a.removeObject(e)})),null===(t=e.tile.hover)||void 0===t||t.tileObjects.forEach((e=>a.removeObject(e))))}));const m=h.length>0||u.length>0;return m&&(t.needLabeling=!0,l.addRerenderEvent()),m}function w(e){e.viewportTiles.forEach((t=>(0,o.bg)(e.tiles[t])))}function x(e){switch(e){case"geojson":return 3;case"raster":return 1/0}return 2}},9833:(e,t,i)=>{i.d(t,{IF:()=>m,LC:()=>_,NQ:()=>T,QT:()=>v,Tp:()=>u,U9:()=>g,_v:()=>p,a7:()=>w,b9:()=>M,bg:()=>I,bt:()=>b,hW:()=>y,nR:()=>E,qC:()=>S,z3:()=>n});var n,o=i(7204),r=i(1683),s=i(6392),a=i(3672),l=i(4265),d=i(9218),c=i(647),h=i(2153);function u(e,t,i,o){return{type:e,sourceId:i,key:(0,s.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,r){const s=[];i.oldHoverTileObjects.forEach((i=>{i.tickerFinished(t)?(e.tileManager.removeObject(i),i.clean(t)):s.push(i)})),i.oldHoverTileObjects=s,void 0!==o?t.performanceCaveatEmitted||(r||!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),d.tiles.maxDetailLevel),n=t.coords[3];return i===n}(t,i))return void f(e,i,t);const r=(0,a.Ak)(n);if(t.hiddenObjects.other.has(r)||e.floorManager.isObjectHidden(r))return;(function(e,t,i,n){const o=t.newMod||t.currentMod,r=(null==o?void 0:o.params.getSelectedIds())||[],s=e.map.state;return e.defaultSource.generateHoverTile(s,t.coords,s.handyStyleId,r,self.devicePixelRatio,{},i,n)})(e,i,n,o).then((o=>{f(e,i,t);const r={id:n,tileObjects:[],generatedData:[]},s=[];o.results.forEach((n=>{const o=new l.W("hover",n.collectorOutput.data,e.renderer,e.modelsScene,t,i.coords),{packedRasters:a,rastersToLoad:c}=n.collectorOutput;void 0!==a&&e.assetManager.prepareRasters(n.styleId,a),e.assetManager.loadRasters(c),r.tileObjects.push(o),e.tileManager.addObject(o),o.startTicker(t,d.houseHover.inAnimationType,d.houseHover.inAnimationTime,0,1),n.collectorOutput.labels.length&&s.push({metatileHash:n.metatileHash,labels:n.collectorOutput.labels,styleId:n.styleId})})),r.generatedData=o.results,e.labeler.addLabels("label_hover",h.AL.Tile,s),e.identifier.debouncedFillCache(),i.hover=r}))}(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,d.houseHover.outAnimationType,d.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,r.jW)(e.currentMod))&&(!e.newMod||(0,r.jW)(e.newMod))}function v(e,t){e.currentMod&&(0,r.Bp)(e.currentMod,t),e.newMod&&(0,r.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(c.l.equal(e.currentMod.params,t))return e.currentMod.useful=!0,void(e.newMod=void 0)}if(e.newMod){c.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,s.vl)(e.coords,t),o=i.get(n);o?(e.newMod=o,e.newMod.useful=!0):(e.newMod=(0,r.es)(e,n,t),e.idSet&&e.newMod.params.setTileIds(e.idSet))}function S(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,r.zL)(e.currentMod,t,i,o),e.newMod&&((0,r.zL)(e.newMod,t,i,o),e.newMod.needGenerate&&(e.needGenerate=!0))}function I(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 E(e){e.revision++}!function(e){e[e.Initial=0]="Initial",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded"}(n||(n={}))},7619:(e,t,i)=>{i.d(t,{I:()=>v});var n=i(6392),o=i(9311),r=i(9833),s=i(1683),a=i(4245),l=i(2153),d=i(4635),c=i(4288),h=i(1285),u=i(462);function m(e){e.tilesAppearance=u.W.WaitingLayer,e.stopLabelAnimation=!0,Object.keys(e.tiles).forEach((t=>{(0,r.NQ)(e.tiles[t])})),(0,d.eh)(e)}var f=i(6874);function p(e){e.tilesAppearance=u.W.WaitingLayer,Object.keys(e.tiles).forEach((t=>{(0,r.nR)(e.tiles[t])})),(0,d.eh)(e)}var _=i(309);class v{constructor(e,t,i,n,o,r,s,a={}){this.disabledRegions=null,this.generatingCount=0,this.tilesGenerationQueue=[],this.disableTilesAnimation=!1,a=Object.assign({viewportPadding:0,disableTilesAnimation:!1,requestOddTiles:!1},a),this.modules=o,this.mapState=r,this.prevStyleState=r.styleState,this.sourceCore=s,this.id=(0,f.f)(),this.disableTilesAnimation=!!a.disableTilesAnimation,this.gridState=(0,d.y7)(s.type,s.id,this.id,e,t,i,n,o,this.mapState,a.viewportPadding,a.requestOddTiles),this.maxGeneratingCount=(0,d.Rh)(s.type)}destroy(){(0,d.d1)(this.gridState),this.modules.modelsScene.clearSourceTileMapBySource(this.sourceCore.id)}redraw(){(0,d.d1)(this.gridState),this.modules.modelsScene.clearSourceTileMapBySource(this.sourceCore.id),(0,o.o)(this.gridState,this.mapState)}getZoomDirection(){return this.gridState.zoomDirection}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,d.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),this.modules.map.core.getIsFirstStyleUpdate())}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,r.hW)(t);if(n&&n.ready)return!1}return!0}updateViewport(){(0,o.o)(this.gridState,this.mapState)}update(){this.mapState.needReplicasUpdate&&this.setModObjectsSyncNecessity();const e=Object.assign({},this.gridState.displayedMods);this.mapState.styleState!==this.prevStyleState&&(0,h.TZ)(this.gridState,this.mapState.styleState),(0,c.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,r.hW)(o);if(!a)continue;const d=(0,s.Hd)(a);if(0===d.length)continue;const c=t.getLabelsDemKey(d);a.demKey!==c&&(a.demKey=c,i.addTileLabels(a.labelsKey,l.AL.Tile,d))}}(this.gridState,t,i),this.fetch((0,d.w1)(this.gridState)),this.abortFetch((0,d.lH)(this.gridState)),this.generate((0,d.e)(this.gridState)),this.clearTiles((0,d.HM)(this.gridState)),(0,d.aq)(this.modules,this.mapState,this.gridState,e,this.disableTilesAnimation),this.updateVisibility()}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===r.z3.Loading&&(e.serverMetadata=t)}))}))}abortFetch(e){e.forEach((e=>this.sourceCore.abortTileFetch(e.coords)))}updateGenerationQueue(){if(this.generatingCount>this.maxGeneratingCount)return;const e=this.getTileToGenerate();if(!e)return;++this.generatingCount;const{tile:t,mod:i}=e,n={tileCoords:t.coords,selectedIds:i.params.getSelectedIds(),styleId:i.params.styleId},o=this.disabledRegions,d={areTileBoundsVisible:this.mapState.showDefaultTileBounds};this.sourceCore.generateTile(this.mapState,n.tileCoords,n.styleId,n.selectedIds,devicePixelRatio,d).then((e=>{if(!e)return void(0,_.wm)(this.sourceCore.type);if(!Array.isArray(e.results))return;let{results:n}=e;o&&(n=n.filter((e=>!o.includes(e.regionId))));const{tileParentChildrenMap:d}=e;if(d){const{tileKey:e,parentChildrenMap:t}=d;this.modules.tileManager.updateParentChildrenData(e,t)}n.forEach((e=>{const{styleId:t,metatileHash:i,regionId:n,collectorOutput:o}=e,{packedRasters:r,rastersToLoad:s,floorHidingMap:l,dataModelsUrls:d}=o;void 0!==r&&this.modules.assetManager.prepareRasters(t,r),this.modules.assetManager.fillDataModelUrlMap(d),this.modules.assetManager.loadRasters(s),this.modules.floorManager.prepareFloors(n,i,new a.g(l),this.sourceCore.type)})),t.idSet=(0,r.b9)(n),(0,s.aK)(i,n,t.idSet),this.modules.labeler.addTileLabels(i.labelsKey,l.AL.Tile,(0,s.Hd)(i))})).finally((()=>{this.generatingCount=this.generatingCount-1,this.updateGenerationQueue()}))}getTileToGenerate(){this.tilesGenerationQueue.sort(((e,t)=>(0,n.qu)(this.mapState.center,e,t)));let e=this.tilesGenerationQueue.shift();for(;e;){const t=(0,r._v)(e);if(t){if(t.useful)return{mod:t,tile:e};e.newMod=void 0}e=this.tilesGenerationQueue.shift()}return null}addTileToGenerationQueue(e){this.tilesGenerationQueue.push(e),this.updateGenerationQueue()}generate(e){e.sort(((e,t)=>(0,n.qu)(this.mapState.center,e,t))).forEach((e=>{var t;(null===(t=e.newMod)||void 0===t?void 0:t.needGenerate)&&!this.tilesGenerationQueue.includes(e)&&this.addTileToGenerationQueue(e)}))}clearTiles(e){this.modules.modelsScene.clearSourceTileMapByTiles(this.sourceCore.id,e);for(const t of e)this.sourceCore.deleteTile(t.coords),delete this.gridState.tiles[t.key]}updateVisibility(){const e=[];this.gridState.tileModsCache.getData().forEach((t=>{t.objects&&t.objects.forEach((t=>{e.push(t)}))})),0!==e.length&&this.updateObjectsVisibility(e)}updateObjectsVisibility(e){let t=!1;for(const i of this.mapState.objectsIdsToUpdate){const n=this.mapState.hiddenObjects.other.has(i)||this.modules.floorManager.isObjectHidden(i)?0:1;for(const o of e)o.updateObjVisiblity(i,n)&&(t=!0)}t&&(this.modules.renderer.addRerenderEvent(),this.modules.identifier.debouncedFillCache())}setModObjectsSyncNecessity(){this.gridState.tileModsCache.getData().forEach((e=>{var t;null===(t=e.objects)||void 0===t||t.forEach((e=>{e.needSync=!0}))}))}}},1683:(e,t,i)=>{i.d(t,{Bp:()=>d,Hd:()=>l,aK:()=>a,es:()=>s,jW:()=>c,zL:()=>h});var n,o=i(4265),r=i(9218);function s(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.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 d(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 c(e){return e.status===n.Initial}function h(e,t,i,s){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"zenith":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:s,metatileHash:a}=e[i];if(!n.getMetatile(a)||t.styleZoom>r.loadModelsInfoStyleZoom&&!o.isModelsInfoLoaded(s))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,s)&&(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:n}}=t;return new o.W(e.tile.type,n,s.renderer,s.modelsScene,i,e.tile.coords,void 0,s)})),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={}))},647:(e,t,i)=>{i.d(t,{l:()=>s});var n=i(3672),o=i(6490),r=i(6392);class s{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 s(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,r.vX)(this.selectedIds,this.tileIds):this.selectedIds.slice()}setTileIds(e){this.tileIds=e}}},4265:(e,t,i)=>{i.d(t,{W:()=>u,Y:()=>h});var n=i(127),o=i(9450),r=i(6392),s=i(6757),a=i(6273),l=i(1913),d=i(1315);let c=0;class h{constructor(e){this.tickerName=`tile-fade-${e}-${c++}`,this.readiness=1,this.needSync=!1,this.modelMatrices=new Map,this.coords=[0,0,0,0],this.bounds=new Map,this.mvpMatrices=new Map,this.demMatrices=new Map,this.flatMapTexMatrices=new Map,this.purpose=e,this.buffers=[],this.children=[],this.identifyChildren=[],this.depthTestChildren=[],this.shadowChildren=[]}updateMvpMatrix(e,t,i){this.modelMatrices.forEach(((o,r)=>{var s,a,l;const d=null!==(s=this.mvpMatrices.get(r))&&void 0!==s?s:new Float32Array(16);if(n.dC(d,e,o),this.mvpMatrices.set(r,d),t){const e=null!==(a=this.demMatrices.get(r))&&void 0!==a?a:new Float32Array(16);n.dC(e,t,o),this.demMatrices.set(r,e)}if(i){const e=null!==(l=this.flatMapTexMatrices.get(r))&&void 0!==l?l:new Float32Array(16);n.dC(e,i,o),this.flatMapTexMatrices.set(r,e)}}))}clean(e){for(const e of this.buffers)e.remove();this.buffers=[],this.children=[],this.identifyChildren=[],this.depthTestChildren=[],this.shadowChildren=[],l.sT(this.tickerName,e)}updateTicker(e){l.Vx(this.tickerName,{step:(e,t)=>{this.readiness=t}},e)}startTicker(e,t,i,n,o){l.BL(this.tickerName,{easing:t},e,n,o,i)}tickerFinished(e){return!l.rS(this.tickerName,e)}}class u extends h{constructor(e,t,i,n,o,r=[0,0,0,0],a,l){super(e),this.objectsMap={},this.dynamicObject=a;const{buffers:c,objects:h,identifyObjects:u,depthTestObjects:m,shadowObjects:f}=(0,s.B)(i,t,this,o,l);this.buffers=c,this.children=h,this.identifyChildren=u,this.depthTestChildren=m,this.shadowChildren=f,this.setTileCoords(r,o),h.forEach((e=>{(0,d.OB)(e)&&n.addLayerModelToSourceTileMap(e)}))}setTileCoords(e,t){const i=e[2],n=e[3],o=(0,r.aq)(i);this.coords=e,this.size=o,this.zoomLevel=i,this.detailLevel=n,this.mvpMatrices.clear(),this.demMatrices.clear(),this.flatMapTexMatrices.clear(),this.syncReplicas(t)}syncReplicas(e){const t=[...e.visibleMapReplicas];if(this.dynamicObject&&this.dynamicObject.isOutOfMainReplica()){const e=t[0],i=t[t.length-1];t.push(e-1,i+1)}const i=a.jO/a.Bq*this.size,s=Math.pow(2,this.coords[2]);this.bounds.clear(),this.modelMatrices.clear(),t.forEach((e=>{const t=[this.coords[0]+e*s,this.coords[1],this.coords[2],this.coords[3]],l=(0,r.Oy)(t);this.bounds.set(e,{min:[l[0],l[1]],max:[l[0]+this.size,l[1]+this.size]});const d=n.Ue();n.wA(d,[l[0]-i,l[1]-i,0],o.al(this.size/a.gt,this.size/a.gt,a._9/a.gt)),this.modelMatrices.set(e,d)})),this.needSync=!1}updateObjVisiblity(e,t){const i=this.objectsMap[e];if(!i)return!1;let n=!1;return i.forEach(((e,i)=>{const o=i[0].getBuffer("a_float_visibility").getData();if(!(o instanceof Uint8Array))return;let r=!1;for(const{offset:i,size:n}of e)if(o[i]!==t){for(let e=i;e<i+n;++e)o[e]=t;r=!0}if(r){i[0].rewriteData("a_float_visibility");for(const e of i)e.isDirty=!0;n=!0}})),n}}},5600:(e,t,i)=>{function n(e){return e}i.d(t,{D:()=>n})},2153:(e,t,i)=>{var n,o,r,s,a;i.d(t,{AL:()=>r,Dl:()=>a,_r:()=>o,a_:()=>n,m3:()=>s}),function(e){e[e.Common=0]="Common",e[e.Commercial=1]="Commercial",e[e.CommercialCity=2]="CommercialCity",e[e.CommercialPremium=3]="CommercialPremium",e[e.Landmark=4]="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"}(r||(r={})),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"}(s||(s={})),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={}))},3024:(e,t,i)=>{var n;function o(e){switch(e){case"chess":return n.Chess;case"doubledash":return n.DoubleDash;case"triangles":return n.Triangles;case"circle":return n.Circle;case"heart":return n.Chevron;case"stripe":return n.Stripe;default:return n.None}}i.d(t,{R:()=>o,y:()=>n}),function(e){e[e.Chess=1]="Chess",e[e.DoubleDash=2]="DoubleDash",e[e.Stripe=3]="Stripe",e[e.Triangles=4]="Triangles",e[e.Circle=5]="Circle",e[e.Chevron=6]="Chevron",e[e.None=-1]="None"}(n||(n={}))},6479:(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={}))},878:(e,t,i)=>{var n;i.d(t,{H:()=>n}),function(e){e[e.Tile=0]="Tile",e[e.Custom=1]="Custom"}(n||(n={}))},462:(e,t,i)=>{var n,o;i.d(t,{W:()=>o,Y:()=>n}),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={}))},5095:(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,{L:()=>o,n:()=>n})},9865:(e,t,i)=>{function n(e){return Array.isArray(e)?e:[e]}function o(e){return e&&e.buffer instanceof ArrayBuffer}i.d(t,{f:()=>o,l:()=>n})},7966:(e,t,i)=>{i.d(t,{As:()=>f,HB:()=>w,U0:()=>u,bX:()=>d,fb:()=>l,gA:()=>c,mN:()=>h,z:()=>p});var n=i(6392),o=i(2435),r=i(7464),s=i(3194),a=i(7486);function l(e,t,i){return(0,o.IG)(i.fontUrlTemplate,{name:e,range:String(t)})}function d(e,t,i){const n=v(e)?e:g(t.iconBaseUrl,e);return(0,o.IG)(n,{subdomain:i,appHost:window.location.host})}function c(e,t){return v(e)?e:g(t.modelsBaseUrl,e)}function h(e,t,i){return v(e)?e:t?/{\w+}/g.test(t)?(0,o.XK)(t,{modelSrc:e,subdomain:(0,n.Kn)(i)}):g(t,e):e}function u(e,t,i){return e.replace("image",`image_${t}x${i}`)}const m=/_i$/;function f(e,t){const i=v(t.fontsPath)?t.fontsPath:g(t.rootUrl,t.fontsPath);e.fontUrlTemplate=g(i,"{name}_{range}.pbf"),e.iconBaseUrl=v(t.iconsPath)?t.iconsPath:g(t.rootUrl,t.iconsPath),e.modelsBaseUrl=v(t.modelsPath)?t.modelsPath:g(t.rootUrl,t.modelsPath)}function p(e){return v(e.stylePath)?e.stylePath:g(e.rootUrl,e.stylePath)}const _=new RegExp("^(?:[a-z]+:)?(?:[a-z]+:)?//","i");function v(e){return _.test(e)}function g(...e){const t=e.filter((e=>e.length>0));let i=t[0];for(let e=1;e<t.length;e++){"/"!==i[i.length-1]&&(i+="/");const n=t[e];"/"===n[0]?i+=n.slice(1):i+=n}return i}function y(e,t,i){const n=(0,r.pV)(i.style.iconAnchor),o=(0,r.PR)(e,n[0],n[1]);return t.rasterSets.byKey[o]}function b(e,t,i,n){const r=y(n.replace(m,""),t,i);if(!r)return;const s=t.icons[r.name];return s?d(s.url,t,(0,o.Sy)(e.map.state.subdomains,r.name)):void 0}function w(e,t,i){const n=e.styleManager.getStyle(e.map.state.handyStyleId);if(!n)return;const l=n.layersById[t.layerId];if(!l)return;const c=(0,s.jJ)(e.map.state.styleZoom,e.map.state.styleState,[]);let h;const f=l.style.iconWidth,p=(0,s.vn)(f,c);if(i.isCommercial){h=n.rasterSets.byKey[(0,r.zV)(t.id.lo,t.id.hi)];const e=h.url;if(!e)return;const i=(0,a.Bl)(h.rasters,p*window.devicePixelRatio,!0);if(void 0===i)return;const{w:o,h:s}=h.rasters[i];return{baseUrl:e,fullUrl:u(e,o,s),width:o,height:s}}const _=l.style.iconImage;if(!_)return;const v=(0,s.Q9)(_,c);if(h=y(v,n,l),!h)return;const g=function(e,t,i,n){const r=t.icons[i.name];if(!r)return;const s=(0,a.Bl)(i.rasters,n*window.devicePixelRatio,!0);if(void 0===s)return;const l=d(r.url,t,(0,o.Sy)(e.map.state.subdomains,i.name)),{w:c,h}=i.rasters[s];return{fullUrl:l,width:c,height:h}}(e,n,h,p);if(g){if(function(e){return m.test(e)}(v)){const t=b(e,n,l,v);void 0!==t&&(g.fullUrlUnhovered=t)}return g}}},1274:(e,t,i)=>{function n(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 o=0;o<e.length;o++)i[o]=n(t,e[o].clientX,e[o].clientY);return i}function r(e){return e.touches.length>1}i.d(t,{KK:()=>o,N2:()=>r,yK:()=>n})},6490:(e,t,i)=>{i.d(t,{$I:()=>y,$X:()=>f,AB:()=>h,Id:()=>l,Kh:()=>v,Kv:()=>c,TH:()=>g,Te:()=>a,VJ:()=>w,Xx:()=>s,ZY:()=>d,kn:()=>u,l4:()=>m,sB:()=>p,t7:()=>x,uZ:()=>r,vO:()=>_,vZ:()=>b});var n=i(9450),o=i(4874);function r(e,t,i){return e=Math.max(e,t),e=Math.min(e,i)}function s(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 d(e){return e/Math.PI*180}function c(e,t,i){void 0!==i.zoom&&(i.zoom=r(i.zoom,e.minZoom,e.maxZoom));const s=new o.V(e),a=s.unproject(t);s.setState(Object.assign(Object.assign({},e),i));const l=s.unproject(t),d=n.Ue();return n.lu(d,a,l),d}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 r((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){return e===t||e.length===t.length&&!e.some(((e,i)=>e!==t[i]))}function b(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,r,s;if(i&&n){if(r=e.length,r!==t.length)return!1;for(o=r;0!=o--;)if(!b(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 d=e instanceof RegExp,c=t instanceof RegExp;if(d!==c)return!1;if(d&&c)return e.toString()===t.toString();const h=Object.keys(e);if(r=h.length,r!==Object.keys(t).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,h[o]))return!1;for(o=r;0!=o--;)if(s=h[o],!b(e[s],t[s]))return!1;return!0}return e!=e&&t!=t}function w(e,t){const i=e.indexOf(t);return-1!==i&&(e.splice(i,1),!0)}function x(e,t,i){return e+(t-e)*i}},1375:(e,t,i)=>{i.d(t,{cX:()=>c});i(4713),i(9218);var n=i(3249),o=i(7188),r=i(5597),s=i(8009),a=i(6273),l=i(3194),d=i(6392);function c(e,t,i){const c=a.Bq,h={x:new Uint16Array([0,c,c,0,0]),y:new Uint16Array([0,0,c,c,0])},u=(0,n.FJ)({}),m=(0,l.Yi)(i,o.i4,o.Dz,u,o.wz);(0,r.XI)({collector:e,generator:s.z.generate,args:[n.jf,t,m,(0,d.Bs)([0,0,0,0]),h]})}},4576:(e,t,i)=>{i.d(t,{dm:()=>w,rq:()=>x,JA:()=>b,Xq:()=>S});var n=i(6208),o=i.n(n),r=i(9899),s=i(7999);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 d{constructor(e,t){this.stacks=e.readFields(c,[],t)}}function c(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,s.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(3698),f=i(6490),p=i(9218),_=i(309),v=i(3194),g=i(6273);class y{constructor(e,t,i){const n=[];let o=0;for(let i=0;i<e.length;i++){const r=e.charCodeAt(i),s=t&&t[r];s?(n.push(s),o+=s.advance):r!==p.fonts.bomCharCode&&(0,_.Q7)(e[i],r)}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 r=new y(o[e],i,t);n.lines.push(r),r.width>n.maxWidth&&(n.maxWidth=r.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 S(e){const t=new d(new(o())(new Uint8Array(e))).stacks[0].glyphs,{width:i,height:n}=function(e){const t=[],i=new r.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 r=e[Number(n[o])];r.bitmap&&(r.texTop=(0,m.Bb)(r.y/i),r.texLeft=(0,m.Bb)(r.x/t),r.texBottom=(0,m.Bb)((r.y+r.height)/i),r.texRight=(0,m.Bb)((r.x+r.width)/t))}}(t,i,n);const s=function(e,t,i){const n=new Uint8Array(t*i),o=Object.keys(e);for(let i=0;i<o.length;i++){const r=e[Number(o[i])];if(r.bitmap)for(let e=0;e<r.height;e++){const i=t*(r.y+e)+r.x,o=r.width*e;for(let e=0;e<r.width;e++)n[i+e]=r.bitmap[o+e]}}return n.buffer}(t,i,n);return{glyphData:t,bitmap:s,width:i,height:n}}},9073:(e,t,i)=>{i.d(t,{$X:()=>B,A5:()=>h,C:()=>u,EO:()=>b,I0:()=>j,LX:()=>f,PA:()=>_,Qn:()=>I,TD:()=>m,Vv:()=>L,X$:()=>x,XV:()=>P,Xg:()=>T,Z3:()=>S,_L:()=>A,a4:()=>M,gr:()=>D,h0:()=>z,ik:()=>k,kC:()=>C,nn:()=>y,pc:()=>v,r9:()=>g,to:()=>R,vn:()=>E,yq:()=>p});var n=i(378),o=i(9450),r=i(127),s=i(6273),a=i(6490),l=i(8194),d=i(4874),c=i(9218);const h=2*Math.PI*6378137,u=s.sX/h,m=r.wA([],[-1,-1,0],[2,2,1]),f=r.wA([],[.5,.5,0],[.5,.5,1]);function p(e){var t;const i=s.sX/2,n=Math.sin((0,a.Id)(e[1])),r=e[0]*s.sX/360,l=Math.log((1+n)/(1-n))*s.sX/(4*Math.PI);let d=0;if(e.length>2){const i=T(e[1]);d=(null!==(t=e[2])&&void 0!==t?t:0)*u*i}return o.al(r,(0,a.uZ)(l,-i,i),d)}function _(e){const t=[0,0];t[0]=360*e[0]/s.sX;const i=-2*Math.PI/s.sX;if(t[1]=90-2*(0,a.ZY)(Math.atan(Math.exp(e[1]*i))),e[2]){const i=T(t[1]);t[2]=e[2]/u/i}return t}function v(e){return Math.max(e,c.minCalculationScreenHeight)}function g(e,t){const i=c.defaultCameraConfig,n=v(t[1])/2,o=s.sX/Math.pow(2,e);return n/s.y4*o/Math.tan(i.fov/2)}function y(e,t){const i=c.defaultCameraConfig;return Math.log(v(t[1])*s.sX/(2*s.y4*Math.tan(i.fov/2)*e))/Math.LN2}function b(e){return s.ax*Math.pow(2,-e)}function w(e){const t=_(e)[1],i=1/(2*Math.cos((0,a.Id)(t)));return Math.log(i)/Math.log(2)}function x(e,t){const i=w(t)*(0,a.sB)(9,10,e);return e+(0,a.uZ)(i,-1,0)}function S(e,t){const i=w(t),n=i*(0,a.sB)(9,10+i,e);return e-(0,a.uZ)(n,-1,0)}function I(e,t){return s.LF*(e/s.$U)/t}function M(e,t){return t*u*T(e[1])}function T(e){return 1/Math.cos((0,a.Id)(e))}function E(e,t){const i=Math.PI/180,n=e[1]*i,o=t[1]*i,r=Math.sin((t[1]-e[1])*i/2),s=Math.sin((t[0]-e[0])*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return Math.round(6371e3*l)}function P(e){let t=0;if(e.length>1)for(let i=0;i<e.length-1;i++)t+=E(e[i],e[i+1]);return t}const L=l.Ue([-s.sX/2,-s.sX/2],[s.sX/2,s.sX/2]),A=l.Ue([-100*s.sX/2,-s.sX/2],[100*s.sX/2,s.sX/2]);function C(e){const t=-s.ed,i=s.ed;let n=e[0];if(n>=-s.ed&&n<=s.ed)return;const o=i-t;n=((n-t)%o+o)%o+t,e[0]=n}function z(e,t){return e*Math.pow(2,-t)*s.sX/s.y4}function k(e,t){return e*Math.pow(2,t)*s.y4/s.sX}function R(e,t){return 0===e?-1/0:-Math.log(t*s.y4/(e*s.sX))/Math.LN2}const F=n.Ue(),O=n.Ue();function D(e,t,i){n.$X(F,i,e),n.$X(O,t,e);const o=n.AK(F,O)/n.kE(F);return Math.atan2(o,e[2])}function B(e,t,i,n,o,r,s={top:0,right:0,bottom:0,left:0},l={top:0,right:0,bottom:0,left:0},h,u){const m=c.defaultCameraConfig,f=new d.V({center:p(e),zoom:t,rotation:(0,a.Id)(i),size:n,pitch:(0,a.Id)(o),viewport:s,padding:l,cameraConfig:m}),v=_(f.unproject(r)),g=_(f.unproject([r[0]+h,r[1]+u]));return Math.max(1,E(v,g))}function j(e){const t=[...e];return function(e){const t=e[0],i=e[1];return(0,a.Kh)(t,-s.ed,s.ed)&&(0,a.Kh)(i,-s.ed,s.ed)}(t)||(t[0]=(s.sX+(t[0]+s.ed)%s.sX)%s.sX-s.ed),t}},1959:(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})},309:(e,t,i)=>{i.d(t,{$z:()=>s,Q7:()=>o,cM:()=>l,wm:()=>a});var n=i(7999);function o(e,t){l(`No glyph for character ${e} (code = ${t}, range = ${(0,n.rx)(t)})`)}const r=new Set;function s(e){console.group("Gltf model error"),console.warn("Stage:",e.layer),e.message&&console.warn("Message:",e.message),e.originalError&&(console.groupCollapsed("Original error"),console.warn(e.originalError),console.groupEnd()),console.groupEnd()}function a(e){l(`Got an empty response from the "${e}" tile generation.`)}function l(e){r.has(e)||(console.log(e),r.add(e))}},7636:(e,t,i)=>{i.d(t,{g:()=>l});var n=i(9450),o=i(8194),r=i(6490),s=i(9073),a=i(9090);function l(e,t,i){if(0===e.length)return;const l=(0,r.Id)(t),c=o.Ue();for(const t of e){const e=(0,s.yq)(t);(0,a.hk)(e,-l),o.aM(c,e)}const h=n.Ue();return o.be(h,c),(0,a.hk)(h,l),{center:h,zoom:d(c,i)}}function d(e,t){return Math.min((0,s.to)(t[0],Math.abs(e.max[0]-e.min[0])),(0,s.to)(t[1],Math.abs(e.max[1]-e.min[1])))}},8194:(e,t,i)=>{i.d(t,{JG:()=>d,Rk:()=>u,Ue:()=>s,X3:()=>a,aM:()=>l,bA:()=>v,be:()=>h,jV:()=>_,kK:()=>p,mc:()=>c,r3:()=>m,se:()=>f});var n=i(378),o=i(6490),r=i(9073);function s(e,t){return{min:e||n.al(1/0,1/0),max:t||n.al(-1/0,-1/0)}}function a(e){return s((0,r.yq)(e.southWest),(0,r.yq)(e.northEast))}function l(e,t){n.VV(e.min,e.min,t),n.Fp(e.max,e.max,t)}function d(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 c(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){return t[1]<=e.max[1]&&t[1]>=e.min[1]}function p(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 _(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 v(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}},2539:(e,t,i)=>{i.d(t,{Jh:()=>f,Oy:()=>a,Z4:()=>p,hS:()=>s,iE:()=>l,z_:()=>m});i(1245);var n=i(9450),o=i(378),r=(i(127),i(8194));Array(16);function s(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 d(e,t,i){const{a:o,b:r,c:a}=s(e,t);return n.al(i,-(o*i+a)/r,0)}function c(e,t,i){const{a:o,b:r,c:a}=s(e,t);return n.al(-(r*i+a)/o,i,0)}const h=r.Ue(),u=r.Ue();function m(e,t,i){const n=t[t.length-1]*i;let r=e[0],s=0;const a=[r];let l,d=1;for(;d<e.length&&!l;){const i=e[d],c=t[d];let h=i;if(c>n){if(!l){const e=(n-s)/(c-s);l=[],o.t7(l,r,i,e)}h=l}a.push(h),r=h,s=t[d],d++}return a}function f(e,t){let i=e[0];r.mc(h),r.aM(h,i);let n=[i];const o=[n];let s=1;for(;s<e.length;){const a=e[s];let l=!1,m=a;if(r.JG(u,h),r.aM(u,m),u.max[0]-u.min[0]>t){m=d(i,m,u.max[0]===m[0]?u.min[0]+t:u.max[0]-t),l=!0}if(l&&(r.JG(u,h),r.aM(u,m)),u.max[1]-u.min[1]>t){m=c(i,m,u.max[1]===m[1]?u.min[1]+t:u.max[1]-t),l=!0}l?(n.push(m),r.mc(h),r.aM(h,m),n=[m],o.push(n),i=m):(n.push(a),r.aM(h,a),i=a,s++)}return o}function p(e,t,i){const n=e[0]-t[0],o=e[1]-t[1],r=i[0]-t[0],s=i[1]-t[1],a=r*r+s*s,l=0!==a?(n*r+o*s)/a:0;return l<0?t:l>1?i:[t[0]+l*r,t[1]+l*s]}},4091:(e,t,i)=>{i.d(t,{bu:()=>n,qt:()=>o});const n=e=>(e=>{if(e.length>2){let t=0;for(let i=e.length-1,n=i,o=0;o<=i;o++){const i=e[n],r=e[o];t+=(i[0]+r[0])*(i[1]-r[1]),n=o}return t/2}return 0})(e)>0;function o(e){const t=(e=e.slice().sort(s)).length,i=new Array(2*t);let n=0;for(let o=0;o<t;o++){const t=e[o];for(;n>=2&&r(i[n-2],i[n-1],t)<=0;)n--;i[n++]=t}const o=n+1;for(let s=t-2;s>=0;s--){const t=e[s];for(;n>=o&&r(i[n-2],i[n-1],t)<=0;)n--;i[n++]=t}return i.slice(0,n-1)}function r(e,t,i){return(t[1]-e[1])*(i[0]-e[0])-(t[0]-e[0])*(i[1]-e[1])}function s(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}},267:(e,t,i)=>{i.d(t,{BS:()=>s,By:()=>a,M4:()=>l,mW:()=>d});var n=i(9450),o=i(8194),r=i(2539);function s(e){const t=e[0][0],i=e[0][1],n=e[1][0],o=e[1][1],r=e[2][0],s=e[2][1],a=e[3][0],l=e[3][1];return{min:[Math.min(t,n,r,a),Math.min(i,o,s,l)],max:[Math.max(t,n,r,a),Math.max(i,o,s,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=s(e);if(!(0,o.kK)(t,i))return!1;const n=[(0,r.hS)(e[3],e[2]),(0,r.hS)(e[1],e[0]),(0,r.hS)(e[0],e[3]),(0,r.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 d(e,t,i){e.forEach((e=>{const o=1+t/n.TE(i,e);n.t7(e,i,e,o)}))}},9090:(e,t,i)=>{i.d(t,{AE:()=>l,Cb:()=>d,Hl:()=>g,IB:()=>_,L$:()=>y,Tz:()=>u,af:()=>m,ax:()=>h,fN:()=>p,hk:()=>b,m2:()=>f,se:()=>v,tG:()=>w,uI:()=>c});var n=i(378),o=i(9450),r=i(6490);const s=[0,0,0],a=[0,0,0];function l(e,t,i,n,o){if(t!==n||i!==o){const r=o-i,s=t-n,a=1/Math.sqrt(r*r+s*s);e[0]=r*a,e[1]=s*a}else e[0]=0,e[1]=0}function d(e,t,i,n){return o.lu(s,i,t),o.lu(a,i,n),o.kC(e,a,s),o.Fv(e,e),e}function c(e,t,i,n,o){if(t!==n||i!==o){const r=n-t,s=o-i,a=1/Math.sqrt(r*r+s*s);e[0]=r*a,e[1]=s*a}else e[0]=0,e[1]=0}function h(e,t,i,n,o){const r=t+n,s=i+o,a=t*r+i*s;if(0!==a){const t=1/a;e[0]=r*t,e[1]=s*t}else e[0]=0,e[1]=0}function u(e){return(0,r.uZ)(127*e,-127,127)}function m(e,t=e){return e[0]=u(t[0]),e[1]=u(t[1]),e}function f(e,t,i,n,o){e[0]=t*n+i*o,e[1]=i*n-t*o}function p(e,t){const i=t[0];e[0]=-t[1],e[1]=i}function _(e,t){const i=t[0];e[0]=t[1],e[1]=-i}function v(e){return 0===e[0]&&0===e[1]}function g(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])}function y(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}function b(e,t){const i=Math.sin(t),o=Math.cos(t),r=o*e[0]-i*e[1],s=i*e[0]+o*e[1];n.t8(e,r,s)}function w(e,t,i,o,r=!0){n.I6(t,i)||n.I6(i,o)?n.t8(e,0,0):(n.lu(s,i,t),n.lu(a,o,i),r?(p(s,s),p(a,a)):(_(s,s),_(a,a)),n.Fv(s,s),n.Fv(a,a),n.IH(e,s,a),n.Fv(e,e))}},7188:(e,t,i)=>{i.d(t,{Dz:()=>u,GG:()=>s,KP:()=>d,Qy:()=>c,SD:()=>r,ev:()=>a,i4:()=>p,nF:()=>m,so:()=>_,wz:()=>f});var n=i(6490),o=i(4716);function r(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 s(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){var i,n,o,r,s,a;const l={};e.forEach(((e,t)=>{l[e]=t}));let d=e.length;l.selected=null!==(i=l.selected)&&void 0!==i?i:d++,l.hovered=null!==(n=l.hovered)&&void 0!==n?n:d++,l.dpi=null!==(o=l.dpi)&&void 0!==o?o:d++,l.isRealtime=null!==(r=l.isRealtime)&&void 0!==r?r:d++,l.pixelDensityPreset=null!==(s=l.pixelDensityPreset)&&void 0!==s?s:d++,l.tier=null!==(a=l.tier)&&void 0!==a?a:d++;for(const e in t)void 0===l[e]&&(l[e]=d++);return l}(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,vertexProps:l(e.vertexProps)}}function l(e){const t={point:["x","y","z"],polygon:["x","y","cut","signed_z"],polyline:["x","y"]};if(!e)return t;const i={0:"point",1:"polyline",2:"polygon"};return Object.keys(e).forEach((n=>{const o=i[n];void 0!==o?t[o]=e[parseInt(n,10)]:console.warn(`Неизвестный тип геометрии "${n}", нужно его поддержать`)})),t}function d(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,vertexProps:{}})}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 h=0;const u={beginningIsCut:h++,class:h++,componentDistanceEnd:h++,componentDistanceStart:h++,db_icon_priority:h++,db_label_priority:h++,db_label2_priority:h++,dpi:h++,endingIsCut:h++,height:h++,db_hidden_by_plan_building_id:h++,id:h++,isRealtime:h++,db_label:h++,db_label2:h++,nextPointX:h++,nextPointY:h++,db_object_class:h++,objectLength:h++,pixelDensityPreset:h++,previousPointX:h++,previousPointY:h++,db_region:h++,selected:h++,hovered:h++,db_sublayer:h++,traffic_color:h++,traffic_road_class:h++,traffic_road_z_level:h++,db_tiers:h++,model_src:h++,linkedIds:h++,azimuth:h++},m={version:"0.0.0",tileProps:u,tilePropsByIndex:(0,n.l4)(u),defaultProps:{},dictionaries:{},reverseDictionaries:{},vertexProps:{}},f=[],p={},_={sourceName:"zenith"}},2702:(e,t,i)=>{function n(e,t,i){return t.precomputes.forEach(((t,n)=>{e.push(i.tileData[n])})),e}function o(e,t){for(let i=0,n=t.length;i<n;i++)e.push(t[i]);return e}i.d(t,{L:()=>o,v:()=>n})},3698:(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 r(e){return 256*Math.log(e)+.5<<16>>16}i.d(t,{Bb:()=>o,KF:()=>r,wj:()=>n})},173:(e,t,i)=>{i.d(t,{R4:()=>s,b8:()=>o,ff:()=>r});var n=i(309);function o(e,t){let i=2166136261;for(const e of t)i^=e,i*=16777619;e.randomSeed=Math.abs(i)}function r(e,t,i){let o=.5;return e.randomSeed?(e.randomSeed=16807*e.randomSeed%2147483647,o=(e.randomSeed-1)/2147483646):(0,n.cM)("Resolve 'random': random seed is absent, the mean value between start and end will be used."),o*(i-t)+t}function s(e=128){const t=[],i=[];for(let n=0;n<e;n++)t.push(a(n,2)),i.push(a(n,3));return{base2:t,base3:i}}function a(e,t){let i=0,n=1/t;for(;e>0;)i+=n*(e%t),e=Math.floor(e/t),n/=t;return i}},7486:(e,t,i)=>{i.d(t,{Bl:()=>c,W8:()=>d,rA:()=>l});var n=i(6479),o=i(7464);let r=10001;const s={w:0,h:0,x:0,y:0,atlasIndex:0,isPacked:!1},a={};function l(e,t,i,l,d){const c=(0,o.zV)(e.lo,e.hi);if(!a[c]){const o=r++;a[c]={type:n.f.Unique,isSvg:!1,index:o,key:c,name:"",fileName:"",id:e,regionId:i,url:d,rasters:t.map(((e,t)=>Object.assign(Object.assign({},s),{rasterSetIndex:o,rasterIndex:t,w:e,h:e,anchorX:l[0],anchorY:l[1]})))}}return a[c]}function d(e){const t=r++;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 c(e,t,i){let n,o=1/0;for(let r=0;r<e.length;r++){const s=e[r];if(i&&!s.isPacked)continue;const a=Math.abs(s.w-t);a<o&&(n=r,o=a)}return n}},297:(e,t,i)=>{i.d(t,{ng:()=>c,Iw:()=>l,dp:()=>o,iY:()=>n,GY:()=>s,rJ:()=>r,w7:()=>d});let n=e=>e,o=null,r=!1;const s=new Promise((e=>{o=()=>{r=!0,e()}})),a=new Set(["ar"]);function l(e,t){return"always-on"===e||"depends-on-language"===e&&a.has(t)}function d(e,t,i){const n=t.workers.labeling;function r(){n.markRtlPluginLoaded().then((()=>{null!==o&&o()}))}return l(e.scenario,i)?fetch(e.url,{integrity:e.hash}).then((e=>e.text())).then((e=>Promise.all([n.loadRtlPlugin(e),Promise.resolve(c(e))]))).catch((e=>{r();const t=new Error,i="[RTL Plugin]: loading failed.";var n;throw t.message="object"==typeof(n=e)&&Boolean(n)&&"message"in n?`${i} ${e.message}`:i,t})):(r(),Promise.resolve())}const c=function(e){let t,i=!1;return function(...n){return i||(i=!0,t=e.apply(this,n)),t}}((function(e){new Function(e)(),n=self.mapglRtlPlugin.processRtl,o&&o()}))},7999:(e,t,i)=>{i.d(t,{Go:()=>a,lD:()=>r,rx:()=>s,zT:()=>o});var n=i(9218);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 r(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 s(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(s(o))}})),Array.from(t)}},2398:(e,t,i)=>{i.d(t,{U:()=>r});var n=i(6392),o=i(5095);class r{constructor(e,t=!1){this.dataType=e,this.pendingRequests=new Map,this.ignoredStatusCodes=t?[204,404]:[204]}fetch(e,t){return new Promise((i=>{const r=t(e),s=(0,n.gx)(e),a=("json"===this.dataType?o.L:o.n)({url:r},((e,t)=>{if(this.pendingRequests.delete(s),void 0!==e)return this.ignoredStatusCodes.includes(e.status)||console.error(`Failed to fetch a tile by url "${r}" Error: status "${e.status}", message: ${e.message}`),void i({error:e});i({data:t})}));this.pendingRequests.set(s,{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))}}},3675:(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}}},4245:(e,t,i)=>{i.d(t,{g:()=>o});var n=i(3672);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={}}}},7204:(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}delete(e){const t=this.map[e.hi];return!(!t||!t[e.lo])&&delete t[e.lo]}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}}},3672:(e,t,i)=>{i.d(t,{Ak:()=>l,IL:()=>d,Ru:()=>o,nI:()=>r,v7:()=>s,y5:()=>a});const n=1e5;function o(e,t){return{type:64,lo:e,hi:t}}function r(e){return null!==e&&"object"==typeof e&&64===e.type}function s(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(!s(e[i],t[i]))return!1;return!0}function l(e){return g(e.lo,e.hi)}function d(e){const t=y(e);return o(t[0],t[1])}function c(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,r=0;for(;--o>=0;){const s=r*n+t[o],a=Math.floor(s/i);r=s-a*i,e[o]=a}}function m(e,t){let i=0;for(let o=0;o<4;o++){const r=e[o]+t[o]+i;i=Math.floor(r/n),e[o]=r%n}}function f(e,t){let i=0;for(let o=0;o<4;o++){let r=e[o]-t[o]-i;r<0?(r+=n,i=1):i=0,e[o]=r}}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=c(e),n=c(t);return h(n),m(n,i),p(n)}function y(e){const t=v(e),i=c(0);u(i,t);const n=_(i);return h(i),f(t,i),[_(t),n]}},3429:(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)}}}},3487:(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]}}},9981:(e,t,i)=>{i.d(t,{aU:()=>s,fL:()=>r,o1:()=>o});var n=i(6273);function o(e){return n.$U*e}function r(e){return e/n.$U}function s(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)}},7609:(e,t,i)=>{i.d(t,{CE:()=>u,Cz:()=>f,M7:()=>p,Ty:()=>c,h3:()=>m,wu:()=>h});var n=i(9218);const o=new Set(n.commercialSublayers),r=new Set(n.commercialCitySublayers),s=new Set(n.commercialPremiumSublayers),a=new Set(n.personalSublayers),l=new Set(n.landmarkPoiSublayers),d=new Set(n.commercialModelSublayers);function c(e){return o.has(e)}function h(e){return r.has(e)}function u(e){return s.has(e)}function m(e){return a.has(e)}function f(e){return l.has(e)}function p(e){return d.has(e)}},4411:(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 r=o.hosts.get(e);if(r){if(r[i])return"destroy"===i&&o.hosts.delete(e),r[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}}}}},7256:(e,t,i)=>{i.d(t,{D:()=>s,H:()=>r});var n=i(6892),o=i(3675);class r 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,r={from:e,to:i,msg:n,transferable:o};this.routeMessage(r)}))}send(e,t,i){const o=this.workers.get(e);if(o){const r={to:e,from:n.P.Main,msg:t,transferable:i};void 0!==i?o.postMessage(r,i):o.postMessage(r)}}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:r}}=e;if(i===n.P.Main)this.emit("message",e);else if(i===n.P.All)t!==n.P.Main&&this.emit(r,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 s 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)}}},4500:(e,t,i)=>{i.d(t,{J:()=>o});var n=i(6892);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++,r=new Promise((e=>{this.pendingFunctions.set(o,e)})),s={type:n.C.FunctionUse,data:{id:o,name:t,args:i}};return this.connector.send(e,s),r}}onFunctionUse(e,t){const{data:{name:i,args:n,id:o}}=e,r=this.functions.get(i);if(r){const e=r(...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`)}}},6892:(e,t,i)=>{var n,o;i.d(t,{C:()=>o,P:()=>n}),function(e){e[e.Main=0]="Main",e[e.Parser=1]="Parser",e[e.Labeling=2]="Labeling",e[e.Models=3]="Models",e[e.All=4]="All"}(n||(n={})),function(e){e[e.FunctionUse=0]="FunctionUse",e[e.FunctionResult=1]="FunctionResult"}(o||(o={}))},1913:(e,t,i)=>{i.d(t,{rS:()=>U,U2:()=>B,BL:()=>j,sT:()=>N,Vx:()=>V});var n={};i.r(n),i.d(n,{ease:()=>a,easeInBack:()=>z,easeInCirc:()=>T,easeInCubic:()=>h,easeInElastic:()=>L,easeInExpo:()=>S,easeInOutBack:()=>R,easeInOutCirc:()=>P,easeInOutCubic:()=>m,easeInOutElastic:()=>C,easeInOutExpo:()=>M,easeInOutQuad:()=>c,easeInOutQuart:()=>_,easeInOutQuint:()=>y,easeInOutSine:()=>x,easeInQuad:()=>l,easeInQuart:()=>f,easeInQuint:()=>v,easeInSine:()=>b,easeOutBack:()=>k,easeOutBounce:()=>F,easeOutCirc:()=>E,easeOutCubic:()=>u,easeOutElastic:()=>A,easeOutExpo:()=>I,easeOutQuad:()=>d,easeOutQuart:()=>p,easeOutQuint:()=>g,easeOutSine:()=>w,inertia:()=>O,linear:()=>r});var o=i(9218);function r(e,t,i,n){return t+i/n*e}const s=i(6636)(.25,.1,.25,1);function a(e,t,i,n){return t+i*s(e/n)}function l(e,t,i,n){return i*(e/=n)*e+t}function d(e,t,i,n){return-i*(e/=n)*(e-2)+t}function c(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t}function h(e,t,i,n){return i*(e/=n)*e*e+t}function u(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t}function m(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function f(e,t,i,n){return i*(e/=n)*e*e*e+t}function p(e,t,i,n){return-i*((e=e/n-1)*e*e*e-1)+t}function _(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t}function v(e,t,i,n){return i*(e/=n)*e*e*e*e+t}function g(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t}function y(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t}function b(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}function w(e,t,i,n){return i*Math.sin(e/n*(Math.PI/2))+t}function x(e,t,i,n){return-i/2*(Math.cos(Math.PI*e/n)-1)+t}function S(e,t,i,n){return 0==e?t:i*Math.pow(2,10*(e/n-1))+t}function I(e,t,i,n){return e==n?t+i:i*(1-Math.pow(2,-10*e/n))+t}function M(e,t,i,n){return 0==e?t:e==n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t}function T(e,t,i,n){return-i*(Math.sqrt(1-(e/=n)*e)-1)+t}function E(e,t,i,n){return i*Math.sqrt(1-(e=e/n-1)*e)+t}function P(e,t,i,n){return(e/=n/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t}function L(e,t,i,n){var o=1.70158,r=0,s=i;if(0==e)return t;if(1==(e/=n))return t+i;if(r||(r=.3*n),s<Math.abs(i)){s=i;o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return-s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r)+t}function A(e,t,i,n){var o=1.70158,r=0,s=i;if(0==e)return t;if(1==(e/=n))return t+i;if(r||(r=.3*n),s<Math.abs(i)){s=i;o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return s*Math.pow(2,-10*e)*Math.sin((e*n-o)*(2*Math.PI)/r)+i+t}function C(e,t,i,n){var o=1.70158,r=0,s=i;if(0==e)return t;if(2==(e/=n/2))return t+i;if(r||(r=n*(.3*1.5)),s<Math.abs(i)){s=i;o=r/4}else o=r/(2*Math.PI)*Math.asin(i/s);return e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*n-o)*(2*Math.PI)/r)*.5+i+t}function z(e,t,i,n,o){return null==o&&(o=1.70158),i*(e/=n)*e*((o+1)*e-o)+t}function k(e,t,i,n,o){return null==o&&(o=1.70158),i*((e=e/n-1)*e*((o+1)*e+o)+1)+t}function R(e,t,i,n,o){return null==o&&(o=1.70158),(e/=n/2)<1?i/2*(e*e*((1+(o*=1.525))*e-o))+t:i/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t}function F(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t}function O(e,t,i,n){return i*(1-Math.pow(1-e/n,o.inertia.nonLinearity+1))+t}const D={easing:"easeInOutQuad",forceFinalValue:!0,renderAfterUpdate:!0};function B(e,t){return t.tickers[e]}function j(e,t,i,n,o,r,s){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({},D),t),{from:n,to:o,duration:r,attributes:s,startTime:i.time,alreadyStartedGroupTickers:a})}function N(e,t){delete t.tickers[e]}function U(e,t){return!!t.tickers[e]}function V(e,t,i){var n;const o=i.tickers[e];if(!o)return;if(o.alreadyStartedGroupTickers&&o.alreadyStartedGroupTickers.some((e=>!!i.tickers[e])))return void(o.startTime=i.time);const r=i.time-o.startTime;let s;if(o.from.length){s=[];for(let e=0;e<o.from.length;e++){const t=G(o.easing,o.from[e],o.to[e],o.duration,r);s.push(t)}}else s=G(o.easing,o.from,o.to,o.duration,r);let a=!1;r>=o.duration&&(o.forceFinalValue&&(s=o.to),a=!0),t.step&&t.step(i,s,o.attributes),a&&(N(e,i),t.complete&&t.complete(i)),o.renderAfterUpdate&&((null===(n=o.attributes)||void 0===n?void 0:n.layerId)?i.rerenderEvents.push({type:"layerAnimationTicker",layerId:o.attributes.layerId,styleId:o.attributes.styleId}):i.rerenderEvents.push({type:"coreAnimationTicker"}))}function G(e,t,i,o,r){return n[e](r,t,i-t,o)}},6392:(e,t,i)=>{i.d(t,{Bs:()=>g,C5:()=>H,CJ:()=>S,HL:()=>z,IR:()=>K,Kn:()=>x,L7:()=>N,Ny:()=>E,Oy:()=>X,Sl:()=>T,VV:()=>M,VW:()=>Z,Z$:()=>B,_W:()=>J,a2:()=>U,aM:()=>F,aq:()=>V,b5:()=>P,cL:()=>w,d1:()=>W,gQ:()=>ee,gx:()=>y,hm:()=>G,iq:()=>Q,qu:()=>O,rL:()=>C,tW:()=>te,vX:()=>D,vl:()=>b,x7:()=>Y,xG:()=>R,xH:()=>I,z6:()=>$});var n=i(378),o=i(9450),r=i(4716),s=i(6208),a=i.n(s),l=i(7188),d=i(2435),c=i(267),h=i(9748),u=i(6273),m=i(8194),f=i(9073),p=i(9218),_=i(6490);const v=[0,0,0];function g(e){return{coords:e,size:V(e[2]),offset:X(e)}}function y(e){return`${e[0]}_${e[1]}_${e[2]}_${e[3]}`}function b(e,t){return`${y(e)}_${t.stringify()}`}function w(e){const t=e.split("_");return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10)]}function x(e){return p.tiles.subdomains[Math.abs(e[0]+e[1])%p.tiles.subdomains.length]}function S(e){const t=new(a())(e),i=h.F.read(t),{x:n,y:o,zoom:r,tiles:s}=i.tileGroups[0];return s.map((({regionId:e,hash:t,data:i})=>(i||(console.warn(`Tile ${r}_${n}_${o} from region ${e} is corrupt (has no data)`),i=new Uint8Array(0)),{data:i,regionId:e,metatileHash:(0,l.SD)(t)})))}function I(e){return e.map((e=>({regionId:e.regionId,metatileHash:e.metatileHash})))}function M(e){const t=4*Math.ceil(e.byteLength/4),i=new ArrayBuffer(t);return new Uint8Array(i).set(e),i}function T(e){const[t,i,n]=e;return{min:X([t,i,n,n]),max:X([t+1,i+1,n,n])}}function E(e,t,i=0){const n=T(e);return n.min[0]-=i,n.min[1]-=i,n.max[0]+=i,n.max[1]+=i,(0,c.M4)(t,n)}function P(e,t,i,n,o=0,r=1/0,s=!1){var a;s&&(a=t,(t=2*Math.trunc(a/2)+1)>r&&(t-=2));const l=(0,c.BS)(e.tilesBounds),d=V(t),h=Math.pow(2,t),m=Math.floor((l.min[0]+u.ed-o)/d),f=Math.floor((l.max[0]+u.ed+o)/d),p=Math.max(Math.floor((l.min[1]+u.ed-o)/d),0),_=Math.min(Math.floor((l.max[1]+u.ed+o)/d),h-1),v=[],g=new Set;for(let i=m;i<=f;i++)for(let r=p;r<=_;r++){const s=[i,r,t,n];if(E(s,e.tilesBounds,o)){s[0]=(h+s[0]%h)%h;const e=y(s);g.has(e)||(g.add(e),v.push(s))}}return e.demMode&&function(e,t,i,n,o){const r=new Set(e.map(y)),s=new Set,a=(0,c.By)(t.tilesBounds);let l=e.slice();for(let d=i;d>=n;d--){let i=0;const n=[];l.forEach((o=>{const a=L(o),l=y(a);s.has(l)||(n.push(a),s.add(l),A(a,(n=>{const o=y(n);r.has(o)||s.has(o)||!E(n,t.extendedTilesBounds)||(e.push(n),r.add(o),i++)})))}));const h=V(d-1);(0,c.mW)(a,h,t.center);const m=(0,c.BS)(a),f=Math.pow(2,d-1),p=Math.floor((m.min[0]+u.ed)/h),_=Math.floor((m.max[0]+u.ed)/h),v=Math.max(Math.floor((m.min[1]+u.ed)/h),0),g=Math.min(Math.floor((m.max[1]+u.ed)/h),f-1);for(let e=p;e<=_;e++)for(let t=v;t<=g;t++){const r=[e,t,d-1,o];r[0]=(f+r[0]%f)%f;const l=y(r);!s.has(l)&&E(r,a)&&(n.push(r),i++)}if(!i)break;l=n}}(v,e,t,i,n),v}function L(e,t=1){const[i,n,o,r]=e,s=Math.pow(2,t);return[Math.trunc(i/s),Math.trunc(n/s),o-t,r]}function A(e,t){let[i,n,o]=e;const r=e[3];i*=2,n*=2,o++,t([i,n,o,r]),t([i+1,n,o,r]),t([i,n+1,o,r]),t([i+1,n+1,o,r])}function C(e,t,i,n,o,s,l,c,u,m,f,p){const _=new(a()),v={tiles:[{x:o[0],y:o[1],zoom:o[2]}]};h.w.write(v,_);const g={x:o[0].toString(),y:o[1].toString(),z:o[2].toString(),protocol:i,host:e,subdomain:n[Math.abs(o[0]+o[1])%n.length],tileSet:t,lang:c,appId:l,tileKey:s,sessionId:f,defaultLang:m,dt:null==p?void 0:p.join(","),request:encodeURIComponent(r.c(_.finish()))};return u?(0,d.Gr)({url:u},g):(0,d.Gr)("tiles",g)}function z(e,t){const i=e.coords,n=t.coords,o=i[2],r=n[2];return o===r?i[0]===n[0]&&i[1]===n[1]:o<r?k(e,t):k(t,e)}function k(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,r=e.coords[1]*i,s=r+i,a=t.coords[0],l=t.coords[1];return a>=n&&a<o&&l>=r&&l<s}function R(e,t,i,n){const o=function(e,t,i){const{coords:n}=e,o=Math.min(t,i),r=Math.pow(2,e.zoomLevel-o);return y([Math.floor(n[0]/r),Math.floor(n[1]/r),o,t])}(t,i,n);return e[o]}function F(e,t){const i=[];for(const n in e){const o=e[n];k(t,o)&&i.push(o)}return i}function O(e,t,i){return n.TE(e,q(t.coords))-n.TE(e,q(i.coords))}function D(e,t){return e.filter((e=>t.has(e)))}function B(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]}const j=o.Ue();function N(e,t,i,n){var o;j[0]=t[0][i],j[1]=t[1][i],j[2]=(null!==(o=t[2])&&void 0!==o?o:[])[i],B(e,j,n)}function U(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]}function V(e){return Math.pow(2,32-e)}function G(e){return e[0]>=0&&e[0]<=u.Bq&&e[1]>=0&&e[1]<=u.Bq}function H(e,t){return e*u.sX/(u.Bq*Math.pow(2,t))}function Z(e){return(0,_.uZ)(e/u._9*u.Bq,0,u._H)}function W(e){return e/u.Bq*u._9}function X(e){const t=V(e[2]),i=2147483648;return o.al(e[0]*t-i,e[1]*t-i,0)}function K(e){const t=2147483648;return[e[0]+t,e[1]+t,32,32]}function q(e){const t=V(e[2]),i=2147483648;return o.al((e[0]+.5)*t-i,(e[1]+.5)*t-i,0)}function $(e,t){const i=2147483648,n=V(t);return[(e[0]-n/2+i)/n,(e[1]-n/2+i)/n,t,t]}function Y(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,r=n.Ue();return(0,m.be)(r,e),$(r,o)}const J=e=>{const[t,i,n,o]=e;return[t,Math.pow(2,n)-1-i,n,o]},Q=(e,t)=>{B(v,t,e);const i=(0,f.PA)(v);return(0,f.Xg)(i[1])};function ee(e,t,i){const n=[0,0,0];return B(n,[e,t],i),(0,f.PA)(n)}function te(e){const t=Math.min(e[0][0],e[1][0],e[2][0],e[3][0])+u.ed,i=Math.max(e[0][0],e[1][0],e[2][0],e[3][0])+u.ed,n=Math.floor(t/u.sX),o=Math.floor(i/u.sX);return Array.from({length:o-n+1},((e,t)=>t+n))}},9476:(e,t,i)=>{function n(e,t,i){let n,o,r,s;const a=function(){const l=Date.now()-r;l<t&&l>=0?n=setTimeout(a,t-l):(n=null,i||(s=e(...o),n||(o=null)))};return function(...l){o=l,r=Date.now();const d=i&&!n;return n||(n=setTimeout(a,t)),d&&(s=e(...o),o=null),s}}i.d(t,{D:()=>n})},6874:(e,t,i)=>{i.d(t,{H:()=>s,f:()=>o});let n=1;function o(){return n++}let r=3;const s=()=>r++},2435:(e,t,i)=>{i.d(t,{Ag:()=>h,Gr:()=>l,IG:()=>d,Nt:()=>a,Sy:()=>c,XK:()=>r});var n=i(9218);const o=/\{(\w+)\}/g;function r(e,t){return e.replace(o,((e,i)=>t[i]))}function s(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){return("object"==typeof e?e.url:n.urls[e]).replace(o,((e,i)=>{var n;return null!==(n=t[i])&&void 0!==n?n:e})).replace(o,((e,i)=>{var n;return null!==(n=t[i])&&void 0!==n?n:e}))}function l(e,t){const i=r(t.host,{subdomain:t.subdomain});return s(r("object"==typeof e?e.url:n.urls[e],Object.assign(Object.assign({},t),{host:i})))}function d(e,t){return s(r(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]}function h(e,t){const i=new URL(t);return e.startsWith("//")?`${i.protocol}${e}`:e.startsWith("/")?`${i.origin}${e}`:e}},2618:(e,t,i)=>{i.d(t,{TD:()=>d,gl:()=>o});var n=i(6273);const o=4294967295,r=o-1,s={},a=["main","parser","labeling","models"];let l=0;a.forEach((e=>{const t=l+Math.floor(r/a.length);s[e]={min:l,max:t-1e6},l=t}));class d{constructor(e){this.ids=[],this.phases=[],this.sublayers=[],this.styleIds=[],this.layerIds=[],this.instanceIds=[],this.objectClasses=[],this.floorIds=[],this.center=[],this.strings={},this.minIdentifyIndex=s[e].min,this.maxIdentifyIndex=s[e].max,this.index=this.minIdentifyIndex}getIndex(e){var t,i,r,s,a,l,d,c,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!==(s=null===(r=e.floorId)||void 0===r?void 0:r.hi)&&void 0!==s?s:o),this.phases.push(e.layer.renderIndex),this.sublayers.push(null!==(d=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!==d?d:NaN),this.styleIds.push(e.styleId),this.layerIds.push(e.layer.innerId),this.instanceIds.push(null!==(c=e.instanceId)&&void 0!==c?c: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,r=new Uint32Array(this.layerIds).buffer,s=new Uint8Array(this.instanceIds).buffer,a=new Uint32Array(this.objectClasses).buffer,l=new Int32Array(this.center).buffer,d=this.index,c=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:d,endIndex:c,phaseBuffer:i,sublayerBuffer:n,styleIdBuffer:o,layerIdBuffer:r,instanceIdBuffer:s,objectClassBuffer:a,centerBuffer:l,strings:h}}}},8575:(e,t,i)=>{i.d(t,{P:()=>w});var n=i(5597);const o=.8;class r{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 s{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,a,l){this.buildingsData={},this.drawMode=a;const d="buildingModel"!==e?67200:336e3,c=(0,n.vP)(e,t);this.elements=new r(d,c),this.indices=new s(2*d/c),this.views={},this.binder=o,o(this,this.elements.buffer),this.attributes=i,this.key=l}static generateKey(e){const t=e;return JSON.stringify(t)}resetOffsets(){this.elements.offset=0,this.elements.comittedOffsets=0,this.indices.offset=0,this.indices.comittedOffsets=0}resetBuildingsData(){this.buildingsData={}}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(2618),d=i(9899),c=i(9218),h=i(7486);class u{constructor(){this.packer=new d.Z(c.atlasSize[0],c.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 r of t){const t=r.w*i,s=r.h*i;if(o.has(`${t}_${s}`))continue;let a=this.packer.packOne(t+2,s+2);null===a&&(this.packer=new d.Z(c.atlasSize[0],c.atlasSize[1]),this.currentAtlasIndex++,a=this.packer.packOne(t+2,s+2));const l=n.length,h={rasterSetIndex:e.index,rasterIndex:l,w:t,h:s,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,r=(0,h.Bl)(n,t,!1);if(void 0===r)continue;const s=e.rasters[r];if(s.isPacked)continue;let a=this.packer.packOne(s.w+2,s.h+2);null===a&&(this.packer=new d.Z(c.atlasSize[0],c.atlasSize[1]),this.currentAtlasIndex++,a=this.packer.packOne(s.w+2,s.h+2)),s.x=a.x+1,s.y=a.y+1,s.atlasIndex=this.currentAtlasIndex,s.isPacked=!0,this.packedRasters.push(e.index,r,s.x,s.y,s.w,s.h,this.currentAtlasIndex)}}}var m=i(3672),f=i(4245),p=i(6273);const _=Math.pow(2,32)-1;class v{constructor(){this.colorById=new Map,this.index=0}getIndex(e){if("number"==typeof e)return this.nextIndex();const t="string"==typeof e?e:(0,m.Ak)(e),i=this.colorById.get(t);if(void 0!==i)return i;const n=this.nextIndex();return this.colorById.set(t,n),n}nextIndex(){return++this.index%_}}const g=Math.pow(2,20),y=["main","parser","labeling","models"],b={};for(let e=0;e<y.length;e++){b[y[e]]={min:1+e*g,max:(e+1)*g}}class w{constructor(e){this.atlasPacker=new u,this.buildingPointIndexer=new v,this.geoIds=new Uint32Array(0),this.floorHidingMap=new f.g,this.usedModels=new Set,this.dataModels={},this.promotedObjectAttributes={},this.addedBuckets=[],this.labels=[],this.idIndexer=new l.TD(e),this.workerName=e,this.dataModelsIndex=b[e].min,this.buckets={},this.reset()}reset(){this.buckets={},this.addedBuckets=[],this.geoIds=new Uint32Array(0),this.floorHidingMap.clear(),this.labels=[],this.usedModels.clear()}addLabel(e){this.labels.push(e)}addUsedModel(e){this.usedModels.add(e)}addPromotedObjectAttributes(e,t){this.promotedObjectAttributes[(0,m.Ak)(e)]=t}addUsedModelByUrl(e){const t=this.dataModels[e];if(t)return t;const{min:i,max:n}=b[this.workerName];this.dataModelsIndex=i+(this.dataModelsIndex+1-i)%(n-i);const o=-this.dataModelsIndex;return this.dataModels[e]=o,o}getDataModelsUrls(){const e={};for(const t in this.dataModels)this.usedModels.has(this.dataModels[t])&&(e[t]=this.dataModels[t]);return e}getBucket(e,t,i,n,o=p.Fg){let r=this.buckets[e];void 0===r&&(r={},this.buckets[e]=r);let s=r[t];void 0===s&&(s=r[t]={});const l=a.generateKey(i),d=s[l];if(d)return this.addedBuckets.push(d),d;const c=new a(e,t,i,n,o,l);return s[l]=c,this.addedBuckets.push(c),c}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 r=o,s=e[r];for(const e in s){const o=e,a=s[o],l=(0,n.vP)(r,o)/4;let d=0;for(const e in a)d+=a[e].indices.offset;if(0===d)continue;const c=[],h=new Int32Array(d*l);let u=0;for(const e in a){const t=a[e],{elements:i,indices:n,attributes:o,meta:r,buildingsData:s}=t,{view:d}=i,{buffer:m}=n;if(0===i.offset)continue;const f=u,p={};for(let e=0;e<n.offset;e++){const t=s?s[e]:null;if(t){x(t,u/l,p)}const i=m[e]*l;for(let e=0;e<l;e++)h[u++]=d[i+e]}c.push({attributes:o,drawMode:t.drawMode,rangeStart:4*f,rangeEnd:4*u,meta:r,objectsData:Object.keys(p).length>0?p:void 0}),t.resetOffsets(),t.resetBuildingsData()}t.push({symbol:r,sink:o,buffer:h.buffer,generatedObjects:c}),i.push(h.buffer)}}const o=this.idIndexer.getPacked();i.push(o.idBuffer,o.phaseBuffer,o.floorIdBuffer);const r=this.atlasPacker.getPackedRasters();void 0!==r&&i.push(r.buffer);const s=this.atlasPacker.getRastersToLoad();i.push(s.buffer);const a=this.getDataModelsUrls();this.usedModels=new Set;const l=new Uint32Array(this.geoIds);i.push(l.buffer);const d=this.floorHidingMap.serialize();this.floorHidingMap.clear();const c=this.labels;this.labels=[];const h=this.promotedObjectAttributes;return this.promotedObjectAttributes={},{data:t,labels:c,geoIds:l,floorHidingMap:d,packedRasters:r,rastersToLoad:s,dataModelsUrls:a,identifyIds:o,transferable:i,promotedObjectAttributes:h}}}function x(e,t,i){const n=e.buildingId;i[n]||(i[n]=[]);let o=!1;for(const r of i[n]){const i=r.offset+r.size,n=t+e.size;(r.offset<=t&&i>=t||t<=r.offset&&n>=r.offset)&&(r.offset=Math.min(t,r.offset),r.size=Math.max(i,n)-r.offset,o=!0)}o||i[n].push({offset:t,size:e.size})}},5317:(e,t,i)=>{i.d(t,{x:()=>l});var n=i(2153),o=i(3754),r=i(1245),s=i(6336);const a=new Map;class l{constructor(e,t,i,l,d,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),r.JG(this.anchorWorld,i),0!==l&&(this.anchorWorld[2]*=l),this.anchorScreen=d.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=e.styleTextPriority;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||e.pointType===n.a_.CommercialPremium)if(a.has(this.label.id))this.commPriorityRandomFactor=a.get(this.label.id);else{const e=(0,s.M)();this.commPriorityRandomFactor=e,a.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(e.styleTextPriority,e.styleIconPriority):e.styleTextPriority,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(e.styleTextPriority,e.styleIconPriority),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=e.styleIconPriority,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"_"+e.styleIconPriority.toFixed(0)+"_"+e.styleTextPriority.toFixed(0)}return""}}},4009:(e,t,i)=>{var n=i(9218),o=i(5597),r=i(9476),s=i(9808),a=i(2153);function l(e,t,i){const n=e[t];if(void 0!==n)return n[i]}var d,c=i(7123);function h(e,t,i){const{minX:n,maxX:o,minY:r,maxY:s}=i;e.push(n,r,o-n,s-r,t)}function u(e,t,i,n){const o=e.anchorScreen,r=e.boxes[t];return{element:e,minX:o[0]+r[0]-i,maxX:o[0]+r[2]+i,minY:o[1]+r[1]-n,maxY:o[1]+r[3]+n}}function m(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),r=l(t,i,n);return void 0===o&&void 0===r||(void 0===o?void 0===r||r:void 0===r?void 0===o||o:o||r)}(e.labelingGroupTable,t.labelingGroupTable,i,n)}function f(e,t,i,n,o,r){const s=u(t,i,n,o);if(s.minX>r.maxX||s.maxX<r.minX||s.minY>r.maxY||s.maxY<r.minY)return!0;const a=e.search(s);for(let e=0;e<a.length;e++)if(m(t,a[e].element))return!0;return!1}function p(e,t,i,n,o){if(-1!==e.placementIndex)if(f(t,e,0,n.leftRight,n.topBottom,i))e.placementIndex=-1,o&&h(o,a.m3.CommercialDead,u(e,0,n.leftRight,n.topBottom));else{e.placementIndex=0;const i=u(e,0,n.leftRight,n.topBottom);t.insert(i),o&&h(o,a.m3.CommercialAlive,i)}else o&&h(o,a.m3.CommercialDead,u(e,0,n.leftRight,n.topBottom))}function _(e,t,i,n){let o=!0;for(let r=0;r<e.boxes.length;r++)if(f(t,e,r,e.marginLeftRight,e.marginTopBottom,i)){if(o=!1,n)for(let t=0;t<e.boxes.length;t++){const i=u(e,t,e.marginLeftRight,e.marginTopBottom);let o;o=t===r?a.m3.Dead:t<r?a.m3.Alive:a.m3.Unused,h(n,o,i)}break}if(o)for(let i=0;i<e.boxes.length;i++){const o=u(e,i,e.marginLeftRight,e.marginTopBottom);t.insert(o),n&&h(n,a.m3.Alive,o)}e.placementIndex=o?0:-1}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.label.pointType===a.a_.CommercialCity}function b(e){return g(e)&&e.label.pointType===a.a_.CommercialPremium}function w(e){return e.label.pointType!==a.a_.CommercialCity||-1!==e.placementIndex&&e.label.pointType===a.a_.CommercialCity}function x(e,t){if(0===t.size)return!1;const i=e.filter((e=>!!function(e,t){return e.type===a.Dl.Icon&&t.has(e.label.id)}(e,t)&&(e.adsType=d.Donor,!0))).length;return i>0}function S(e,t,i,n,o){switch(e.type){case a.Dl.LineText:case a.Dl.Icon:if(-1===e.placementIndex&&g(e))break;_(e,i,n,o);if(e.adsType===d.Donor){const r=t.get(e.label.id);if(!r)break;-1!==e.placementIndex&&(r.parent=e,_(r,i,n,o),t.delete(e.label.id))}break;case a.Dl.Box:if(!e.parent){_(e,i,n,o);break}e.placementIndex=-1;break;case a.Dl.PoiText:case a.Dl.PoiText2:e.parent&&-1===e.parent.placementIndex||e.firstLabel&&-1===e.firstLabel.placementIndex?e.placementIndex=-1:function(e,t,i,n){e.placementIndex=-1;for(let o=0;o<e.boxes.length;o++)if(!e.firstLabel||e.firstLabel.placementIndex===o){if(!f(t,e,o,e.marginLeftRight,e.marginTopBottom,i)){const i=u(e,o,e.marginLeftRight,e.marginTopBottom);if(t.insert(i),e.placementIndex=o,n){h(n,a.m3.Alive,i);for(let t=o+1;t<e.boxes.length;t++)h(n,a.m3.Unused,u(e,t,e.marginLeftRight,e.marginTopBottom))}break}n&&h(n,a.m3.Dead,u(e,o,e.marginLeftRight,e.marginTopBottom))}}(e,i,n,o)}}function I(e,t,i,o,r){const l=[],h=new Map;t.forEach((e=>{if((t=e).type===a.Dl.Box&&"markerText"===t.labelingGroup&&void 0!==t.parent)return h.set(e.parent.label.id,e),void(e.placementIndex=-1);var t;l.push(e)}));const u=new Set(h.keys()),m=e.concat(l),f=i.debugLabels?[]:void 0,{size:_,viewport:b}=i,I=_[0],M=_[1],T=(n.labeling.tileMultiplier-1)/2,E=Math.round(I*T),P=Math.round(M*T),L={minX:b.left-E,maxX:b.left+I+E,minY:b.top-P,maxY:b.top+M+P},A=c(),C=x(m,u),z=m.sort(((e,t)=>{const n=e.label instanceof s._?e.label.hovered:0,r=t.label instanceof s._?t.label.hovered:0,a=i.disableSurvivedPoiPrevalence?0:(o.has(t.id)?1:0)-(o.has(e.id)?1:0),l=C?(t.adsType===d.Donor?1:0)-(e.adsType===d.Donor?1:0):0;return t.groupPriority-e.groupPriority||(g(t)?t.commPriorityRandomFactor:0)-(g(e)?e.commPriorityRandomFactor:0)||l||a||r-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]}));let k=-1;const R=z.filter(((e,t)=>!!g(e)&&(k=t,!0)));if(-1!==k){for(let e=0;e<=k;e++)S(z[e],h,A,L,f);A.clear(),function(e,t,i,n,o){const r=c();v(e.filter(y),i).forEach((e=>{p(e,r,t,n.city,o)})),r.clear(),v(e.filter(w),i).forEach((e=>{p(e,r,t,n.default,o)}))}(R,L,o,r,f)}for(let e=0;e<z.length;e++)S(z[e],h,A,L,f);return f}!function(e){e[e.Donor=0]="Donor"}(d||(d={}));var M=i(8575);class T{constructor(e,t,i){this.line=e,this.lengths=[],this.angles=[];let n=t,o=e[0],r=e[1];const s=e.length/3;for(let t=0;t<s;t++){const i=e[3*t]-o,s=e[3*t+1]-r;n+=Math.sqrt(i*i+s*s),this.lengths.push(n),o+=i,r+=s}this.finishLength=this.lengths[this.lengths.length-1],this.startLength=this.lengths[0],this.midLength=i/2,this.vertexCount=s,this.angles.push(0);for(let e=1;e<s;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],r=(e-o)/(this.lengths[i]-o);return[(1-r)*this.line[3*n]+r*this.line[3*i],(1-r)*this.line[3*n+1]+r*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 E{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 r=[];let s=i[t].pop();for(;void 0!==s;)r.push(s),s=0===s.componentDistanceStart&&0===s.componentDistanceEnd||void 0===i[s.componentDistanceEnd]?void 0:i[s.componentDistanceEnd].pop();if(1===r.length){const t=r[0];t.axis=new T(t.mapPointVertices,t.componentDistanceStartWorld,t.objectLengthWorld),e.push(t)}else r.length>1&&e.push(this.stitch(r))}}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 T(i,o.componentDistanceStartWorld,o.objectLengthWorld),e[0]}}var P=i(5317),L=i(378),A=i(9450),C=i(6273);class z{constructor(e,t,i,n,o,r,s,l,d,c,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:C.Rw,this.itemPriority=null!=h?h:1,this.parent=c,this.placementIndex=0,this.labelingGroup=d,this.labelingGroupTable=l.labelingGroups.table,this.anchorWorld=A.Ue(),A.JG(this.anchorWorld,n),0!==r&&(this.anchorWorld[2]*=r),this.anchorScreen=s.project(this.anchorWorld),L.IH(this.anchorScreen,this.anchorScreen,o),this.boxes=[[0,0,t,i]]}}var k=i(9073),R=i(6490),F=i(4576),O=i(3194),D=i(3249),B=i(3754),j=i(297);const N=(0,R.Id)(n.labeling.axisAngleToleranceDeg),U=n.labeling.axisCheckDistancePx,V=(0,R.Id)(n.labeling.lineLabelsHidePitchDeg);function G(e,t,i,n,o,r,s,l,d,c,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&&t.pointType!==a.a_.CommercialPremium||i.commercialPoi.add(t.id)}return i}(e,o),g=new E;for(let r=0;r<e.length;r++){const u=e[r],m=o.get(u);if(void 0!==m)for(let e=0;e<m.length;e++){const o=m[e],r=n.getStyle(o.styleId);if(r){if(!(o.source===a.AL.Tile&&c.has(o.id)||o.source!==a.AL.PersonalPoi&&v.personalPoi.has(o.id)&&o.pointType!==a.a_.Commercial&&o.pointType!==a.a_.CommercialCity&&o.pointType!==a.a_.CommercialPremium||o.source===a.AL.PersonalPoi&&v.commercialPoi.has(o.id)))switch(o.layer.type){case"point":if(H(o,s,l,t.styleState,t.styleZoom,r,h,t.elevation)&&J(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];Z(p,f,_,o,e,i,t,r,d)}break;case"labelLine":H(o,s,l,t.styleState,t.styleZoom,r,h,t.elevation)&&J(o,t.styleZoom)&&g.add(o);break;case"oneWayLine":J(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],r=n.getStyle(o.styleId);r?"point"===o.layer.type?W(p,f,_,o,r,i,t,d):X(m,p,o,r,i,t):console.error(`Not found style ${o.styleId} in labeling#collectLabelingElements`)}return r.forEach((({id:e,width:o,height:r,position:s,offset:a,labelingGroup:l,parentPoiId:d})=>{let c;if(d&&(c=_[d],!c))return;const h=n.getStyle(D.jf);if(!h)return void console.error(`Not found style ${D.jf} in labeling#collectLabelingElements`);const m=new z(e,o,r,s,a,t.buildingHeight,i,h,l,c,null==c?void 0:c.itemPriority,null==c?void 0:c.groupPriority);u.push(m)})),{boxElements:u,oneWayTileElements:m,noLabelingElements:f,otherTileElements:p}}function H(e,t,i,n,o,r,s,a){var l;const{layer:d}=e;if("point"!==d.type&&"labelLine"!==d.type)return!1;Number.isNaN(e.demElevation)?e.elevation=0:e.elevation=(e.demElevation-(null!=a?a:0))*k.C;const c=(0,O.bs)(o,n,!1,e.tileData);if(j.rJ&&!e.rtlProcessed&&(e.label=null!==(l=(0,j.iY)(e.label))&&void 0!==l?l:"",e.label2=(0,j.iY)(e.label2),e.iconLabel=(0,j.iY)(e.iconLabel),e.updateRanges(),s(C.Uo,e.ranges),(0,O.EG)(d.style.textFont).forEach((t=>{t.length&&s(t,e.ranges)})),"point"===d.type&&d.style.textFont2&&(0,O.EG)(d.style.textFont2).forEach((t=>{t.length&&s(t,e.ranges)})),"point"===d.type&&d.style.iconTextFont&&(0,O.EG)(d.style.iconTextFont).forEach((t=>{t.length&&s(t,e.ranges)})),e.rtlProcessed=!0),!e.rtlProcessed)return!1;const{ranges:h}=e,u=(0,F.rq)(d.style.textFont,c,r);let m;if(u&&e.label&&(0,F.dm)(u,h,i)&&(m=(0,F.JA)(e.label,d.style.textLetterSpacing,t[u]),e.textMetrics=m),"labelLine"===d.type)return!u||!!m;const f=(0,F.rq)(d.style.iconTextFont,c,r);f&&e.iconLabel&&(0,F.dm)(f,h,i)&&(e.iconTextMetrics=(0,F.JA)(e.iconLabel,d.style.iconTextLetterSpacing,t[f]));const p=(0,F.rq)(d.style.textFont2,c,r);return u&&e.label&&p&&e.label2&&(0,F.dm)(p,h,i)&&(e.textMetrics2=(0,F.JA)(e.label2,d.style.textLetterSpacing,t[p])),u&&e.label?!(!m||f&&e.iconLabel&&!e.iconTextMetrics||p&&e.label2&&!e.textMetrics2):!f||!e.iconLabel||!!e.iconTextMetrics}function Z(e,t,i,n,r,s,l,d,c){var h;(0,o.Pn)(n,r,d,n.layer,l,s,c);for(let o=0;o<n.labelingElements.length;o++){const r=n.labelingElements[o];r.labelingGroup!==B.R_&&(null===(h=r.parent)||void 0===h?void 0:h.labelingGroup)!==B.R_?(e.push(r),r.type===a.Dl.Icon&&(i[r.label.id]=r)):t.push(r)}}function W(e,t,i,n,o,r,s,a){const{layer:l}=n;if("point"!==l.type)return;const{zoom:d,styleZoom:c}=s,h=Math.floor(c),u=d+(h-c),{startLength:m,midLength:f,finishLength:p}=n.axis,_=(0,O.bs)(h,s.styleState,!1,n.tileData),v=Math.max((0,k.h0)((0,O.vn)(l.style.duplicationSpacing,_),u),1),g=(0,k.h0)(l.style.endingOffsets,d),y=m+g,b=p-g;for(let l=m+(f-m)%v;l<b;l+=v)if(l>y){const d=n.axis,c=l,h=d.getSegmentIndex(c);Z(e,t,i,n,d.interpolate(c,h),r,s,o,a)}}function X(e,t,i,o,r,s){const{layer:a}=i;if("labelLine"!==a.type&&"oneWayLine"!==a.type)return;const{zoom:l,styleZoom:d}=s,c=Math.floor(d),h=l+(c-d),{startLength:u,midLength:m,finishLength:f}=i.axis,p=(0,O.bs)(d,s.styleState,!1,i.tileData),_=(0,O.bs)(c,s.styleState,!1,i.tileData);let v,g,y,b;if("labelLine"===a.type){const e=(0,O.vn)(a.style.textFontSize,p)/n.fonts.baseSize,t=(0,O.vn)(a.style.textFontSize,_)/n.fonts.baseSize;v=i.textMetrics.maxWidth*e,g=i.textMetrics.maxWidth*t,y=(0,k.h0)((0,O.vn)(a.style.textDuplicationSpacing,_),h),b=(0,k.h0)(Math.max(a.style.lineEndingOffsets,a.style.textLabelingSideMargin),l)}else v=(0,O.vn)(a.style.lineLength,p),g=(0,O.vn)(a.style.lineLength,_),y=(0,k.h0)((0,O.vn)(a.style.duplicationSpacing,_),h),b=(0,k.h0)(a.style.endingOffsets,l);const w=(0,k.h0)(g,h),x=(0,k.h0)(v,l)/2,S=y+w,I=u+(m-u)%S,M=u+x+b,T=f-x-b,E="labelLine"!==a.type?e:t;for(let e=I;e<T;e+=S)e>M&&K(E,i,e,x,v,r,s,o)}function K(e,t,i,o,r,s,l,d){const c=t.axis,{zoom:h,styleZoom:u}=l,{startLength:m,finishLength:f}=c,p=c.getSegmentIndex(i),_=c.interpolate(i,p);if((0,k.gr)(s.position,_,l.center)>V||!function(e,t,i,o,r,s){if("oneWayLine"===e.layer.type)return!0;const a=e.axis,l=(0,O.bs)(r,s,!1,e.tileData),d=(0,O.vn)(e.layer.style.textFontSize,l)/n.fonts.baseSize,c=a.getSegmentIndex(t-i),h=a.getSegmentIndex(t+i),u=(0,k.h0)(U*d,o);for(let e=c;e<h;e++){if(e>1&&q(a.angles[e-1],a.angles[e])>N)return!1;const t=a.getSegmentIndex(a.lengths[e]-u);if(0!==t){if(q(a.angles[t],a.angles[a.getSegmentIndex(a.lengths[e]+u)])>N)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 P.x(t,g,_,l.buildingHeight,s,d);y.anchorPosition=i,y.anchorSegmentIndex=p,y.halfLabelWidth=o,v||(y.overflowStyleZoom=(0,k.X$)((0,k.to)(r,f-m),_),function(e,t,i,n,o,r){const{axis:s,layer:a}=t;if("labelLine"!==a.type)return;const{zoom:l,styleZoom:d}=o,c=(0,O.bs)(d,o.styleState,!1,t.tileData),h=(0,O.vn)(a.style.textFontSize,c),u=h/2,m=(0,k.h0)(h,l),f=(0,k.h0)(a.style.textLabelingSideMargin,l),p=Math.max(0,i-n+m/2-f),_=Math.min(s.lengths[s.lengths.length-1],i+n-m/2+f);let v=s.getSegmentIndex(p);for(let t=p;t<_;t+=m){for(;s.lengths[v]<t;)v++;Y(e,s,t,v,r,u)}for(;s.lengths[v]<_;)v++;Y(e,s,_,v,r,u)}(y,t,i,o,l,s)),e.push(y)}function q(e,t){const i=Math.abs(e-t);return i>Math.PI?2*Math.PI-i:i}const $=[0,0];function Y(e,t,i,n,o,r){o.putProject($,t.interpolate(i,n)),$[0]=$[0]-e.anchorScreen[0],$[1]=$[1]-e.anchorScreen[1],e.boxes.push([$[0]-r,$[1]-r,$[0]+r,$[1]+r])}function J(e,t){const{source:i,detailLevel:o,layer:{minzoom:r,maxzoom:s}}=e,l=i===a.AL.PersonalPoi,d=l||r>o,c=l||s<o+1||o===n.tiles.maxDetailLevel;return(!d||t>=r)&&(!c||t<s)}var Q=i(7256),ee=i(4500),te=i(3487),ie=i(6892),ne=i(7436),oe=i(267),re=i(8194),se=i(4874),ae=i(6336);const le=new Map;!function(e){const t=new Q.D(e),i=new ee.J(t),l=new M.P("labeling"),d=new ne.h,c=i.get(ie.P.Main,"loadFont"),h=new Map,u=new Map;let m=[],f=new Map;const p=new te.c,_=new te.c,v={},w=(0,r.D)((()=>l.reset()),n.workerResetDebounceTime);function x(e,t){for(const i of t)p.has(e,i)||(c(e,i),p.set(e,i,!0))}function S(e,t,i){if(e.has(i.label.sourceId))return o.jh.none;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?o.jh.fadeIn:n.placementIndex===i.placementIndex?o.jh.none:o.jh.fadeIn}i.set("setComPoiRandomSeed",(e=>{(0,ae.P)(e)})),i.set("appendLabels",((e,t,i,n,o)=>{const r=(0,s.v)(i,t,d,n,o);h.set(e,r)})),i.set("appendLabelBox",((e,t)=>{u.set(e,t)})),i.set("removeEmptyBoxLabel",(e=>{u.delete(e)})),i.set("removeLabels",(e=>{h.delete(e),u.delete(e)})),i.set("processLabels",((e,t,i,n,r,s,c)=>{const p=new Set(r),M=[];let T=new Map;const E=[];return i.forEach((i=>{const r=new se.V(i),w=new Set,P=[...t];e.forEach((({sourceId:e,animate:t,labelsKeys:i})=>{t||w.add(e),P.push(...i)}));const{boxElements:L,oneWayTileElements:A,otherTileElements:C,noLabelingElements:z}=G(P,i,r,d,h,u,v,_,n,p,x),k=I(C,L,i,c?le:f,s),R=[...z,...A,...C],F=new Map;for(let e=0;e<R.length;e++){const t=R[e];-1!==t.placementIndex&&F.set(t.id,t)}for(let e=0;e<R.length;e++){const t=R[e],{label:{styleId:r,layer:s}}=t;if(-1===t.placementIndex)continue;const a=S(w,f,t),c=d.getStyle(r);c?(0,o.SV)(c,s,l,t,a,n,i,i.tileInfo):console.error(`Not found style ${r} in labeling#processLabels`)}for(let e=0;e<m.length;e++){const t=m[e],{id:r,label:s,layer:c}=t,{styleId:h}=s,u=d.getStyle(h);if(!u){console.error(`Not found style ${h} in labeling#processLabels`);continue}if(w.has(t.label.sourceId))continue;const f=t.placementIndex,p=F.get(r);-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)(u,c,l,t,o.jh.fadeOut,n,i,i.tileInfo))}M.push(...R),T=new Map([...T,...F]);const O=l.getAccumulatedData(),D=[];for(const e of L)-1!==e.placementIndex&&D.push(e.label.idLo);const B=new Map,j=(0,oe.BS)(i.tilesBounds);for(const e of C)if(-1!==e.placementIndex&&g(e)&&re.r3(j,e.anchorWorld)){const t={};g(N=e)&&y(N)?t.adsPriority="city":b(e)&&(t.adsPriority="premium"),B.set(e.label.id,t)}var N;const U={survivedLabelBoxIds:D,survivedCommPois:Array.from(B).map((e=>{const t={id:e[0]};return void 0!==e[1].adsPriority&&(t.adsPriority=e[1].adsPriority),t})),collectorOutput:O,transferable:O.transferable};if(k){const e=new Int32Array(k.length);e.set(k),U.labels=e.buffer}E.push(U)})),m=M,f=T,w(),E})),i.set("appendFont",((e,t)=>{v[e]||(v[e]={});const i=v[e];for(const e in t)i[e]=t[e]})),i.set("markFontAsLoaded",((e,t)=>{_.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],r=t[7*e+6],s=t[7*e+2],a=t[7*e+3],l=t[7*e+4],d=t[7*e+5],c=n.byIndex[i];if(void 0!==c)if(c.isSvg)c.rasters[o]={rasterIndex:o,rasterSetIndex:i,x:s,y:a,w:l,h:d,anchorX:c.anchorX,anchorY:c.anchorY,atlasIndex:r,isPacked:!0};else{const e=c.rasters[o];if(void 0===e){console.error(`Not found raster with index ${o} and raster set index ${i}`);continue}e.x=s,e.y=a,e.atlasIndex=r,e.isPacked=!0}else console.error(`Not found raster set with index ${i}`)}})),i.set("clearPreviousLabels",(()=>{m=[],f.clear()})),i.set("syncStyle",((...e)=>d.proxySyncStyle(...e))),i.set("loadRtlPlugin",j.ng),i.set("markRtlPluginLoaded",(()=>{j.dp&&(0,j.dp)()}))}(self)},9808:(e,t,i)=>{i.d(t,{_:()=>u,v:()=>h});var n=i(7999),o=i(3672),r=i(2153),s=i(6392),a=i(6201),l=i(2618),d=i(3194);function c(e){return"labelLine"===e.type||"point"===e.type||"oneWayLine"===e.type}function h(e,t,i,n,o){const r=[];for(const s of e)for(const e of s.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 h=new u(e,d,t,s.metatileHash);switch(e.type){case a.R2.Point:h.setSpecificPointAttributes(e,n,o);break;case a.R2.Line:h.setSpecificLineAttributes(e,n,o);break;case a.R2.OneWayLine:h.setSpecificOneWayAttributes(e)}r.push(h)}return r}class u{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=r.a_.Common,this.iconPriority=0,this.styleIconPriority=0,this.styleTextPriority=0,this.identifyIndex=l.gl,this.identifyPoiLabelIndex=l.gl,this.labelingTextureIndex=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.checkPointOffset=[0,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:r._r.Line,this.tileData=e.tileData,this.labelPriority=e.labelPriority,this.detailLevel=e.tileCoords[2],this.styleIconPriority=e.styleIconPriority,this.styleTextPriority=e.styleTextPriority,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.labelingTextureIndex=e.labelingTextureIndex,this.hovered=e.hovered,this.demElevation=e.demElevation;const l=(0,d.bs)(i,t,!0,e.tileData);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,s.Bs)(e.tileCoords);this.mapPointVertices=[];const h=[0,0,0],u=[0,0,0];if(e.geometryType===r._r.Point)(0,s.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++)h[0]=e.vertices[0][t],h[1]=e.vertices[1][t],(0,s.Z$)(u,h,c),this.mapPointVertices.push(u[0],u[1],u[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,s.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,s.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=(0,d.bs)(i,t,!0,e.tileData);this.label=(0,a.It)(this.layer.style.textField,n);const o=(0,s.Bs)(e.tileCoords);this.mapPointVertices=[];const r=[0,0,0],l=[0,0,0];for(let t=0;t<e.vertices[0].length;t++)r[0]=e.vertices[0][t],r[1]=e.vertices[1][t],(0,s.Z$)(l,r,o),this.mapPointVertices.push(l[0],l[1],l[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,s.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,s.C5)(e.objectLength,e.tileCoords[2]),this.tiers=(0,d.FR)(this.layer.ignoreTier,n)?void 0:e.tiers}setSpecificOneWayAttributes(e){const t=(0,s.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,s.Z$)(n,i,t),this.mapPointVertices.push(n[0],n[1],n[2]);this.componentDistanceStart=e.componentDistanceStart,this.componentDistanceEnd=e.componentDistanceEnd,this.componentDistanceStartWorld=(0,s.C5)(this.componentDistanceStart,e.tileCoords[2]),this.objectLengthWorld=(0,s.C5)(e.objectLength,e.tileCoords[2]),this.tiers=e.tiers}updateRanges(){this.ranges=(0,n.Go)([this.label,this.label2,this.iconLabel])}}},6336:(e,t,i)=>{i.d(t,{M:()=>o,P:()=>r});var n=i(173);let o=Math.random;const r=e=>{const t={randomSeed:0};(0,n.b8)(t,[e]),o=()=>(0,n.ff)(t,0,1)}},6100:(e,t,i)=>{var n=i(7256),o=i(4500),r=i(4411),s=i(8894);!function(e){const t=new n.D(e),i=new o.J(t);new r.Z(i).set("ModelsWorker",s.q)}(self)},8894:(e,t,i)=>{i.d(t,{q:()=>V});var n=i(7731),o=i(9450),r=i(1245),s=i(127);function a(e){return{copyright:e.copyright,generator:e.generator,version:e.version,minVersion:e.minVersion}}function l(e=[]){return e.map((e=>{var t;return{bufferView:e.bufferView,byteOffset:null!==(t=e.byteOffset)&&void 0!==t?t:0,componentType:e.componentType,normalized:e.normalized,count:e.count,type:e.type,max:e.max,min:e.min,sparse:e.sparse,name:e.name,extensions:e.extensions,extras:e.extras}}))}function d(e=[]){return e.map((e=>({channels:e.channels,samplers:e.samplers,name:e.name,extensions:e.extensions,extras:e.extras})))}function c(e=[]){return e.map((e=>({uri:e.uri,byteLength:e.byteLength,name:e.name,extensions:e.extensions,extras:e.extras,buffer:void 0})))}function h(e=[]){return e.map((e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,byteStride:e.byteStride,target:e.target,name:e.name,extensions:e.extensions,extras:e.extras})))}function u(e=[]){return e.map((e=>({type:e.type,orthographic:e.orthographic,perspective:e.perspective,name:e.name,extensions:e.extensions,extras:e.extras})))}function m(e=[]){return e.map((e=>({primitives:e.primitives,name:e.name,weights:e.weights,extensions:e.extensions,extras:e.extras})))}function f(e=[]){return e.map((e=>({alphaCutoff:e.alphaCutoff,alphaMode:e.alphaMode,doubleSided:e.doubleSided,emissiveFactor:e.emissiveFactor,emissiveTexture:e.emissiveTexture,normalTexture:e.normalTexture,occlusionTexture:e.occlusionTexture,pbrMetallicRoughness:e.pbrMetallicRoughness,name:e.name,extras:e.extras,extensions:e.extensions})))}function p(e=[]){return e.map((e=>({nodes:e.nodes,extensions:e.extensions,extras:e.extras,name:e.name})))}function _(e=[]){return e.map((e=>{var t,i,n;const a=null!==(t=e.rotation)&&void 0!==t?t:[0,0,0,1],l=null!==(i=e.scale)&&void 0!==i?i:[1,1,1],d=null!==(n=e.translation)&&void 0!==n?n:[0,0,0];return{camera:e.camera,children:e.children,matrix:e.matrix?s.al(...e.matrix):void 0,rotation:r.al(...a),scale:o.al(...l),translation:o.al(...d),name:e.name,mesh:e.mesh,skin:e.skin,extras:e.extras,extensions:e.extensions}}))}function v(e=[]){return e.map((e=>({bufferView:e.bufferView,mimeType:e.mimeType,name:e.name,uri:e.uri,extensions:e.extensions,extras:e.extras,image:void 0})))}function g(e=[]){return e.map((e=>({extensions:e.extensions,extras:e.extras,name:e.name,sampler:e.sampler,source:e.source})))}function y(e=[]){return e.map((e=>({extensions:e.extensions,extras:e.extras,name:e.name,magFilter:e.magFilter,minFilter:e.minFilter,wrapS:e.wrapS,wrapT:e.wrapT})))}function b(e=[]){return e.map((e=>({joints:e.joints,extensions:e.extensions,extras:e.extras,inverseBindMatrices:e.inverseBindMatrices,name:e.name,skeleton:e.skeleton})))}const w="image/jpeg",x="image/png",S="image/texture";function I(e){return e.substring(0,e.lastIndexOf("/")+1)}function M(e){const t=atob(e.split(",")[1]),i=new ArrayBuffer(t.length),n=new Uint8Array(i);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return i}class T{constructor(e){this.data=e}static isGlb(e){const t=new Uint32Array(e,0,T.glbHeaderInts),i=t[0],n=t[1];return i===this.glbMagic&&n===this.glbVersion}extractGlbData(){if(void 0===this.getCheckedGlbInfo())return{json:B,buffers:[]};let e;const t=[],i=this.getAllChunkInfos();for(const n of i)n.type!==T.jsonChunkType||e?n.type===T.binaryChunkType&&t.push(this.getBufferFromChunk(n)):e=this.getJsonFromChunk(n);return{json:e||B,buffers:t}}getCheckedGlbInfo(){const e=new Uint32Array(this.data,0,T.glbHeaderInts),t=e[0],i=e[1],n=e[2];if(this.checkEquality(t,T.glbMagic,"glb magic")&&this.checkEquality(i,T.glbVersion,"glb header version")&&this.checkEquality(n,this.data.byteLength,"glb byte length"))return{magic:t,version:i,length:n}}getAllChunkInfos(){const e=[];let t=4*T.glbHeaderInts;for(;t<this.data.byteLength;){const i=this.getChunkInfo(t);e.push(i),t+=i.length+4*T.glbChunkHeaderInts}return e}getChunkInfo(e){const t=new Uint32Array(this.data,e,T.glbChunkHeaderInts);return{start:e+4*T.glbChunkHeaderInts,length:t[0],type:t[1]}}getJsonFromChunk(e){const t=e.length,i=4*(T.glbHeaderInts+T.glbChunkHeaderInts),n=new Uint8Array(this.data,i,t),o=new TextDecoder("utf-8").decode(n);return JSON.parse(o)}getBufferFromChunk(e){return this.data.slice(e.start,e.start+e.length)}checkEquality(e,t,i){return e===t||(console.error(`[GLB MODEL PARSING ERROR] Found invalid/unsupported ${i}, expected: ${t}, but was: ${e}`),!1)}}T.glbHeaderInts=3,T.glbChunkHeaderInts=2,T.glbMagic=1179937895,T.glbVersion=2,T.jsonChunkType=1313821514,T.binaryChunkType=5130562;var E=i(6849);let P;function L(){P=function(){return(0,n.mG)(this,void 0,void 0,(function*(){const e=yield function(){return(0,n.mG)(this,void 0,void 0,(function*(){let e=yield fetch(E.rQ).then((e=>e.text()));const t="if (typeof exports === 'object' && typeof module === 'object')",i=e.indexOf(t);return 0!==i&&(e=e.slice(0,i),e+="return DracoDecoderModule;"),e}))}();return new Function(e)()()}))}().then((e=>e)).catch((e=>{const t="Draco decoder module failed to initialize"+((null==e?void 0:e.message)?` with the following error: ${e.message}`:".");throw new Error(t)}))}function A(e){switch(e){case 5120:return"Int8Array";case 5121:return"Uint8Array";case 5122:return"Int16Array";case 5123:return"Uint16Array";case 5124:return"Int32Array";case 5125:return"Uint32Array";default:return"Float32Array"}}function C(e,t,i,n,o,r){const s=o.num_components(),a=i.num_points()*s;let l,d,c;switch(r){case"Float32Array":c=4*a,l=e._malloc(c),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_FLOAT32,c,l),d=new Float32Array(e.HEAPF32.buffer,l,a).slice(),e._free(l);break;case"Int8Array":l=e._malloc(a),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_INT8,a,l),d=new Int8Array(e.HEAP8.buffer,l,a).slice(),e._free(l);break;case"Int16Array":c=2*a,l=e._malloc(c),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_INT16,c,l),d=new Int16Array(e.HEAP16.buffer,l,a).slice(),e._free(l);break;case"Int32Array":c=4*a,l=e._malloc(c),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_INT32,c,l),d=new Int32Array(e.HEAP32.buffer,l,a).slice(),e._free(l);break;case"Uint8Array":l=e._malloc(a),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_UINT8,a,l),d=new Uint8Array(e.HEAPU8.buffer,l,a).slice(),e._free(l);break;case"Uint16Array":c=2*a,l=e._malloc(c),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_UINT16,c,l),d=new Uint16Array(e.HEAPU16.buffer,l,a).slice(),e._free(l);break;case"Uint32Array":c=4*a,l=e._malloc(c),t.GetAttributeDataArrayForAllPoints(i,o,e.DT_UINT32,c,l),d=new Uint32Array(e.HEAPU32.buffer,l,a).slice(),e._free(l);break;default:throw new Error("DRACOLoader: Unexpected attribute type.")}return{name:n,array:d,itemSize:s,componentType:r}}function z(e,t,i,n){const o=e.bufferView,r=t.bufferViews[o],s=t.buffers[r.buffer],a=new Int8Array(s.buffer).slice(r.byteOffset,r.byteOffset+r.byteLength),l=new i.Decoder,d=new i.DecoderBuffer;d.Init(a,r.byteLength);const c=function(e,t,i,n,o,r){let s,a;const l=t.GetEncodedGeometryType(i);if(l!==e.TRIANGULAR_MESH)throw new Error("DRACOLoader: Unexpected geometry type.");if(s=new e.Mesh,a=t.DecodeBufferToMesh(i,s),!a.ok()||0===s.ptr)throw new Error("DRACOLoader: Decoding failed: "+a.error_msg());const d={index:null,attributes:{}},c=s.num_points();for(const i in n){let a,l=5120;for(const[e,t]of Object.entries(r))if(e===i){l=o.accessors[t].componentType,a=o.accessors[t].count;break}if(c!==a)throw new Error(`DRACOLoader: Accessor vertex count ${a} does not match draco decoder vertex count  ${c}`);l=A(l);const h=t.GetAttributeByUniqueId(s,n[i]),u=C(e,t,s,i,h,l);d.attributes[u.name]=u}if(l===e.TRIANGULAR_MESH){const i=3*s.num_faces(),n=4*i,o=e._malloc(n);t.GetTrianglesUInt32Array(s,n,o);const r=new Uint32Array(e.HEAPU32.buffer,o,i).slice();e._free(o),d.index={array:r,itemSize:1}}return e.destroy(s),d}(i,l,d,e.attributes,t,n);return i.destroy(d),c}function k(e,t,i,n,o){const r={buffer:e,byteLength:e.byteLength,extensions:void 0,extras:void 0,name:void 0,uri:void 0};t.buffers.push(r);const s={buffer:t.buffers.length-1,byteLength:e.byteLength,byteOffset:0,byteStride:0,extensions:void 0,extras:void 0,name:o,target:n};t.bufferViews.push(s),t.accessors[i].byteOffset=0,t.accessors[i].bufferView=t.bufferViews.length-1}function R(e,t){let i;switch(t){case"Int8Array":i=new ArrayBuffer(e.length);new Int8Array(i).set(e);break;case"Uint8Array":i=new ArrayBuffer(e.length);new Uint8Array(i).set(e);break;case"Int16Array":i=new ArrayBuffer(2*e.length);new Int16Array(i).set(e);break;case"Uint16Array":i=new ArrayBuffer(2*e.length);new Uint16Array(i).set(e);break;case"Int32Array":i=new ArrayBuffer(4*e.length);new Int32Array(i).set(e);break;case"Uint32Array":i=new ArrayBuffer(4*e.length);new Uint32Array(i).set(e);break;default:i=new ArrayBuffer(4*e.length);new Float32Array(i).set(e)}return i}function F(e,t,i,n){const o=t.index.array;if(void 0!==n&&(k(o,e,n,34963,"index buffer view"),e.accessors[n].componentType=5125),void 0!==t.attributes.POSITION){k(R(t.attributes.POSITION.array,t.attributes.POSITION.componentType),e,i.POSITION,34962,"position buffer view")}if(void 0!==t.attributes.NORMAL){k(R(t.attributes.NORMAL.array,t.attributes.NORMAL.componentType),e,i.NORMAL,34962,"normal buffer view")}for(let n=0;n<4;++n){const o=`TEXCOORD_${n}`;if(void 0!==t.attributes[o]){k(R(t.attributes[o].array,t.attributes[o].componentType),e,i[o],34962,`${o} buffer view`)}}if(void 0!==t.attributes.TANGENT){k(R(t.attributes.TANGENT.array,t.attributes.TANGENT.componentType),e,i.TANGENT,34962,"Tangent buffer view")}if(void 0!==t.attributes.COLOR_0){k(R(t.attributes.COLOR_0.array,t.attributes.COLOR_0.componentType),e,i.COLOR_0,34962,"color buffer view")}if(void 0!==t.attributes.JOINTS_0){k(R(t.attributes.JOINTS_0.array,t.attributes.JOINTS_0.componentType),e,i.JOINTS_0,34963,"JOINTS_0 buffer view")}if(void 0!==t.attributes.WEIGHTS_0){k(R(t.attributes.WEIGHTS_0.array,t.attributes.WEIGHTS_0.componentType),e,i.WEIGHTS_0,34963,"WEIGHTS_0 buffer view")}if(void 0!==t.attributes.JOINTS_1){k(R(t.attributes.JOINTS_1.array,t.attributes.JOINTS_1.componentType),e,i.JOINTS_1,34963,"JOINTS_1 buffer view")}if(void 0!==t.attributes.WEIGHTS_1){k(R(t.attributes.WEIGHTS_1.array,t.attributes.WEIGHTS_1.componentType),e,i.WEIGHTS_1,34963,"WEIGHTS_1 buffer view")}}var O=i(2435);function D(e){return(0,n.mG)(this,void 0,void 0,(function*(){const t=yield self.fetch(e);if(!t.ok)throw new Error(`${t.status} ${t.statusText}: ${t.url}`);return t}))}const B={asset:{version:""}};function j(e,t){return(0,n.mG)(this,void 0,void 0,(function*(){if(void 0===t.uri)return!1;const i=t.mimeType||((n=t.uri).startsWith("data:image")?n.split(";")[0].split(":")[1]:".png"===n.substring(n.lastIndexOf("."))?x:w);var n;if(t.mimeType=i,"undefined"==typeof createImageBitmap||i!==w&&i!==x)return console.error(`Unsupported image type ${i}`),!1;if(t.uri.startsWith("data:image")){const e=M(t.uri);t.image=yield createImageBitmap(new Blob([e],{type:i}))}else{const n=yield D(`${I(e.path)}${t.uri}`),o=yield n.arrayBuffer();t.image=yield createImageBitmap(new Blob([o],{type:i}))}return!0}))}function N(e,t){return(0,n.mG)(this,void 0,void 0,(function*(){yield Promise.all(e.images.map((i=>(0,n.mG)(this,void 0,void 0,(function*(){if(i.image)return void(i.mimeType!==S&&console.error("Image has already been loaded"));const o=yield function(e,t,i){var o;return(0,n.mG)(this,void 0,void 0,(function*(){if(!t.bufferView)return!1;const n=e.bufferViews[t.bufferView];if(void 0===n)return!1;yield i;const r=e.buffers[n.buffer].buffer;if(!r)return!1;const s=new Uint8Array(r,n.byteOffset,n.byteLength);if("undefined"==typeof createImageBitmap)return!1;if(!function(e){const t=137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]&&13===e[4]&&10===e[5]&&26===e[6]&&10===e[7],i=255===e[0]&&216===e[1]&&255===e[2];return t||i}(s))return console.error(`Unsupported image type ${null!==(o=t.mimeType)&&void 0!==o?o:""}`),!1;{const e=new Blob([s],{type:t.mimeType});t.image=yield createImageBitmap(e)}return!0}))}(e,i,t);if(o)return;(yield j(e,i))||console.error(`Was not able to resolve image with uri ${i.uri}`)})))))}))}function U(e){return(0,n.mG)(this,void 0,void 0,(function*(){const t=(0,O.Ag)(e,self.origin);try{const e=yield D(t);let i,o=B;try{const r=yield e.arrayBuffer();if(T.isGlb(r)){const e=new T(r).extractGlbData();o=e.json,i=e.buffers}else{const e=new TextDecoder("utf-8"),t=new Uint8Array(r);o=JSON.parse(e.decode(t))}const s=function(e,t){var i,n,o;return{path:t,extensions:e.extensions,extensionsRequired:null!==(i=e.extensionsRequired)&&void 0!==i?i:[],extensionsUsed:null!==(n=e.extensionsUsed)&&void 0!==n?n:[],extras:e.extras,accessors:l(e.accessors),buffers:c(e.buffers),bufferViews:h(e.bufferViews),cameras:u(e.cameras),scene:null!==(o=e.scene)&&void 0!==o?o:0,scenes:p(e.scenes),nodes:_(e.nodes),materials:f(e.materials),meshes:m(e.meshes),asset:a(e.asset),animations:d(e.animations),images:v(e.images),textures:g(e.textures),samplers:y(e.samplers),skins:b(e.skins)}}(o,t),w=function(e,t){return(0,n.mG)(this,void 0,void 0,(function*(){t?e.buffers[0].buffer=t[0]||[]:yield Promise.all(e.buffers.map((t=>(0,n.mG)(this,void 0,void 0,(function*(){if(t.buffer)console.error("Buffer is already loaded");else if(t.uri)if(t.uri.startsWith("data:"))t.buffer=M(t.uri);else{const i=yield D(I(e.path)+t.uri).then((e=>e.arrayBuffer()));t.buffer=i}else console.error("Buffer can not be loaded. No uri")})))))}))}(s,i),x=N(s,w),S=function(e){var t;return(0,n.mG)(this,void 0,void 0,(function*(){if(!Array.isArray(e.meshes))return Promise.resolve();for(const i of e.meshes)if(Array.isArray(i.primitives))for(const n of i.primitives){if(void 0===(null===(t=n.extensions)||void 0===t?void 0:t.KHR_draco_mesh_compression))continue;P||L();const i=yield P;if(!i)continue;const o=z(n.extensions.KHR_draco_mesh_compression,e,i,n.attributes);F(e,o,n.attributes,n.indices)}}))}(s);return yield Promise.all([w,x,S]),{type:"ok",result:s}}catch(e){return{type:"error",layer:"parsing",originalError:e}}}catch(e){return{type:"error",layer:"network",originalError:e}}}))}class V{loadModel(e){return(0,n.mG)(this,void 0,void 0,(function*(){return yield U(e)}))}}},2458:(e,t,i)=>{var n=i(6208),o=i.n(n),r=i(9476),s=i(9218),a=i(6273),l=i(7084),d=i(5970),c=i(4922),h=i(7609),u=i(3672),m=i(7204),f=i(143),p=i(3194),_=i(2097),v=i(4333),g=i(9981),y=i(7188),b=i(8194),w=i(8183),x=i(6392),S=i(5597),I=i(4091),M=i(7407);const T=[[0],[0],[0]],E=[[0],[0],[0]],P=[[0],[0],[0]];function L(e,t,i,n,o,r,a){const{tileProps:c,tileAttrs:h}=n,m=(0,u.IL)(e.floorId),f=(0,u.IL)(e.buildingId);h[c.db_height]=s.floors.islandHeight,h[c.db_sublayer]=e.areaSublayer,h[c.selected]=a?1:0,h[c.db_region]=r;i.getLayers(t.id,c,h).filter((e=>(0,p.FR)(e.filter,n))).forEach((i=>{if("polygonExtrusion"===i.type){(0,S.Eu)(i,n);for(let r=0;r<e.area.length;r++){const s=new Uint16Array(e.area[r].slice().buffer);k(s);const a=z(s),c=l(s);T[0].length=0,T[1].length=0,T[2].length=0;for(let e=0;e<c.length;e+=3){for(let t=0;t<3;t++)T[0][t]=a[c[e+t]][0],T[1][t]=a[c[e+t]][1],T[2][t]=1;do{d.p.generate(o,t.id,i,n,{x:T[0],y:T[1],cut:T[2]},!1,void 0,m,f)}while(o.isOverloaded())}}}}))}function A(e,t,i,n,o,r,s,a){const{tileProps:d,tileAttrs:h}=t,m=(0,u.IL)(e.floorId),f="Floor"===e.sublayer;h[d.db_sublayer]=e.areaSublayer,h[d.selected]=s?1:0,h[d.db_region]=r;n.getLayers(i.id,d,h).filter((e=>(0,p.FR)(e.filter,t))).forEach((n=>{if("polygon"!==n.type)return;(0,S.Eu)(n,t);const r=e.area.map((e=>{const t=new Uint16Array(e.slice().buffer);return k(t),t})),s=r.map(z);for(let d=0;d<e.area.length;d++){const h=r[d],u=s[d],p=[],v=[],g=[];let y=h.length;const x=(0,I.bu)(u);for(let t=d+1;t<e.area.length;t++){const e=s[t];if((0,I.bu)(e)!==x){const i=r[t];p.push(i),g.push(e),v.push(y/2),y+=i.length,d++}}const S=[0,0];let M=f?(0,w.y)(u):[];if(f&&g.forEach((e=>{M=M.concat((0,w.y)(e))})),f){const e=b.Ue();for(let t=0;t<u.length;t++)b.aM(e,u[t]);b.be(S,e)}let P=h,L=u;p.length&&(P=new Uint16Array(y),P.set(h),p.forEach(((e,t)=>{P.set(e,2*v[t])})),L=L.concat(...g));const A=l(P,v);T[0].length=0,T[1].length=0,T[2].length=0;for(let e=0;e<A.length;e+=3){for(let t=0;t<3;t++){const i=A[e+t];T[0][t]=L[i][0],T[1][t]=L[i][1],T[2][t]=0,f&&(E[t]=M[i])}do{_.a.generate(o,i.id,n,t,{x:T[0],y:T[1],cut:T[2]},a,void 0,m)}while(o.isOverloaded());if(f)do{c._.generateFloorsBottomFill(o,i.id,T,E,S)}while(o.isOverloaded())}}}))}function C(e,t,i,n,o,r,a){if(!e.wallSublayer)return;const{tileProps:l,tileAttrs:c}=t,h=(0,u.IL)(e.floorId),m=(0,u.IL)(e.buildingId);c[l.db_height]=s.floors.wallHeight,c[l.db_sublayer]=e.wallSublayer,c[l.selected]=a?1:0,c[l.db_region]=r;n.getLayers(i.id,l,c).filter((e=>(0,p.FR)(e.filter,t))).forEach((n=>{if("polygonExtrusion"===n.type){(0,S.Eu)(n,t);for(let r=0;r<e.wallTop.length;r++){const s=new Uint16Array(e.wallTop[r].slice().buffer);k(s);const a=z(s),l=b.Ue();for(let e=0;e<a.length;e++)b.aM(l,a[e]);const c=[0,0];b.be(c,l);const u=a.length;T[0].length=0,T[1].length=0,T[2].length=0;for(let e=0;e<u;e++){const t=(0,f.X)(e,u);T[0][t]=a[e][0],T[1][t]=a[e][1],T[2][t]=1}do{d.p.generate(o,i.id,n,t,{x:T[0],y:T[1],cut:T[2]},!1,c,h,m)}while(o.isOverloaded())}}}))}function z(e){const t=[];for(let i=0;i<e.length/2;i++)t.push([e[2*i],e[2*i+1]]);return t}function k(e){e.forEach(((t,i)=>{e[i]*=a.gt}))}var R=i(8575),F=i(5095),O=i(7721),D=i(6479),B=i(7256),j=i(4500),N=i(6892),U=i(1573);var V=i(9450),G=i(9073);let H=[];var Z=i(2435);class W{constructor(){this.cache=new Map,this.pendingRequests=new Map}fetch(e,t,i,n,o){return new Promise((r=>{const s=X(e,n,o,t,i),a=(0,x.gx)(e),l=(0,F.L)({url:s},((e,t)=>{if(this.pendingRequests.delete(a),void 0!==e)return 204!==e.status&&console.error(e),this.cache.set(a,void 0),void r();const i=t[0];i?this.cache.set(a,i):this.cache.set(a,void 0),r()}));this.pendingRequests.set(a,{xhr:l,resolve:r})}))}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 X(e,t,i,n,o){const r=Math.pow(2,e[2])-1,a=e[0],l=(16777215&r-e[1])*(1<<24)+(16777215&a);return(0,Z.XK)(s.traffic.url,{protocol:o,host:n,z:String(e[2]),tiles:String(l),regions:t.join(","),time:String(i)})}var K=i(7436),q=i(4847);class $ extends q.g{constructor(e){super(),this.obClassEnumIndex=0,this.sublayerEnumIndex=0,this.workerParserSyncMetatile=e.get(N.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})}}var Y=i(4411),J=i(2176),Q=i(603);!function(e){const t=new B.D(e),i=new j.J(t),n=new Y.Z(i),l=new W,d=new K.h,c={main:{addNewRasterSets:i.get(N.P.Main,"addNewRasterSets")},labeling:{addNewRasterSets:i.get(N.P.Labeling,"addNewRasterSets")}},f={},_={},w=new R.P("parser"),I=(0,r.D)((()=>w.reset()),s.workerResetDebounceTime),T=()=>{const e=w.atlasPacker.getNewRasterSets();e.size&&e.forEach(((e,t)=>{c.main.addNewRasterSets(t,e),c.labeling.addNewRasterSets(t,e)}))},E={sources:{},collector:w,styleManager:d,syncNewRasterSets:T,debouncedResetCollector:I};n.set("GeoJsonSource",J.T,E);const z={collector:w,metatiles:f,styleManager:d,syncRasterSets:T,resetCollector:I,createImageBitmap:e.createImageBitmap};n.set("ZenithWorker",Q.Z,z);const k=(e,t)=>{f[e]=t};i.set("setMetatile",k);const Z=new $(i);k(a.DL,Z),i.set("syncStyle",((...e)=>d.proxySyncStyle(...e))),i.set("prepareAtlas",(t=>new Promise((i=>{(0,F.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("packRasters",(e=>{for(let t=0;t<e.length;t+=3){const i=e[t+2],n={type:D.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}]};w.atlasPacker.pack(n,[e[t]],1)}const t=w.atlasPacker.getPackedRasters(),i=[];return void 0!==t&&i.push(t.buffer),{packedRasters:t,transferable:i}})),i.set("fetchTrafficTile",(e=>l.fetch(e.coords,e.tileServer,e.tileProtocol,e.regionIds,e.timestamp))),i.set("deleteTrafficTile",(e=>{l.delete(e)})),i.set("abortTrafficTileRequest",(e=>{l.abortRequest(e)}));const X=(0,y.KP)(["db_sublayer","traffic_road_class","traffic_color","traffic_road_z_level","db_tiers","db_has_immersive_counterpart"],["Traffic_jams"]);i.set("generateTrafficTile",(({coords:e,pixelRatio:t,styleState:i,styleId:n,sourceId:o})=>{const r=(0,x.gx)(e),s=(0,x.Bs)(e),c=[],h=[],u=d.getStyle(n);if(!u)return Promise.resolve({results:c,transferable:h});const m=l.get(r);if(m){const e=function(e,t,i,n,o,r,s,l,d){if(!i)return e.getAccumulatedData();const c=l.coords[3],{tileProps:h}=t,u=Object.keys(h).length,m=[],f=(0,g.o1)(r),_=(0,p.Yi)(o,y.i4,h,m,y.wz,l);for(const o of s.tile){const{color:r=0,geo:s,road:v,normals:g,zLevel:y=0,is_immersive:b,logicalLevels:w}=o;for(let e=0;e<u;e++)m[e]=NaN;m[h.db_sublayer]="Traffic_jams",m[h.traffic_color]=r,m[h.traffic_road_class]=v,m[h.traffic_road_z_level]=y,m[h.db_tiers]=w?[(0,U.bg)(w.begin,w.end)]:void 0,m[h.db_has_immersive_counterpart]=Number(b),m[h.beginningIsCut]=0,m[h.endingIsCut]=0;for(let o=0;o<s.length;o++){const r=s[o],u=g[o],v=[],y=[],b=[],w=[];for(let e=0;e<r.length;e++)v[e]=r[e][0]*a.gt,y[e]=r[e][1]*a.gt,b[e]=u[e][0],w[e]=u[e][1];const x={x:v,y,normal_x:b,normal_y:w},I=n.getLayers(i.id,h,m).filter((e=>(0,p.FR)(e.filter,_)));(0,S.PA)(e,i,I,_,t,c,d,l,f,x)}}return e.getAccumulatedData()}(w,X,u,d,i,t,m,s,o);c.push({regionId:1,metatileHash:0,styleId:u.id,collectorOutput:e})}return Promise.resolve({results:c,transferable:h})})),i.set("loadFloor",((e,t)=>new Promise((i=>{(0,F.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 r=new(o())(n),s=O.Z.read(r),a=s.tileCoords;_[e]=Object.assign(Object.assign({},s),{tileCoords:[a[0],a[1],a[2],a[2]]}),Z.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:r}=i[e];t.add(n),r&&t.add(r),t.add(o)}}for(let e=0;e<o.length;e++){const{humanReadableIconId:n,sublayer:r}=o[e];t.add(r),n&&i.add(n)}return{sublayers:t,objectClasses:i}})(_[e]));const l={};s.entities.forEach((e=>{e.firmId&&(l[e.firmId]=e.floorIndex)})),i({type:"success",center:s.center,bound:s.bound,defaultFloor:s.defaultFloor,floors:s.floorGeometries.map((({ids:e,name:t})=>({ids:e,name:t}))),buildings:s.buildings.concat(s.hybrids),isMetroSchema:s.isMetroSchema,firmsToFloorIndexMap:l})}))})))),i.set("generateFloor",((e,t,i,n,o,r,s,l,c,f)=>{const b={tileCoords:_[e].tileCoords,collectorOutput:w.getAccumulatedData(),styleId:0},E=d.getStyle(r);if(!E)return b;let z;return z=c?w.getAccumulatedData():function(e,t,i,n,o,r,s,l,d,c,f,_){var b,w;const{floorGeometries:I,defaultFloor:T,tileCoords:E,entities:z}=o,{tileProps:k}=r,R=(0,g.o1)(l),F=new m.c,O=new m.c(c),D=[],B=Object.keys(k).length;Number.isNaN(d)&&(d=T);const j=I[d],N=(0,p.Yi)(i,y.i4,k,D,y.wz,(0,x.Bs)(E));for(let i=0;i<j.rooms.length;i++){const o=j.rooms[i];for(let e=0;e<B;e++)D[e]=NaN;const r=o.firmIds.length?o.firmIds[0]:o.buildingId,a=(0,u.IL)(r);F.add(a);const l=O.has(a);D[k.id]=a,o.isIsland?L(o,e,t,N,n,s,l):(A(o,N,e,t,n,s,l,R),C(o,N,e,t,n,s,l))}for(let i=0;i<z.length;i++){const o=z[i],l=o.sublayer;if(o.floorIndex!==d)continue;if((0,h.Ty)(l))continue;for(let e=0;e<B;e++)D[e]=NaN;P[0]=[o.coordinates[0]*a.gt],P[1]=[o.coordinates[1]*a.gt];for(let e=0;e<B;e++)D[e]=NaN;D[k.db_sublayer]=l,D[k.db_point_building_id]=o.buildingId;let c=!1;const m=o.firmId||o.id;if(m){const e=(0,u.IL)(m);c=O.has(e),F.add(e),D[k.id]=e}D[k.selected]=c?1:0,D[k.db_region]=s,(0,h.Ty)(l)||(D[k.db_object_class]=null!==(b=o.humanReadableIconId)&&void 0!==b?b:r.reverseDictionaries.db_object_class[o.iconId]),D[k.db_label]=o.text,D[k.db_label2]=o.text2,D[k.db_icon_priority]=o.priority,D[k.db_label_priority]=o.textPriority,D[k.azimuth]=null!==(w=o.azimuth)&&void 0!==w?w:0;const g=(0,u.IL)(o.floorId);t.getLayers(e.id,k,D).filter((e=>(0,p.FR)(e.filter,N))).forEach((t=>{"point"!==t.type&&"gltfModel"!==t.type||((0,S.Eu)(t,N),"point"===t.type?(0,v.p)(n,e,t,N,r,E,f,{x:P[0],y:P[1]},R,void 0,g):M.m.generateInstanced(n,e,t,N,{x:P[0],y:P[1]},(0,x.Bs)(E),f,_))}))}return n.setGeoIds(new Uint32Array(F.toFlatArray())),n.getAccumulatedData()}(E,d,s,w,_[e],Z,t,i,n,o,l,f),I(),T(),{tileCoords:_[e].tileCoords,collectorOutput:z,transferable:z.transferable,styleId:E.id}})),i.set("generatePersonalPoi",((e,t,i,n,o,r,s,a)=>{const l=d.getStyle(r);if(!l)return;const c=function(e,t,i,n,o,r,s,a,l){var d,c,h;const{tileProps:f,dictionaries:_}=n,v=Object.keys(f).length,w=new m.c(s),I=[];if(void 0===(null===(d=_.db_sublayer)||void 0===d?void 0:d.s_personal_poi))return e.getAccumulatedData();for(let e=0;e<v;e++)I[e]=NaN;const M=(0,g.o1)(r),T=b.Ue(),E=[];for(const e of a){const t=(0,G.yq)(e.point);b.aM(T,t),E.push(t)}const P=(0,x.x7)(T),L=(0,x.Bs)(P),A=(0,p.Yi)(i,y.i4,f,I,y.wz,L);for(let i=0;i<a.length;i++){const r=a[i],s=V.Ue();(0,x.a2)(s,E[i],L);const d=(0,u.IL)(r.id),m={x:[s[0]],y:[s[1]]};for(let e=0;e<v;e++)I[e]=NaN;I[f.id]=(0,u.IL)(r.id),I[f.db_sublayer]="s_personal_poi",I[f.db_object_class]=null!==(c=r.humanReadableClassId)&&void 0!==c?c:null===(h=n.reverseDictionaries.db_object_class)||void 0===h?void 0:h[r.classId],I[f.db_label]=r.name,I[f.db_icon_priority]=1,I[f.db_label_priority]=0,I[f.selected]=w.has(d)?1:0,I[f.db_region]=o,H=t.layers.filter((e=>(0,p.FR)(e.filter,A)));const _=void 0;(0,S.PA)(e,t,H,A,n,_,l,L,M,m)}return e.getAccumulatedData()}(w,l,s,f[i],t,n,o,e,a);return I(),T(),{collectorOutput:c,transferable:c.transferable,styleId:l.id}}))}(self)},2205:()=>{setTimeout((()=>{if("__mapglPlugins"in window)for(const e in window.__mapglPlugins)window.mapgl[e]=window.__mapglPlugins[e]}),0)},7721:(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:[],isMetroSchema:!1},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()):25===e&&(t.isMetroSchema=n.readBoolean())},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]);e.isMetroSchema&&t.writeBooleanField(25,e.isMetroSchema)},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:"",azimuth:0},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():18===e&&(t.azimuth=i.readFloat())},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),e.azimuth&&t.writeFloatField(18,e.azimuth)},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)}},9748:(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)}},9899:(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 r(e,t,i){this.x=0,this.y=e,this.w=this.free=t,this.h=i}function s(e,t,i,n,o,r,s){this.id=e,this.x=t,this.y=i,this.w=n,this.h=o,this.maxw=r||n,this.maxh=s||o,this.refcount=0}o.prototype.pack=function(e,t){e=[].concat(e),t=t||{};for(var i,n,o,r,s=[],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(!(r=this.packOne(i,n,o)))continue;t.inPlace&&(e[a].x=r.x,e[a].y=r.y,e[a].id=r.id),s.push(r)}return this.shrink(),s},o.prototype.packOne=function(e,t,i){var n,o,s,a,l,d,c,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&&(s=n.maxw*n.maxh-e*t)<u.waste&&(u.waste=s,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&&(s=(o.h-t)*e)<u.waste&&(u.freebin=-1,u.waste=s,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 r(m,this.w,t),this.allocShelf(this.shelves.push(o)-1,e,t,i)):this.autoResize?(l=d=this.h,((c=h=this.w)<=l||e>c)&&(h=2*Math.max(e,c)),(l<c||t>l)&&(d=2*Math.max(t,l)),this.resize(h,d),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},r.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 s(i,n,this.y,e,t,e,this.h)},r.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 r=t[n]={id:n,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.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.nc=void 0,i(6977)})()));